diff --git a/beacon-chain/blockchain/process_block_helpers.go b/beacon-chain/blockchain/process_block_helpers.go index 1a9d40f93..e43de946d 100644 --- a/beacon-chain/blockchain/process_block_helpers.go +++ b/beacon-chain/blockchain/process_block_helpers.go @@ -201,6 +201,13 @@ func (s *Service) updateJustified(ctx context.Context, state *stateTrie.BeaconSt } func (s *Service) updateFinalized(ctx context.Context, cp *ethpb.Checkpoint) error { + // Blocks need to be saved so that we can retrieve finalized block from + // DB when migrating states. + if err := s.beaconDB.SaveBlocks(ctx, s.getInitSyncBlocks()); err != nil { + return err + } + s.clearInitSyncBlocks() + s.prevFinalizedCheckpt = s.finalizedCheckpt s.finalizedCheckpt = cp