reth icon indicating copy to clipboard operation
reth copied to clipboard

perf(consensus): never drop FCU

Open emhane opened this issue 9 months ago • 2 comments

Closes https://github.com/paradigmxyz/reth/issues/8203.

  • Adds VecDeque with engine messages to ensure no messages a dropped.

emhane avatar May 13 '24 21:05 emhane

wondering if it's tackling the problem at head better, to replace this with a VecDeque instead @mattsse

https://github.com/paradigmxyz/reth/blob/081796b138fd00a6d0af2ad463123fdbe04765ab/crates/consensus/beacon/src/engine/mod.rs#L187-L188

emhane avatar May 13 '24 21:05 emhane

wondering if it's tackling the problem at head better, to replace this with a VecDeque instead @mattsse

https://github.com/paradigmxyz/reth/blob/081796b138fd00a6d0af2ad463123fdbe04765ab/crates/consensus/beacon/src/engine/mod.rs#L187-L188

eventually, yes, but rn this is basically just fake concurrency of sequential message processing as prep for #7154 but maybe a vecque could also work here @rkrasiuk

mattsse avatar May 14 '24 19:05 mattsse

That looks good and should work.

I was only thinking maybe we should only add the messages to the queue when we actually can't process them, i.e. when the pruner is running and we skip an FCU. Instead of always caching the messages and popping them from the queue on the next poll that I think slows down the engine message processing a bit.

shekhirin avatar May 15 '24 15:05 shekhirin

doesn't work though :/ @shekhirin @mattsse and not sure why, that loop is very complex

emhane avatar May 16 '24 16:05 emhane

think we should rewrite this future implementation to be a stream, so we can better reason about it. rn it's very complex to create a mental model of how this state machine will behave based on varying external conditions. related https://github.com/paradigmxyz/reth/issues/6541.

emhane avatar May 17 '24 14:05 emhane

closing in favour of https://github.com/paradigmxyz/reth/pull/8315

emhane avatar May 20 '24 07:05 emhane