From 745f3a61812a146264d9e815b90925bff1b74a4b Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 25 Jun 2024 15:20:39 -0700 Subject: [PATCH] feature: add awareness of new taproot chans overlay feature bit This bit will be false by default in current production deployments. --- feature/default_sets.go | 4 ++++ feature/deps.go | 5 +++++ feature/manager.go | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/feature/default_sets.go b/feature/default_sets.go index cc802fe85..4a9b2bf64 100644 --- a/feature/default_sets.go +++ b/feature/default_sets.go @@ -92,4 +92,8 @@ var defaultSetDesc = setDesc{ SetInit: {}, // I SetNodeAnn: {}, // N }, + lnwire.SimpleTaprootOverlayChansOptional: { + SetInit: {}, // I + SetNodeAnn: {}, // N + }, } diff --git a/feature/deps.go b/feature/deps.go index 64b4f2fc9..922f25214 100644 --- a/feature/deps.go +++ b/feature/deps.go @@ -79,6 +79,11 @@ var deps = depDesc{ lnwire.AnchorsZeroFeeHtlcTxOptional: {}, lnwire.ExplicitChannelTypeOptional: {}, }, + lnwire.SimpleTaprootOverlayChansOptional: { + lnwire.SimpleTaprootChannelsOptionalStaging: {}, + lnwire.TLVOnionPayloadOptional: {}, + lnwire.ScidAliasOptional: {}, + }, lnwire.RouteBlindingOptional: { lnwire.TLVOnionPayloadOptional: {}, }, diff --git a/feature/manager.go b/feature/manager.go index 0b6653985..89f1d4b6b 100644 --- a/feature/manager.go +++ b/feature/manager.go @@ -63,6 +63,9 @@ type Config struct { // NoRouteBlinding unsets route blinding feature bits. NoRouteBlinding bool + // NoTaprootOverlay unsets the taproot overlay channel feature bits. + NoTaprootOverlay bool + // CustomFeatures is a set of custom features to advertise in each // set. CustomFeatures map[Set][]lnwire.FeatureBit @@ -192,6 +195,10 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) { raw.Unset(lnwire.Bolt11BlindedPathsOptional) raw.Unset(lnwire.Bolt11BlindedPathsRequired) } + if cfg.NoTaprootOverlay { + raw.Unset(lnwire.SimpleTaprootOverlayChansOptional) + raw.Unset(lnwire.SimpleTaprootOverlayChansRequired) + } for _, custom := range cfg.CustomFeatures[set] { if custom > set.Maximum() { return nil, fmt.Errorf("feature bit: %v "+