diff --git a/config.go b/config.go index f206b43a50c..9c4809b61f4 100644 --- a/config.go +++ b/config.go @@ -694,6 +694,7 @@ func DefaultConfig() Config { MaxChannelUpdateBurst: discovery.DefaultMaxChannelUpdateBurst, ChannelUpdateInterval: discovery.DefaultChannelUpdateInterval, SubBatchDelay: discovery.DefaultSubBatchDelay, + AnnouncementConf: discovery.DefaultProofMatureDelta, }, Invoices: &lncfg.Invoices{ HoldExpiryDelta: lncfg.DefaultHoldInvoiceExpiryDelta, diff --git a/discovery/gossiper.go b/discovery/gossiper.go index 9c51734396a..129aa5cda99 100644 --- a/discovery/gossiper.go +++ b/discovery/gossiper.go @@ -62,6 +62,11 @@ const ( // we'll maintain. This is the global size across all peers. We'll // allocate ~3 MB max to the cache. maxRejectedUpdates = 10_000 + + // DefaultProofMatureDelta specifies the default value used for + // ProofMatureDelta, which is the number of confirmations needed before + // processing the announcement signatures. + DefaultProofMatureDelta = 5 ) var ( @@ -1984,8 +1989,6 @@ func (d *AuthenticatedGossiper) addNode(msg *lnwire.NodeAnnouncement, // NOTE: must be used inside a lock. func (d *AuthenticatedGossiper) isPremature(chanID lnwire.ShortChannelID, delta uint32, msg *networkMsg) bool { - // TODO(roasbeef) make height delta 6 - // * or configurable msgHeight := chanID.BlockHeight + delta diff --git a/docs/release-notes/release-notes-0.19.0.md b/docs/release-notes/release-notes-0.19.0.md index 4fc64028d35..98063868b05 100644 --- a/docs/release-notes/release-notes-0.19.0.md +++ b/docs/release-notes/release-notes-0.19.0.md @@ -160,6 +160,10 @@ range TLVs provided with the existing set of records on the HTLC, overwriting any conflicting values with those supplied by the API. +* [Make](https://github.com/lightningnetwork/lnd/pull/9405) the param +`ProofMatureDelta` used in gossip to be configurable via +`--gossip.announcement-conf`, with a default value of 5. + ## lncli Updates ## Code Health @@ -204,6 +208,7 @@ config option](https://github.com/lightningnetwork/lnd/pull/9182) and introduce a new option `channel-max-fee-exposure` which is unambiguous in its description. The underlying functionality between those two options remain the same. + ## Breaking Changes ## Performance Improvements diff --git a/lncfg/gossip.go b/lncfg/gossip.go index fbe5aae4027..de077afc6e6 100644 --- a/lncfg/gossip.go +++ b/lncfg/gossip.go @@ -18,6 +18,8 @@ type Gossip struct { ChannelUpdateInterval time.Duration `long:"channel-update-interval" description:"The interval used to determine how often lnd should allow a burst of new updates for a specific channel and direction."` SubBatchDelay time.Duration `long:"sub-batch-delay" description:"The duration to wait before sending the next announcement batch if there are multiple. Use a small value if there are a lot announcements and they need to be broadcast quickly."` + + AnnouncementConf uint32 `long:"announcement-conf" description:"The number of confirmations required before processing channel announcements."` } // Parse the pubkeys for the pinned syncers. diff --git a/sample-lnd.conf b/sample-lnd.conf index 86ea8248587..e46f0590cef 100644 --- a/sample-lnd.conf +++ b/sample-lnd.conf @@ -1729,6 +1729,8 @@ ; be broadcast quickly. ; gossip.sub-batch-delay=5s +; The number of confirmations required before processing channel announcements. +; gossip.announcement-conf=5 [invoices] diff --git a/server.go b/server.go index 9fd0b7a006b..e79b25ac031 100644 --- a/server.go +++ b/server.go @@ -1118,7 +1118,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr, return s.genNodeAnnouncement(nil) }, - ProofMatureDelta: 0, + ProofMatureDelta: cfg.Gossip.AnnouncementConf, TrickleDelay: time.Millisecond * time.Duration(cfg.TrickleDelay), RetransmitTicker: ticker.New(time.Minute * 30), RebroadcastInterval: time.Hour * 24,