Skip to content

Commit

Permalink
check propsoer head == head root
Browse files Browse the repository at this point in the history
  • Loading branch information
eserilev committed Mar 25, 2024
1 parent 08b46f2 commit 6ec394e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def test_basic_is_head_root(spec, state):

yield 'steps', test_steps


@with_altair_and_later
@spec_state_test
def test_head_weak_parent_weak(spec, state):
Expand All @@ -83,7 +84,7 @@ def test_head_weak_parent_weak(spec, state):
for _ in range(3):
state, store, _ = yield from apply_next_epoch_with_attestations(
spec, state, store, True, True, test_steps=test_steps)

assert spec.compute_epoch_at_slot(spec.get_current_slot(store)) == 4
assert state.current_justified_checkpoint.epoch == store.justified_checkpoint.epoch == 3
assert state.finalized_checkpoint.epoch == store.finalized_checkpoint.epoch == 2
Expand Down Expand Up @@ -146,6 +147,7 @@ def test_head_weak_parent_weak(spec, state):

proposer_head = spec.get_proposer_head(store, head_root, state.slot)
assert proposer_head != parent_root
assert proposer_head == head_root

output_store_checks(spec, store, test_steps)
test_steps.append({
Expand All @@ -156,6 +158,7 @@ def test_head_weak_parent_weak(spec, state):

yield 'steps', test_steps


@with_altair_and_later
@spec_state_test
def test_basic_is_parent_root(spec, state):
Expand Down Expand Up @@ -231,7 +234,7 @@ def test_basic_is_parent_root(spec, state):
# The conditions in `get_proposer_head`
assert spec.is_head_late(store, head_root)
assert spec.is_shuffling_stable(slot)
assert spec.is_ffg_competitive(store, head_root, parent_root)
assert spec.is_shuffling_stable(store, head_root, parent_root)
assert spec.is_finalization_ok(store, slot)
assert spec.is_proposing_on_time(store)

Expand Down

0 comments on commit 6ec394e

Please sign in to comment.