Skip to content
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

Merged
merged 8 commits into from
Apr 11, 2023
Merged

Conversation

ralexstokes
Copy link
Member

@ralexstokes ralexstokes commented Apr 10, 2023

  • 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

also relevant: ethereum/consensus-specs#3319

@ralexstokes ralexstokes requested a review from eth-bot as a code owner April 10, 2023 08:08
@github-actions github-actions bot added c-status Changes a proposal's status s-review This EIP is in Review t-core labels Apr 10, 2023
@eth-bot
Copy link
Collaborator

eth-bot commented Apr 10, 2023

✅ All reviewers have approved.

@eth-bot eth-bot changed the title Update 4788 mechanism Update EIP-4788: Move to Review Apr 10, 2023
@eth-bot eth-bot added the e-review Waiting on editor to review label Apr 10, 2023
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Apr 10, 2023
- 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
@github-actions github-actions bot added s-draft This EIP is a Draft and removed s-review This EIP is in Review labels Apr 10, 2023
@eth-bot eth-bot changed the title Update EIP-4788: Move to Review Update EIP-4788: Move to Draft Apr 10, 2023
@github-actions github-actions bot added w-ci Waiting on CI to pass and removed w-ci Waiting on CI to pass labels Apr 10, 2023
EIPS/eip-4788.md Outdated Show resolved Hide resolved
EIPS/eip-4788.md Outdated Show resolved Hide resolved
EIPS/eip-4788.md Outdated Show resolved Hide resolved
EIPS/eip-4788.md Outdated Show resolved Hide resolved
ralexstokes and others added 3 commits April 11, 2023 12:45
@github-actions github-actions bot added w-ci Waiting on CI to pass and removed w-ci Waiting on CI to pass labels Apr 11, 2023
@github-actions github-actions bot removed the w-ci Waiting on CI to pass label Apr 11, 2023
@github-actions
Copy link

The commit 7a98c7b (as a parent of ed1df6b) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot added the w-ci Waiting on CI to pass label Apr 11, 2023
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.
Copy link
Contributor

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

EIPS/eip-4788.md Outdated Show resolved Hide resolved
@eth-bot eth-bot enabled auto-merge (squash) April 11, 2023 12:20
Copy link
Collaborator

@eth-bot eth-bot left a 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...

@eth-bot eth-bot merged commit a8cf4ef into ethereum:master Apr 11, 2023
@github-actions github-actions bot removed the w-ci Waiting on CI to pass label Apr 11, 2023
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)
Copy link
Contributor

@mkalinin mkalinin Apr 12, 2023

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.

Copy link
Member Author

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

@ralexstokes ralexstokes deleted the update-4788 branch April 13, 2023 03:05
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.
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MUST, rather than should

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-status Changes a proposal's status e-review Waiting on editor to review s-draft This EIP is a Draft t-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants