From 093f5f39f1de63257a87dc43bafbdca27b8bd972 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Wed, 12 Jun 2024 09:56:08 -0600 Subject: [PATCH 01/10] EIP-7742: uncouple blob counts across CL and EL --- pysetup/spec_builders/electra.py | 49 +++++++++++++++++++++++++---- specs/electra/beacon-chain.md | 53 ++++++++++++++++++++++++++++++++ specs/electra/fork-choice.md | 37 ++++++++++++++++++++++ specs/electra/validator.md | 1 + 4 files changed, 134 insertions(+), 6 deletions(-) create mode 100644 specs/electra/fork-choice.md diff --git a/pysetup/spec_builders/electra.py b/pysetup/spec_builders/electra.py index 1f968a817d..3d4d06f5e4 100644 --- a/pysetup/spec_builders/electra.py +++ b/pysetup/spec_builders/electra.py @@ -8,16 +8,53 @@ class ElectraSpecBuilder(BaseSpecBuilder): @classmethod def imports(cls, preset_name: str): - return f''' + return f""" from eth2spec.deneb import {preset_name} as deneb -''' +""" -## TODO: deal with changed gindices + @classmethod + def execution_engine_cls(cls) -> str: + return """ +class NoopExecutionEngine(ExecutionEngine): + + def notify_new_payload(self: ExecutionEngine, + execution_payload: ExecutionPayload, + parent_beacon_block_root: Root, + target_blobs_per_block: uint64) -> bool: + return True + + def notify_forkchoice_updated(self: ExecutionEngine, + head_block_hash: Hash32, + safe_block_hash: Hash32, + finalized_block_hash: Hash32, + payload_attributes: Optional[PayloadAttributes]) -> Optional[PayloadId]: + pass + + def get_payload(self: ExecutionEngine, payload_id: PayloadId) -> GetPayloadResponse: + # pylint: disable=unused-argument + raise NotImplementedError("no default block production") + + def is_valid_block_hash(self: ExecutionEngine, + execution_payload: ExecutionPayload, + parent_beacon_block_root: Root) -> bool: + return True + + def is_valid_versioned_hashes(self: ExecutionEngine, new_payload_request: NewPayloadRequest) -> bool: + return True + + def verify_and_notify_new_payload(self: ExecutionEngine, + new_payload_request: NewPayloadRequest) -> bool: + return True + + +EXECUTION_ENGINE = NoopExecutionEngine()""" + + ## TODO: deal with changed gindices @classmethod def hardcoded_ssz_dep_constants(cls) -> Dict[str, str]: return { - 'FINALIZED_ROOT_GINDEX': 'GeneralizedIndex(169)', - 'CURRENT_SYNC_COMMITTEE_GINDEX': 'GeneralizedIndex(86)', - 'NEXT_SYNC_COMMITTEE_GINDEX': 'GeneralizedIndex(87)', + "FINALIZED_ROOT_GINDEX": "GeneralizedIndex(169)", + "CURRENT_SYNC_COMMITTEE_GINDEX": "GeneralizedIndex(86)", + "NEXT_SYNC_COMMITTEE_GINDEX": "GeneralizedIndex(87)", } diff --git a/specs/electra/beacon-chain.md b/specs/electra/beacon-chain.md index d9e9d1f27b..41a988b367 100644 --- a/specs/electra/beacon-chain.md +++ b/specs/electra/beacon-chain.md @@ -67,6 +67,11 @@ - [New `compute_consolidation_epoch_and_update_churn`](#new-compute_consolidation_epoch_and_update_churn) - [Updated `slash_validator`](#updated-slash_validator) - [Beacon chain state transition function](#beacon-chain-state-transition-function) + - [Execution engine](#execution-engine) + - [Request data](#request-data) + - [Engine APIs](#engine-apis) + - [Modified `notify_new_payload`](#modified-notify_new_payload) + - [Modified `verify_and_notify_new_payload`](#modified-verify_and_notify_new_payload) - [Epoch processing](#epoch-processing) - [Updated `process_epoch`](#updated-process_epoch) - [Updated `process_registry_updates`](#updated--process_registry_updates) @@ -758,6 +763,54 @@ def slash_validator(state: BeaconState, ## Beacon chain state transition function +### Execution engine + +#### Request data + +#### Engine APIs + +##### Modified `notify_new_payload` + +*Note*: The function `notify_new_payload` is modified to include the target number of blobs +allowed per block. + +```python +def notify_new_payload(self: ExecutionEngine, + execution_payload: ExecutionPayload, + parent_beacon_block_root: Root, + target_blobs_per_block: uint64) -> bool: + """ + Return ``True`` if and only if ``execution_payload`` is valid with respect to ``self.execution_state``. + """ + ... +``` + +##### Modified `verify_and_notify_new_payload` + +```python +def verify_and_notify_new_payload(self: ExecutionEngine, + new_payload_request: NewPayloadRequest) -> bool: + """ + Return ``True`` if and only if ``new_payload_request`` is valid with respect to ``self.execution_state``. + """ + execution_payload = new_payload_request.execution_payload + parent_beacon_block_root = new_payload_request.parent_beacon_block_root + + if not self.is_valid_block_hash(execution_payload, parent_beacon_block_root): + return False + + if not self.is_valid_versioned_hashes(new_payload_request): + return False + + # [Modified in Electra] + if not self.notify_new_payload(execution_payload, + parent_beacon_block_root, + MAX_BLOBS_PER_BLOCK // 2): + return False + + return True +``` + ### Epoch processing #### Updated `process_epoch` diff --git a/specs/electra/fork-choice.md b/specs/electra/fork-choice.md new file mode 100644 index 0000000000..9737a68a9f --- /dev/null +++ b/specs/electra/fork-choice.md @@ -0,0 +1,37 @@ +# Electra -- Fork Choice + +## Table of contents + + + + +- [Introduction](#introduction) +- [Containers](#containers) +- [Helpers](#helpers) + - [Extended `PayloadAttributes`](#extended-payloadattributes) + + + + +## Introduction + +This is the modification of the fork choice accompanying the Electra upgrade. + +## Containers + +## Helpers + +### Extended `PayloadAttributes` + +`PayloadAttributes` is extended with the maximum number of blobs per block. + +```python +@dataclass +class PayloadAttributes(object): + timestamp: uint64 + prev_randao: Bytes32 + suggested_fee_recipient: ExecutionAddress + withdrawals: Sequence[Withdrawal] + parent_beacon_block_root: Root + target_blobs_per_block: uint64 # [New in Electra] +``` diff --git a/specs/electra/validator.md b/specs/electra/validator.md index f589e963c5..6d31856ac4 100644 --- a/specs/electra/validator.md +++ b/specs/electra/validator.md @@ -139,6 +139,7 @@ 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=MAX_BLOBS_PER_BLOCK // 2, # [New in Electra] ) return execution_engine.notify_forkchoice_updated( head_block_hash=parent_hash, From 87b5f1a969dd309ce61d3e06bd7e5f924f4b9f89 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Thu, 22 Aug 2024 14:06:00 -0600 Subject: [PATCH 02/10] updates to send maximum blob count --- specs/electra/fork-choice.md | 3 ++- specs/electra/validator.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/specs/electra/fork-choice.md b/specs/electra/fork-choice.md index 9737a68a9f..8b61e124d1 100644 --- a/specs/electra/fork-choice.md +++ b/specs/electra/fork-choice.md @@ -33,5 +33,6 @@ class PayloadAttributes(object): suggested_fee_recipient: ExecutionAddress withdrawals: Sequence[Withdrawal] parent_beacon_block_root: Root - target_blobs_per_block: uint64 # [New in Electra] + target_blob_count: uint64 # [New in Electra] + maximum_blob_count: uint64 # [New in Electra] ``` diff --git a/specs/electra/validator.md b/specs/electra/validator.md index 6d31856ac4..2750c1ec26 100644 --- a/specs/electra/validator.md +++ b/specs/electra/validator.md @@ -139,7 +139,8 @@ 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=MAX_BLOBS_PER_BLOCK // 2, # [New in Electra] + target_blob_count=MAX_BLOBS_PER_BLOCK // 2, # [New in Electra] + maximum_blob_count=MAX_BLOBS_PER_BLOCK, # [New in Electra] ) return execution_engine.notify_forkchoice_updated( head_block_hash=parent_hash, From 6c635ee85420ad6b7480d7ac61c13cce4adf309a Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Mon, 21 Oct 2024 09:23:20 -0500 Subject: [PATCH 03/10] Merge changes into existing engine API spec --- specs/electra/beacon-chain.md | 69 +++++------------------------------ 1 file changed, 10 insertions(+), 59 deletions(-) diff --git a/specs/electra/beacon-chain.md b/specs/electra/beacon-chain.md index 758ffc7a81..2e4b8bfb6c 100644 --- a/specs/electra/beacon-chain.md +++ b/specs/electra/beacon-chain.md @@ -65,11 +65,6 @@ - [New `compute_consolidation_epoch_and_update_churn`](#new-compute_consolidation_epoch_and_update_churn) - [Modified `slash_validator`](#modified-slash_validator) - [Beacon chain state transition function](#beacon-chain-state-transition-function) - - [Execution engine](#execution-engine) - - [Request data](#request-data) - - [Engine APIs](#engine-apis) - - [Modified `notify_new_payload`](#modified-notify_new_payload) - - [Modified `verify_and_notify_new_payload`](#modified-verify_and_notify_new_payload) - [Epoch processing](#epoch-processing) - [Modified `process_epoch`](#modified-process_epoch) - [Modified `process_registry_updates`](#modified-process_registry_updates) @@ -757,54 +752,6 @@ def slash_validator(state: BeaconState, ## Beacon chain state transition function -### Execution engine - -#### Request data - -#### Engine APIs - -##### Modified `notify_new_payload` - -*Note*: The function `notify_new_payload` is modified to include the target number of blobs -allowed per block. - -```python -def notify_new_payload(self: ExecutionEngine, - execution_payload: ExecutionPayload, - parent_beacon_block_root: Root, - target_blobs_per_block: uint64) -> bool: - """ - Return ``True`` if and only if ``execution_payload`` is valid with respect to ``self.execution_state``. - """ - ... -``` - -##### Modified `verify_and_notify_new_payload` - -```python -def verify_and_notify_new_payload(self: ExecutionEngine, - new_payload_request: NewPayloadRequest) -> bool: - """ - Return ``True`` if and only if ``new_payload_request`` is valid with respect to ``self.execution_state``. - """ - execution_payload = new_payload_request.execution_payload - parent_beacon_block_root = new_payload_request.parent_beacon_block_root - - if not self.is_valid_block_hash(execution_payload, parent_beacon_block_root): - return False - - if not self.is_valid_versioned_hashes(new_payload_request): - return False - - # [Modified in Electra] - if not self.notify_new_payload(execution_payload, - parent_beacon_block_root, - MAX_BLOBS_PER_BLOCK // 2): - return False - - return True -``` - ### Epoch processing #### Modified `process_epoch` @@ -1039,15 +986,17 @@ class NewPayloadRequest(object): ##### Modified `notify_new_payload` -*Note*: The function `notify_new_payload` is modified to include the additional `execution_requests` parameter in Electra. +*Note*: The function `notify_new_payload` is modified to include the additional +`execution_requests_list` and `target_blobs_per_block` parameters in Electra. ```python def notify_new_payload(self: ExecutionEngine, execution_payload: ExecutionPayload, parent_beacon_block_root: Root, - execution_requests_list: Sequence[bytes]) -> bool: + execution_requests_list: Sequence[bytes], + target_blobs_per_block: uint64) -> bool: """ - Return ``True`` if and only if ``execution_payload`` and ``execution_requests`` + Return ``True`` if and only if ``execution_payload`` and ``execution_requests_list`` are valid with respect to ``self.execution_state``. """ ... @@ -1055,8 +1004,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 parameter `execution_requests` -when calling `notify_new_payload` in Electra. +*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 `notify_new_payload` in Electra. ```python def verify_and_notify_new_payload(self: ExecutionEngine, @@ -1067,6 +1016,7 @@ 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 = MAX_BLOBS_PER_BLOCK // 2 # [New in Electra:EIP7742] if not self.is_valid_block_hash(execution_payload, parent_beacon_block_root): return False @@ -1078,7 +1028,8 @@ def verify_and_notify_new_payload(self: ExecutionEngine, if not self.notify_new_payload( execution_payload, parent_beacon_block_root, - execution_requests_list): + execution_requests_list, + target_blobs_per_block): return False return True From c57a90ab7bd83913f34a53c81081a5528dd04e9b Mon Sep 17 00:00:00 2001 From: Justin Traglia <95511699+jtraglia@users.noreply.github.com> Date: Tue, 22 Oct 2024 07:37:16 -0500 Subject: [PATCH 04/10] Rename *_blob_count to *_blobs_per_block --- specs/electra/fork-choice.md | 4 ++-- specs/electra/validator.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/specs/electra/fork-choice.md b/specs/electra/fork-choice.md index 8b61e124d1..92109ac1e4 100644 --- a/specs/electra/fork-choice.md +++ b/specs/electra/fork-choice.md @@ -33,6 +33,6 @@ class PayloadAttributes(object): suggested_fee_recipient: ExecutionAddress withdrawals: Sequence[Withdrawal] parent_beacon_block_root: Root - target_blob_count: uint64 # [New in Electra] - maximum_blob_count: uint64 # [New in Electra] + target_blobs_per_block: uint64 # [New in Electra:EIP7742] + maximum_blobs_per_block: uint64 # [New in Electra:EIP7742] ``` diff --git a/specs/electra/validator.md b/specs/electra/validator.md index 8fe5e6b068..cb52f4f0b9 100644 --- a/specs/electra/validator.md +++ b/specs/electra/validator.md @@ -176,8 +176,8 @@ 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_blob_count=MAX_BLOBS_PER_BLOCK // 2, # [New in Electra] - maximum_blob_count=MAX_BLOBS_PER_BLOCK, # [New in Electra] + target_blobs_per_block=MAX_BLOBS_PER_BLOCK // 2, # [New in Electra:EIP7742] + maximum_blobs_per_block=MAX_BLOBS_PER_BLOCK, # [New in Electra:EIP7742] ) return execution_engine.notify_forkchoice_updated( head_block_hash=parent_hash, From 9d762fedbaa520bddb0a08859630023e4e4e02b5 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Tue, 22 Oct 2024 07:39:21 -0500 Subject: [PATCH 05/10] Update PayloadAttributes note --- specs/electra/fork-choice.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/electra/fork-choice.md b/specs/electra/fork-choice.md index 92109ac1e4..17347be7bb 100644 --- a/specs/electra/fork-choice.md +++ b/specs/electra/fork-choice.md @@ -23,7 +23,7 @@ This is the modification of the fork choice accompanying the Electra upgrade. ### Extended `PayloadAttributes` -`PayloadAttributes` is extended with the maximum number of blobs per block. +*Note*: `PayloadAttributes` is extended with the target/maximum number of blobs per block. ```python @dataclass From 04225d5cfaf94f7662bed30dcc274cc29b83383b Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Tue, 22 Oct 2024 07:49:11 -0500 Subject: [PATCH 06/10] Pass new args to is_valid_block_hash too --- pysetup/spec_builders/electra.py | 4 +++- specs/electra/beacon-chain.md | 27 +++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/pysetup/spec_builders/electra.py b/pysetup/spec_builders/electra.py index 8479d2d54e..b7d6cb1dcf 100644 --- a/pysetup/spec_builders/electra.py +++ b/pysetup/spec_builders/electra.py @@ -47,7 +47,9 @@ def get_payload(self: ExecutionEngine, payload_id: PayloadId) -> GetPayloadRespo def is_valid_block_hash(self: ExecutionEngine, execution_payload: ExecutionPayload, - parent_beacon_block_root: Root) -> bool: + parent_beacon_block_root, + execution_requests_list: Sequence[bytes], + target_blobs_per_block: uint64) -> bool: return True def is_valid_versioned_hashes(self: ExecutionEngine, new_payload_request: NewPayloadRequest) -> bool: diff --git a/specs/electra/beacon-chain.md b/specs/electra/beacon-chain.md index 2e4b8bfb6c..1127120c68 100644 --- a/specs/electra/beacon-chain.md +++ b/specs/electra/beacon-chain.md @@ -984,6 +984,23 @@ class NewPayloadRequest(object): #### 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. + +```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: + """ + Return ``True`` if and only if ``execution_payload.block_hash`` is computed correctly. + """ + ... +``` + ##### Modified `notify_new_payload` *Note*: The function `notify_new_payload` is modified to include the additional @@ -1005,7 +1022,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 `notify_new_payload` in Electra. +`execution_requests_list` and `target_blobs_per_block` when calling `is_valid_block_hash` and +`notify_new_payload` in Electra. ```python def verify_and_notify_new_payload(self: ExecutionEngine, @@ -1018,7 +1036,12 @@ def verify_and_notify_new_payload(self: ExecutionEngine, execution_requests_list = get_execution_requests_list(new_payload_request.execution_requests) # [New in Electra] target_blobs_per_block = MAX_BLOBS_PER_BLOCK // 2 # [New in Electra:EIP7742] - if not self.is_valid_block_hash(execution_payload, parent_beacon_block_root): + # [Modified in Electra] + if not self.is_valid_block_hash( + execution_payload, + parent_beacon_block_root, + execution_requests_list, + target_blobs_per_block): return False if not self.is_valid_versioned_hashes(new_payload_request): From 6209809862a1c6fc1d8c137093274360c532914b Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Tue, 22 Oct 2024 07:52:28 -0500 Subject: [PATCH 07/10] Fix table of contents --- specs/electra/beacon-chain.md | 1 + 1 file changed, 1 insertion(+) diff --git a/specs/electra/beacon-chain.md b/specs/electra/beacon-chain.md index 1127120c68..d837a2a561 100644 --- a/specs/electra/beacon-chain.md +++ b/specs/electra/beacon-chain.md @@ -77,6 +77,7 @@ - [Request data](#request-data) - [Modified `NewPayloadRequest`](#modified-newpayloadrequest) - [Engine APIs](#engine-apis) + - [Modified `is_valid_block_hash`](#modified-is_valid_block_hash) - [Modified `notify_new_payload`](#modified-notify_new_payload) - [Modified `verify_and_notify_new_payload`](#modified-verify_and_notify_new_payload) - [Block processing](#block-processing) From 4da2cea7e3ce672b257e6ec36245635162a88c08 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Tue, 29 Oct 2024 09:04:07 -0500 Subject: [PATCH 08/10] Fix mistake (missing type hint) --- pysetup/spec_builders/electra.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysetup/spec_builders/electra.py b/pysetup/spec_builders/electra.py index b7d6cb1dcf..43362e4102 100644 --- a/pysetup/spec_builders/electra.py +++ b/pysetup/spec_builders/electra.py @@ -47,7 +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, + parent_beacon_block_root: Root, execution_requests_list: Sequence[bytes], target_blobs_per_block: uint64) -> bool: return True From e3eb09b71604374a253025f80598d27f5bd88508 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Thu, 31 Oct 2024 10:06:32 -0500 Subject: [PATCH 09/10] Rename maximum_blobs_per_block to max_blobs_per_block --- specs/electra/fork-choice.md | 2 +- specs/electra/validator.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/electra/fork-choice.md b/specs/electra/fork-choice.md index 17347be7bb..8530239325 100644 --- a/specs/electra/fork-choice.md +++ b/specs/electra/fork-choice.md @@ -34,5 +34,5 @@ class PayloadAttributes(object): withdrawals: Sequence[Withdrawal] parent_beacon_block_root: Root target_blobs_per_block: uint64 # [New in Electra:EIP7742] - maximum_blobs_per_block: uint64 # [New in Electra:EIP7742] + max_blobs_per_block: uint64 # [New in Electra:EIP7742] ``` diff --git a/specs/electra/validator.md b/specs/electra/validator.md index cb52f4f0b9..de0bdb4de1 100644 --- a/specs/electra/validator.md +++ b/specs/electra/validator.md @@ -177,7 +177,7 @@ def prepare_execution_payload(state: BeaconState, withdrawals=withdrawals, parent_beacon_block_root=hash_tree_root(state.latest_block_header), target_blobs_per_block=MAX_BLOBS_PER_BLOCK // 2, # [New in Electra:EIP7742] - maximum_blobs_per_block=MAX_BLOBS_PER_BLOCK, # [New in Electra:EIP7742] + max_blobs_per_block=MAX_BLOBS_PER_BLOCK, # [New in Electra:EIP7742] ) return execution_engine.notify_forkchoice_updated( head_block_hash=parent_hash, From 9e085e41c9950bacf0f73c80888a5f5227a58ef2 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Wed, 4 Dec 2024 14:12:13 -0600 Subject: [PATCH 10/10] Move target_blobs_per_block to NewPayloadRequest --- specs/_features/eip7594/beacon-chain.md | 1 + specs/_features/eip7732/beacon-chain.md | 1 + specs/electra/beacon-chain.md | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/specs/_features/eip7594/beacon-chain.md b/specs/_features/eip7594/beacon-chain.md index 7ba88aa882..ffee297942 100644 --- a/specs/_features/eip7594/beacon-chain.md +++ b/specs/_features/eip7594/beacon-chain.md @@ -53,6 +53,7 @@ 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=MAX_BLOBS_PER_BLOCK // 2, ) ) # Cache execution payload header diff --git a/specs/_features/eip7732/beacon-chain.md b/specs/_features/eip7732/beacon-chain.md index 2303e33d40..df25fb43ac 100644 --- a/specs/_features/eip7732/beacon-chain.md +++ b/specs/_features/eip7732/beacon-chain.md @@ -705,6 +705,7 @@ 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=MAX_BLOBS_PER_BLOCK // 2, ) ) diff --git a/specs/electra/beacon-chain.md b/specs/electra/beacon-chain.md index 8e65b66df3..d61228bd31 100644 --- a/specs/electra/beacon-chain.md +++ b/specs/electra/beacon-chain.md @@ -1004,6 +1004,7 @@ 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 @@ -1058,7 +1059,7 @@ 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 = MAX_BLOBS_PER_BLOCK // 2 # [New in Electra:EIP7742] + target_blobs_per_block = new_payload_request.target_blobs_per_block # [New in Electra:EIP7742] if b'' in execution_payload.transactions: return False @@ -1241,6 +1242,7 @@ 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=MAX_BLOBS_PER_BLOCK // 2, # [New in Electra:EIP7742] ) ) # Cache execution payload header