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.
I think this link needs to be refered with a specific commit hash instead of the dev tag
eth-bot
left a comment
There was a problem hiding this comment.
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.
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.
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
| ## 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.
Why the parenthesis? Might just actually also say "SSZ hash tree root"
| sstore(HISTORY_STORAGE_ADDRESS, slot % SLOTS_PER_HISTORICAL_ROOT, parent_beacon_block_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. |
also relevant: ethereum/consensus-specs#3319