mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-11 09:21:38 +02: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{
|
Gossip: &lncfg.Gossip{
|
||||||
MaxChannelUpdateBurst: discovery.DefaultMaxChannelUpdateBurst,
|
MaxChannelUpdateBurst: discovery.DefaultMaxChannelUpdateBurst,
|
||||||
ChannelUpdateInterval: discovery.DefaultChannelUpdateInterval,
|
ChannelUpdateInterval: discovery.DefaultChannelUpdateInterval,
|
||||||
|
SubBatchDelay: discovery.DefaultSubBatchDelay,
|
||||||
},
|
},
|
||||||
Invoices: &lncfg.Invoices{
|
Invoices: &lncfg.Invoices{
|
||||||
HoldExpiryDelta: lncfg.DefaultHoldInvoiceExpiryDelta,
|
HoldExpiryDelta: lncfg.DefaultHoldInvoiceExpiryDelta,
|
||||||
|
@ -47,6 +47,10 @@ const (
|
|||||||
// updates that we'll hold onto.
|
// updates that we'll hold onto.
|
||||||
maxPrematureUpdates = 100
|
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
|
// maxRejectedUpdates tracks the max amount of rejected channel updates
|
||||||
// we'll maintain. This is the global size across all peers. We'll
|
// we'll maintain. This is the global size across all peers. We'll
|
||||||
// allocate ~3 MB max to the cache.
|
// 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."`
|
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."`
|
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.
|
// 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
|
// Use a small batch window so we can broadcast our sweep
|
||||||
// transactions faster.
|
// transactions faster.
|
||||||
"--sweeper.batchwindowduration=5s",
|
"--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...)
|
args = append(args, nodeArgs...)
|
||||||
|
|
||||||
|
@ -1423,6 +1423,10 @@ litecoin.node=ltcd
|
|||||||
; gossip.max-channel-update-burst=10
|
; gossip.max-channel-update-burst=10
|
||||||
; gossip.channel-update-interval=1m
|
; 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]
|
[invoices]
|
||||||
|
|
||||||
|
@ -1013,7 +1013,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
|||||||
HistoricalSyncTicker: ticker.New(cfg.HistoricalSyncInterval),
|
HistoricalSyncTicker: ticker.New(cfg.HistoricalSyncInterval),
|
||||||
NumActiveSyncers: cfg.NumGraphSyncPeers,
|
NumActiveSyncers: cfg.NumGraphSyncPeers,
|
||||||
MinimumBatchSize: 10,
|
MinimumBatchSize: 10,
|
||||||
SubBatchDelay: time.Second * 5,
|
SubBatchDelay: cfg.Gossip.SubBatchDelay,
|
||||||
IgnoreHistoricalFilters: cfg.IgnoreHistoricalGossipFilters,
|
IgnoreHistoricalFilters: cfg.IgnoreHistoricalGossipFilters,
|
||||||
PinnedSyncers: cfg.Gossip.PinnedSyncers,
|
PinnedSyncers: cfg.Gossip.PinnedSyncers,
|
||||||
MaxChannelUpdateBurst: cfg.Gossip.MaxChannelUpdateBurst,
|
MaxChannelUpdateBurst: cfg.Gossip.MaxChannelUpdateBurst,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user