Bring more clarity to notify_forkchoice_updated calls#2745
Merged
djrtwo merged 4 commits intoethereum:devfrom Nov 26, 2021
Merged
Bring more clarity to notify_forkchoice_updated calls#2745djrtwo merged 4 commits intoethereum:devfrom
djrtwo merged 4 commits intoethereum:devfrom
Conversation
djrtwo
reviewed
Nov 24, 2021
specs/merge/fork-choice.md
Outdated
| *Note*: The call of the `notify_forkchoice_updated` function maps on the `POS_FORKCHOICE_UPDATED` event defined in the [EIP-3675](https://eips.ethereum.org/EIPS/eip-3675#definitions). | ||
| As per EIP-3675, before a post-transition block is finalized, `notify_forkchoice_updated` must be called with `finalized_block_hash = Hash32()`. | ||
|
|
||
| *Note*: Client software must not call this function as long as the paylod of the head of the chain is empty, i.e. `get_head(store).body.payload == ExecutionPayload()`. |
Contributor
There was a problem hiding this comment.
This statement is too strong. The validator that builds the merge transition block will call notify_forkchoice_updated when their store has an empty payload to kick off the build process
Contributor
There was a problem hiding this comment.
Instead, it might be. "must not call this function as long as the transition conditions are not met on the PoW chain. i.e. there exists a block for which is_valid_terminal_pow_block returns true"
Contributor
There was a problem hiding this comment.
btw maybe use capital "MUST NOT".
Contributor
Author
There was a problem hiding this comment.
Should be fixed now.
hwwhww
reviewed
Nov 25, 2021
Co-authored-by: Hsiao-Wei Wang <hsiaowei.eth@gmail.com>
djrtwo
approved these changes
Nov 26, 2021
Contributor
djrtwo
left a comment
There was a problem hiding this comment.
looks good! just a minor typo that i'll patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR clarifies two things:
notify_forkchoice_updatedmust not be called if a block with empty payload becomes the head of the chainnotify_forkchoice_updatedmust be called withhead_block_hash = terminal_pow_block.block_hashif it attempts to initiate build process of the payload for the merge transition block; this case is also specified in thevalidator.mdin a form of python code hence isn't that obvious