Skip to content

Commit 56f20f7

Browse files
committed
Specify proposing_on_time condition
1 parent 64c7231 commit 56f20f7

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

specs/bellatrix/fork-choice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def should_override_forkchoice_update(
129129
time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT
130130
current_time_ok = (head_block.slot == current_slot or
131131
(proposal_slot == current_slot and
132-
time_into_slot < SECONDS_PER_SLOT // INTERVALS_PER_SLOT))
132+
time_into_slot <= SECONDS_PER_SLOT // INTERVALS_PER_SLOT // 2))
133133
single_slot_reorg = parent_slot_ok and current_time_ok
134134

135135
# Shuffling stable.

specs/phase0/fork-choice.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,10 @@ def get_proposer_head(store: Store, head_root: Root, slot: Slot) -> Root:
308308
# Only re-org a single slot at most.
309309
single_slot_reorg = parent_block.slot + 1 == head_block.slot and head_block.slot + 1 == slot
310310

311+
# Only re-org if we are proposing on-time.
312+
time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT
313+
proposing_on_time = time_into_slot <= SECONDS_PER_SLOT // INTERVALS_PER_SLOT // 2
314+
311315
# Do not re-org on an epoch boundary where the proposer shuffling could change.
312316
shuffling_stable = slot % SLOTS_PER_EPOCH != 0
313317

@@ -326,8 +330,8 @@ def get_proposer_head(store: Store, head_root: Root, slot: Slot) -> Root:
326330
reorg_threshold = calculate_committee_fraction(justified_state, REORG_WEIGHT_THRESHOLD)
327331
head_weak = head_weight < reorg_threshold
328332

329-
if all([head_late, finalization_ok, single_slot_reorg, shuffling_stable, ffg_competitive,
330-
head_weak]):
333+
if all([head_late, finalization_ok, single_slot_reorg, proposing_on_time, shuffling_stable,
334+
ffg_competitive, head_weak]):
331335
# We can re-org the current head by building upon its parent block.
332336
return parent_root
333337
else:

0 commit comments

Comments
 (0)