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

refactor(engine): always connect buffered blocks on r/w hook finish #4657

Merged
merged 9 commits into from
Sep 20, 2023

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Sep 19, 2023

This PR removes a separate ConnectBufferedBlocks engine hook action, and instead connects the buffered blocks upon completion of any hook with read-write access to the database.

It is logically correct, because when we start a hook with read-write access to the database, we can't process incoming payloads, and buffer them instead, hence we need to check the buffered blocks (payloads) for any such hook.

@shekhirin shekhirin changed the title refactor(engine): always connect buffered blocks refactor(engine): always connect buffered blocks on r/w hook finish Sep 19, 2023
@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Merging #4657 (df50e3a) into main (8012942) will decrease coverage by 0.01%.
Report is 9 commits behind head on main.
The diff coverage is 81.25%.

Impacted file tree graph

Files Changed Coverage Δ
crates/consensus/beacon/src/engine/hooks/mod.rs 62.50% <0.00%> (-2.72%) ⬇️
...es/consensus/beacon/src/engine/hooks/controller.rs 79.41% <76.92%> (+5.16%) ⬆️
crates/consensus/beacon/src/engine/mod.rs 74.30% <88.23%> (-0.28%) ⬇️
crates/consensus/beacon/src/engine/hooks/prune.rs 87.01% <100.00%> (+0.76%) ⬆️

... and 23 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.74% <0.00%> (-0.06%) ⬇️
unit-tests 63.35% <81.25%> (+0.01%) ⬆️

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

Components Coverage Δ
reth binary 32.17% <ø> (-0.01%) ⬇️
blockchain tree 83.75% <ø> (ø)
pipeline 88.54% <ø> (ø)
storage (db) 73.01% <ø> (-0.47%) ⬇️
trie 94.73% <ø> (-0.04%) ⬇️
txpool 49.44% <ø> (ø)
networking 77.10% <ø> (-0.15%) ⬇️
rpc 57.82% <ø> (+0.36%) ⬆️
consensus 63.25% <81.25%> (+0.58%) ⬆️
revm 28.16% <ø> (+0.12%) ⬆️
payload builder 8.45% <ø> (ø)
primitives 86.53% <ø> (+0.02%) ⬆️

Base automatically changed from alexey/pruner-bt-update to main September 19, 2023 17:08
@shekhirin shekhirin force-pushed the alexey/hook-connect-buffered-blocks branch from ab40d7b to b6a2d37 Compare September 19, 2023 17:49
@shekhirin shekhirin added C-debt Refactor of code section that is hard to understand or maintain A-consensus Related to the consensus engine labels Sep 19, 2023
@shekhirin shekhirin marked this pull request as ready for review September 19, 2023 17:55
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

It is logically correct, because when we start a hook with read-write access to the database, we can't process incoming payloads, and buffer them instead, hence we need to check the buffered blocks (payloads) for any such hook.

this is correct, however it looks like this breaks a few tests

@shekhirin shekhirin marked this pull request as draft September 20, 2023 07:42
@shekhirin
Copy link
Collaborator Author

@mattsse god bless engine tests, fixed

@shekhirin shekhirin marked this pull request as ready for review September 20, 2023 12:13
@shekhirin shekhirin added this pull request to the merge queue Sep 20, 2023
Merged via the queue into main with commit 6016da7 Sep 20, 2023
22 checks passed
@shekhirin shekhirin deleted the alexey/hook-connect-buffered-blocks branch September 20, 2023 12:26
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-debt Refactor of code section that is hard to understand or maintain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants