From 717facc2020315652f66988cdab15bc75c313357 Mon Sep 17 00:00:00 2001 From: Keagan McClelland Date: Wed, 13 Dec 2023 17:08:48 -0800 Subject: [PATCH] feature: make gossip queries compulsory --- feature/default_sets.go | 2 +- feature/manager_internal_test.go | 8 ++++---- peer/brontide.go | 7 +++++++ peer/brontide_test.go | 1 + 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/feature/default_sets.go b/feature/default_sets.go index 3b7e0f7ea..e423ad08d 100644 --- a/feature/default_sets.go +++ b/feature/default_sets.go @@ -14,7 +14,7 @@ var defaultSetDesc = setDesc{ SetInit: {}, // I SetNodeAnn: {}, // N }, - lnwire.GossipQueriesOptional: { + lnwire.GossipQueriesRequired: { SetInit: {}, // I SetNodeAnn: {}, // N }, diff --git a/feature/manager_internal_test.go b/feature/manager_internal_test.go index 365d0071c..8cd3766a4 100644 --- a/feature/manager_internal_test.go +++ b/feature/manager_internal_test.go @@ -150,7 +150,7 @@ func TestUpdateFeatureSets(t *testing.T) { SetInit: {}, // I SetNodeAnn: {}, // N }, - lnwire.GossipQueriesOptional: { + lnwire.GossipQueriesRequired: { SetNodeAnn: {}, // N }, } @@ -200,7 +200,7 @@ func TestUpdateFeatureSets(t *testing.T) { ), SetNodeAnn: lnwire.NewRawFeatureVector( lnwire.DataLossProtectRequired, - lnwire.GossipQueriesOptional, + lnwire.GossipQueriesRequired, lnwire.FeatureBit(1000), ), }, @@ -221,7 +221,7 @@ func TestUpdateFeatureSets(t *testing.T) { ), SetNodeAnn: lnwire.NewRawFeatureVector( lnwire.DataLossProtectRequired, - lnwire.GossipQueriesOptional, + lnwire.GossipQueriesRequired, ), }, config: Config{ @@ -241,7 +241,7 @@ func TestUpdateFeatureSets(t *testing.T) { ), SetNodeAnn: lnwire.NewRawFeatureVector( lnwire.DataLossProtectRequired, - lnwire.GossipQueriesOptional, + lnwire.GossipQueriesRequired, lnwire.FeatureBit(500), ), SetInvoice: lnwire.NewRawFeatureVector( diff --git a/peer/brontide.go b/peer/brontide.go index 89f9e1248..705ec6974 100644 --- a/peer/brontide.go +++ b/peer/brontide.go @@ -754,6 +754,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 diff --git a/peer/brontide_test.go b/peer/brontide_test.go index d127176d5..7ef02fff3 100644 --- a/peer/brontide_test.go +++ b/peer/brontide_test.go @@ -1080,6 +1080,7 @@ func TestPeerCustomMessage(t *testing.T) { initReplyMsg := lnwire.NewInitMessage( lnwire.NewRawFeatureVector( lnwire.DataLossProtectRequired, + lnwire.GossipQueriesOptional, ), lnwire.NewRawFeatureVector(), )