diff --git a/specs/bellatrix/fork-choice.md b/specs/bellatrix/fork-choice.md index f63a0035ca..a1b2ab0a7b 100644 --- a/specs/bellatrix/fork-choice.md +++ b/specs/bellatrix/fork-choice.md @@ -129,7 +129,7 @@ def should_override_forkchoice_update( time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT current_time_ok = (head_block.slot == current_slot or (proposal_slot == current_slot and - time_into_slot < SECONDS_PER_SLOT // INTERVALS_PER_SLOT)) + time_into_slot <= SECONDS_PER_SLOT // INTERVALS_PER_SLOT // 2)) single_slot_reorg = parent_slot_ok and current_time_ok # Shuffling stable. diff --git a/specs/phase0/fork-choice.md b/specs/phase0/fork-choice.md index 8e58c3fc4b..27b2b80c71 100644 --- a/specs/phase0/fork-choice.md +++ b/specs/phase0/fork-choice.md @@ -308,6 +308,10 @@ def get_proposer_head(store: Store, head_root: Root, slot: Slot) -> Root: # Only re-org a single slot at most. single_slot_reorg = parent_block.slot + 1 == head_block.slot and head_block.slot + 1 == slot + # Only re-org if we are proposing on-time. + time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT + proposing_on_time = time_into_slot <= SECONDS_PER_SLOT // INTERVALS_PER_SLOT // 2 + # Do not re-org on an epoch boundary where the proposer shuffling could change. shuffling_stable = slot % SLOTS_PER_EPOCH != 0 @@ -326,8 +330,8 @@ def get_proposer_head(store: Store, head_root: Root, slot: Slot) -> Root: reorg_threshold = calculate_committee_fraction(justified_state, REORG_WEIGHT_THRESHOLD) head_weak = head_weight < reorg_threshold - if all([head_late, finalization_ok, single_slot_reorg, shuffling_stable, ffg_competitive, - head_weak]): + if all([head_late, finalization_ok, single_slot_reorg, proposing_on_time, shuffling_stable, + ffg_competitive, head_weak]): # We can re-org the current head by building upon its parent block. return parent_root else: