verifyFinalization checks for justification being consistent with later finalization (#1386)

This commit is contained in:
tersec 2020-07-28 17:35:32 +00:00 committed by GitHub
parent 0ffcbd10e5
commit a07dab300c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -500,6 +500,9 @@ proc process_epoch*(state: var BeaconState, updateFlags: UpdateFlags,
process_justification_and_finalization(state, per_epoch_cache, updateFlags)
# state.slot hasn't been incremented yet.
if verifyFinalization in updateFlags and currentEpoch >= 2:
doAssert state.current_justified_checkpoint.epoch + 2 >= currentEpoch
if verifyFinalization in updateFlags and currentEpoch >= 3:
# Rule 2/3/4 finalization results in the most pessimal case. The other
# three finalization rules finalize more quickly as long as the any of