Apply suggestions from code review
Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
This commit is contained in:
parent
b0fb861cf5
commit
3b20e3ea02
|
@ -176,8 +176,8 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
|
||||||
store.block_states[hash_tree_root(block)] = state
|
store.block_states[hash_tree_root(block)] = state
|
||||||
|
|
||||||
# Add proposer score boost if the block is timely
|
# Add proposer score boost if the block is timely
|
||||||
if (get_current_slot(store) == block.slot and
|
is_before_attestation_broadcast = store.time % SECONDS_PER_SLOT < SECONDS_PER_SLOT // ATTESTATION_OFFSET_QUOTIENT
|
||||||
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(
|
store.proposer_score_boost = LatestMessage(
|
||||||
root=hash_tree_root(block),
|
root=hash_tree_root(block),
|
||||||
epoch=compute_epoch_at_slot(block.slot)
|
epoch=compute_epoch_at_slot(block.slot)
|
||||||
|
|
|
@ -114,7 +114,7 @@ def get_forkchoice_store(anchor_state: BeaconState, anchor_block: BeaconBlock) -
|
||||||
anchor_epoch = get_current_epoch(anchor_state)
|
anchor_epoch = get_current_epoch(anchor_state)
|
||||||
justified_checkpoint = Checkpoint(epoch=anchor_epoch, root=anchor_root)
|
justified_checkpoint = Checkpoint(epoch=anchor_epoch, root=anchor_root)
|
||||||
finalized_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(
|
return Store(
|
||||||
time=uint64(anchor_state.genesis_time + SECONDS_PER_SLOT * anchor_state.slot),
|
time=uint64(anchor_state.genesis_time + SECONDS_PER_SLOT * anchor_state.slot),
|
||||||
genesis_time=anchor_state.genesis_time,
|
genesis_time=anchor_state.genesis_time,
|
||||||
|
|
Loading…
Reference in New Issue