From b082140312aad8248ffb7dafe1bf9c5d0c66c221 Mon Sep 17 00:00:00 2001 From: Potuz Date: Wed, 24 Jul 2024 16:02:53 -0300 Subject: [PATCH] Revert "Remove block_timeliness from the store" The damned linter complains and there's no problem having it This reverts commit b7461ac174b56244a34e654f2083f35da3b4e29d. --- specs/_features/eip7732/fork-choice.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specs/_features/eip7732/fork-choice.md b/specs/_features/eip7732/fork-choice.md index 19c9b88dd..0eb49ddfc 100644 --- a/specs/_features/eip7732/fork-choice.md +++ b/specs/_features/eip7732/fork-choice.md @@ -106,7 +106,7 @@ class Store(object): equivocating_indices: Set[ValidatorIndex] blocks: Dict[Root, BeaconBlock] = field(default_factory=dict) block_states: Dict[Root, BeaconState] = field(default_factory=dict) - # block_timeliness removed in EIP-7732 + block_timeliness: Dict[Root, boolean] = field(default_factory=dict) checkpoint_states: Dict[Checkpoint, BeaconState] = field(default_factory=dict) latest_messages: Dict[ValidatorIndex, LatestMessage] = field(default_factory=dict) unrealized_justifications: Dict[Root, Checkpoint] = field(default_factory=dict) @@ -431,6 +431,7 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None: time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT is_before_attesting_interval = time_into_slot < SECONDS_PER_SLOT // INTERVALS_PER_SLOT is_timely = get_current_slot(store) == block.slot and is_before_attesting_interval + store.block_timeliness[hash_tree_root(block)] = is_timely # Add proposer score boost if the block is timely and not conflicting with an existing block is_first_block = store.proposer_boost_root == Root()