diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index 3b1c14e4b..e7d3089c2 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -159,4 +159,6 @@ WHISK_EPOCHS_PER_SHUFFLING_PHASE: 256 WHISK_PROPOSER_SELECTION_GAP: 2 # EIP7594 +NUMBER_OF_COLUMNS: 128 DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32 +MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384 diff --git a/configs/minimal.yaml b/configs/minimal.yaml index d6d4a0942..692ba97c7 100644 --- a/configs/minimal.yaml +++ b/configs/minimal.yaml @@ -157,4 +157,6 @@ WHISK_EPOCHS_PER_SHUFFLING_PHASE: 4 WHISK_PROPOSER_SELECTION_GAP: 1 # EIP7594 +NUMBER_OF_COLUMNS: 128 DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32 +MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384 diff --git a/presets/mainnet/eip7594.yaml b/presets/mainnet/eip7594.yaml index ab7b8b936..e34265b9e 100644 --- a/presets/mainnet/eip7594.yaml +++ b/presets/mainnet/eip7594.yaml @@ -6,5 +6,3 @@ FIELD_ELEMENTS_PER_CELL: 64 # uint64(floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments')) KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4 -# `uint64((FIELD_ELEMENTS_PER_BLOB * 2) // FIELD_ELEMENTS_PER_CELL)` (= 128) -NUMBER_OF_COLUMNS: 128 diff --git a/presets/minimal/eip7594.yaml b/presets/minimal/eip7594.yaml index cf814c9db..def2b4e80 100644 --- a/presets/minimal/eip7594.yaml +++ b/presets/minimal/eip7594.yaml @@ -6,5 +6,3 @@ FIELD_ELEMENTS_PER_CELL: 64 # uint64(floorlog2(get_generalized_index(BeaconBlockBody, 'blob_kzg_commitments')) KZG_COMMITMENTS_INCLUSION_PROOF_DEPTH: 4 -# `uint64((FIELD_ELEMENTS_PER_BLOB * 2) // FIELD_ELEMENTS_PER_CELL)` (= 128) -NUMBER_OF_COLUMNS: 128 diff --git a/pysetup/spec_builders/eip7594.py b/pysetup/spec_builders/eip7594.py index 4ad02fc07..8ce35d6bd 100644 --- a/pysetup/spec_builders/eip7594.py +++ b/pysetup/spec_builders/eip7594.py @@ -17,7 +17,7 @@ from eth2spec.deneb import {preset_name} as deneb def hardcoded_custom_type_dep_constants(cls, spec_object) -> str: return { 'FIELD_ELEMENTS_PER_CELL': spec_object.preset_vars['FIELD_ELEMENTS_PER_CELL'].value, - 'NUMBER_OF_COLUMNS': spec_object.preset_vars['NUMBER_OF_COLUMNS'].value, + 'NUMBER_OF_COLUMNS': spec_object.config_vars['NUMBER_OF_COLUMNS'].value, } @classmethod diff --git a/specs/_features/eip7594/p2p-interface.md b/specs/_features/eip7594/p2p-interface.md index fb60774b1..b282abbe4 100644 --- a/specs/_features/eip7594/p2p-interface.md +++ b/specs/_features/eip7594/p2p-interface.md @@ -25,6 +25,9 @@ - [The Req/Resp domain](#the-reqresp-domain) - [Messages](#messages) - [DataColumnSidecarsByRoot v1](#datacolumnsidecarsbyroot-v1) + - [The discovery domain: discv5](#the-discovery-domain-discv5) + - [ENR structure](#enr-structure) + - [`custody_subnet_count`](#custody_subnet_count) @@ -44,7 +47,7 @@ | Name | Value | Description | |------------------------------------------|-----------------------------------|---------------------------------------------------------------------| -| `MAX_REQUEST_DATA_COLUMN_SIDECARS` | `NUMBER_OF_COLUMNS` | Maximum number of data column sidecars in a single request | +| `MAX_REQUEST_DATA_COLUMN_SIDECARS` | `MAX_REQUEST_BLOCKS_DENEB * NUMBER_OF_COLUMNS` | Maximum number of data column sidecars in a single request | | `MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS` | `2**12` (= 4096 epochs, ~18 days) | The minimum epoch range over which a node must serve data column sidecars | ### Containers @@ -194,3 +197,15 @@ Clients MAY limit the number of blocks and sidecars in the response. Clients SHOULD include a sidecar in the response as soon as it passes the gossip validation rules. Clients SHOULD NOT respond with sidecars related to blocks that fail gossip validation rules. Clients SHOULD NOT respond with sidecars related to blocks that fail the beacon chain state transition + +### The discovery domain: discv5 + +#### ENR structure + +##### `custody_subnet_count` + +A new field is added to the ENR under the key `custody_subnet_count` to facilitate custody data column discovery. + +| Key | Value | +|:-----------------------|:-------------| +| `custody_subnet_count` | SSZ `uint64` | diff --git a/specs/altair/p2p-interface.md b/specs/altair/p2p-interface.md index fac540fb9..5b0c938df 100644 --- a/specs/altair/p2p-interface.md +++ b/specs/altair/p2p-interface.md @@ -33,6 +33,8 @@ Altair adds new messages, topics and data to the Req-Resp, Gossip and Discovery - [GetMetaData v2](#getmetadata-v2) - [Transitioning from v1 to v2](#transitioning-from-v1-to-v2) - [The discovery domain: discv5](#the-discovery-domain-discv5) + - [ENR structure](#enr-structure) + - [Sync committee bitfield](#sync-committee-bitfield) @@ -287,10 +289,16 @@ the responder MUST return the **InvalidRequest** response code. ### The discovery domain: discv5 -The `attnets` key of the ENR is used as defined in the Phase 0 document. +#### ENR structure + +##### Sync committee bitfield An additional bitfield is added to the ENR under the key `syncnets` to facilitate sync committee subnet discovery. The length of this bitfield is `SYNC_COMMITTEE_SUBNET_COUNT` where each bit corresponds to a distinct `subnet_id` for a specific sync committee subnet. The `i`th bit is set in this bitfield if the validator is currently subscribed to the `sync_committee_{i}` topic. +| Key | Value | +|:-------------|:-------------------------------------------------| +| `syncnets` | SSZ `Bitvector[SYNC_COMMITTEE_SUBNET_COUNT]` | + See the [validator document](./validator.md#sync-committee-subnet-stability) for further details on how the new bits are used. 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 5f709a22a..90cf0b522 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 @@ -10,8 +10,11 @@ from eth2spec.test.context import ( @single_phase def test_invariants(spec): assert spec.FIELD_ELEMENTS_PER_BLOB % spec.FIELD_ELEMENTS_PER_CELL == 0 - assert spec.FIELD_ELEMENTS_PER_BLOB * 2 % spec.NUMBER_OF_COLUMNS == 0 - assert spec.SAMPLES_PER_SLOT <= spec.NUMBER_OF_COLUMNS + assert spec.FIELD_ELEMENTS_PER_BLOB * 2 % spec.config.NUMBER_OF_COLUMNS == 0 + assert spec.SAMPLES_PER_SLOT <= spec.config.NUMBER_OF_COLUMNS assert spec.CUSTODY_REQUIREMENT <= spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT - assert spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT <= spec.NUMBER_OF_COLUMNS - assert spec.NUMBER_OF_COLUMNS % spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT == 0 + assert spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT <= spec.config.NUMBER_OF_COLUMNS + assert spec.config.NUMBER_OF_COLUMNS % spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT == 0 + assert spec.config.MAX_REQUEST_DATA_COLUMN_SIDECARS == ( + spec.config.MAX_REQUEST_BLOCKS_DENEB * spec.config.NUMBER_OF_COLUMNS + )