Commit message · Matt CoralloLimit outbound gossip buffer by size, rather than length
In 686a586c96aae6901d533646fc135379f825eb0d we stopped punishing
peers for slowly draining the gossip forwarding buffer, delaying
responding to our ping message. While that change was nice on its
own, it also now allows us to be a bit more flexible with what
enters the `gossip_broadcast_buffer`.
Because we now do not count pending messages in
`gossip_broadcast_buffer` against the peer's ping-response timer,
there's no reason to continue to limit it based on
`messages_sent_since_pong`. Thus, we drop that restriction here.
However, in practice, the reason for the vast majority of gossip
forwarding drops on my node is the 24-message total queue limit,
rather than the `messages_sent_since_pong` limit. This limit was
set to bend over backwards trying to avoid counting message buffer
sizes while keeping peer message buffers small.
In practice, there is really no reason to do that - summing the
capacity of tens of buffers is negligible cost and allows us to be
much more flexible with how many messages we queue.
Here we do so, limiting the total outbound message buffer size
before gossip forwards are dropped to 128 KiB per peer, rather than
24 messages. In practice, this appears to almost entirely remove
gossip forward drops on my node.
85/100 · StrongMessage clarity
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
Why it was queuedcryptography-sensitive path
AI analysis · Low 28/100This commit changes how a Lightning node decides when to stop forwarding gossip messages to a peer. Previously, the node dropped gossip if a peer's outbound message queue reached 24 messages or if too many messages had been sent since the last ping reply. Now it drops gossip only when the total buffered data for that peer exceeds 128 KiB. The change is described by the authors as a performance/flexibility improvement to reduce unnecessary gossip drops, not as a security fix. There is no direct evidence in the commit or supplied references that this resolves an exploitable vulnerability.