-
Notifications
You must be signed in to change notification settings - Fork 996
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
Various spec fixes for EIP-7251 #3657
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
982a983
EIP-7251: format/lint fixes/docs, add validator guide
ralexstokes a80a777
add missing extended types for EIP-7251
ralexstokes b5d7bd0
bugfix: voluntary exit processing in EIP-7251
ralexstokes 61168e6
spec bugfix: incorrect `process_epoch` definition
ralexstokes 8cf2fd5
add EIP-7251 `initialize_beacon_state_from_eth1` function
ralexstokes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# EIP-7251 -- Honest Validator | ||
|
||
## Table of contents | ||
|
||
<!-- TOC --> | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
|
||
- [Introduction](#introduction) | ||
- [Prerequisites](#prerequisites) | ||
- [Beacon chain responsibilities](#beacon-chain-responsibilities) | ||
- [Block and sidecar proposal](#block-and-sidecar-proposal) | ||
- [Constructing the `BeaconBlockBody`](#constructing-the-beaconblockbody) | ||
- [ExecutionPayload](#executionpayload) | ||
|
||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- /TOC --> | ||
|
||
## Introduction | ||
|
||
This document represents the changes to be made in the code of an "honest validator". | ||
|
||
## Prerequisites | ||
|
||
This document is an extension of the [Deneb -- Honest Validator](../deneb/validator.md) guide. | ||
All behaviors and definitions defined in this document, and documents it extends, carry over unless explicitly noted or overridden. | ||
|
||
All terminology, constants, functions, and protocol mechanics defined in the updated [Beacon Chain doc of EIP-7251](./beacon-chain.md) are requisite for this document and used throughout. | ||
Please see related Beacon Chain doc before continuing and use them as a reference throughout. | ||
|
||
## Beacon chain responsibilities | ||
|
||
All validator responsibilities remain unchanged other than those noted below. | ||
|
||
### Block and sidecar proposal | ||
|
||
#### Constructing the `BeaconBlockBody` | ||
|
||
##### ExecutionPayload | ||
|
||
`prepare_execution_payload` is updated from the Deneb specs. | ||
|
||
*Note*: In this section, `state` is the state of the slot for the block proposal _without_ the block yet applied. | ||
That is, `state` is the `previous_state` processed through any empty slots up to the assigned slot using `process_slots(previous_state, slot)`. | ||
|
||
*Note*: The only change to `prepare_execution_payload` is the new definition of `get_expected_withdrawals`. | ||
|
||
```python | ||
def prepare_execution_payload(state: BeaconState, | ||
safe_block_hash: Hash32, | ||
finalized_block_hash: Hash32, | ||
suggested_fee_recipient: ExecutionAddress, | ||
execution_engine: ExecutionEngine) -> Optional[PayloadId]: | ||
# Verify consistency of the parent hash with respect to the previous execution payload header | ||
parent_hash = state.latest_execution_payload_header.block_hash | ||
|
||
# Set the forkchoice head and initiate the payload build process | ||
withdrawals, _ = get_expected_withdrawals(state) # [Modified in EIP-7251] | ||
|
||
payload_attributes = PayloadAttributes( | ||
timestamp=compute_timestamp_at_slot(state, state.slot), | ||
prev_randao=get_randao_mix(state, get_current_epoch(state)), | ||
suggested_fee_recipient=suggested_fee_recipient, | ||
withdrawals=withdrawals, | ||
parent_beacon_block_root=hash_tree_root(state.latest_block_header), | ||
) | ||
return execution_engine.notify_forkchoice_updated( | ||
head_block_hash=parent_hash, | ||
safe_block_hash=safe_block_hash, | ||
finalized_block_hash=finalized_block_hash, | ||
payload_attributes=payload_attributes, | ||
) | ||
``` |
Oops, something went wrong.
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.
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.
@hwwhww are we still merging these? state bumps can be computed from the upgrade_to_* function
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.
they do serve distinct purposes
for testing, we will usually start at genesis, whereas at the fork boundary there is likely state we want to bring forward/translate from the old fork to the new
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 @dapplion was pointing to an old discussion. I just opened an issue: #3663 (a good first issue!)
It's better to clean up them in other PRs altogether. 👍