multi: add new config options to tune gossip msg allocated bandwidth

We go with the defaults of if no values are set.
This commit is contained in:
Olaoluwa Osuntokun
2025-03-20 14:54:26 -07:00
parent 05702d48b2
commit c7ed5d65c6
5 changed files with 45 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ import (
"time"
"github.com/lightningnetwork/lnd/discovery"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/routing/route"
)
@@ -32,6 +33,10 @@ type Gossip struct {
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."`
MsgRateBytes uint64 `long:"msg-rate-bytes" description:"The maximum number of bytes of gossip messages that will be sent per second. This is a global limit that applies to all peers."`
MsgBurstBytes uint64 `long:"msg-burst-bytes" description:"The maximum number of bytes of gossip messages that will be sent in a burst. This is a global limit that applies to all peers. This value should be set to something greater than 130 KB"`
}
// Parse the pubkeys for the pinned syncers.
@@ -58,6 +63,11 @@ func (g *Gossip) Validate() error {
"%v", g.AnnouncementConf, minAnnouncementConf)
}
if g.MsgBurstBytes < lnwire.MaxSliceLength {
return fmt.Errorf("msg-burst-bytes=%v must be at least %v",
g.MsgBurstBytes, lnwire.MaxSliceLength)
}
return nil
}