P2Pstream calls poll_flush for each queued egress message, before calling start_send for the next. Instead, poll_flush should only be called once before the loop and once after the loop. According to docs, poll_ready should be called before each call to start_send. So, this also requires modifying poll_ready, to not call poll_flush
This will increase egress throughput. The Sink implementation on the P2PStream, constraints the Sink implementation on all layers above, like EthStream.
Describe the feature
P2Pstream
callspoll_flush
for each queued egress message, before callingstart_send
for the next. Instead,poll_flush
should only be called once before the loop and once after the loop. According to docs,poll_ready
should be called before each call tostart_send
. So, this also requires modifyingpoll_ready
, to not callpoll_flush
This will increase egress throughput. The
Sink
implementation on theP2PStream
, constraints theSink
implementation on all layers above, likeEthStream
.https://github.com/paradigmxyz/reth/blob/72f2f1b850a9454789f3ebb3f6efccaee4125659/crates/net/eth-wire/src/p2pstream.rs#L619-L635
https://github.com/paradigmxyz/reth/blob/72f2f1b850a9454789f3ebb3f6efccaee4125659/crates/net/eth-wire/src/p2pstream.rs#L539-L574
Additional context
No response