Skip to content

fix(test): avoid duplicate slot in test_head_switches_to_heavier_fork#474

Open
latifkasuli wants to merge 1 commit intoleanEthereum:mainfrom
latifkasuli:fix/470-heavier-fork-unique-slots
Open

fix(test): avoid duplicate slot in test_head_switches_to_heavier_fork#474
latifkasuli wants to merge 1 commit intoleanEthereum:mainfrom
latifkasuli:fix/470-heavier-fork-unique-slots

Conversation

@latifkasuli
Copy link
Contributor

Summary

Fixes another test case identified in #470 (Avoid multiple-blocks-same-slot in all test cases).

  • test_head_switches_to_heavier_fork created fork_a and fork_b at the same slot (2), violating the one-block-per-slot constraint.
  • Moved fork_b from slot 2 to slot 3, and its child block from slot 3 to slot 4, so each block occupies a unique slot.
  • Updated the attestation reference to target fork_b at its new slot (3).
  • The test still validates the same LMD-GHOST property: extending a fork with a child block and attestation makes it heavier and switches the head.

Test plan

  • uv run fill tests/consensus/devnet/fc/test_fork_choice_head.py --fork=Devnet -v -- all 6 tests pass

Addresses #470

Move fork_b from slot 2 to slot 3, and its child from slot 3 to slot 4,
so each block occupies a unique slot.

The test still validates the core LMD-GHOST property: extending a fork
with a child block (plus attestation) makes it heavier and switches the head.

Addresses leanEthereum#470
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant