From b4e37dc23b98aea62c73b9bfe8a949de01dc1e00 Mon Sep 17 00:00:00 2001 From: Andrew Davis <1709934+Savid@users.noreply.github.com> Date: Tue, 14 May 2024 15:34:48 +0300 Subject: [PATCH 1/5] EIP-7594: add custody settings config --- configs/mainnet.yaml | 2 ++ configs/minimal.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index cda09fca72..101c6d7da9 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -159,6 +159,8 @@ NUMBER_OF_COLUMNS: 128 MAX_CELLS_IN_EXTENDED_MATRIX: 768 DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32 MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384 +SAMPLES_PER_SLOT: 8 +CUSTODY_REQUIREMENT: 1 # [New in Electra:EIP7251] MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 # 2**7 * 10**9 (= 128,000,000,000) diff --git a/configs/minimal.yaml b/configs/minimal.yaml index e7a92a811e..a2f8028ce1 100644 --- a/configs/minimal.yaml +++ b/configs/minimal.yaml @@ -158,6 +158,8 @@ NUMBER_OF_COLUMNS: 128 MAX_CELLS_IN_EXTENDED_MATRIX: 768 DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32 MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384 +SAMPLES_PER_SLOT: 8 +CUSTODY_REQUIREMENT: 1 # [New in Electra:EIP7251] MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000 # 2**6 * 10**9 (= 64,000,000,000) From 3f37ac3ee38a30dbcbe54b925ff32beb6e431b03 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Wed, 15 May 2024 14:48:20 +0800 Subject: [PATCH 2/5] Add `TARGET_NUMBER_OF_PEERS` to config --- configs/mainnet.yaml | 1 + configs/minimal.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index 101c6d7da9..7051873ce9 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -161,6 +161,7 @@ DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32 MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384 SAMPLES_PER_SLOT: 8 CUSTODY_REQUIREMENT: 1 +TARGET_NUMBER_OF_PEERS: 70 # [New in Electra:EIP7251] MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 # 2**7 * 10**9 (= 128,000,000,000) diff --git a/configs/minimal.yaml b/configs/minimal.yaml index a2f8028ce1..8e2a222d47 100644 --- a/configs/minimal.yaml +++ b/configs/minimal.yaml @@ -160,6 +160,7 @@ DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32 MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384 SAMPLES_PER_SLOT: 8 CUSTODY_REQUIREMENT: 1 +TARGET_NUMBER_OF_PEERS: 70 # [New in Electra:EIP7251] MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000 # 2**6 * 10**9 (= 64,000,000,000) From 49d725265f633152ac63364dafb8de2195e729d4 Mon Sep 17 00:00:00 2001 From: Andrew Davis <1709934+Savid@users.noreply.github.com> Date: Wed, 15 May 2024 09:48:52 +0300 Subject: [PATCH 3/5] add TARGET_NUMBER_OF_PEERS Co-authored-by: Hsiao-Wei Wang --- configs/mainnet.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index 7051873ce9..57b7eb3e98 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -162,6 +162,7 @@ MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384 SAMPLES_PER_SLOT: 8 CUSTODY_REQUIREMENT: 1 TARGET_NUMBER_OF_PEERS: 70 +TARGET_NUMBER_OF_PEERS: 70 # [New in Electra:EIP7251] MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 # 2**7 * 10**9 (= 128,000,000,000) From b2c6c6ce414c198d33520f5aaa65fadad8450fce Mon Sep 17 00:00:00 2001 From: Andrew Davis <1709934+Savid@users.noreply.github.com> Date: Wed, 15 May 2024 09:49:43 +0300 Subject: [PATCH 4/5] fix double TARGET_NUMBER_OF_PEERS --- configs/mainnet.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index 57b7eb3e98..7051873ce9 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -162,7 +162,6 @@ MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384 SAMPLES_PER_SLOT: 8 CUSTODY_REQUIREMENT: 1 TARGET_NUMBER_OF_PEERS: 70 -TARGET_NUMBER_OF_PEERS: 70 # [New in Electra:EIP7251] MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 # 2**7 * 10**9 (= 128,000,000,000) From 461e5a1f8d766c13a6c5bc5047ed70b451b10dda Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Wed, 15 May 2024 12:32:46 +0300 Subject: [PATCH 5/5] fix tests --- .../test/eip7594/unittests/test_config_invariants.py | 4 ++-- .../eth2spec/test/eip7594/unittests/test_custody.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) 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 9ad21d2624..998bf35128 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 @@ -11,8 +11,8 @@ 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.SAMPLES_PER_SLOT <= spec.config.NUMBER_OF_COLUMNS - assert spec.CUSTODY_REQUIREMENT <= spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT + assert spec.config.SAMPLES_PER_SLOT <= spec.config.NUMBER_OF_COLUMNS + 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.MAX_REQUEST_DATA_COLUMN_SIDECARS == ( 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 e1ab136c4f..5db3635a8e 100644 --- a/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py +++ b/tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py @@ -9,7 +9,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.NUMBER_OF_COLUMNS // spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT + columns_per_subnet = spec.config.NUMBER_OF_COLUMNS // 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)) @@ -20,8 +20,8 @@ def run_get_custody_columns(spec, peer_count, custody_subnet_count): @single_phase def test_get_custody_columns_peers_within_number_of_columns(spec): peer_count = 10 - custody_subnet_count = spec.CUSTODY_REQUIREMENT - assert spec.NUMBER_OF_COLUMNS > peer_count + custody_subnet_count = spec.config.CUSTODY_REQUIREMENT + assert spec.config.NUMBER_OF_COLUMNS > peer_count run_get_custody_columns(spec, peer_count, custody_subnet_count) @@ -30,8 +30,8 @@ def test_get_custody_columns_peers_within_number_of_columns(spec): @single_phase def test_get_custody_columns_peers_more_than_number_of_columns(spec): peer_count = 200 - custody_subnet_count = spec.CUSTODY_REQUIREMENT - assert spec.NUMBER_OF_COLUMNS < peer_count + custody_subnet_count = spec.config.CUSTODY_REQUIREMENT + assert spec.config.NUMBER_OF_COLUMNS < peer_count run_get_custody_columns(spec, peer_count, custody_subnet_count)