diff --git a/specs/phase0/fork-choice.md b/specs/phase0/fork-choice.md index 64d48d4b5..39d9bd402 100644 --- a/specs/phase0/fork-choice.md +++ b/specs/phase0/fork-choice.md @@ -279,9 +279,13 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None: assert get_current_slot(store) >= block.slot # Add new block to the store store.blocks[hash_tree_root(block)] = block - # Check block is a descendant of the finalized block + + # Check that block is later than the finalized epoch slot (optimization to reduce calls to get_ancestor) finalized_slot = compute_start_slot_at_epoch(store.finalized_checkpoint.epoch) + assert block.slot > finalized_slot + # Check block is a descendant of the finalized block assert get_ancestor(store, hash_tree_root(block), finalized_slot) == store.finalized_checkpoint.root + # Check the block is valid and compute the post-state state = state_transition(pre_state, signed_block, True) # Add new state for this block to the store