Skip to content

Commit

Permalink
Use fork choice for block import finalization
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhauner committed Jun 29, 2022
1 parent de0a2bb commit 24b4667
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion beacon_node/beacon_chain/src/block_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1401,9 +1401,13 @@ fn check_block_against_finalized_slot<T: BeaconChainTypes>(
block_root: Hash256,
chain: &BeaconChain<T>,
) -> Result<(), BlockError<T::EthSpec>> {
// The finalized checkpoint is being read from fork choice, rather than the cached head.
//
// Fork choice has the most up-to-date view of finalization and there's no point importing a
// block which conflicts with the fork-choice view of finalization.
let finalized_slot = chain
.canonical_head
.cached_head()
.fork_choice_read_lock()
.finalized_checkpoint()
.epoch
.start_slot(T::EthSpec::slots_per_epoch());
Expand Down

0 comments on commit 24b4667

Please sign in to comment.