From bde91ac3f323f6a7cafbf8d0ea9cff23692fbea1 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Fri, 15 Sep 2023 16:38:42 +0800 Subject: [PATCH] Fix `test_proposer_boost_root_same_slot_untimely_block` --- .../test/phase0/fork_choice/test_on_block.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_on_block.py b/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_on_block.py index cd4135049..b9bd03a4a 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_on_block.py +++ b/tests/core/pyspec/eth2spec/test/phase0/fork_choice/test_on_block.py @@ -28,6 +28,9 @@ from eth2spec.test.helpers.fork_choice import ( is_ready_to_justify, find_next_justifying_slot, ) +from eth2spec.test.helpers.forks import ( + is_post_deneb, +) from eth2spec.test.helpers.state import ( next_epoch, next_slots, @@ -523,8 +526,13 @@ def test_proposer_boost_root_same_slot_untimely_block(spec, state): signed_block = state_transition_and_sign_block(spec, state, block) # Process block on untimely arrival in the same slot - time = (store.genesis_time + block.slot * spec.config.SECONDS_PER_SLOT + - spec.config.SECONDS_PER_SLOT // spec.INTERVALS_PER_SLOT) + if not is_post_deneb(spec): + time = (store.genesis_time + block. slot * spec.config.SECONDS_PER_SLOT + + spec.config.SECONDS_PER_SLOT // spec.INTERVALS_PER_SLOT) + else: + time = (store.genesis_time + block.slot * spec.config.SECONDS_PER_SLOT + + spec.config.LATE_BLOCK_CUTOFF_MS // 1000) + on_tick_and_append_step(spec, store, time, test_steps) yield from add_block(spec, store, signed_block, test_steps)