From 8625704ddee7c059521d6bbc477fe64dc2050db2 Mon Sep 17 00:00:00 2001 From: tersec Date: Thu, 9 Mar 2023 16:19:36 +0000 Subject: [PATCH] don't clear validator change subpools after creating each block (#4704) * don't clear validator change subpools after creating each block * remove now-spurious tests of removed behavior --- beacon_chain/consensus_object_pools/exit_pool.nim | 2 -- tests/test_exit_pool.nim | 9 --------- 2 files changed, 11 deletions(-) diff --git a/beacon_chain/consensus_object_pools/exit_pool.nim b/beacon_chain/consensus_object_pools/exit_pool.nim index e42489c3c..cfa3a3b67 100644 --- a/beacon_chain/consensus_object_pools/exit_pool.nim +++ b/beacon_chain/consensus_object_pools/exit_pool.nim @@ -228,8 +228,6 @@ proc getValidatorChangeMessagesForBlock( if not output.add validator_change_message: break - subpool.clear() - proc getBeaconBlockValidatorChanges*( pool: var ValidatorChangePool, cfg: RuntimeConfig, state: ForkyBeaconState): BeaconBlockValidatorChanges = diff --git a/tests/test_exit_pool.nim b/tests/test_exit_pool.nim index d5f5d549b..d81d02f62 100644 --- a/tests/test_exit_pool.nim +++ b/tests/test_exit_pool.nim @@ -91,8 +91,6 @@ suite "Validator change pool testing suite": pool[].getBeaconBlockValidatorChanges( cfg, forkyState.data).proposer_slashings.lenu64 == min(i + 1, MAX_PROPOSER_SLASHINGS) - pool[].getBeaconBlockValidatorChanges( - cfg, forkyState.data).proposer_slashings.len == 0 test "addValidatorChangeMessage/getAttesterSlashingMessage": for i in 0'u64 .. MAX_ATTESTER_SLASHINGS + 5: @@ -114,8 +112,6 @@ suite "Validator change pool testing suite": pool[].getBeaconBlockValidatorChanges( cfg, forkyState.data).attester_slashings.lenu64 == min(i + 1, MAX_ATTESTER_SLASHINGS) - pool[].getBeaconBlockValidatorChanges( - cfg, forkyState.data).attester_slashings.len == 0 test "addValidatorChangeMessage/getVoluntaryExitMessage": # Need to advance state or it will not accept voluntary exits @@ -144,8 +140,6 @@ suite "Validator change pool testing suite": pool[].getBeaconBlockValidatorChanges( cfg, forkyState.data).voluntary_exits.lenu64 == min(i + 1, MAX_VOLUNTARY_EXITS) - pool[].getBeaconBlockValidatorChanges( - cfg, forkyState.data).voluntary_exits.len == 0 test "addValidatorChangeMessage/getBlsToExecutionChange (pre-capella)": # Need to advance state or it will not accept voluntary exits @@ -217,9 +211,6 @@ suite "Validator change pool testing suite": # Ensure priority of API to gossip messages is observed allIt(priorityMessages, pool[].isSeen(it)) - pool[].getBeaconBlockValidatorChanges( - cfg, forkyState.data).bls_to_execution_changes.len == 0 - test "pre-pre-fork voluntary exit": var cache: StateCache