From 282d85b9e7ea3148c7bae80a11c375d3e7497ecd Mon Sep 17 00:00:00 2001 From: Danny Ryan Date: Mon, 22 Nov 2021 11:31:44 -0700 Subject: [PATCH] simplify on_tick proposer boost update --- specs/phase0/fork-choice.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/specs/phase0/fork-choice.md b/specs/phase0/fork-choice.md index 7a87d0070..420ae5722 100644 --- a/specs/phase0/fork-choice.md +++ b/specs/phase0/fork-choice.md @@ -369,10 +369,11 @@ def on_tick(store: Store, time: uint64) -> None: store.time = time current_slot = get_current_slot(store) + # Reset store.proposer_score_boost if this is a new slot - if store.proposer_score_boost.root != Root(): - if current_slot != store.blocks[store.proposer_score_boost.root].slot: - store.proposer_score_boost = LatestMessage(root=Root(), epoch=Epoch(0)) + if current_slot > previous_slot: + store.proposer_score_boost = LatestMessage(root=Root(), epoch=Epoch(0)) + # Not a new epoch, return if not (current_slot > previous_slot and compute_slots_since_epoch_start(current_slot) == 0): return