-
Notifications
You must be signed in to change notification settings - Fork 975
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
Bellatrix: pass justified as a safe block #2858
Conversation
Co-authored-by: Hsiao-Wei Wang <[email protected]>
I have added a |
specs/bellatrix/fork-choice.md
Outdated
MUST be set to the return value of the following function: | ||
|
||
```python | ||
def get_safe_block_hash(store: Store) -> Hash32: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should likely got in the safe_block helper file
Applied the following review suggestions:
|
@@ -0,0 +1,46 @@ | |||
# Fork Choice -- Safe Block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this file is cross forks. Maybe note that it is only valid post-Bellatrix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, safe block algorithm can be implemented with Phase0
structures. I would add a note that get_safe_execution_payload_hash
helper is based on Bellatrix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me! opened #2865 to track needing some unit tests here
Introduces a
get_safe_block_hash
function that returns a block hash of a safe execution block. This function may be redefined post-Merge. The current definition uses the most recent justified block as a safe block.An alternative approach is in having generally defined
get_safe_block
function (as an extension outside of the main fork-choice spec) utilized byget_safe_block_hash
. But it can be easily done later on onceget_safe_block
will represent more complicated logic than it currently is, or I can be convinced that it should be done within this PR.TODO
get_safe_block
implementation returningstore.justified_checkpoint.root