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

Remove EIP-7742 #4046

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Features are researched and developed in parallel, and then consolidated into se
| Seq. | Code Name | Fork Epoch | Specs |
| - | - | - | - |
| 5 | **Electra** | TBD | <ul><li>Core</li><ul><li>[Beacon Chain changes](specs/electra/beacon-chain.md)</li><li>[Electra fork](specs/electra/fork.md)</li></ul><li>Additions</li><ul><li>[Light client sync protocol changes](specs/electra/light-client/sync-protocol.md) ([fork](specs/electra/light-client/fork.md), [networking](specs/electra/light-client/p2p-interface.md))</li><li>[Honest validator guide changes](specs/electra/validator.md)</li><li>[P2P networking](specs/electra/p2p-interface.md)</li></ul></ul> |
| 6 | **Fulu** | TBD | <ul><li>Core</li><ul><li>[Beacon Chain changes](specs/fulu/beacon-chain.md)</li><li>[Fulu fork](specs/fulu/fork.md)</li><li>[Data availability sampling core](specs/fulu/das-core.md)</li><li>[Polynomial commitments sampling](specs/fulu/polynomial-commitments-sampling.md)</li><li>[Fork choice changes](specs/fulu/fork-choice.md)</li></ul><li>Additions</li><ul><li>[Honest validator guide changes](specs/fulu/validator.md)</li><li>[P2P networking](specs/fulu/p2p-interface.md)</li><li>[Peer sampling](specs/fulu/peer-sampling.md)</li></ul></ul> |
| 6 | **Fulu** | TBD | <ul><li>Core</li><ul><li>[Beacon Chain changes](specs/fulu/beacon-chain.md)</li><li>[Fulu fork](specs/fulu/fork.md)</li><li>[Data availability sampling core](specs/fulu/das-core.md)</li><li>[Polynomial commitments sampling](specs/fulu/polynomial-commitments-sampling.md)</li><li>[Fork choice changes](specs/fulu/fork-choice.md)</li></ul><li>Additions</li><ul><li>[P2P networking](specs/fulu/p2p-interface.md)</li><li>[Peer sampling](specs/fulu/peer-sampling.md)</li></ul></ul> |

### Outdated Specifications

Expand Down
3 changes: 0 additions & 3 deletions configs/mainnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000
# `9`
BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 9
# `uint64(6)`
TARGET_BLOBS_PER_BLOCK_ELECTRA: 6
# `uint64(9)`
MAX_BLOBS_PER_BLOCK_ELECTRA: 9
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA
Expand All @@ -174,7 +172,6 @@ DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
SAMPLES_PER_SLOT: 8
CUSTODY_REQUIREMENT: 4
TARGET_BLOBS_PER_BLOCK_FULU: 9
MAX_BLOBS_PER_BLOCK_FULU: 12
# `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_FULU`
MAX_REQUEST_BLOB_SIDECARS_FULU: 1536
Expand Down
3 changes: 0 additions & 3 deletions configs/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 128000000000
# `9`
BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 9
# `uint64(6)`
TARGET_BLOBS_PER_BLOCK_ELECTRA: 6
# `uint64(9)`
MAX_BLOBS_PER_BLOCK_ELECTRA: 9
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA
Expand All @@ -175,7 +173,6 @@ DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
SAMPLES_PER_SLOT: 8
CUSTODY_REQUIREMENT: 4
TARGET_BLOBS_PER_BLOCK_FULU: 9
MAX_BLOBS_PER_BLOCK_FULU: 12
# `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_FULU`
MAX_REQUEST_BLOB_SIDECARS_FULU: 1536
Expand Down
6 changes: 2 additions & 4 deletions pysetup/spec_builders/electra.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ class NoopExecutionEngine(ExecutionEngine):
def notify_new_payload(self: ExecutionEngine,
execution_payload: ExecutionPayload,
parent_beacon_block_root: Root,
execution_requests_list: Sequence[bytes],
target_blobs_per_block: uint64) -> bool:
execution_requests_list: Sequence[bytes]) -> bool:
return True

def notify_forkchoice_updated(self: ExecutionEngine,
Expand All @@ -48,8 +47,7 @@ def get_payload(self: ExecutionEngine, payload_id: PayloadId) -> GetPayloadRespo
def is_valid_block_hash(self: ExecutionEngine,
execution_payload: ExecutionPayload,
parent_beacon_block_root: Root,
execution_requests_list: Sequence[bytes],
target_blobs_per_block: uint64) -> bool:
execution_requests_list: Sequence[bytes]) -> bool:
return True

def is_valid_versioned_hashes(self: ExecutionEngine, new_payload_request: NewPayloadRequest) -> bool:
Expand Down
1 change: 0 additions & 1 deletion specs/_features/eip7732/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,6 @@ def process_execution_payload(state: BeaconState,
versioned_hashes=versioned_hashes,
parent_beacon_block_root=state.latest_block_header.parent_root,
execution_requests=requests,
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_ELECTRA,
)
)

Expand Down
27 changes: 8 additions & 19 deletions specs/electra/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ The following values are (non-configurable) constants used throughout the specif

| Name | Value | Description |
| - | - | - |
| `TARGET_BLOBS_PER_BLOCK_ELECTRA` | `uint64(6)` | *[New in Electra:EIP7691]* Target number of blobs in a single block limited by `MAX_BLOBS_PER_BLOCK_ELECTRA` |
| `MAX_BLOBS_PER_BLOCK_ELECTRA` | `uint64(9)` | *[New in Electra:EIP7691]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` |

### Validator cycle
Expand Down Expand Up @@ -1014,22 +1013,19 @@ class NewPayloadRequest(object):
versioned_hashes: Sequence[VersionedHash]
parent_beacon_block_root: Root
execution_requests: ExecutionRequests # [New in Electra]
target_blobs_per_block: uint64 # [New in Electra:EIP7742]
```

#### Engine APIs

##### Modified `is_valid_block_hash`

*Note*: The function `is_valid_block_hash` is modified to include the additional
`execution_requests_list` and `target_blobs_per_block` parameters in Electra.
*Note*: The function `is_valid_block_hash` is modified to include the additional `execution_requests_list`.

```python
def is_valid_block_hash(self: ExecutionEngine,
execution_payload: ExecutionPayload,
parent_beacon_block_root: Root,
execution_requests_list: Sequence[bytes],
target_blobs_per_block: uint64) -> bool:
execution_requests_list: Sequence[bytes]) -> bool:
"""
Return ``True`` if and only if ``execution_payload.block_hash`` is computed correctly.
"""
Expand All @@ -1038,15 +1034,13 @@ def is_valid_block_hash(self: ExecutionEngine,

##### Modified `notify_new_payload`

*Note*: The function `notify_new_payload` is modified to include the additional
`execution_requests_list` and `target_blobs_per_block` parameters in Electra.
*Note*: The function `notify_new_payload` is modified to include the additional `execution_requests_list`.

```python
def notify_new_payload(self: ExecutionEngine,
execution_payload: ExecutionPayload,
parent_beacon_block_root: Root,
execution_requests_list: Sequence[bytes],
target_blobs_per_block: uint64) -> bool:
execution_requests_list: Sequence[bytes]) -> bool:
"""
Return ``True`` if and only if ``execution_payload`` and ``execution_requests_list``
are valid with respect to ``self.execution_state``.
Expand All @@ -1056,9 +1050,8 @@ def notify_new_payload(self: ExecutionEngine,

##### Modified `verify_and_notify_new_payload`

*Note*: The function `verify_and_notify_new_payload` is modified to pass the additional parameters
`execution_requests_list` and `target_blobs_per_block` when calling `is_valid_block_hash` and
`notify_new_payload` in Electra.
*Note*: The function `verify_and_notify_new_payload` is modified to pass the additional parameter
`execution_requests_list` when calling `is_valid_block_hash` and `notify_new_payload` in Electra.

```python
def verify_and_notify_new_payload(self: ExecutionEngine,
Expand All @@ -1069,7 +1062,6 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
execution_payload = new_payload_request.execution_payload
parent_beacon_block_root = new_payload_request.parent_beacon_block_root
execution_requests_list = get_execution_requests_list(new_payload_request.execution_requests) # [New in Electra]
target_blobs_per_block = new_payload_request.target_blobs_per_block # [New in Electra:EIP7742]

if b'' in execution_payload.transactions:
return False
Expand All @@ -1078,8 +1070,7 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
if not self.is_valid_block_hash(
execution_payload,
parent_beacon_block_root,
execution_requests_list,
target_blobs_per_block):
execution_requests_list):
return False

if not self.is_valid_versioned_hashes(new_payload_request):
Expand All @@ -1089,8 +1080,7 @@ def verify_and_notify_new_payload(self: ExecutionEngine,
if not self.notify_new_payload(
execution_payload,
parent_beacon_block_root,
execution_requests_list,
target_blobs_per_block):
execution_requests_list):
return False

return True
Expand Down Expand Up @@ -1254,7 +1244,6 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
versioned_hashes=versioned_hashes,
parent_beacon_block_root=state.latest_block_header.parent_root,
execution_requests=body.execution_requests, # [New in Electra]
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_ELECTRA, # [New in Electra:EIP7691:EIP7742]
)
)
# Cache execution payload header
Expand Down
38 changes: 0 additions & 38 deletions specs/electra/fork-choice.md

This file was deleted.

2 changes: 0 additions & 2 deletions specs/electra/validator.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ def prepare_execution_payload(state: BeaconState,
suggested_fee_recipient=suggested_fee_recipient,
withdrawals=withdrawals,
parent_beacon_block_root=hash_tree_root(state.latest_block_header),
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_ELECTRA, # [New in Electra:EIP7742]
max_blobs_per_block=MAX_BLOBS_PER_BLOCK_ELECTRA, # [New in Electra:EIP7742]
)
return execution_engine.notify_forkchoice_updated(
head_block_hash=parent_hash,
Expand Down
2 changes: 0 additions & 2 deletions specs/fulu/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

| Name | Value | Description |
| - | - | - |
| `TARGET_BLOBS_PER_BLOCK_FULU` | `uint64(9)` | *[New in Fulu:EIP7594]* Target number of blobs in a single block limited by `MAX_BLOBS_PER_BLOCK_FULU` |
| `MAX_BLOBS_PER_BLOCK_FULU` | `uint64(12)` | *[New in Fulu:EIP7594]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` |

#### Execution payload
Expand All @@ -54,7 +53,6 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi
versioned_hashes=versioned_hashes,
parent_beacon_block_root=state.latest_block_header.parent_root,
execution_requests=body.execution_requests,
target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_FULU, # [Modified in Fulu:EIP7594]
)
)
# Cache execution payload header
Expand Down
68 changes: 0 additions & 68 deletions specs/fulu/validator.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def test_processing_pending_partial_withdrawals(spec):
@spec_test
@single_phase
def test_networking(spec):
assert spec.config.TARGET_BLOBS_PER_BLOCK_ELECTRA <= spec.config.MAX_BLOBS_PER_BLOCK_ELECTRA
assert spec.config.MAX_BLOBS_PER_BLOCK_ELECTRA <= spec.MAX_BLOB_COMMITMENTS_PER_BLOCK
assert (
spec.config.MAX_REQUEST_BLOB_SIDECARS_ELECTRA ==
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def test_polynomical_commitments_sampling(spec):
@spec_test
@single_phase
def test_networking(spec):
assert spec.config.TARGET_BLOBS_PER_BLOCK_FULU <= spec.config.MAX_BLOBS_PER_BLOCK_FULU
assert spec.config.MAX_BLOBS_PER_BLOCK_FULU <= spec.MAX_BLOB_COMMITMENTS_PER_BLOCK
assert (
spec.config.MAX_REQUEST_BLOB_SIDECARS_FULU ==
Expand Down