Skip to content

fix(consensus): increase gossipsub outbound queue to 2560 - #6453

Merged
meyer9 merged 1 commit into
mainfrom
fix/gossip-outbound-queue-10x
Nov 5, 2026
Merged

meyer9 merged 1 commit into
mainfrom
fix/gossip-outbound-queue-10x

Conversation

@meyer9

@meyer9 meyer9 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Raises MAX_OUTBOUND_QUEUE from 256 to 2560 (10x). This constant sets the gossipsub connection_handler_queue_len, the per-connection queue of outbound messages; raising it gives each peer connection more headroom before messages are dropped under bursty load.

Verified with cargo check -p base-consensus-gossip.

@cb-heimdall

cb-heimdall commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Heimdall Review Status

Requirement Status More Info
Reviews ✅ 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
1 if authored by an app that is not allowlisted and lacks verified human attribution 0
Sum 1


/// The maximum outbound queue.
pub const MAX_OUTBOUND_QUEUE: usize = 256;
pub const MAX_OUTBOUND_QUEUE: usize = 2560;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This queue limit applies to each connection, and each queued publish/forward holds its own copy of the message bytes (up to MAX_GOSSIP_SIZE = 10 MiB). A 10x increase raises the worst-case buffered memory from ~2.5 GiB to ~25 GiB per stalled peer. With the default p2p.peers.hi of 30, that is up to ~750 GiB in theory. Even at typical 0.5–1 MiB block payloads, one stalled or malicious peer that stops reading can pin GBs on the sequencer or validator, and that risks an OOM on the node publishing blocks. It also delays the queue-full signal gossipsub uses to detect slow peers by 10x. Please justify the number using observed drop metrics and the realistic payload size × peers memory budget, or bound the queue by bytes or a smaller value instead of a flat 10x.

@meyer9
meyer9 marked this pull request as ready for review November 5, 2026 19:19
@meyer9
meyer9 added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 92ee0c5 Nov 5, 2026
28 checks passed
@meyer9
meyer9 deleted the fix/gossip-outbound-queue-10x branch November 5, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants