Skip to content

Commit d295813

Browse files
Savidhwwhww
andauthored
EIP-7594: add custody settings config (#3766)
* EIP-7594: add custody settings config * Add `TARGET_NUMBER_OF_PEERS` to config * add TARGET_NUMBER_OF_PEERS Co-authored-by: Hsiao-Wei Wang <[email protected]> * fix double TARGET_NUMBER_OF_PEERS * fix tests --------- Co-authored-by: Hsiao-Wei Wang <[email protected]>
1 parent fdeff74 commit d295813

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

configs/mainnet.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ NUMBER_OF_COLUMNS: 128
159159
MAX_CELLS_IN_EXTENDED_MATRIX: 768
160160
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
161161
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
162+
SAMPLES_PER_SLOT: 8
163+
CUSTODY_REQUIREMENT: 1
164+
TARGET_NUMBER_OF_PEERS: 70
162165

163166
# [New in Electra:EIP7251]
164167
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 # 2**7 * 10**9 (= 128,000,000,000)

configs/minimal.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ NUMBER_OF_COLUMNS: 128
158158
MAX_CELLS_IN_EXTENDED_MATRIX: 768
159159
DATA_COLUMN_SIDECAR_SUBNET_COUNT: 32
160160
MAX_REQUEST_DATA_COLUMN_SIDECARS: 16384
161+
SAMPLES_PER_SLOT: 8
162+
CUSTODY_REQUIREMENT: 1
163+
TARGET_NUMBER_OF_PEERS: 70
161164

162165
# [New in Electra:EIP7251]
163166
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000 # 2**6 * 10**9 (= 64,000,000,000)

tests/core/pyspec/eth2spec/test/eip7594/unittests/test_config_invariants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
def test_invariants(spec):
1212
assert spec.FIELD_ELEMENTS_PER_BLOB % spec.FIELD_ELEMENTS_PER_CELL == 0
1313
assert spec.FIELD_ELEMENTS_PER_EXT_BLOB % spec.config.NUMBER_OF_COLUMNS == 0
14-
assert spec.SAMPLES_PER_SLOT <= spec.config.NUMBER_OF_COLUMNS
15-
assert spec.CUSTODY_REQUIREMENT <= spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT
14+
assert spec.config.SAMPLES_PER_SLOT <= spec.config.NUMBER_OF_COLUMNS
15+
assert spec.config.CUSTODY_REQUIREMENT <= spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT
1616
assert spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT <= spec.config.NUMBER_OF_COLUMNS
1717
assert spec.config.NUMBER_OF_COLUMNS % spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT == 0
1818
assert spec.config.MAX_REQUEST_DATA_COLUMN_SIDECARS == (

tests/core/pyspec/eth2spec/test/eip7594/unittests/test_custody.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
def run_get_custody_columns(spec, peer_count, custody_subnet_count):
1010
assignments = [spec.get_custody_columns(node_id, custody_subnet_count) for node_id in range(peer_count)]
1111

12-
columns_per_subnet = spec.NUMBER_OF_COLUMNS // spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT
12+
columns_per_subnet = spec.config.NUMBER_OF_COLUMNS // spec.config.DATA_COLUMN_SIDECAR_SUBNET_COUNT
1313
for assignment in assignments:
1414
assert len(assignment) == custody_subnet_count * columns_per_subnet
1515
assert len(assignment) == len(set(assignment))
@@ -20,8 +20,8 @@ def run_get_custody_columns(spec, peer_count, custody_subnet_count):
2020
@single_phase
2121
def test_get_custody_columns_peers_within_number_of_columns(spec):
2222
peer_count = 10
23-
custody_subnet_count = spec.CUSTODY_REQUIREMENT
24-
assert spec.NUMBER_OF_COLUMNS > peer_count
23+
custody_subnet_count = spec.config.CUSTODY_REQUIREMENT
24+
assert spec.config.NUMBER_OF_COLUMNS > peer_count
2525
run_get_custody_columns(spec, peer_count, custody_subnet_count)
2626

2727

@@ -30,8 +30,8 @@ def test_get_custody_columns_peers_within_number_of_columns(spec):
3030
@single_phase
3131
def test_get_custody_columns_peers_more_than_number_of_columns(spec):
3232
peer_count = 200
33-
custody_subnet_count = spec.CUSTODY_REQUIREMENT
34-
assert spec.NUMBER_OF_COLUMNS < peer_count
33+
custody_subnet_count = spec.config.CUSTODY_REQUIREMENT
34+
assert spec.config.NUMBER_OF_COLUMNS < peer_count
3535
run_get_custody_columns(spec, peer_count, custody_subnet_count)
3636

3737

0 commit comments

Comments
 (0)