-
Notifications
You must be signed in to change notification settings - Fork 1.1k
eip7928: introduce specs for block access lists #4526
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
Merged
jtraglia
merged 13 commits into
ethereum:master
from
nerolation:eip7928-block-access-lists
Aug 27, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
aa2c1b8
Add EIP-7928: Block-Level Access Lists
nerolation a69f440
update engine api
nerolation fbc87d1
Update EIP-7928 Specs: Engine API
nerolation b8fe0c4
Merge branch 'master' into eip7928-block-access-lists
jtraglia f884d8f
Add EIP-7928 specs rebased on Fulu
nerolation 3d66ef9
Add EIP-7928 fork constants to configs
nerolation 553daf7
Add tests
nerolation 5da7a4a
Update specs/_features/eip7928/fork.md
nerolation 202e23b
Fix bugs
nerolation a737d7f
Fix comment
jtraglia 5c6af94
Update labels & workflows
jtraglia 8440b33
Merge branch 'master' into eip7928-block-access-lists
jtraglia 34f0d45
Move compute_fork_version
jtraglia 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 hidden or 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 |
---|---|---|
|
@@ -20,6 +20,7 @@ categories: | |
labels: | ||
- gloas | ||
- eip7732 | ||
- eip7928 | ||
|
||
# Features | ||
- title: EIP-6110 | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,12 @@ | ||
from ..constants import EIP7928 | ||
from .base import BaseSpecBuilder | ||
|
||
|
||
class EIP7928SpecBuilder(BaseSpecBuilder): | ||
fork: str = EIP7928 | ||
|
||
@classmethod | ||
def imports(cls, preset_name: str): | ||
return f""" | ||
from eth2spec.fulu import {preset_name} as fulu | ||
""" |
This file contains hidden or 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,147 @@ | ||
# EIP-7928 -- The Beacon Chain | ||
|
||
*Note*: This document is a work-in-progress for researchers and implementers. | ||
|
||
<!-- mdformat-toc start --slug=github --no-anchors --maxlevel=6 --minlevel=2 --> | ||
|
||
- [Introduction](#introduction) | ||
- [Custom types](#custom-types) | ||
- [Extended Containers](#extended-containers) | ||
- [`ExecutionPayload`](#executionpayload) | ||
- [`ExecutionPayloadHeader`](#executionpayloadheader) | ||
- [`NewPayloadRequest`](#newpayloadrequest) | ||
- [Beacon chain state transition function](#beacon-chain-state-transition-function) | ||
- [Block processing](#block-processing) | ||
- [Execution payload](#execution-payload) | ||
- [Modified `process_execution_payload`](#modified-process_execution_payload) | ||
|
||
<!-- mdformat-toc end --> | ||
|
||
## Introduction | ||
|
||
*Note*: This specification is built upon [Fulu](../../fulu/beacon-chain.md) and | ||
is under active development. | ||
|
||
## Custom types | ||
|
||
| Name | SSZ equivalent | Description | | ||
| ----------------- | ------------------------------------- | ----------------------------- | | ||
| `BlockAccessList` | `ByteList[MAX_BYTES_PER_TRANSACTION]` | RLP encoded block access list | | ||
|
||
## Extended Containers | ||
|
||
### `ExecutionPayload` | ||
|
||
```python | ||
class ExecutionPayload(Container): | ||
parent_hash: Hash32 | ||
fee_recipient: ExecutionAddress | ||
state_root: Bytes32 | ||
receipts_root: Bytes32 | ||
logs_bloom: ByteVector[BYTES_PER_LOGS_BLOOM] | ||
prev_randao: Bytes32 | ||
block_number: uint64 | ||
gas_limit: uint64 | ||
gas_used: uint64 | ||
timestamp: uint64 | ||
extra_data: ByteList[MAX_EXTRA_DATA_BYTES] | ||
base_fee_per_gas: uint256 | ||
block_hash: Hash32 | ||
transactions: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD] | ||
withdrawals: List[Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD] | ||
blob_gas_used: uint64 | ||
excess_blob_gas: uint64 | ||
# [New in EIP7928] | ||
block_access_list: BlockAccessList | ||
``` | ||
|
||
### `ExecutionPayloadHeader` | ||
|
||
```python | ||
class ExecutionPayloadHeader(Container): | ||
parent_hash: Hash32 | ||
fee_recipient: ExecutionAddress | ||
state_root: Bytes32 | ||
receipts_root: Bytes32 | ||
logs_bloom: ByteVector[BYTES_PER_LOGS_BLOOM] | ||
prev_randao: Bytes32 | ||
block_number: uint64 | ||
gas_limit: uint64 | ||
gas_used: uint64 | ||
timestamp: uint64 | ||
extra_data: ByteList[MAX_EXTRA_DATA_BYTES] | ||
base_fee_per_gas: uint256 | ||
block_hash: Hash32 | ||
transactions_root: Root | ||
withdrawals_root: Root | ||
blob_gas_used: uint64 | ||
excess_blob_gas: uint64 | ||
# [New in EIP7928] | ||
block_access_list_root: Root | ||
``` | ||
|
||
### `NewPayloadRequest` | ||
|
||
*Note*: The `NewPayloadRequest` is unchanged. The `block_access_list` is | ||
included in the `execution_payload` field. | ||
|
||
## Beacon chain state transition function | ||
|
||
### Block processing | ||
|
||
#### Execution payload | ||
|
||
##### Modified `process_execution_payload` | ||
|
||
```python | ||
def process_execution_payload( | ||
state: BeaconState, body: BeaconBlockBody, execution_engine: ExecutionEngine | ||
) -> None: | ||
payload = body.execution_payload | ||
|
||
# Verify consistency of the parent hash with respect to the previous execution payload header | ||
assert payload.parent_hash == state.latest_execution_payload_header.block_hash | ||
# Verify prev_randao | ||
assert payload.prev_randao == get_randao_mix(state, get_current_epoch(state)) | ||
# Verify timestamp | ||
assert payload.timestamp == compute_time_at_slot(state, state.slot) | ||
# Verify commitments are under limit | ||
assert ( | ||
len(body.blob_kzg_commitments) | ||
<= get_blob_parameters(get_current_epoch(state)).max_blobs_per_block | ||
) | ||
# Verify the execution payload is valid | ||
versioned_hashes = [ | ||
kzg_commitment_to_versioned_hash(commitment) for commitment in body.blob_kzg_commitments | ||
] | ||
assert execution_engine.verify_and_notify_new_payload( | ||
NewPayloadRequest( | ||
execution_payload=payload, | ||
versioned_hashes=versioned_hashes, | ||
parent_beacon_block_root=state.latest_block_header.parent_root, | ||
execution_requests=body.execution_requests, | ||
) | ||
) | ||
# Cache execution payload header | ||
state.latest_execution_payload_header = ExecutionPayloadHeader( | ||
parent_hash=payload.parent_hash, | ||
fee_recipient=payload.fee_recipient, | ||
state_root=payload.state_root, | ||
receipts_root=payload.receipts_root, | ||
logs_bloom=payload.logs_bloom, | ||
prev_randao=payload.prev_randao, | ||
block_number=payload.block_number, | ||
gas_limit=payload.gas_limit, | ||
gas_used=payload.gas_used, | ||
timestamp=payload.timestamp, | ||
extra_data=payload.extra_data, | ||
base_fee_per_gas=payload.base_fee_per_gas, | ||
block_hash=payload.block_hash, | ||
transactions_root=hash_tree_root(payload.transactions), | ||
withdrawals_root=hash_tree_root(payload.withdrawals), | ||
blob_gas_used=payload.blob_gas_used, | ||
excess_blob_gas=payload.excess_blob_gas, | ||
# [New in EIP7928] | ||
block_access_list_root=hash_tree_root(payload.block_access_list), | ||
) | ||
``` |
This file contains hidden or 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,111 @@ | ||
# EIP-7928 -- Fork Logic | ||
|
||
*Note*: This document is a work-in-progress for researchers and implementers. | ||
|
||
<!-- mdformat-toc start --slug=github --no-anchors --maxlevel=6 --minlevel=2 --> | ||
|
||
- [Introduction](#introduction) | ||
- [Configuration](#configuration) | ||
- [Fork to EIP-7928](#fork-to-eip-7928) | ||
- [Fork trigger](#fork-trigger) | ||
- [Upgrading the state](#upgrading-the-state) | ||
|
||
<!-- mdformat-toc end --> | ||
|
||
## Introduction | ||
|
||
This document describes the process of the EIP-7928 upgrade. | ||
|
||
## Configuration | ||
|
||
Warning: this configuration is not definitive. | ||
|
||
| Name | Value | | ||
| ---------------------- | ------------------------------------- | | ||
| `EIP7928_FORK_VERSION` | `Version('0x0b000000')` | | ||
| `EIP7928_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** | | ||
|
||
## Fork to EIP-7928 | ||
|
||
### Fork trigger | ||
|
||
The fork is triggered at epoch `EIP7928_FORK_EPOCH`. | ||
|
||
### Upgrading the state | ||
|
||
If `state.slot % SLOTS_PER_EPOCH == 0` and | ||
`compute_epoch_at_slot(state.slot) == EIP7928_FORK_EPOCH`, an irregular state | ||
change is made to upgrade to EIP-7928. | ||
|
||
```python | ||
def upgrade_to_eip7928(pre: fulu.BeaconState) -> BeaconState: | ||
epoch = get_current_epoch(pre) | ||
latest_execution_payload_header = ExecutionPayloadHeader( | ||
parent_hash=pre.latest_execution_payload_header.parent_hash, | ||
fee_recipient=pre.latest_execution_payload_header.fee_recipient, | ||
state_root=pre.latest_execution_payload_header.state_root, | ||
receipts_root=pre.latest_execution_payload_header.receipts_root, | ||
logs_bloom=pre.latest_execution_payload_header.logs_bloom, | ||
prev_randao=pre.latest_execution_payload_header.prev_randao, | ||
block_number=pre.latest_execution_payload_header.block_number, | ||
gas_limit=pre.latest_execution_payload_header.gas_limit, | ||
gas_used=pre.latest_execution_payload_header.gas_used, | ||
timestamp=pre.latest_execution_payload_header.timestamp, | ||
extra_data=pre.latest_execution_payload_header.extra_data, | ||
base_fee_per_gas=pre.latest_execution_payload_header.base_fee_per_gas, | ||
block_hash=pre.latest_execution_payload_header.block_hash, | ||
transactions_root=pre.latest_execution_payload_header.transactions_root, | ||
withdrawals_root=pre.latest_execution_payload_header.withdrawals_root, | ||
blob_gas_used=pre.latest_execution_payload_header.blob_gas_used, | ||
excess_blob_gas=pre.latest_execution_payload_header.excess_blob_gas, | ||
# [New in EIP7928] | ||
block_access_list_root=Root(), | ||
) | ||
post = BeaconState( | ||
genesis_time=pre.genesis_time, | ||
genesis_validators_root=pre.genesis_validators_root, | ||
slot=pre.slot, | ||
fork=Fork( | ||
previous_version=pre.fork.current_version, | ||
# [Modified in EIP7928] | ||
current_version=EIP7928_FORK_VERSION, | ||
epoch=epoch, | ||
), | ||
latest_block_header=pre.latest_block_header, | ||
block_roots=pre.block_roots, | ||
state_roots=pre.state_roots, | ||
historical_roots=pre.historical_roots, | ||
eth1_data=pre.eth1_data, | ||
eth1_data_votes=pre.eth1_data_votes, | ||
eth1_deposit_index=pre.eth1_deposit_index, | ||
validators=pre.validators, | ||
balances=pre.balances, | ||
randao_mixes=pre.randao_mixes, | ||
slashings=pre.slashings, | ||
previous_epoch_participation=pre.previous_epoch_participation, | ||
current_epoch_participation=pre.current_epoch_participation, | ||
justification_bits=pre.justification_bits, | ||
previous_justified_checkpoint=pre.previous_justified_checkpoint, | ||
current_justified_checkpoint=pre.current_justified_checkpoint, | ||
finalized_checkpoint=pre.finalized_checkpoint, | ||
inactivity_scores=pre.inactivity_scores, | ||
current_sync_committee=pre.current_sync_committee, | ||
next_sync_committee=pre.next_sync_committee, | ||
latest_execution_payload_header=latest_execution_payload_header, | ||
next_withdrawal_index=pre.next_withdrawal_index, | ||
next_withdrawal_validator_index=pre.next_withdrawal_validator_index, | ||
historical_summaries=pre.historical_summaries, | ||
deposit_requests_start_index=pre.deposit_requests_start_index, | ||
deposit_balance_to_consume=pre.deposit_balance_to_consume, | ||
exit_balance_to_consume=pre.exit_balance_to_consume, | ||
earliest_exit_epoch=pre.earliest_exit_epoch, | ||
consolidation_balance_to_consume=pre.consolidation_balance_to_consume, | ||
earliest_consolidation_epoch=pre.earliest_consolidation_epoch, | ||
pending_deposits=pre.pending_deposits, | ||
pending_partial_withdrawals=pre.pending_partial_withdrawals, | ||
pending_consolidations=pre.pending_consolidations, | ||
proposer_lookahead=pre.proposer_lookahead, | ||
) | ||
|
||
return post | ||
``` |
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.
Uh oh!
There was an error while loading. Please reload this page.