From b3e1c297c8e0ab2e62b3a5068576d94f0e0585ab Mon Sep 17 00:00:00 2001 From: zhiqiangxu <652732310@qq.com> Date: Mon, 21 Aug 2023 05:02:33 +0000 Subject: [PATCH] `ForkChoice`: remove an impossible case for `parent_checkpoints` (#4626) `parent_finalized.epoch + 1 > block_epoch` will never be `true` since as the comment says: ``` A block in epoch `N` cannot contain attestations which would finalize an epoch higher than `N - 1`. ``` --- consensus/fork_choice/src/fork_choice.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/fork_choice/src/fork_choice.rs b/consensus/fork_choice/src/fork_choice.rs index b3749ea9d8..ea3a58127b 100644 --- a/consensus/fork_choice/src/fork_choice.rs +++ b/consensus/fork_choice/src/fork_choice.rs @@ -750,7 +750,7 @@ where .unrealized_justified_checkpoint .zip(parent_block.unrealized_finalized_checkpoint) .filter(|(parent_justified, parent_finalized)| { - parent_justified.epoch == block_epoch && parent_finalized.epoch + 1 >= block_epoch + parent_justified.epoch == block_epoch && parent_finalized.epoch + 1 == block_epoch }); let (unrealized_justified_checkpoint, unrealized_finalized_checkpoint) = if let Some((