From a59c7beb131f0f8519e421d4fa173e9df4be6798 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 23 Aug 2024 12:44:20 +0200 Subject: [PATCH 01/13] EIP-7594: PeerDAS explicit csc integer size --- specs/_features/eip7594/das-core.md | 4 ++-- specs/_features/eip7594/p2p-interface.md | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/specs/_features/eip7594/das-core.md b/specs/_features/eip7594/das-core.md index 2096fb9a31..5ad289deaf 100644 --- a/specs/_features/eip7594/das-core.md +++ b/specs/_features/eip7594/das-core.md @@ -105,7 +105,7 @@ class MatrixEntry(Container): ### `get_custody_columns` ```python -def get_custody_columns(node_id: NodeID, custody_subnet_count: uint64) -> Sequence[ColumnIndex]: +def get_custody_columns(node_id: NodeID, custody_subnet_count: uint8) -> Sequence[ColumnIndex]: assert custody_subnet_count <= DATA_COLUMN_SIDECAR_SUBNET_COUNT subnet_ids: List[uint64] = [] @@ -222,7 +222,7 @@ def get_data_column_sidecars(signed_block: SignedBeaconBlock, Each node downloads and custodies a minimum of `CUSTODY_REQUIREMENT` subnets per slot. The particular subnets that the node is required to custody are selected pseudo-randomly (more on this below). -A node *may* choose to custody and serve more than the minimum honesty requirement. Such a node explicitly advertises a number greater than `CUSTODY_REQUIREMENT` via the peer discovery mechanism -- for example, in their ENR (e.g. `custody_subnet_count: 4` if the node custodies `4` subnets each slot) -- up to a `DATA_COLUMN_SIDECAR_SUBNET_COUNT` (i.e. a super-full node). +A node *may* choose to custody and serve more than the minimum honesty requirement. Such a node explicitly advertises a number greater than `CUSTODY_REQUIREMENT` via the peer discovery mechanism -- for example, in their ENR (e.g. `custody_subnet_count` as known as `csc: 4` if the node custodies `4` subnets each slot) -- up to a `DATA_COLUMN_SIDECAR_SUBNET_COUNT` (i.e. a super-full node). A node stores the custodied columns for the duration of the pruning period and responds to peer requests for samples on those columns. diff --git a/specs/_features/eip7594/p2p-interface.md b/specs/_features/eip7594/p2p-interface.md index 1b25c5fc5a..d6ccd902fb 100644 --- a/specs/_features/eip7594/p2p-interface.md +++ b/specs/_features/eip7594/p2p-interface.md @@ -119,14 +119,14 @@ The `MetaData` stored locally by clients is updated with an additional field to seq_number: uint64 attnets: Bitvector[ATTESTATION_SUBNET_COUNT] syncnets: Bitvector[SYNC_COMMITTEE_SUBNET_COUNT] - custody_subnet_count: uint64 + csc: uint8 ) ``` Where - `seq_number`, `attnets`, and `syncnets` have the same meaning defined in the Altair document. -- `custody_subnet_count` represents the node's custody subnet count. Clients MAY reject ENRs with a value less than `CUSTODY_REQUIREMENT`. +- `csc` represents the node's custody subnet count. Clients MAY reject ENRs with a value less than `CUSTODY_REQUIREMENT`. ### The gossip domain: gossipsub @@ -322,6 +322,6 @@ Requests the MetaData of a peer, using the new `MetaData` definition given above A new field is added to the ENR under the key `csc` to facilitate custody data column discovery. -| Key | Value | -|--------|------------------------------------------| -| `csc` | Custody subnet count, big endian integer | +| Key | Value | +|--------|------------------------------------------------| +| `csc` | Custody subnet count, big endian uint8 integer | From b69ff9b326541c447a718a8af6583745a9ebd440 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 23 Aug 2024 14:01:25 +0200 Subject: [PATCH 02/13] add spec test for csc int size --- .../pyspec/eth2spec/test/eip7594/unittests/test_custody.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py index 5db3635a8e..fac3c44fd3 100644 --- a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py +++ b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py @@ -51,3 +51,9 @@ def test_get_custody_columns_custody_size_more_than_number_of_columns(spec): node_id = 1 custody_subnet_count = spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT + 1 expect_assertion_error(lambda: spec.get_custody_columns(node_id, custody_subnet_count)) + +@with_eip7594_and_later +@spec_test +@single_phase +def test_custody_subnet_count_int_bitlength(custody_subnet_count): + assert uint8(custody_subnet_count) == custody_subnet_count From 7acf9e1a88143df5b7098db4764b7be16f873c8c Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 23 Aug 2024 14:14:53 +0200 Subject: [PATCH 03/13] import uint8 --- .../core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py index fac3c44fd3..f1215bff54 100644 --- a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py +++ b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py @@ -4,7 +4,7 @@ single_phase, with_eip7594_and_later, ) - +from eth2spec.utils.ssz.ssz_typing import uint8 def run_get_custody_columns(spec, peer_count, custody_subnet_count): assignments = [spec.get_custody_columns(node_id, custody_subnet_count) for node_id in range(peer_count)] From a0eabcf1fc8203057b5bdd694797cca6394f4ec5 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 23 Aug 2024 14:17:43 +0200 Subject: [PATCH 04/13] make linter happy --- .../core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py index f1215bff54..99ae2635a6 100644 --- a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py +++ b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py @@ -6,6 +6,7 @@ ) from eth2spec.utils.ssz.ssz_typing import uint8 + def run_get_custody_columns(spec, peer_count, custody_subnet_count): assignments = [spec.get_custody_columns(node_id, custody_subnet_count) for node_id in range(peer_count)] @@ -52,6 +53,7 @@ def test_get_custody_columns_custody_size_more_than_number_of_columns(spec): custody_subnet_count = spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT + 1 expect_assertion_error(lambda: spec.get_custody_columns(node_id, custody_subnet_count)) + @with_eip7594_and_later @spec_test @single_phase From 68d1a6c7cdcc20000364de1cf6da5238ff06de5a Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Fri, 23 Aug 2024 14:50:04 +0200 Subject: [PATCH 05/13] add spec --- .../core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py index 99ae2635a6..5c0e94ceba 100644 --- a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py +++ b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py @@ -57,5 +57,5 @@ def test_get_custody_columns_custody_size_more_than_number_of_columns(spec): @with_eip7594_and_later @spec_test @single_phase -def test_custody_subnet_count_int_bitlength(custody_subnet_count): +def test_custody_subnet_count_int_bitlength(spec, custody_subnet_count): assert uint8(custody_subnet_count) == custody_subnet_count From 75f69532b1bad5ffc41bbf9dcbb21184afe33f1a Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Mon, 26 Aug 2024 17:07:08 +0200 Subject: [PATCH 06/13] Update p2p-interface.md --- specs/_features/eip7594/p2p-interface.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/specs/_features/eip7594/p2p-interface.md b/specs/_features/eip7594/p2p-interface.md index d6ccd902fb..64c4bacb73 100644 --- a/specs/_features/eip7594/p2p-interface.md +++ b/specs/_features/eip7594/p2p-interface.md @@ -322,6 +322,6 @@ Requests the MetaData of a peer, using the new `MetaData` definition given above A new field is added to the ENR under the key `csc` to facilitate custody data column discovery. -| Key | Value | -|--------|------------------------------------------------| -| `csc` | Custody subnet count, big endian uint8 integer | +| Key | Value | +|--------|-------------------------------------| +| `csc` | Custody subnet count, uint8 integer | From cf8c8387c4d07b4a95ff8af294c87205cc8166c2 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Tue, 27 Aug 2024 09:45:00 +0200 Subject: [PATCH 07/13] Update specs/_features/eip7594/das-core.md Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com> --- specs/_features/eip7594/das-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/_features/eip7594/das-core.md b/specs/_features/eip7594/das-core.md index 5ad289deaf..7d0e4ad694 100644 --- a/specs/_features/eip7594/das-core.md +++ b/specs/_features/eip7594/das-core.md @@ -222,7 +222,7 @@ def get_data_column_sidecars(signed_block: SignedBeaconBlock, Each node downloads and custodies a minimum of `CUSTODY_REQUIREMENT` subnets per slot. The particular subnets that the node is required to custody are selected pseudo-randomly (more on this below). -A node *may* choose to custody and serve more than the minimum honesty requirement. Such a node explicitly advertises a number greater than `CUSTODY_REQUIREMENT` via the peer discovery mechanism -- for example, in their ENR (e.g. `custody_subnet_count` as known as `csc: 4` if the node custodies `4` subnets each slot) -- up to a `DATA_COLUMN_SIDECAR_SUBNET_COUNT` (i.e. a super-full node). +A node *may* choose to custody and serve more than the minimum honesty requirement. Such a node explicitly advertises a number greater than `CUSTODY_REQUIREMENT` through the peer discovery mechanism, specifically by setting a higher value in the `csc` (custody subnet count) field within its ENR. This value can be increased up to `DATA_COLUMN_SIDECAR_SUBNET_COUNT`, indicating a super-full node. A node stores the custodied columns for the duration of the pruning period and responds to peer requests for samples on those columns. From 652ca87231f4e2d617afd44760c41677b7536632 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Tue, 27 Aug 2024 10:15:18 +0200 Subject: [PATCH 08/13] revert metadata name --- specs/_features/eip7594/p2p-interface.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/_features/eip7594/p2p-interface.md b/specs/_features/eip7594/p2p-interface.md index 64c4bacb73..38797a2fb0 100644 --- a/specs/_features/eip7594/p2p-interface.md +++ b/specs/_features/eip7594/p2p-interface.md @@ -119,7 +119,7 @@ The `MetaData` stored locally by clients is updated with an additional field to seq_number: uint64 attnets: Bitvector[ATTESTATION_SUBNET_COUNT] syncnets: Bitvector[SYNC_COMMITTEE_SUBNET_COUNT] - csc: uint8 + custody_subnet_count: uint8 # csc ) ``` From 26d020052c6eb91adc23e32143069890e3a15047 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Wed, 28 Aug 2024 10:41:54 +0200 Subject: [PATCH 09/13] Update specs/_features/eip7594/das-core.md Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com> --- specs/_features/eip7594/das-core.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specs/_features/eip7594/das-core.md b/specs/_features/eip7594/das-core.md index 7d0e4ad694..1938e4c4d3 100644 --- a/specs/_features/eip7594/das-core.md +++ b/specs/_features/eip7594/das-core.md @@ -222,7 +222,7 @@ def get_data_column_sidecars(signed_block: SignedBeaconBlock, Each node downloads and custodies a minimum of `CUSTODY_REQUIREMENT` subnets per slot. The particular subnets that the node is required to custody are selected pseudo-randomly (more on this below). -A node *may* choose to custody and serve more than the minimum honesty requirement. Such a node explicitly advertises a number greater than `CUSTODY_REQUIREMENT` through the peer discovery mechanism, specifically by setting a higher value in the `csc` (custody subnet count) field within its ENR. This value can be increased up to `DATA_COLUMN_SIDECAR_SUBNET_COUNT`, indicating a super-full node. +A node *may* choose to custody and serve more than the minimum honesty requirement. Such a node explicitly advertises a number greater than `CUSTODY_REQUIREMENT` through the peer discovery mechanism, specifically by setting a higher value in the `custody_subnet_count` field within its ENR. This value can be increased up to `DATA_COLUMN_SIDECAR_SUBNET_COUNT`, indicating a super-full node. A node stores the custodied columns for the duration of the pruning period and responds to peer requests for samples on those columns. From cf688131519ff4c9b38710e63ac70ddb728b4c88 Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Wed, 28 Aug 2024 11:16:28 +0200 Subject: [PATCH 10/13] update tests --- scripts/build_run_docker_tests.sh | 2 +- .../pyspec/eth2spec/test/eip7594/unittests/test_custody.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/build_run_docker_tests.sh b/scripts/build_run_docker_tests.sh index 9d2740ca27..91aa2c8ae1 100755 --- a/scripts/build_run_docker_tests.sh +++ b/scripts/build_run_docker_tests.sh @@ -10,7 +10,7 @@ # Set variables -ALL_EXECUTABLE_SPECS=("phase0" "altair" "bellatrix" "capella" "deneb" "electra" "whisk") +ALL_EXECUTABLE_SPECS=("phase0" "altair" "bellatrix" "capella" "deneb" "electra" "whisk" "eip7594") TEST_PRESET_TYPE=minimal FORK_TO_TEST=phase0 WORKDIR="//consensus-specs//tests//core//pyspec" diff --git a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py index 5c0e94ceba..3c3c63fedf 100644 --- a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py +++ b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py @@ -11,6 +11,7 @@ def run_get_custody_columns(spec, peer_count, custody_subnet_count): assignments = [spec.get_custody_columns(node_id, custody_subnet_count) for node_id in range(peer_count)] columns_per_subnet = spec.config.NUMBER_OF_COLUMNS // spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT + assert custody_subnet_count <= spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT for assignment in assignments: assert len(assignment) == custody_subnet_count * columns_per_subnet assert len(assignment) == len(set(assignment)) @@ -57,5 +58,5 @@ def test_get_custody_columns_custody_size_more_than_number_of_columns(spec): @with_eip7594_and_later @spec_test @single_phase -def test_custody_subnet_count_int_bitlength(spec, custody_subnet_count): - assert uint8(custody_subnet_count) == custody_subnet_count +def test_custody_subnet_count_int_bitlength(spec): + assert spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT == uint8(spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT) \ No newline at end of file From e05264b379907c00d5958dd54d8bc17f8ce4c60c Mon Sep 17 00:00:00 2001 From: Barnabas Busa Date: Wed, 28 Aug 2024 11:27:14 +0200 Subject: [PATCH 11/13] make linter happy --- .../core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py index 3c3c63fedf..087bbc2485 100644 --- a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py +++ b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py @@ -59,4 +59,4 @@ def test_get_custody_columns_custody_size_more_than_number_of_columns(spec): @spec_test @single_phase def test_custody_subnet_count_int_bitlength(spec): - assert spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT == uint8(spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT) \ No newline at end of file + assert spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT == uint8(spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT) From 6411967b61d1b5d26d16e061e2bfd5c225d90768 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Wed, 28 Aug 2024 21:26:26 +0800 Subject: [PATCH 12/13] Make `DATA_COLUMN_SIDECAR_SUBNET_COUNT` in uint8 --- specs/_features/eip7594/das-core.md | 8 ++++---- .../test/eip7594/unittests/test_config_invariants.py | 4 +++- .../eth2spec/test/eip7594/unittests/test_custody.py | 12 ++---------- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/specs/_features/eip7594/das-core.md b/specs/_features/eip7594/das-core.md index 7d0e4ad694..279f818e20 100644 --- a/specs/_features/eip7594/das-core.md +++ b/specs/_features/eip7594/das-core.md @@ -67,7 +67,7 @@ The following values are (non-configurable) constants used throughout the specif | Name | Value | Description | | - | - | - | -| `DATA_COLUMN_SIDECAR_SUBNET_COUNT` | `128` | The number of data column sidecar subnets used in the gossipsub protocol | +| `DATA_COLUMN_SIDECAR_SUBNET_COUNT` | `uint8(128)` | The number of data column sidecar subnets used in the gossipsub protocol | ### Custody setting @@ -113,7 +113,7 @@ def get_custody_columns(node_id: NodeID, custody_subnet_count: uint8) -> Sequenc while len(subnet_ids) < custody_subnet_count: subnet_id = ( bytes_to_uint64(hash(uint_to_bytes(uint256(current_id)))[0:8]) - % DATA_COLUMN_SIDECAR_SUBNET_COUNT + % int(DATA_COLUMN_SIDECAR_SUBNET_COUNT) ) if subnet_id not in subnet_ids: subnet_ids.append(subnet_id) @@ -124,9 +124,9 @@ def get_custody_columns(node_id: NodeID, custody_subnet_count: uint8) -> Sequenc assert len(subnet_ids) == len(set(subnet_ids)) - columns_per_subnet = NUMBER_OF_COLUMNS // DATA_COLUMN_SIDECAR_SUBNET_COUNT + columns_per_subnet = NUMBER_OF_COLUMNS // int(DATA_COLUMN_SIDECAR_SUBNET_COUNT) return sorted([ - ColumnIndex(DATA_COLUMN_SIDECAR_SUBNET_COUNT * i + subnet_id) + ColumnIndex(int(DATA_COLUMN_SIDECAR_SUBNET_COUNT) * i + subnet_id) for i in range(columns_per_subnet) for subnet_id in subnet_ids ]) 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 fc54cc3088..fbbae4e8f8 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 @@ -3,6 +3,7 @@ spec_test, with_eip7594_and_later, ) +from eth2spec.utils.ssz.ssz_typing import uint8 @with_eip7594_and_later @@ -12,9 +13,10 @@ def test_invariants(spec): assert spec.FIELD_ELEMENTS_PER_BLOB % spec.FIELD_ELEMENTS_PER_CELL == 0 assert spec.FIELD_ELEMENTS_PER_EXT_BLOB % spec.config.NUMBER_OF_COLUMNS == 0 assert spec.config.SAMPLES_PER_SLOT <= spec.config.NUMBER_OF_COLUMNS + assert spec.config.NUMBER_OF_COLUMNS == uint8(spec.config.NUMBER_OF_COLUMNS) # ENR field is uint8 assert spec.config.CUSTODY_REQUIREMENT <= spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT 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.NUMBER_OF_COLUMNS % int(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 ) diff --git a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py index 5c0e94ceba..27aee3457a 100644 --- a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py +++ b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py @@ -4,15 +4,14 @@ single_phase, with_eip7594_and_later, ) -from eth2spec.utils.ssz.ssz_typing import uint8 def run_get_custody_columns(spec, peer_count, custody_subnet_count): assignments = [spec.get_custody_columns(node_id, custody_subnet_count) for node_id in range(peer_count)] - columns_per_subnet = spec.config.NUMBER_OF_COLUMNS // spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT + columns_per_subnet = spec.config.NUMBER_OF_COLUMNS // int(spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT) for assignment in assignments: - assert len(assignment) == custody_subnet_count * columns_per_subnet + assert len(assignment) == int(custody_subnet_count) * columns_per_subnet assert len(assignment) == len(set(assignment)) @@ -52,10 +51,3 @@ def test_get_custody_columns_custody_size_more_than_number_of_columns(spec): node_id = 1 custody_subnet_count = spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT + 1 expect_assertion_error(lambda: spec.get_custody_columns(node_id, custody_subnet_count)) - - -@with_eip7594_and_later -@spec_test -@single_phase -def test_custody_subnet_count_int_bitlength(spec, custody_subnet_count): - assert uint8(custody_subnet_count) == custody_subnet_count From d0feb58301ea3c765466880b8bc2ebe8945afce3 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Thu, 29 Aug 2024 01:39:19 +0800 Subject: [PATCH 13/13] add `int` casting for bypassing remerkeable type conversion --- .../test/eip7594/networking/test_get_custody_columns.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/core/pyspec/eth2spec/test/eip7594/networking/test_get_custody_columns.py b/tests/core/pyspec/eth2spec/test/eip7594/networking/test_get_custody_columns.py index b41f19a6ca..692b73e49d 100644 --- a/tests/core/pyspec/eth2spec/test/eip7594/networking/test_get_custody_columns.py +++ b/tests/core/pyspec/eth2spec/test/eip7594/networking/test_get_custody_columns.py @@ -20,7 +20,7 @@ def _run_get_custody_columns(spec, rng, node_id=None, custody_subnet_count=None) assert len(result) == len(set(result)) assert len(result) == ( - custody_subnet_count * spec.config.NUMBER_OF_COLUMNS // spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT + int(custody_subnet_count) * spec.config.NUMBER_OF_COLUMNS // int(spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT) ) assert all(i < spec.config.NUMBER_OF_COLUMNS for i in result) python_list_result = [int(i) for i in result]