mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +01:00
multi: make SubBatchDelay
configurable
This commit adds a new config option `--gossip.sub-batch-delay` so we can speed up our itest.
This commit is contained in:
parent
c6c218f384
commit
c3d1d3c4f1
@ -629,6 +629,7 @@ func DefaultConfig() Config {
|
||||
Gossip: &lncfg.Gossip{
|
||||
MaxChannelUpdateBurst: discovery.DefaultMaxChannelUpdateBurst,
|
||||
ChannelUpdateInterval: discovery.DefaultChannelUpdateInterval,
|
||||
SubBatchDelay: discovery.DefaultSubBatchDelay,
|
||||
},
|
||||
Invoices: &lncfg.Invoices{
|
||||
HoldExpiryDelta: lncfg.DefaultHoldInvoiceExpiryDelta,
|
||||
|
@ -47,6 +47,10 @@ const (
|
||||
// updates that we'll hold onto.
|
||||
maxPrematureUpdates = 100
|
||||
|
||||
// DefaultSubBatchDelay is the default delay we'll use when
|
||||
// broadcasting the next announcement batch.
|
||||
DefaultSubBatchDelay = 5 * time.Second
|
||||
|
||||
// maxRejectedUpdates tracks the max amount of rejected channel updates
|
||||
// we'll maintain. This is the global size across all peers. We'll
|
||||
// allocate ~3 MB max to the cache.
|
||||
|
@ -16,6 +16,8 @@ type Gossip struct {
|
||||
MaxChannelUpdateBurst int `long:"max-channel-update-burst" description:"The maximum number of updates for a specific channel and direction that lnd will accept over the channel update interval."`
|
||||
|
||||
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."`
|
||||
}
|
||||
|
||||
// Parse the pubkeys for the pinned syncers.
|
||||
|
@ -187,6 +187,10 @@ func (cfg *BaseNodeConfig) GenArgs() []string {
|
||||
// Use a small batch window so we can broadcast our sweep
|
||||
// transactions faster.
|
||||
"--sweeper.batchwindowduration=5s",
|
||||
|
||||
// Use a small batch delay so we can broadcast the
|
||||
// announcements quickly in the tests.
|
||||
"--gossip.sub-batch-delay=5ms",
|
||||
}
|
||||
args = append(args, nodeArgs...)
|
||||
|
||||
|
@ -1423,6 +1423,10 @@ litecoin.node=ltcd
|
||||
; gossip.max-channel-update-burst=10
|
||||
; gossip.channel-update-interval=1m
|
||||
|
||||
; 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.
|
||||
; gossip.sub-batch-delay=5s
|
||||
|
||||
[invoices]
|
||||
|
||||
|
@ -1013,7 +1013,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
HistoricalSyncTicker: ticker.New(cfg.HistoricalSyncInterval),
|
||||
NumActiveSyncers: cfg.NumGraphSyncPeers,
|
||||
MinimumBatchSize: 10,
|
||||
SubBatchDelay: time.Second * 5,
|
||||
SubBatchDelay: cfg.Gossip.SubBatchDelay,
|
||||
IgnoreHistoricalFilters: cfg.IgnoreHistoricalGossipFilters,
|
||||
PinnedSyncers: cfg.Gossip.PinnedSyncers,
|
||||
MaxChannelUpdateBurst: cfg.Gossip.MaxChannelUpdateBurst,
|
||||
|
Loading…
Reference in New Issue
Block a user