Skip to content

Commit

Permalink
only mark post-finalized blocks invalid (#4072)
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec authored Sep 6, 2022
1 parent fb5d87f commit 776f092
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions beacon_chain/consensus_object_pools/blockchain_dag.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1515,14 +1515,14 @@ proc markBlockInvalid*(dag: ChainDAGRef, root: Eth2Digest) =
doAssert strictVerification notin dag.updateFlags
return

if root == dag.finalizedHead.blck.root:
if blck.slot <= dag.finalizedHead.slot:
# https://github.com/ethereum/consensus-specs/blob/v1.2.0-rc.3/sync/optimistic.md#re-orgs
# "If the justified checkpoint transitions from `NOT_VALIDATED` ->
# `INVALIDATED`, a consensus engine MAY choose to alert the user and force
# the application to exit."
#
# But be slightly less aggressive, and only check finalized.
warn "markBlockInvalid: finalized block invalidated"
warn "markBlockInvalid: attempted to mark finalized block invalidated"
doAssert strictVerification notin dag.updateFlags
return

Expand Down

0 comments on commit 776f092

Please sign in to comment.