Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: handle sync and engine messages in same loop #3276

Merged

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Jun 20, 2023

this improves the engine poll loop hinted at in #3179

this should reduce the time we're potentially unresponsive to engine messages because we no longer drain all download events at once and instead alternate between both sources like: select! { engine messages from rpc, sync event }

this way we only process 1 download response before checking engine messages again

@mattsse mattsse requested review from rkrasiuk and Rjected as code owners June 20, 2023 15:44
@mattsse mattsse added C-perf A change motivated by improving speed, memory usage or disk footprint A-consensus Related to the consensus engine labels Jun 20, 2023
Copy link
Collaborator

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

lgtm overall, although I'm not too knowledgeable about this part of the code, so will defer to @rkrasiuk or others

@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Merging #3276 (7ca1da6) into main (8eeba4d) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #3276      +/-   ##
==========================================
- Coverage   69.72%   69.71%   -0.01%     
==========================================
  Files         530      530              
  Lines       71531    71529       -2     
==========================================
- Hits        49876    49868       -8     
- Misses      21655    21661       +6     
Flag Coverage Δ
integration-tests 16.37% <0.00%> (-0.01%) ⬇️
unit-tests 64.76% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
crates/consensus/beacon/src/engine/sync.rs 74.50% <ø> (-1.97%) ⬇️
crates/consensus/beacon/src/engine/mod.rs 78.60% <100.00%> (+0.11%) ⬆️

... and 6 files with indirect coverage changes

Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

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

Nice, yeah I see how the alternating loop acts like a select, returning if both are Pending

@mattsse mattsse added this pull request to the merge queue Jun 21, 2023
Merged via the queue into main with commit 00e6adf Jun 21, 2023
@mattsse mattsse deleted the matt/poll-engine-messages-and-sync-events-in-same-loop branch June 21, 2023 13:34
yuichiroaoki pushed a commit to yuichiroaoki/reth that referenced this pull request Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Related to the consensus engine C-perf A change motivated by improving speed, memory usage or disk footprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants