Skip to content

Commit

Permalink
Merge pull request #8270 from ProofOfKeags/feature/stfu
Browse files Browse the repository at this point in the history
DynComms [1/n]: Implement Quiescence Protocol
  • Loading branch information
guggero authored Nov 27, 2024
2 parents fbeab72 + debc43d commit c8cfa59
Show file tree
Hide file tree
Showing 33 changed files with 1,859 additions and 39 deletions.
5 changes: 5 additions & 0 deletions docs/release-notes/release-notes-0.19.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
signal relay was added. This signal has *no impact* on routing, and
is deployed experimentally to assist ongoing channel jamming research.

* Add initial support for [quiescence](https://github.com/lightningnetwork/lnd/pull/8270).
This is a protocol gadget required for Dynamic Commitments and Splicing that
will be added later.

## Functional Enhancements
* [Add ability](https://github.com/lightningnetwork/lnd/pull/8998) to paginate
wallet transactions.
Expand Down Expand Up @@ -216,6 +220,7 @@ The underlying functionality between those two options remain the same.
* Elle Mouton
* George Tsagkarelis
* hieblmi
* Keagan McClelland
* Oliver Gugger
* Pins
* Viktor Tigerström
Expand Down
4 changes: 4 additions & 0 deletions feature/default_sets.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ var defaultSetDesc = setDesc{
SetNodeAnn: {}, // N
SetInvoice: {}, // 9
},
lnwire.QuiescenceOptional: {
SetInit: {}, // I
SetNodeAnn: {}, // N
},
lnwire.ShutdownAnySegwitOptional: {
SetInit: {}, // I
SetNodeAnn: {}, // N
Expand Down
6 changes: 6 additions & 0 deletions feature/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ type Config struct {
// NoRouteBlinding unsets route blinding feature bits.
NoRouteBlinding bool

// NoQuiescence unsets quiescence feature bits.
NoQuiescence bool

// NoTaprootOverlay unsets the taproot overlay channel feature bits.
NoTaprootOverlay bool

Expand Down Expand Up @@ -199,6 +202,9 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) {
raw.Unset(lnwire.Bolt11BlindedPathsOptional)
raw.Unset(lnwire.Bolt11BlindedPathsRequired)
}
if cfg.NoQuiescence {
raw.Unset(lnwire.QuiescenceOptional)
}
if cfg.NoTaprootOverlay {
raw.Unset(lnwire.SimpleTaprootOverlayChansOptional)
raw.Unset(lnwire.SimpleTaprootOverlayChansRequired)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require (
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb
github.com/lightningnetwork/lnd/cert v1.2.2
github.com/lightningnetwork/lnd/clock v1.1.1
github.com/lightningnetwork/lnd/fn v1.2.3
github.com/lightningnetwork/lnd/fn v1.2.5
github.com/lightningnetwork/lnd/healthcheck v1.2.6
github.com/lightningnetwork/lnd/kvdb v1.4.11
github.com/lightningnetwork/lnd/queue v1.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ github.com/lightningnetwork/lnd/cert v1.2.2 h1:71YK6hogeJtxSxw2teq3eGeuy4rHGKcFf
github.com/lightningnetwork/lnd/cert v1.2.2/go.mod h1:jQmFn/Ez4zhDgq2hnYSw8r35bqGVxViXhX6Cd7HXM6U=
github.com/lightningnetwork/lnd/clock v1.1.1 h1:OfR3/zcJd2RhH0RU+zX/77c0ZiOnIMsDIBjgjWdZgA0=
github.com/lightningnetwork/lnd/clock v1.1.1/go.mod h1:mGnAhPyjYZQJmebS7aevElXKTFDuO+uNFFfMXK1W8xQ=
github.com/lightningnetwork/lnd/fn v1.2.3 h1:Q1OrgNSgQynVheBNa16CsKVov1JI5N2AR6G07x9Mles=
github.com/lightningnetwork/lnd/fn v1.2.3/go.mod h1:SyFohpVrARPKH3XVAJZlXdVe+IwMYc4OMAvrDY32kw0=
github.com/lightningnetwork/lnd/fn v1.2.5 h1:pGMz0BDUxrhvOtShD4FIysdVy+ulfFAnFvTKjZO5Pp8=
github.com/lightningnetwork/lnd/fn v1.2.5/go.mod h1:SyFohpVrARPKH3XVAJZlXdVe+IwMYc4OMAvrDY32kw0=
github.com/lightningnetwork/lnd/healthcheck v1.2.6 h1:1sWhqr93GdkWy4+6U7JxBfcyZIE78MhIHTJZfPx7qqI=
github.com/lightningnetwork/lnd/healthcheck v1.2.6/go.mod h1:Mu02um4CWY/zdTOvFje7WJgJcHyX2zq/FG3MhOAiGaQ=
github.com/lightningnetwork/lnd/kvdb v1.4.11 h1:fk1HMVFrsVK3xqU7q+JWHRgBltw/a2qIg1E3zazMb/8=
Expand Down
12 changes: 12 additions & 0 deletions htlcswitch/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,18 @@ type ChannelUpdateHandler interface {
// will only ever be called once. If no CommitSig is owed in the
// argument's LinkDirection, then we will call this hook immediately.
OnCommitOnce(LinkDirection, func())

// InitStfu allows us to initiate quiescence on this link. It returns
// a receive only channel that will block until quiescence has been
// achieved, or definitively fails. The return value is the
// ChannelParty who holds the role of initiator or Err if the operation
// fails.
//
// This operation has been added to allow channels to be quiesced via
// RPC. It may be removed or reworked in the future as RPC initiated
// quiescence is a holdover until we have downstream protocols that use
// it.
InitStfu() <-chan fn.Result[lntypes.ChannelParty]
}

// CommitHookID is a value that is used to uniquely identify hooks in the
Expand Down
Loading

0 comments on commit c8cfa59

Please sign in to comment.