From 0c65f79d824065606b5854002f37891f573b048e Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Thu, 23 Sep 2021 15:20:18 +0200 Subject: [PATCH] fix merkle proof test for mainnet The `test_next_sync_committee_tree` currently only supports the minimal preset, as it incorrectly initializes the `next_sync_committee`. On the mainnet preset, `SYNC_COMMITTEE_SIZE` is 512, but the default states use only 256 validators, leading to an IndexError during the test execution. `next_sync_committee` is already initialized correctly prior to the test run using the spec's `get_next_sync_committee` function, which fills up extra committee slots with duplicate validators in this scenario. This makes it unnecessary to manually initialize the `next_sync_committee`. Removed the incorrect initialization to allow testing on mainnet preset. --- .../core/pyspec/eth2spec/test/altair/unittests/test_helpers.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/altair/unittests/test_helpers.py b/tests/core/pyspec/eth2spec/test/altair/unittests/test_helpers.py index c837f06c3..137539113 100644 --- a/tests/core/pyspec/eth2spec/test/altair/unittests/test_helpers.py +++ b/tests/core/pyspec/eth2spec/test/altair/unittests/test_helpers.py @@ -9,9 +9,6 @@ from eth2spec.test.helpers.merkle import build_proof @with_phases([ALTAIR]) @spec_state_test def test_next_sync_committee_tree(spec, state): - state.next_sync_committee: object = spec.SyncCommittee( - pubkeys=[state.validators[i]for i in range(spec.SYNC_COMMITTEE_SIZE)] - ) next_sync_committee_branch = build_proof(state.get_backing(), spec.NEXT_SYNC_COMMITTEE_INDEX) assert spec.is_valid_merkle_branch( leaf=state.next_sync_committee.hash_tree_root(),