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

Commit transaction before responding on Engine API #4506

Merged
merged 9 commits into from
Jun 20, 2022
Merged

Conversation

yperbasis
Copy link
Member

Consider the following scenario:

  1. CL sends engine_newPayload
  2. CL sends engine_forkchoiceUpdated with headBlockHash pointing to the newly added block
  3. CL asks for eth_getBlockByNumber("latest")

If we don't commit the DB transaction before replying to CL in 2, there's a race condition between 2 & 3 because in 3 we might be looking at the old LastForkchoice.headBlockHash. That's why Hive test "Inconsistent Head in ForkchoiceState" was failing.

Copy link
Contributor

@enriavil1 enriavil1 left a comment

Choose a reason for hiding this comment

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

LGTM

@yperbasis yperbasis merged commit daa8492 into devel Jun 20, 2022
@yperbasis yperbasis deleted the merge_stuff_g branch June 20, 2022 21:03
@VBulikov VBulikov mentioned this pull request Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants