From cadf870dcb1ec806cfd17984b18498cb847107ab Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Mon, 21 Jul 2025 22:41:32 +0800 Subject: [PATCH 1/3] discovery: increase default msg rates to 1MB --- discovery/sync_manager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discovery/sync_manager.go b/discovery/sync_manager.go index 65e0774a4..4dbc0d96d 100644 --- a/discovery/sync_manager.go +++ b/discovery/sync_manager.go @@ -32,12 +32,12 @@ const ( // This is the most that can be sent in a given go. Requests beyond // this, will block indefinitely. Once tokens (bytes are depleted), // they'll be refilled at the DefaultMsgBytesPerSecond rate. - DefaultMsgBytesBurst = 2 * 100 * 1_024 + DefaultMsgBytesBurst = 2 * 1000 * 1_024 // DefaultMsgBytesPerSecond is the max bytes/s we'll permit for outgoing // messages. Once tokens (bytes) have been taken from the bucket, // they'll be refilled at this rate. - DefaultMsgBytesPerSecond = 100 * 1_024 + DefaultMsgBytesPerSecond = 1000 * 1_024 // assumedMsgSize is the assumed size of a message if we can't compute // its serialized size. This comes out to 1 KB. From 03bf1974a3783cddbbaa046c5245fb5aa4c75e64 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Mon, 21 Jul 2025 22:44:55 +0800 Subject: [PATCH 2/3] lncfg: update docs about `msg-rate-bytes` and `msg-burst-bytes` --- lncfg/gossip.go | 4 ++-- sample-lnd.conf | 22 +++++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lncfg/gossip.go b/lncfg/gossip.go index 37595e439..3c49001c4 100644 --- a/lncfg/gossip.go +++ b/lncfg/gossip.go @@ -34,9 +34,9 @@ type Gossip struct { 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."` + 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."` - 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"` + 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."` } // Parse the pubkeys for the pinned syncers. diff --git a/sample-lnd.conf b/sample-lnd.conf index 7e105de27..1c62a21f5 100644 --- a/sample-lnd.conf +++ b/sample-lnd.conf @@ -1763,16 +1763,20 @@ ; The number of confirmations required before processing channel announcements. ; gossip.announcement-conf=6 -; The allotted bandwidth rate expressed in bytes/second that will be allocated -; towards outbound gossip messages. Realized rates above this value will be -; throttled. This value is shared across all peers. -; gossip.msg-rate-bytes=102400 +; 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. +; gossip.msg-rate-bytes=1024000 -; The amount of bytes of gossip messages that can be sent at a given time. This -; is used as the amount of tokens in the token bucket algorithm. This value -; MUST be set to something about 65 KB, otherwise a single max sized message -; can never be sent. -; gossip.msg-burst-bytes=204800 +; 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. +; gossip.msg-burst-bytes=2048000 [invoices] From d0c07d76d20a9de016023afa1b79bd0c1583c3ea Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Fri, 25 Jul 2025 17:45:02 +0800 Subject: [PATCH 3/3] docs: update release notes --- docs/release-notes/release-notes-0.20.0.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/release-notes/release-notes-0.20.0.md b/docs/release-notes/release-notes-0.20.0.md index e41243ca9..54d47620c 100644 --- a/docs/release-notes/release-notes-0.20.0.md +++ b/docs/release-notes/release-notes-0.20.0.md @@ -70,6 +70,10 @@ circuit. The indices are only available for forwarding events saved after v0.20. finish under this timeout value. Consider using a larger timeout value if you have a slow network. +* The default value for `gossip.msg-rate-bytes` has been + [increased](https://github.com/lightningnetwork/lnd/pull/10096) from 100KB to + 1MB, and `gossip.msg-burst-bytes` has been increased from 200KB to 2MB. + ## lncli Additions