From 654333ea105e9abbbdd757cd875ea28516c9800a Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Wed, 27 Nov 2024 00:17:42 +0800 Subject: [PATCH 01/17] Add EIP-7691 --- configs/mainnet.yaml | 22 ++-- configs/minimal.yaml | 20 +++- specs/_features/eip7594/p2p-interface.md | 12 +- specs/electra/beacon-chain.md | 10 +- specs/electra/p2p-interface.md | 111 ++++++++++++++++-- .../unittests/test_config_invariants.py | 13 ++ .../core/pyspec/eth2spec/test/helpers/blob.py | 3 + 7 files changed, 163 insertions(+), 28 deletions(-) diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index 36b4db4123..3a6873a678 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -144,14 +144,26 @@ ATTESTATION_SUBNET_PREFIX_BITS: 6 # Deneb # `2**7` (=128) MAX_REQUEST_BLOCKS_DENEB: 128 -# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK -MAX_REQUEST_BLOB_SIDECARS: 768 # `2**12` (= 4096 epochs, ~18 days) MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096 # `6` BLOB_SIDECAR_SUBNET_COUNT: 6 -## `uint64(6)` +# `uint64(6)` MAX_BLOBS_PER_BLOCK: 6 +# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK +MAX_REQUEST_BLOB_SIDECARS: 768 + +# Electra +# 2**7 * 10**9 (= 128,000,000,000) +MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 +# 2**8 * 10**9 (= 256,000,000,000) +MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000 +# `9` +BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 9 +# `uint64(9)` +MAX_BLOBS_PER_BLOCK_ELECTRA: 9 +# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA +MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152 # Whisk # `Epoch(2**8)` @@ -170,9 +182,5 @@ MAX_BLOBS_PER_BLOCK_EIP7594: 8 # `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_EIP7594` MAX_REQUEST_BLOB_SIDECARS_EIP7594: 1024 -# [New in Electra:EIP7251] -MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 # 2**7 * 10**9 (= 128,000,000,000) -MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000 # 2**8 * 10**9 (= 256,000,000,000) - # EIP7732 MAX_REQUEST_PAYLOADS: 128 diff --git a/configs/minimal.yaml b/configs/minimal.yaml index ae19518af7..6560304ff7 100644 --- a/configs/minimal.yaml +++ b/configs/minimal.yaml @@ -145,14 +145,26 @@ ATTESTATION_SUBNET_PREFIX_BITS: 6 # Deneb # `2**7` (=128) MAX_REQUEST_BLOCKS_DENEB: 128 -# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK -MAX_REQUEST_BLOB_SIDECARS: 768 # `2**12` (= 4096 epochs, ~18 days) MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096 # `6` BLOB_SIDECAR_SUBNET_COUNT: 6 ## `uint64(6)` MAX_BLOBS_PER_BLOCK: 6 +# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK +MAX_REQUEST_BLOB_SIDECARS: 768 + +# Electra +# [customized] 2**6 * 10**9 (= 64,000,000,000) +MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000 +# [customized] 2**7 * 10**9 (= 128,000,000,000) +MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 128000000000 +# `9` +BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 9 +# `uint64(9)` +MAX_BLOBS_PER_BLOCK_ELECTRA: 9 +# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA +MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152 # Whisk WHISK_EPOCHS_PER_SHUFFLING_PHASE: 4 @@ -169,9 +181,5 @@ MAX_BLOBS_PER_BLOCK_EIP7594: 8 # `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_EIP7594` MAX_REQUEST_BLOB_SIDECARS_EIP7594: 1024 -# [New in Electra:EIP7251] -MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000 # 2**6 * 10**9 (= 64,000,000,000) -MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 128000000000 # 2**7 * 10**9 (= 128,000,000,000) - # EIP7732 MAX_REQUEST_PAYLOADS: 128 diff --git a/specs/_features/eip7594/p2p-interface.md b/specs/_features/eip7594/p2p-interface.md index de2d7e1f0b..c1cc467332 100644 --- a/specs/_features/eip7594/p2p-interface.md +++ b/specs/_features/eip7594/p2p-interface.md @@ -28,8 +28,8 @@ - [`data_column_sidecar_{subnet_id}`](#data_column_sidecar_subnet_id) - [The Req/Resp domain](#the-reqresp-domain) - [Messages](#messages) - - [BlobSidecarsByRoot v2](#blobsidecarsbyroot-v2) - - [BlobSidecarsByRange v2](#blobsidecarsbyrange-v2) + - [BlobSidecarsByRoot v3](#blobsidecarsbyroot-v3) + - [BlobSidecarsByRange v3](#blobsidecarsbyrange-v3) - [DataColumnSidecarsByRoot v1](#datacolumnsidecarsbyroot-v1) - [DataColumnSidecarsByRange v1](#datacolumnsidecarsbyrange-v1) - [GetMetaData v3](#getmetadata-v3) @@ -204,9 +204,9 @@ The following validations MUST pass before forwarding the `sidecar: DataColumnSi #### Messages -##### BlobSidecarsByRoot v2 +##### BlobSidecarsByRoot v3 -**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_root/2/` +**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_root/3/` *[Updated in EIP7594]* @@ -238,9 +238,9 @@ Response Content: No more than `MAX_REQUEST_BLOB_SIDECARS_EIP7594` may be requested at a time. -##### BlobSidecarsByRange v2 +##### BlobSidecarsByRange v3 -**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/2/` +**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/3/` *[Updated in EIP7594]* diff --git a/specs/electra/beacon-chain.md b/specs/electra/beacon-chain.md index 6e7b536fbc..c0dd098031 100644 --- a/specs/electra/beacon-chain.md +++ b/specs/electra/beacon-chain.md @@ -22,6 +22,7 @@ - [Withdrawals processing](#withdrawals-processing) - [Pending deposits processing](#pending-deposits-processing) - [Configuration](#configuration) + - [Execution](#execution-1) - [Validator cycle](#validator-cycle) - [Containers](#containers) - [New containers](#new-containers) @@ -119,6 +120,7 @@ Electra is a consensus-layer upgrade containing a number of features. Including: * [EIP-7002](https://eips.ethereum.org/EIPS/eip-7002): Execution layer triggerable exits * [EIP-7251](https://eips.ethereum.org/EIPS/eip-7251): Increase the MAX_EFFECTIVE_BALANCE * [EIP-7549](https://eips.ethereum.org/EIPS/eip-7549): Move committee index outside Attestation +* [EIP-7691](https://eips.ethereum.org/EIPS/eip-7691): Blob throughput increase *Note:* This specification is built upon [Deneb](../deneb/beacon-chain.md) and is under active development. @@ -200,6 +202,12 @@ The following values are (non-configurable) constants used throughout the specif ## Configuration +### Execution + +| Name | Value | Description | +| - | - | - | +| `MAX_BLOBS_PER_BLOCK_ELECTRA` | `uint64(9)` | *[New in Electra:EIP-7691]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` | + ### Validator cycle | Name | Value | @@ -1205,7 +1213,7 @@ def process_execution_payload(state: BeaconState, body: BeaconBlockBody, executi # Verify timestamp assert payload.timestamp == compute_timestamp_at_slot(state, state.slot) # Verify commitments are under limit - assert len(body.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK + assert len(body.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK_ELECTRA # [Modified in Electra:EIP7691] # 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( diff --git a/specs/electra/p2p-interface.md b/specs/electra/p2p-interface.md index 0ea33df9f7..d923e3f67e 100644 --- a/specs/electra/p2p-interface.md +++ b/specs/electra/p2p-interface.md @@ -11,18 +11,33 @@ The specification of these changes continues in the same format as the network s - [Modifications in Electra](#modifications-in-electra) + - [Configuration](#configuration) - [The gossip domain: gossipsub](#the-gossip-domain-gossipsub) - [Topics and messages](#topics-and-messages) - - [Global topics](#global-topics) - - [`beacon_aggregate_and_proof`](#beacon_aggregate_and_proof) - - [Attestation subnets](#attestation-subnets) - - [`beacon_attestation_{subnet_id}`](#beacon_attestation_subnet_id) + - [Global topics](#global-topics) + - [`beacon_block`](#beacon_block) + - [`beacon_aggregate_and_proof`](#beacon_aggregate_and_proof) + - [Attestation subnets](#attestation-subnets) + - [`beacon_attestation_{subnet_id}`](#beacon_attestation_subnet_id) + - [The Req/Resp domain](#the-reqresp-domain) + - [Messages](#messages) + - [BlobSidecarsByRoot v2](#blobsidecarsbyroot-v2) + - [BlobSidecarsByRange v2](#blobsidecarsbyrange-v2) ## Modifications in Electra +### Configuration + +*[New in Electra:EIP7691]* + +| Name | Value | Description | +|------------------------------------------------|----------------------------------------------------------|---------------------------------------------------------------------------| +| `MAX_REQUEST_BLOB_SIDECARS_ELECTRA` | `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA` | Maximum number of blob sidecars in a single request | +| `BLOB_SIDECAR_SUBNET_COUNT_ELECTRA` | `9` | The number of blob sidecar subnets used in the gossipsub protocol | + ### The gossip domain: gossipsub Some gossip meshes are upgraded in the fork of Electra to support upgraded types. @@ -41,9 +56,16 @@ The specification around the creation, validation, and dissemination of messages The derivation of the `message-id` remains stable. -#### Global topics +##### Global topics + +###### `beacon_block` -##### `beacon_aggregate_and_proof` +*Updated validation* + +- _[REJECT]_ The length of KZG commitments is less than or equal to the limitation defined in Consensus Layer -- + i.e. validate that `len(body.signed_beacon_block.message.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK_ELECTRA` + +###### `beacon_aggregate_and_proof` The following convenience variables are re-defined - `index = get_committee_indices(aggregate.committee_bits)[0]` @@ -52,9 +74,9 @@ The following validations are added: * [REJECT] `len(committee_indices) == 1`, where `committee_indices = get_committee_indices(aggregate)`. * [REJECT] `aggregate.data.index == 0` -#### Attestation subnets +##### Attestation subnets -##### `beacon_attestation_{subnet_id}` +###### `beacon_attestation_{subnet_id}` The topic is updated to propagate `SingleAttestation` objects. @@ -71,3 +93,76 @@ The following validations are removed: that is, it has exactly one participating validator (`len([bit for bit in aggregation_bits if bit]) == 1`, i.e. exactly 1 bit is set). - _[REJECT]_ The number of aggregation bits matches the committee size -- i.e. `len(aggregation_bits) == len(get_beacon_committee(state, attestation.data.slot, index))`. + +### The Req/Resp domain + +#### Messages + +##### BlobSidecarsByRoot v2 + +**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_root/2/` + +*[Updated in ]* + +The `` field is calculated as `context = compute_fork_digest(fork_version, genesis_validators_root)`: + +[1]: # (eth2spec: skip) + +| `fork_version` | Chunk SSZ type | +|------------------------|-----------------------| +| `ELECTRA_FORK_VERSION` | `electra.BlobSidecar` | + +Request Content: + +``` +( + List[BlobIdentifier, MAX_REQUEST_BLOB_SIDECARS_ELECTRA] +) +``` + +Response Content: + +``` +( + List[BlobSidecar, MAX_REQUEST_BLOB_SIDECARS_ELECTRA] +) +``` + +*Updated validation* + +No more than `MAX_REQUEST_BLOB_SIDECARS_ELECTRA` may be requested at a time. + +##### BlobSidecarsByRange v2 + +**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/2/` + +*[Updated in ]* + +The `` field is calculated as `context = compute_fork_digest(fork_version, genesis_validators_root)`: + +[1]: # (eth2spec: skip) + +| `fork_version` | Chunk SSZ type | +|------------------------|-----------------------| +| `ELECTRA_FORK_VERSION` | `electra.BlobSidecar` | + +Request Content: + +``` +( + start_slot: Slot + count: uint64 +) +``` + +Response Content: + +``` +( + List[BlobSidecar, MAX_REQUEST_BLOB_SIDECARS_ELECTRA] +) +``` + +*Updated validation* + +Clients MUST respond with at least the blob sidecars of the first blob-carrying block that exists in the range, if they have it, and no more than `MAX_REQUEST_BLOB_SIDECARS_ELECTRA` sidecars. diff --git a/tests/core/pyspec/eth2spec/test/electra/unittests/test_config_invariants.py b/tests/core/pyspec/eth2spec/test/electra/unittests/test_config_invariants.py index 839fa0dbd4..ce4b6684a4 100644 --- a/tests/core/pyspec/eth2spec/test/electra/unittests/test_config_invariants.py +++ b/tests/core/pyspec/eth2spec/test/electra/unittests/test_config_invariants.py @@ -13,3 +13,16 @@ def test_processing_pending_partial_withdrawals(spec): spec.MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP < spec.MAX_WITHDRAWALS_PER_PAYLOAD ) + + +@with_electra_and_later +@spec_test +@single_phase +def test_networking(spec): + assert spec.config.MAX_BLOBS_PER_BLOCK_ELECTRA <= spec.MAX_BLOB_COMMITMENTS_PER_BLOCK + assert ( + spec.config.MAX_REQUEST_BLOB_SIDECARS_ELECTRA == + spec.config.MAX_REQUEST_BLOCKS_DENEB * spec.config.MAX_BLOBS_PER_BLOCK_ELECTRA + ) + # Start with the same size, but `BLOB_SIDECAR_SUBNET_COUNT` could potentially increase later. + assert spec.config.BLOB_SIDECAR_SUBNET_COUNT_ELECTRA == spec.config.MAX_BLOBS_PER_BLOCK_ELECTRA diff --git a/tests/core/pyspec/eth2spec/test/helpers/blob.py b/tests/core/pyspec/eth2spec/test/helpers/blob.py index c65414b02b..e0d82da1a0 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/blob.py +++ b/tests/core/pyspec/eth2spec/test/helpers/blob.py @@ -3,6 +3,7 @@ from rlp.sedes import Binary, CountableList, List as RLPList, big_endian_int, binary from eth2spec.test.helpers.forks import ( + is_post_electra, is_post_eip7594, ) @@ -108,5 +109,7 @@ def get_sample_blob_tx(spec, blob_count=1, rng=random.Random(5566), is_valid_blo def get_max_blob_count(spec): if is_post_eip7594(spec): return spec.config.MAX_BLOBS_PER_BLOCK_EIP7594 + elif is_post_electra(spec): + return spec.config.MAX_BLOBS_PER_BLOCK_ELECTRA else: return spec.config.MAX_BLOBS_PER_BLOCK From 78c6922cafbe947220ee2cae07b4b8a706968a66 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Wed, 27 Nov 2024 00:58:29 +0800 Subject: [PATCH 02/17] bump minimal preset `MAX_BLOB_COMMITMENTS_PER_BLOCK` and `KZG_COMMITMENT_INCLUSION_PROOF_DEPTH` --- presets/minimal/deneb.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/presets/minimal/deneb.yaml b/presets/minimal/deneb.yaml index 9d0db086b8..c101de3162 100644 --- a/presets/minimal/deneb.yaml +++ b/presets/minimal/deneb.yaml @@ -5,6 +5,6 @@ # `uint64(4096)` FIELD_ELEMENTS_PER_BLOB: 4096 # [customized] -MAX_BLOB_COMMITMENTS_PER_BLOCK: 16 -# [customized] `floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments')) + 1 + ceillog2(MAX_BLOB_COMMITMENTS_PER_BLOCK)` = 4 + 1 + 4 = 9 -KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 9 +MAX_BLOB_COMMITMENTS_PER_BLOCK: 32 +# [customized] `floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments')) + 1 + ceillog2(MAX_BLOB_COMMITMENTS_PER_BLOCK)` = 4 + 1 + 5 = 10 +KZG_COMMITMENT_INCLUSION_PROOF_DEPTH: 10 From 53e8d6657859f2b6166819cb42c6c86560ad23a8 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Thu, 28 Nov 2024 23:56:00 +0800 Subject: [PATCH 03/17] Add the missing `deneb.BlobSidecar` Co-authored-by: Pop Chunhapanya --- specs/electra/p2p-interface.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specs/electra/p2p-interface.md b/specs/electra/p2p-interface.md index d923e3f67e..0738a8a41d 100644 --- a/specs/electra/p2p-interface.md +++ b/specs/electra/p2p-interface.md @@ -110,6 +110,7 @@ The `` field is calculated as `context = compute_fork_digest(fork | `fork_version` | Chunk SSZ type | |------------------------|-----------------------| +| `DENEB_FORK_VERSION` | `deneb.BlobSidecar` | | `ELECTRA_FORK_VERSION` | `electra.BlobSidecar` | Request Content: @@ -144,6 +145,7 @@ The `` field is calculated as `context = compute_fork_digest(fork | `fork_version` | Chunk SSZ type | |------------------------|-----------------------| +| `DENEB_FORK_VERSION` | `deneb.BlobSidecar` | | `ELECTRA_FORK_VERSION` | `electra.BlobSidecar` | Request Content: From 2ec6a1c7f1305c3e109d80deba406b6beee1da12 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Tue, 3 Dec 2024 09:45:02 -0600 Subject: [PATCH 04/17] Fix configuration table formatting --- specs/electra/p2p-interface.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specs/electra/p2p-interface.md b/specs/electra/p2p-interface.md index 0738a8a41d..130aae47bc 100644 --- a/specs/electra/p2p-interface.md +++ b/specs/electra/p2p-interface.md @@ -33,10 +33,10 @@ The specification of these changes continues in the same format as the network s *[New in Electra:EIP7691]* -| Name | Value | Description | -|------------------------------------------------|----------------------------------------------------------|---------------------------------------------------------------------------| -| `MAX_REQUEST_BLOB_SIDECARS_ELECTRA` | `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA` | Maximum number of blob sidecars in a single request | -| `BLOB_SIDECAR_SUBNET_COUNT_ELECTRA` | `9` | The number of blob sidecar subnets used in the gossipsub protocol | +| Name | Value | Description | +|-------------------------------------|----------------------------------------------------------|-------------------------------------------------------------------| +| `MAX_REQUEST_BLOB_SIDECARS_ELECTRA` | `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA` | Maximum number of blob sidecars in a single request | +| `BLOB_SIDECAR_SUBNET_COUNT_ELECTRA` | `9` | The number of blob sidecar subnets used in the gossipsub protocol | ### The gossip domain: gossipsub From 3b8b799609064f76afcada2527c58ba356bdd889 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Tue, 3 Dec 2024 10:05:12 -0600 Subject: [PATCH 05/17] Introduce TARGET_BLOBS_PER_BLOCK_ELECTRA --- configs/mainnet.yaml | 2 ++ configs/minimal.yaml | 4 +++- specs/electra/beacon-chain.md | 1 + .../eth2spec/test/electra/unittests/test_config_invariants.py | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index 3a6873a678..159f77024a 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -162,6 +162,8 @@ MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000 BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 9 # `uint64(9)` MAX_BLOBS_PER_BLOCK_ELECTRA: 9 +# `uint64(6)` +TARGET_BLOBS_PER_BLOCK_ELECTRA: 6 # MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152 diff --git a/configs/minimal.yaml b/configs/minimal.yaml index 6560304ff7..0676ed9a4b 100644 --- a/configs/minimal.yaml +++ b/configs/minimal.yaml @@ -156,13 +156,15 @@ MAX_REQUEST_BLOB_SIDECARS: 768 # Electra # [customized] 2**6 * 10**9 (= 64,000,000,000) -MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000 +MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000 # [customized] 2**7 * 10**9 (= 128,000,000,000) MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 128000000000 # `9` BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 9 # `uint64(9)` MAX_BLOBS_PER_BLOCK_ELECTRA: 9 +# `uint64(6)` +TARGET_BLOBS_PER_BLOCK_ELECTRA: 6 # MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_ELECTRA MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152 diff --git a/specs/electra/beacon-chain.md b/specs/electra/beacon-chain.md index c0dd098031..becabce788 100644 --- a/specs/electra/beacon-chain.md +++ b/specs/electra/beacon-chain.md @@ -207,6 +207,7 @@ The following values are (non-configurable) constants used throughout the specif | Name | Value | Description | | - | - | - | | `MAX_BLOBS_PER_BLOCK_ELECTRA` | `uint64(9)` | *[New in Electra:EIP-7691]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` | +| `TARGET_BLOBS_PER_BLOCK_ELECTRA` | `uint64(6)` | *[New in Electra:EIP-7691]* Target number of blobs in a single block limited by `MAX_BLOBS_PER_BLOCK_ELECTRA` | ### Validator cycle diff --git a/tests/core/pyspec/eth2spec/test/electra/unittests/test_config_invariants.py b/tests/core/pyspec/eth2spec/test/electra/unittests/test_config_invariants.py index ce4b6684a4..4e3b909806 100644 --- a/tests/core/pyspec/eth2spec/test/electra/unittests/test_config_invariants.py +++ b/tests/core/pyspec/eth2spec/test/electra/unittests/test_config_invariants.py @@ -19,6 +19,7 @@ def test_processing_pending_partial_withdrawals(spec): @spec_test @single_phase def test_networking(spec): + assert spec.config.TARGET_BLOBS_PER_BLOCK_ELECTRA <= spec.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 == From 3c212bc63e32814c655344b56199eb48b4ca17a4 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Tue, 3 Dec 2024 13:11:12 -0600 Subject: [PATCH 06/17] Fix mistake --- .../eth2spec/test/electra/unittests/test_config_invariants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/core/pyspec/eth2spec/test/electra/unittests/test_config_invariants.py b/tests/core/pyspec/eth2spec/test/electra/unittests/test_config_invariants.py index 4e3b909806..ab9ac149be 100644 --- a/tests/core/pyspec/eth2spec/test/electra/unittests/test_config_invariants.py +++ b/tests/core/pyspec/eth2spec/test/electra/unittests/test_config_invariants.py @@ -19,7 +19,7 @@ def test_processing_pending_partial_withdrawals(spec): @spec_test @single_phase def test_networking(spec): - assert spec.config.TARGET_BLOBS_PER_BLOCK_ELECTRA <= spec.MAX_BLOBS_PER_BLOCK_ELECTRA + 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 == From 349febe9e7f80c36661b384d5fa992aba610c9ac Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Thu, 5 Dec 2024 11:26:10 -0600 Subject: [PATCH 07/17] Use TARGET_BLOBS_PER_BLOCK in NewPayloadRequest --- specs/_features/eip7594/beacon-chain.md | 2 +- specs/_features/eip7732/beacon-chain.md | 2 +- specs/electra/validator.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/specs/_features/eip7594/beacon-chain.md b/specs/_features/eip7594/beacon-chain.md index ffee297942..71986cef2e 100644 --- a/specs/_features/eip7594/beacon-chain.md +++ b/specs/_features/eip7594/beacon-chain.md @@ -53,7 +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, + target_blobs_per_block=TARGET_BLOBS_PER_BLOCK, ) ) # Cache execution payload header diff --git a/specs/_features/eip7732/beacon-chain.md b/specs/_features/eip7732/beacon-chain.md index df25fb43ac..4703caa175 100644 --- a/specs/_features/eip7732/beacon-chain.md +++ b/specs/_features/eip7732/beacon-chain.md @@ -705,7 +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, + target_blobs_per_block=TARGET_BLOBS_PER_BLOCK, ) ) diff --git a/specs/electra/validator.md b/specs/electra/validator.md index 77476cf394..2a5dacbdfc 100644 --- a/specs/electra/validator.md +++ b/specs/electra/validator.md @@ -176,7 +176,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:EIP7742] + target_blobs_per_block=TARGET_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( From 2439a4c3071e45fa0100b4a39d914e40b5406774 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Thu, 5 Dec 2024 11:31:16 -0600 Subject: [PATCH 08/17] Use Electra config variables --- specs/_features/eip7594/beacon-chain.md | 2 +- specs/_features/eip7732/beacon-chain.md | 2 +- specs/electra/validator.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/specs/_features/eip7594/beacon-chain.md b/specs/_features/eip7594/beacon-chain.md index 71986cef2e..7dca19d05b 100644 --- a/specs/_features/eip7594/beacon-chain.md +++ b/specs/_features/eip7594/beacon-chain.md @@ -53,7 +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=TARGET_BLOBS_PER_BLOCK, + target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_ELECTRA, ) ) # Cache execution payload header diff --git a/specs/_features/eip7732/beacon-chain.md b/specs/_features/eip7732/beacon-chain.md index 4703caa175..bac64274ee 100644 --- a/specs/_features/eip7732/beacon-chain.md +++ b/specs/_features/eip7732/beacon-chain.md @@ -705,7 +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=TARGET_BLOBS_PER_BLOCK, + target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_ELECTRA, ) ) diff --git a/specs/electra/validator.md b/specs/electra/validator.md index 2a5dacbdfc..f8882227c7 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_blobs_per_block=TARGET_BLOBS_PER_BLOCK, # [New in Electra:EIP7742] - max_blobs_per_block=MAX_BLOBS_PER_BLOCK, # [New in Electra:EIP7742] + 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, From 9df5d98cc378201a52ccfed50b8778a35b2e3d34 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Thu, 5 Dec 2024 11:42:00 -0600 Subject: [PATCH 09/17] Set target_blobs_per_block for Electra --- specs/electra/beacon-chain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/electra/beacon-chain.md b/specs/electra/beacon-chain.md index f33d4eb3bc..adb3706bce 100644 --- a/specs/electra/beacon-chain.md +++ b/specs/electra/beacon-chain.md @@ -1251,7 +1251,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] + target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_ELECTRA, # [New in Electra:EIP7742] ) ) # Cache execution payload header From f44f1e71e854e2d35781e54102acdf2ca6e0ddfc Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Thu, 5 Dec 2024 11:43:51 -0600 Subject: [PATCH 10/17] Put TARGET_BLOBS_PER_BLOCK before MAX_BLOBS_PER_BLOCK --- configs/mainnet.yaml | 4 ++-- configs/minimal.yaml | 4 ++-- specs/electra/beacon-chain.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index f691995228..c43359c521 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -160,10 +160,10 @@ MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000 # `9` BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 9 -# `uint64(9)` -MAX_BLOBS_PER_BLOCK_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 MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152 diff --git a/configs/minimal.yaml b/configs/minimal.yaml index c20b8ef735..56f26bea6a 100644 --- a/configs/minimal.yaml +++ b/configs/minimal.yaml @@ -161,10 +161,10 @@ MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000 MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 128000000000 # `9` BLOB_SIDECAR_SUBNET_COUNT_ELECTRA: 9 -# `uint64(9)` -MAX_BLOBS_PER_BLOCK_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 MAX_REQUEST_BLOB_SIDECARS_ELECTRA: 1152 diff --git a/specs/electra/beacon-chain.md b/specs/electra/beacon-chain.md index adb3706bce..acb1ff9d74 100644 --- a/specs/electra/beacon-chain.md +++ b/specs/electra/beacon-chain.md @@ -206,8 +206,8 @@ The following values are (non-configurable) constants used throughout the specif | Name | Value | Description | | - | - | - | -| `MAX_BLOBS_PER_BLOCK_ELECTRA` | `uint64(9)` | *[New in Electra:EIP-7691]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` | | `TARGET_BLOBS_PER_BLOCK_ELECTRA` | `uint64(6)` | *[New in Electra:EIP-7691]* 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:EIP-7691]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` | ### Validator cycle From e44bcfa90b494d52538e66a0afadbde4f729d58b Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Thu, 5 Dec 2024 12:57:06 -0600 Subject: [PATCH 11/17] Make necessary changes for EIP7594 spec Previous to this commit, the max blob count for EIP7594 was 8. Now that we have raised the target/max to 6/9 for Electra, the max blob count for EIP7594 no longer makes sense. I've raised the target/max for it to 9/12 as a placeholder. This also serves as an example of what changes are necessary to increase the blob count in the future. --- configs/mainnet.yaml | 5 +- configs/minimal.yaml | 5 +- specs/_features/eip7594/beacon-chain.md | 5 +- specs/_features/eip7594/validator.md | 68 +++++++++++++++++++ .../unittests/test_config_invariants.py | 1 + 5 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 specs/_features/eip7594/validator.md diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index c43359c521..f010bec54d 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -180,9 +180,10 @@ DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128 MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384 SAMPLES_PER_SLOT: 8 CUSTODY_REQUIREMENT: 4 -MAX_BLOBS_PER_BLOCK_EIP7594: 8 +TARGET_BLOBS_PER_BLOCK_EIP7594: 9 +MAX_BLOBS_PER_BLOCK_EIP7594: 12 # `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_EIP7594` -MAX_REQUEST_BLOB_SIDECARS_EIP7594: 1024 +MAX_REQUEST_BLOB_SIDECARS_EIP7594: 1536 # EIP7732 MAX_REQUEST_PAYLOADS: 128 diff --git a/configs/minimal.yaml b/configs/minimal.yaml index 56f26bea6a..449dd3c421 100644 --- a/configs/minimal.yaml +++ b/configs/minimal.yaml @@ -179,9 +179,10 @@ DATA_COLUMN_SIDECAR_SUBNET_COUNT: 128 MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384 SAMPLES_PER_SLOT: 8 CUSTODY_REQUIREMENT: 4 -MAX_BLOBS_PER_BLOCK_EIP7594: 8 +TARGET_BLOBS_PER_BLOCK_EIP7594: 9 +MAX_BLOBS_PER_BLOCK_EIP7594: 12 # `MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK_EIP7594` -MAX_REQUEST_BLOB_SIDECARS_EIP7594: 1024 +MAX_REQUEST_BLOB_SIDECARS_EIP7594: 1536 # EIP7732 MAX_REQUEST_PAYLOADS: 128 diff --git a/specs/_features/eip7594/beacon-chain.md b/specs/_features/eip7594/beacon-chain.md index 7dca19d05b..8f30e683e7 100644 --- a/specs/_features/eip7594/beacon-chain.md +++ b/specs/_features/eip7594/beacon-chain.md @@ -27,7 +27,8 @@ | Name | Value | Description | | - | - | - | -| `MAX_BLOBS_PER_BLOCK_EIP7594` | `uint64(8)` | *[New in EIP7594]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` | +| `TARGET_BLOBS_PER_BLOCK_EIP7594` | `uint64(9)` | *[New in EIP7594]* Target number of blobs in a single block limited by `MAX_BLOBS_PER_BLOCK_EIP7594` | +| `MAX_BLOBS_PER_BLOCK_EIP7594` | `uint64(12)` | *[New in EIP7594]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` | #### Execution payload @@ -53,7 +54,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=TARGET_BLOBS_PER_BLOCK_ELECTRA, + target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_EIP7594, # [Modified in EIP7594] ) ) # Cache execution payload header diff --git a/specs/_features/eip7594/validator.md b/specs/_features/eip7594/validator.md new file mode 100644 index 0000000000..0fddad4ebe --- /dev/null +++ b/specs/_features/eip7594/validator.md @@ -0,0 +1,68 @@ +# EIP7594 -- Honest Validator + +## Table of contents + + + + + +- [Introduction](#introduction) +- [Prerequisites](#prerequisites) +- [Block proposal](#block-proposal) + - [Constructing the `BeaconBlockBody`](#constructing-the-beaconblockbody) + - [Execution payload](#execution-payload) + + + + +## Introduction + +This document represents the changes to be made in the code of an "honest validator" to implement EIP7594. + +## Prerequisites + +This document is an extension of the [Electra -- Honest Validator](../electra/validator.md) guide. +All behaviors and definitions defined in this document, and documents it extends, carry over unless explicitly noted or overridden. + +All terminology, constants, functions, and protocol mechanics defined in the updated Beacon Chain doc of [EIP7594](./beacon-chain.md) are requisite for this document and used throughout. +Please see related Beacon Chain doc before continuing and use them as a reference throughout. + +## Block proposal + +### Constructing the `BeaconBlockBody` + +#### Execution payload + +`prepare_execution_payload` is updated from the Electra specs. + +*Note*: In this section, `state` is the state of the slot for the block proposal _without_ the block yet applied. +That is, `state` is the `previous_state` processed through any empty slots up to the assigned slot using `process_slots(previous_state, slot)`. + +``python +def prepare_execution_payload(state: BeaconState, + safe_block_hash: Hash32, + finalized_block_hash: Hash32, + suggested_fee_recipient: ExecutionAddress, + execution_engine: ExecutionEngine) -> Optional[PayloadId]: + # Verify consistency of the parent hash with respect to the previous execution payload header + parent_hash = state.latest_execution_payload_header.block_hash + + # Set the forkchoice head and initiate the payload build process + withdrawals, _ = get_expected_withdrawals(state) + + payload_attributes = PayloadAttributes( + timestamp=compute_timestamp_at_slot(state, state.slot), + prev_randao=get_randao_mix(state, get_current_epoch(state)), + 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_EIP7594, # [Modified in EIP7594] + max_blobs_per_block=MAX_BLOBS_PER_BLOCK_EIP7594, # [Modified in EIP7594] + ) + return execution_engine.notify_forkchoice_updated( + head_block_hash=parent_hash, + safe_block_hash=safe_block_hash, + finalized_block_hash=finalized_block_hash, + payload_attributes=payload_attributes, + ) +``` \ No newline at end of file diff --git a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_config_invariants.py b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_config_invariants.py index 33eaada407..624976a350 100644 --- a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_config_invariants.py +++ b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_config_invariants.py @@ -31,6 +31,7 @@ def test_polynomical_commitments_sampling(spec): @spec_test @single_phase def test_networking(spec): + assert spec.config.TARGET_BLOBS_PER_BLOCK_EIP7594 <= spec.config.MAX_BLOBS_PER_BLOCK_EIP7594 assert spec.config.MAX_BLOBS_PER_BLOCK_EIP7594 <= spec.MAX_BLOB_COMMITMENTS_PER_BLOCK assert ( spec.config.MAX_REQUEST_BLOB_SIDECARS_EIP7594 == From bfc49d8de4cad2c91dadb7208741559ad495d888 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Thu, 5 Dec 2024 13:00:13 -0600 Subject: [PATCH 12/17] Change EIP-7691 to EIP7691 in spec comments --- specs/electra/beacon-chain.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/electra/beacon-chain.md b/specs/electra/beacon-chain.md index acb1ff9d74..5fd8816a85 100644 --- a/specs/electra/beacon-chain.md +++ b/specs/electra/beacon-chain.md @@ -206,8 +206,8 @@ The following values are (non-configurable) constants used throughout the specif | Name | Value | Description | | - | - | - | -| `TARGET_BLOBS_PER_BLOCK_ELECTRA` | `uint64(6)` | *[New in Electra:EIP-7691]* 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:EIP-7691]* Maximum number of blobs in a single block limited by `MAX_BLOB_COMMITMENTS_PER_BLOCK` | +| `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 From f63f6e42698037d68654735a88923e71c3ccffd3 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Thu, 5 Dec 2024 13:11:40 -0600 Subject: [PATCH 13/17] Bump BlobSidecarsBy* for EIP7594 to v4 --- specs/_features/eip7594/p2p-interface.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/specs/_features/eip7594/p2p-interface.md b/specs/_features/eip7594/p2p-interface.md index 1b5963dc52..65356a2e49 100644 --- a/specs/_features/eip7594/p2p-interface.md +++ b/specs/_features/eip7594/p2p-interface.md @@ -211,9 +211,9 @@ The following validations MUST pass before forwarding the `sidecar: DataColumnSi #### Messages -##### BlobSidecarsByRoot v3 +##### BlobSidecarsByRoot v4 -**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_root/3/` +**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_root/4/` *[Updated in EIP7594]* @@ -223,6 +223,8 @@ The `` field is calculated as `context = compute_fork_digest(fork | `fork_version` | Chunk SSZ type | |------------------------|-----------------------| +| `DENEB_FORK_VERSION` | `deneb.BlobSidecar` | +| `ELECTRA_FORK_VERSION` | `electra.BlobSidecar` | | `EIP7594_FORK_VERSION` | `eip7594.BlobSidecar` | Request Content: @@ -245,9 +247,9 @@ Response Content: No more than `MAX_REQUEST_BLOB_SIDECARS_EIP7594` may be requested at a time. -##### BlobSidecarsByRange v3 +##### BlobSidecarsByRange v4 -**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/3/` +**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/4/` *[Updated in EIP7594]* @@ -257,6 +259,8 @@ The `` field is calculated as `context = compute_fork_digest(fork | `fork_version` | Chunk SSZ type | |------------------------|-----------------------| +| `DENEB_FORK_VERSION` | `deneb.BlobSidecar` | +| `ELECTRA_FORK_VERSION` | `electra.BlobSidecar` | | `EIP7594_FORK_VERSION` | `eip7594.BlobSidecar` | Request Content: From c544029d13949e5e19cbec9f048f122f05f5deb4 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Thu, 5 Dec 2024 13:16:02 -0600 Subject: [PATCH 14/17] Revert "Bump BlobSidecarsBy* for EIP7594 to v4" This reverts commit f63f6e42698037d68654735a88923e71c3ccffd3. --- specs/_features/eip7594/p2p-interface.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/specs/_features/eip7594/p2p-interface.md b/specs/_features/eip7594/p2p-interface.md index 65356a2e49..1b5963dc52 100644 --- a/specs/_features/eip7594/p2p-interface.md +++ b/specs/_features/eip7594/p2p-interface.md @@ -211,9 +211,9 @@ The following validations MUST pass before forwarding the `sidecar: DataColumnSi #### Messages -##### BlobSidecarsByRoot v4 +##### BlobSidecarsByRoot v3 -**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_root/4/` +**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_root/3/` *[Updated in EIP7594]* @@ -223,8 +223,6 @@ The `` field is calculated as `context = compute_fork_digest(fork | `fork_version` | Chunk SSZ type | |------------------------|-----------------------| -| `DENEB_FORK_VERSION` | `deneb.BlobSidecar` | -| `ELECTRA_FORK_VERSION` | `electra.BlobSidecar` | | `EIP7594_FORK_VERSION` | `eip7594.BlobSidecar` | Request Content: @@ -247,9 +245,9 @@ Response Content: No more than `MAX_REQUEST_BLOB_SIDECARS_EIP7594` may be requested at a time. -##### BlobSidecarsByRange v4 +##### BlobSidecarsByRange v3 -**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/4/` +**Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/3/` *[Updated in EIP7594]* @@ -259,8 +257,6 @@ The `` field is calculated as `context = compute_fork_digest(fork | `fork_version` | Chunk SSZ type | |------------------------|-----------------------| -| `DENEB_FORK_VERSION` | `deneb.BlobSidecar` | -| `ELECTRA_FORK_VERSION` | `electra.BlobSidecar` | | `EIP7594_FORK_VERSION` | `eip7594.BlobSidecar` | Request Content: From 455bb9858478d391229b7216d32672c4a1ab3a03 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Thu, 5 Dec 2024 15:59:49 -0600 Subject: [PATCH 15/17] Fix "updated in ..." notes in p2p specs --- specs/electra/p2p-interface.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs/electra/p2p-interface.md b/specs/electra/p2p-interface.md index 63ed422521..ec7f8a63fe 100644 --- a/specs/electra/p2p-interface.md +++ b/specs/electra/p2p-interface.md @@ -105,7 +105,7 @@ The following validations are removed: **Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_root/2/` -*[Updated in ]* +*[Updated in Electra:EIP7691]* The `` field is calculated as `context = compute_fork_digest(fork_version, genesis_validators_root)`: @@ -140,7 +140,7 @@ No more than `MAX_REQUEST_BLOB_SIDECARS_ELECTRA` may be requested at a time. **Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/2/` -*[Updated in ]* +*[Updated in Electra:EIP7691]* The `` field is calculated as `context = compute_fork_digest(fork_version, genesis_validators_root)`: From 373e11161c95e53df1e60d259a2c0bd7109a1699 Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Thu, 5 Dec 2024 16:02:33 -0600 Subject: [PATCH 16/17] Change "updated" to "modified" --- specs/_features/eip7594/p2p-interface.md | 4 ++-- specs/electra/p2p-interface.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/specs/_features/eip7594/p2p-interface.md b/specs/_features/eip7594/p2p-interface.md index 1b5963dc52..1f8172961e 100644 --- a/specs/_features/eip7594/p2p-interface.md +++ b/specs/_features/eip7594/p2p-interface.md @@ -215,7 +215,7 @@ The following validations MUST pass before forwarding the `sidecar: DataColumnSi **Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_root/3/` -*[Updated in EIP7594]* +*[Modified in EIP7594]* The `` field is calculated as `context = compute_fork_digest(fork_version, genesis_validators_root)`: @@ -249,7 +249,7 @@ No more than `MAX_REQUEST_BLOB_SIDECARS_EIP7594` may be requested at a time. **Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/3/` -*[Updated in EIP7594]* +*[Modified in EIP7594]* The `` field is calculated as `context = compute_fork_digest(fork_version, genesis_validators_root)`: diff --git a/specs/electra/p2p-interface.md b/specs/electra/p2p-interface.md index ec7f8a63fe..0016976e93 100644 --- a/specs/electra/p2p-interface.md +++ b/specs/electra/p2p-interface.md @@ -105,7 +105,7 @@ The following validations are removed: **Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_root/2/` -*[Updated in Electra:EIP7691]* +*[Modified in Electra:EIP7691]* The `` field is calculated as `context = compute_fork_digest(fork_version, genesis_validators_root)`: @@ -140,7 +140,7 @@ No more than `MAX_REQUEST_BLOB_SIDECARS_ELECTRA` may be requested at a time. **Protocol ID:** `/eth2/beacon_chain/req/blob_sidecars_by_range/2/` -*[Updated in Electra:EIP7691]* +*[Modified in Electra:EIP7691]* The `` field is calculated as `context = compute_fork_digest(fork_version, genesis_validators_root)`: From 77cacaa3c4bdd44b57b6f6212da7826fad95fa85 Mon Sep 17 00:00:00 2001 From: Justin Traglia <95511699+jtraglia@users.noreply.github.com> Date: Fri, 6 Dec 2024 08:25:53 -0600 Subject: [PATCH 17/17] Update new in Electra comment Co-authored-by: Hsiao-Wei Wang --- specs/electra/beacon-chain.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/electra/beacon-chain.md b/specs/electra/beacon-chain.md index 5fd8816a85..f4997cd76c 100644 --- a/specs/electra/beacon-chain.md +++ b/specs/electra/beacon-chain.md @@ -1251,7 +1251,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=TARGET_BLOBS_PER_BLOCK_ELECTRA, # [New in Electra:EIP7742] + target_blobs_per_block=TARGET_BLOBS_PER_BLOCK_ELECTRA, # [New in Electra:EIP7691:EIP7742] ) ) # Cache execution payload header