Skip to content

Commit 2e36f9b

Browse files
authored
Merge pull request #10096 from yyforyongyu/increase-gossip-default
Increase the default outgoing bandwidth
2 parents f4173db + d0c07d7 commit 2e36f9b

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

discovery/sync_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ const (
3232
// This is the most that can be sent in a given go. Requests beyond
3333
// this, will block indefinitely. Once tokens (bytes are depleted),
3434
// they'll be refilled at the DefaultMsgBytesPerSecond rate.
35-
DefaultMsgBytesBurst = 2 * 100 * 1_024
35+
DefaultMsgBytesBurst = 2 * 1000 * 1_024
3636

3737
// DefaultMsgBytesPerSecond is the max bytes/s we'll permit for outgoing
3838
// messages. Once tokens (bytes) have been taken from the bucket,
3939
// they'll be refilled at this rate.
40-
DefaultMsgBytesPerSecond = 100 * 1_024
40+
DefaultMsgBytesPerSecond = 1000 * 1_024
4141

4242
// assumedMsgSize is the assumed size of a message if we can't compute
4343
// its serialized size. This comes out to 1 KB.

docs/release-notes/release-notes-0.20.0.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ circuit. The indices are only available for forwarding events saved after v0.20.
7474
finish under this timeout value. Consider using a larger timeout value if you
7575
have a slow network.
7676

77+
* The default value for `gossip.msg-rate-bytes` has been
78+
[increased](https://github.com/lightningnetwork/lnd/pull/10096) from 100KB to
79+
1MB, and `gossip.msg-burst-bytes` has been increased from 200KB to 2MB.
80+
7781

7882
## lncli Additions
7983

lncfg/gossip.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ type Gossip struct {
3434

3535
AnnouncementConf uint32 `long:"announcement-conf" description:"The number of confirmations required before processing channel announcements."`
3636

37-
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."`
37+
MsgRateBytes uint64 `long:"msg-rate-bytes" description:"The total rate of outbound gossip messages, expressed in bytes per second. This setting controls the long-term average speed of gossip traffic sent from your node. The rate limit is applied globally across all peers, not per-peer. If the rate of outgoing messages exceeds this value, lnd will start to queue and delay messages to stay within the limit."`
3838

39-
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"`
39+
MsgBurstBytes uint64 `long:"msg-burst-bytes" description:"The maximum burst of outbound gossip data, in bytes, that can be sent at once. This works in conjunction with gossip.msg-rate-bytes as part of a token bucket rate-limiting scheme. This value represents the size of the token bucket. It allows for short, high-speed bursts of traffic, with the long-term rate controlled by gossip.msg-rate-bytes. This value must be larger than the maximum lightning message size (~65KB) to allow sending large gossip messages."`
4040
}
4141

4242
// Parse the pubkeys for the pinned syncers.

sample-lnd.conf

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,16 +1763,20 @@
17631763
; The number of confirmations required before processing channel announcements.
17641764
; gossip.announcement-conf=6
17651765

1766-
; The allotted bandwidth rate expressed in bytes/second that will be allocated
1767-
; towards outbound gossip messages. Realized rates above this value will be
1768-
; throttled. This value is shared across all peers.
1769-
; gossip.msg-rate-bytes=102400
1770-
1771-
; The amount of bytes of gossip messages that can be sent at a given time. This
1772-
; is used as the amount of tokens in the token bucket algorithm. This value
1773-
; MUST be set to something about 65 KB, otherwise a single max sized message
1774-
; can never be sent.
1775-
; gossip.msg-burst-bytes=204800
1766+
; The total rate of outbound gossip messages, expressed in bytes per second.
1767+
; This setting controls the long-term average speed of gossip traffic sent from
1768+
; your node. The rate limit is applied globally across all peers, not per-peer.
1769+
; If the rate of outgoing messages exceeds this value, lnd will start to queue
1770+
; and delay messages to stay within the limit.
1771+
; gossip.msg-rate-bytes=1024000
1772+
1773+
; The maximum burst of outbound gossip data, in bytes, that can be sent at once.
1774+
; This works in conjunction with `gossip.msg-rate-bytes` as part of a token
1775+
; bucket rate-limiting scheme. This value represents the size of the token
1776+
; bucket. It allows for short, high-speed bursts of traffic, with the long-term
1777+
; rate controlled by `gossip.msg-rate-bytes`. This value must be larger than the
1778+
; maximum lightning message size (~65KB) to allow sending large gossip messages.
1779+
; gossip.msg-burst-bytes=2048000
17761780

17771781
[invoices]
17781782

0 commit comments

Comments
 (0)