-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Update EIP-4788: Move to Draft #6859
Conversation
✅ All reviewers have approved. |
- additional author - use block roots instead of state roots - key by slot - use of ring buffer in state - use header timestamps to derive slot numbers, rather than consume additional header space
7163367
to
38e025c
Compare
Co-authored-by: g11tech <[email protected]>
Co-authored-by: g11tech <[email protected]>
Co-authored-by: g11tech <[email protected]>
Co-authored-by: g11tech <[email protected]>
The commit 7a98c7b (as a parent of ed1df6b) contains errors. |
EIPS/eip-4788.md
Outdated
1. set the value of the `ommers` field in the block to an RLP list with one element: the 32 byte [hash tree root](https://github.com/ethereum/consensus-specs/blob/dev/ssz/simple-serialize.md#merkleization) of the [beacon state](https://github.com/ethereum/consensus-specs/blob/dev/specs/bellatrix/beacon-chain.md#beaconstate) from the previous slot to this block. | ||
|
||
2. set the value of the `ommersHash` field in the block header to the Keccak256 hash of the `ommers` field. | ||
1. set 32 bytes of the execution block header after the `withdrawals_root` to the 32 byte [hash tree root](https://github.com/ethereum/consensus-specs/blob/dev/ssz/simple-serialize.md#merkleization) of the parent beacon 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.
I think this link needs to be refered with a specific commit hash instead of the dev
tag
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.
All Reviewers Have Approved; Performing Automatic Merge...
beacon_state_root = block.ommers[0] | ||
sstore(HISTORY_STORAGE_ADDRESS, block.number, beacon_state_root) | ||
start_timestamp = get_block(block_header.parent_hash).header.timestamp | ||
start_slot = convert_to_slot(start_timestamp) |
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.
We can re-use nonce
field to put a slot number into it allowing to avoid EL to be aware of timestamp to slot conversion. It also opens an opportunity to add SLOT
EVM instruction in the future.
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.
yeah I wasn't sure if this was a new capability, e.g. post-4844 and if so then we can do something like what you suggest to also provide slot data with the root
type: Standards Track | ||
category: Core | ||
created: 2022-02-10 | ||
--- | ||
|
||
## Abstract | ||
|
||
Commit to the state root of the beacon chain in the `ommers` field in the post-merge execution block. Reflect the changes in the `ommersHash` field of the execution block header. | ||
Commit to the (hash tree) root of each beacon chain block in the corresponding execution payload header. |
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.
Why the parenthesis? Might just actually also say "SSZ hash tree root"
``` | ||
|
||
When using any slot value as a key to the storage, the value under consideration should be converted to 32 bytes with big-endian encoding. |
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.
MUST, rather than should
also relevant: ethereum/consensus-specs#3319