Skip to content

fix(net): drain satellite out_buffer in Sink::poll_ready to prevent starvation#23358

Open
0xMars42 wants to merge 1 commit intoparadigmxyz:mainfrom
0xMars42:fix-rlpx-satellite-starvation
Open

fix(net): drain satellite out_buffer in Sink::poll_ready to prevent starvation#23358
0xMars42 wants to merge 1 commit intoparadigmxyz:mainfrom
0xMars42:fix-rlpx-satellite-starvation

Conversation

@0xMars42
Copy link
Copy Markdown
Contributor

@0xMars42 0xMars42 commented Apr 4, 2026

Closes #13856

Drains out_buffer in RlpxSatelliteStream's Sink::poll_ready before reporting readiness, so that buffered satellite messages are flushed to the wire before new primary messages are accepted.

Previously, out_buffer was only drained inside Stream::poll_next. The Sink::poll_ready checked connection and primary readiness but never touched out_buffer, meaning callers could continuously send primary messages via the sink path while satellite messages sat in the buffer waiting for the stream to be polled.

The drain logic checks conn.poll_ready before popping from the buffer to avoid losing messages if the connection returns Pending. The existing poll_ready call on conn after the drain loop was removed since conn is already known to be Ready(Ok(())) from the last drain iteration.

@github-project-automation github-project-automation bot moved this to Backlog in Reth Tracker Apr 4, 2026
@0xMars42 0xMars42 requested review from Rjected and mattsse as code owners April 4, 2026 17:26
@0xMars42 0xMars42 force-pushed the fix-rlpx-satellite-starvation branch from 6a5607d to 35570e2 Compare April 4, 2026 17:40
@0xMars42 0xMars42 force-pushed the fix-rlpx-satellite-starvation branch from 35570e2 to 6c81f21 Compare April 4, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Improve overall multiplex performance for rlpx satellite stream

1 participant