From dad53b3f9a96335715e2f6bbf68cd8ef463b0242 Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Tue, 2 Apr 2024 16:43:27 -0700 Subject: [PATCH 1/3] Revert "feature: make gossip queries compulsory" This reverts commit 717facc2020315652f66988cdab15bc75c313357. It turns out that we can't do this since it would result in incompatibility with LDK. The spec has been updated to reallow optional gossip queries so we revert this commit. --- feature/default_sets.go | 2 +- feature/manager_internal_test.go | 8 ++++---- peer/brontide.go | 7 ------- peer/brontide_test.go | 1 - 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/feature/default_sets.go b/feature/default_sets.go index e423ad08dc..3b7e0f7ea3 100644 --- a/feature/default_sets.go +++ b/feature/default_sets.go @@ -14,7 +14,7 @@ var defaultSetDesc = setDesc{ SetInit: {}, // I SetNodeAnn: {}, // N }, - lnwire.GossipQueriesRequired: { + lnwire.GossipQueriesOptional: { SetInit: {}, // I SetNodeAnn: {}, // N }, diff --git a/feature/manager_internal_test.go b/feature/manager_internal_test.go index dc254adf96..683b4dfa32 100644 --- a/feature/manager_internal_test.go +++ b/feature/manager_internal_test.go @@ -151,7 +151,7 @@ func TestUpdateFeatureSets(t *testing.T) { SetInit: {}, // I SetNodeAnn: {}, // N }, - lnwire.GossipQueriesRequired: { + lnwire.GossipQueriesOptional: { SetNodeAnn: {}, // N }, } @@ -201,7 +201,7 @@ func TestUpdateFeatureSets(t *testing.T) { ), SetNodeAnn: lnwire.NewRawFeatureVector( lnwire.DataLossProtectRequired, - lnwire.GossipQueriesRequired, + lnwire.GossipQueriesOptional, lnwire.FeatureBit(1000), ), }, @@ -222,7 +222,7 @@ func TestUpdateFeatureSets(t *testing.T) { ), SetNodeAnn: lnwire.NewRawFeatureVector( lnwire.DataLossProtectRequired, - lnwire.GossipQueriesRequired, + lnwire.GossipQueriesOptional, ), }, config: Config{ @@ -242,7 +242,7 @@ func TestUpdateFeatureSets(t *testing.T) { ), SetNodeAnn: lnwire.NewRawFeatureVector( lnwire.DataLossProtectRequired, - lnwire.GossipQueriesRequired, + lnwire.GossipQueriesOptional, lnwire.FeatureBit(500), ), SetInvoice: lnwire.NewRawFeatureVector( diff --git a/peer/brontide.go b/peer/brontide.go index 541c0f358a..864bdaca62 100644 --- a/peer/brontide.go +++ b/peer/brontide.go @@ -757,13 +757,6 @@ func (p *Brontide) initGossipSync() { if p.remoteFeatures.HasFeature(lnwire.GossipQueriesOptional) { p.log.Info("Negotiated chan series queries") - if p.cfg.AuthGossiper == nil { - // This should only ever be hit in the unit tests. - p.log.Warn("No AuthGossiper configured. Abandoning " + - "gossip sync.") - return - } - // Register the peer's gossip syncer with the gossiper. // This blocks synchronously to ensure the gossip syncer is // registered with the gossiper before attempting to read diff --git a/peer/brontide_test.go b/peer/brontide_test.go index 46c1bec4d7..8ea8846b2f 100644 --- a/peer/brontide_test.go +++ b/peer/brontide_test.go @@ -1138,7 +1138,6 @@ func TestPeerCustomMessage(t *testing.T) { initReplyMsg := lnwire.NewInitMessage( lnwire.NewRawFeatureVector( lnwire.DataLossProtectRequired, - lnwire.GossipQueriesOptional, ), lnwire.NewRawFeatureVector(), ) From dd2da29cba8e941c0b77c4e974adca097378c1ed Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Wed, 3 Apr 2024 15:47:50 -0700 Subject: [PATCH 2/3] peer: re-add AuthGossiper nil check --- peer/brontide.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/peer/brontide.go b/peer/brontide.go index 864bdaca62..541c0f358a 100644 --- a/peer/brontide.go +++ b/peer/brontide.go @@ -757,6 +757,13 @@ func (p *Brontide) initGossipSync() { if p.remoteFeatures.HasFeature(lnwire.GossipQueriesOptional) { p.log.Info("Negotiated chan series queries") + if p.cfg.AuthGossiper == nil { + // This should only ever be hit in the unit tests. + p.log.Warn("No AuthGossiper configured. Abandoning " + + "gossip sync.") + return + } + // Register the peer's gossip syncer with the gossiper. // This blocks synchronously to ensure the gossip syncer is // registered with the gossiper before attempting to read From 939e3cc6c1de44a5db5f7315adef8172c20f89af Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Thu, 4 Apr 2024 12:28:37 -0700 Subject: [PATCH 3/3] docs: update release notes --- docs/release-notes/release-notes-0.18.0.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/release-notes/release-notes-0.18.0.md b/docs/release-notes/release-notes-0.18.0.md index c4ca138e79..0920c9cc9d 100644 --- a/docs/release-notes/release-notes-0.18.0.md +++ b/docs/release-notes/release-notes-0.18.0.md @@ -390,6 +390,11 @@ bitcoin peers' feefilter values into account](https://github.com/lightningnetwor and makes TLV Onions, Static Remote Keys, Gossip Queries, compulsory features for LND's peers. Data Loss Protection has been compulsory for years. +* [Don't Require Gossip Queries](https://github.com/lightningnetwork/lnd/pull/8615) + This change undoes a portion of what was introduced in #8275 due to a subsequent + [spec change](https://github.com/lightning/bolts/pull/1092/commits/e0ee59f3c92b7c98be8dfc47b7db358b45baf9de) + that meant we shouldn't require it. + ## Testing * Added fuzz tests for [onion