diff --git a/beacon-chain/blockchain/error.go b/beacon-chain/blockchain/error.go index 87ed0d2416db..ad2c5e8bf339 100644 --- a/beacon-chain/blockchain/error.go +++ b/beacon-chain/blockchain/error.go @@ -13,8 +13,6 @@ var ( errNilFinalizedInStore = errors.New("nil finalized checkpoint returned from store") // errNilFinalizedCheckpoint is returned when a nil finalized checkpt is returned from a state. errNilFinalizedCheckpoint = errors.New("nil finalized checkpoint returned from state") - // errNilJustifiedCheckpoint is returned when a nil justified checkpt is returned from a state. - errNilJustifiedCheckpoint = errors.New("nil justified checkpoint returned from state") // errBlockDoesNotExist is returned when a block does not exist for a particular state summary. errBlockDoesNotExist = errors.New("could not find block in DB") // errBlockNotFoundInCacheOrDB is returned when a block is not found in the cache or DB. diff --git a/beacon-chain/blockchain/service.go b/beacon-chain/blockchain/service.go index 09d0cce7906d..ca3a696e4a53 100644 --- a/beacon-chain/blockchain/service.go +++ b/beacon-chain/blockchain/service.go @@ -272,13 +272,6 @@ func (s *Service) StartFromSavedState(saved state.BeaconState) error { } spawnCountdownIfPreGenesis(s.ctx, s.genesisTime, s.cfg.BeaconDB) - justified, err := s.cfg.BeaconDB.JustifiedCheckpoint(s.ctx) - if err != nil { - return errors.Wrap(err, "could not get justified checkpoint") - } - if justified == nil { - return errNilJustifiedCheckpoint - } finalized, err := s.cfg.BeaconDB.FinalizedCheckpoint(s.ctx) if err != nil { return errors.Wrap(err, "could not get finalized checkpoint") @@ -290,8 +283,8 @@ func (s *Service) StartFromSavedState(saved state.BeaconState) error { fRoot := s.ensureRootNotZeros(bytesutil.ToBytes32(finalized.Root)) s.cfg.ForkChoiceStore.Lock() defer s.cfg.ForkChoiceStore.Unlock() - if err := s.cfg.ForkChoiceStore.UpdateJustifiedCheckpoint(s.ctx, &forkchoicetypes.Checkpoint{Epoch: justified.Epoch, - Root: bytesutil.ToBytes32(justified.Root)}); err != nil { + if err := s.cfg.ForkChoiceStore.UpdateJustifiedCheckpoint(s.ctx, &forkchoicetypes.Checkpoint{Epoch: finalized.Epoch, + Root: bytesutil.ToBytes32(finalized.Root)}); err != nil { return errors.Wrap(err, "could not update forkchoice's justified checkpoint") } if err := s.cfg.ForkChoiceStore.UpdateFinalizedCheckpoint(&forkchoicetypes.Checkpoint{Epoch: finalized.Epoch,