Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions tests/consensus/lstar/fork_choice/test_equivocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,18 +259,18 @@ def test_same_slot_equivocating_attesters_count_once(
- one vote at slot 3 targets fork_b from V0, V1, V3, V4.
- V0 and V1 equivocate by voting on both forks at the same slot.
- the two votes tie on slot, so the larger attestation-data root wins.
- the fork_b vote carries the larger root.
- the fork_a vote carries the larger root.

When
----
- both votes arrive by gossip and are accepted.

Then
----
- V0 and V1 count once, toward fork_b.
- fork_b has effective weight 4 from V0, V1, V3, V4.
- fork_a has effective weight 1 from V2.
- head is fork_b.
- V0 and V1 count once, toward fork_a.
- fork_a has effective weight 3 from V0, V1, V2.
- fork_b has effective weight 2 from V3, V4.
- head is fork_a.
- no slot is justified by the below-threshold votes.
"""
fork_choice_test(
Expand Down Expand Up @@ -317,8 +317,8 @@ def test_same_slot_equivocating_attesters_count_once(
TickStep(
time=16,
checks=StoreChecks(
head_slot=Slot(3),
head_root_label="fork_b",
head_slot=Slot(2),
head_root_label="fork_a",
latest_justified_slot=Slot(0),
latest_finalized_slot=Slot(0),
latest_known_aggregated_target_slots=[Slot(2), Slot(3)],
Expand All @@ -327,13 +327,13 @@ def test_same_slot_equivocating_attesters_count_once(
validator=ValidatorIndex(0),
location="known",
attestation_slot=Slot(3),
target_slot=Slot(3),
target_slot=Slot(2),
),
AttestationCheck(
validator=ValidatorIndex(1),
location="known",
attestation_slot=Slot(3),
target_slot=Slot(3),
target_slot=Slot(2),
),
AttestationCheck(
validator=ValidatorIndex(2),
Expand Down Expand Up @@ -379,7 +379,7 @@ def test_equivocation_head_independent_of_arrival_order_a_then_b(
- V1 backs fork_a alone; V2 backs fork_b alone.
- without V0 the two forks tie one-to-one, so V0's vote decides the head.
- the two votes tie on slot, so the larger attestation-data root wins.
- the fork_a vote carries the larger root.
- the fork_b vote carries the larger root.

When
----
Expand All @@ -390,7 +390,7 @@ def test_equivocation_head_independent_of_arrival_order_a_then_b(
- V0 counts once, toward the larger-root fork.
- the larger-root fork has effective weight 2.
- the smaller-root fork has effective weight 1.
- head is fork_a.
- head is fork_b.
- no slot is justified by the below-threshold votes.
"""
fork_choice_test(
Expand Down Expand Up @@ -428,16 +428,16 @@ def test_equivocation_head_independent_of_arrival_order_a_then_b(
TickStep(
time=16,
checks=StoreChecks(
head_slot=Slot(2),
head_root_label="fork_a",
head_slot=Slot(3),
head_root_label="fork_b",
latest_justified_slot=Slot(0),
latest_finalized_slot=Slot(0),
attestation_checks=[
AttestationCheck(
validator=ValidatorIndex(0),
location="known",
attestation_slot=Slot(3),
target_slot=Slot(2),
target_slot=Slot(3),
),
],
),
Expand Down Expand Up @@ -465,7 +465,7 @@ def test_equivocation_head_independent_of_arrival_order_b_then_a(
- V1 backs fork_a alone; V2 backs fork_b alone.
- without V0 the two forks tie one-to-one, so V0's vote decides the head.
- the two votes tie on slot, so the larger attestation-data root wins.
- the fork_a vote carries the larger root.
- the fork_b vote carries the larger root.

When
----
Expand All @@ -476,7 +476,7 @@ def test_equivocation_head_independent_of_arrival_order_b_then_a(
- V0 counts once, toward the larger-root fork.
- the larger-root fork has effective weight 2.
- the smaller-root fork has effective weight 1.
- head is fork_a, matching the opposite arrival order.
- head is fork_b, matching the opposite arrival order.
- no slot is justified by the below-threshold votes.
"""
fork_choice_test(
Expand Down Expand Up @@ -514,16 +514,16 @@ def test_equivocation_head_independent_of_arrival_order_b_then_a(
TickStep(
time=16,
checks=StoreChecks(
head_slot=Slot(2),
head_root_label="fork_a",
head_slot=Slot(3),
head_root_label="fork_b",
latest_justified_slot=Slot(0),
latest_finalized_slot=Slot(0),
attestation_checks=[
AttestationCheck(
validator=ValidatorIndex(0),
location="known",
attestation_slot=Slot(3),
target_slot=Slot(2),
target_slot=Slot(3),
),
],
),
Expand Down
Loading