feature: make gossip queries compulsory

This commit is contained in:
Keagan McClelland 2023-12-13 17:08:48 -08:00
parent 239103c2b3
commit 717facc202
4 changed files with 13 additions and 5 deletions

View File

@ -14,7 +14,7 @@ var defaultSetDesc = setDesc{
SetInit: {}, // I SetInit: {}, // I
SetNodeAnn: {}, // N SetNodeAnn: {}, // N
}, },
lnwire.GossipQueriesOptional: { lnwire.GossipQueriesRequired: {
SetInit: {}, // I SetInit: {}, // I
SetNodeAnn: {}, // N SetNodeAnn: {}, // N
}, },

View File

@ -150,7 +150,7 @@ func TestUpdateFeatureSets(t *testing.T) {
SetInit: {}, // I SetInit: {}, // I
SetNodeAnn: {}, // N SetNodeAnn: {}, // N
}, },
lnwire.GossipQueriesOptional: { lnwire.GossipQueriesRequired: {
SetNodeAnn: {}, // N SetNodeAnn: {}, // N
}, },
} }
@ -200,7 +200,7 @@ func TestUpdateFeatureSets(t *testing.T) {
), ),
SetNodeAnn: lnwire.NewRawFeatureVector( SetNodeAnn: lnwire.NewRawFeatureVector(
lnwire.DataLossProtectRequired, lnwire.DataLossProtectRequired,
lnwire.GossipQueriesOptional, lnwire.GossipQueriesRequired,
lnwire.FeatureBit(1000), lnwire.FeatureBit(1000),
), ),
}, },
@ -221,7 +221,7 @@ func TestUpdateFeatureSets(t *testing.T) {
), ),
SetNodeAnn: lnwire.NewRawFeatureVector( SetNodeAnn: lnwire.NewRawFeatureVector(
lnwire.DataLossProtectRequired, lnwire.DataLossProtectRequired,
lnwire.GossipQueriesOptional, lnwire.GossipQueriesRequired,
), ),
}, },
config: Config{ config: Config{
@ -241,7 +241,7 @@ func TestUpdateFeatureSets(t *testing.T) {
), ),
SetNodeAnn: lnwire.NewRawFeatureVector( SetNodeAnn: lnwire.NewRawFeatureVector(
lnwire.DataLossProtectRequired, lnwire.DataLossProtectRequired,
lnwire.GossipQueriesOptional, lnwire.GossipQueriesRequired,
lnwire.FeatureBit(500), lnwire.FeatureBit(500),
), ),
SetInvoice: lnwire.NewRawFeatureVector( SetInvoice: lnwire.NewRawFeatureVector(

View File

@ -754,6 +754,13 @@ func (p *Brontide) initGossipSync() {
if p.remoteFeatures.HasFeature(lnwire.GossipQueriesOptional) { if p.remoteFeatures.HasFeature(lnwire.GossipQueriesOptional) {
p.log.Info("Negotiated chan series queries") 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. // Register the peer's gossip syncer with the gossiper.
// This blocks synchronously to ensure the gossip syncer is // This blocks synchronously to ensure the gossip syncer is
// registered with the gossiper before attempting to read // registered with the gossiper before attempting to read

View File

@ -1080,6 +1080,7 @@ func TestPeerCustomMessage(t *testing.T) {
initReplyMsg := lnwire.NewInitMessage( initReplyMsg := lnwire.NewInitMessage(
lnwire.NewRawFeatureVector( lnwire.NewRawFeatureVector(
lnwire.DataLossProtectRequired, lnwire.DataLossProtectRequired,
lnwire.GossipQueriesOptional,
), ),
lnwire.NewRawFeatureVector(), lnwire.NewRawFeatureVector(),
) )