From 84bc8f3d64fb00e9fb3f549f40652a9d9b66f2ca Mon Sep 17 00:00:00 2001 From: Potuz Date: Thu, 1 Sep 2022 11:40:32 -0300 Subject: [PATCH] Fix fillInMissingBlocks (#11353) * Fix fillInMissingBlocks Only check that the chain's parent is in forkchoice, rather than it being the finalized checkpoint. Forkchoice anyway guarantees that the chain will be a descendant of the finalized checkpoint. * ensure root is not zero * fix tests Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com> --- beacon-chain/blockchain/process_block_helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beacon-chain/blockchain/process_block_helpers.go b/beacon-chain/blockchain/process_block_helpers.go index 28cc53014b..fb1d935d12 100644 --- a/beacon-chain/blockchain/process_block_helpers.go +++ b/beacon-chain/blockchain/process_block_helpers.go @@ -277,7 +277,7 @@ func (s *Service) fillInForkChoiceMissingBlocks(ctx context.Context, blk interfa if len(pendingNodes) == 1 { return nil } - if root != s.ensureRootNotZeros(finalized.Root) { + if root != s.ensureRootNotZeros(finalized.Root) && !s.ForkChoicer().HasNode(root) { return errNotDescendantOfFinalized } return s.cfg.ForkChoiceStore.InsertOptimisticChain(ctx, pendingNodes)