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

implement getStateForBlockProduction for late block reorg #7929

Merged
merged 6 commits into from
Jan 31, 2024

Conversation

rolfyone
Copy link
Contributor

Currently late block reorg is disabled so this defers to getStateAtSlotExact

This functionality diverges from getStateAtSlotExact with late block reorg, as sometimes the state we're wanting to use is the parent of the head. In this scenario we actually need to check the proposer head, and get the appropriate state based on that instead.

The fallback given all things being equal currently is to call getStateAtSlotExact, which is basically falling back to the old functionality.

  • if late block reorg is disabled
  • if the head root can't be read
  • if the headRoot is the same as the root we're told to use from getProposerHead.

In late block reorg case where we're using parent, we need to call regenerateBeaconState to apply empty slots.

partially addresses #6595

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Currently late block reorg is disabled so this defers to `getStateAtSlotExact`

This functionality diverges from `getStateAtSlotExact` with late block reorg, as sometimes the state we're wanting to use is the parent of the head. In this scenario we actually need to check the proposer head, and get the appropriate state based on that instead.

The fallback given all things being equal currently is to call getStateAtSlotExact, which is basically falling back to the old functionality.
 - if late block reorg is disabled
 - if the head root can't be read
 - if the headRoot is the same as the root we're told to use from getProposerHead.

 In late block reorg case where we're using parent, we need to call `regenerateBeaconState` to apply empty slots.

 partially addresses Consensys#6595

Signed-off-by: Paul Harris <[email protected]>
Copy link
Contributor

@zilm13 zilm13 left a comment

Choose a reason for hiding this comment

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

LGTM, just some nit comments to show I have checked it :)

@rolfyone rolfyone merged commit 30dd311 into Consensys:master Jan 31, 2024
15 checks passed
@rolfyone rolfyone deleted the 6595-combined-chain-data branch January 31, 2024 01:23
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.

3 participants