Fix stale beacon_state_root in test helpers (#9289)

Test helpers `add_attested_block_at_slot` and `add_attested_blocks_at_slot` accepted `state_root` argument which was computed before applying the block.


  


Co-Authored-By: hopinheimer <knmanas6@gmail.com>
This commit is contained in:
hopinheimer
2026-05-12 02:24:18 -04:00
committed by GitHub
parent f968c7e5bb
commit 757873200b
13 changed files with 118 additions and 226 deletions

View File

@@ -46,8 +46,7 @@ async fn missed_blocks_across_epochs() {
let harness = get_harness(VALIDATOR_COUNT, vec![]);
let validator_monitor = &harness.chain.validator_monitor;
let mut genesis_state = harness.get_current_state();
let genesis_state_root = genesis_state.update_tree_hash_cache().unwrap();
let genesis_state = harness.get_current_state();
let genesis_block_root = harness.head_block_root();
// Skip a slot in the first epoch (to prime the cache inside the missed block function) and then
@@ -64,7 +63,7 @@ async fn missed_blocks_across_epochs() {
.collect::<Vec<_>>();
let (block_roots_by_slot, state_roots_by_slot, _, head_state) = harness
.add_attested_blocks_at_slots(genesis_state, genesis_state_root, &slots, &all_validators)
.add_attested_blocks_at_slots(genesis_state, &slots, &all_validators)
.await;
// Prime the proposer shuffling cache.