Apply suggestions from code review

Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
This commit is contained in:
Aditya Asgaonkar 2021-11-22 08:38:08 -08:00 committed by Danny Ryan
parent b0fb861cf5
commit 3b20e3ea02
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
2 changed files with 3 additions and 3 deletions

View File

@ -176,8 +176,8 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
store.block_states[hash_tree_root(block)] = state
# Add proposer score boost if the block is timely
if (get_current_slot(store) == block.slot and
store.time % SECONDS_PER_SLOT < SECONDS_PER_SLOT // ATTESTATION_OFFSET_QUOTIENT):
is_before_attestation_broadcast = store.time % SECONDS_PER_SLOT < SECONDS_PER_SLOT // ATTESTATION_OFFSET_QUOTIENT
if get_current_slot(store) == block.slot and is_before_attestation_broadcast:
store.proposer_score_boost = LatestMessage(
root=hash_tree_root(block),
epoch=compute_epoch_at_slot(block.slot)

View File

@ -114,7 +114,7 @@ def get_forkchoice_store(anchor_state: BeaconState, anchor_block: BeaconBlock) -
anchor_epoch = get_current_epoch(anchor_state)
justified_checkpoint = Checkpoint(epoch=anchor_epoch, root=anchor_root)
finalized_checkpoint = Checkpoint(epoch=anchor_epoch, root=anchor_root)
proposer_score_boost = LatestMessage(root=Root(), epoch=Epoch(0))
proposer_score_boost = LatestMessage(root=Root(), epoch=Epoch())
return Store(
time=uint64(anchor_state.genesis_time + SECONDS_PER_SLOT * anchor_state.slot),
genesis_time=anchor_state.genesis_time,