mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-11 04:00:05 +00:00
Don't regen parent state for genesis state (#6237)
This commit is contained in:
parent
298955c92b
commit
c29cccf78e
@ -454,8 +454,10 @@ func (s *Service) initializeChainInfo(ctx context.Context) error {
|
|||||||
return errors.Wrap(err, "could not get finalized block from db")
|
return errors.Wrap(err, "could not get finalized block from db")
|
||||||
}
|
}
|
||||||
|
|
||||||
if featureconfig.Get().NewStateMgmt && featureconfig.Get().SkipRegenHistoricalStates {
|
// To skip the regeneration of historical state, the node has to generate the parent of the last finalized state.
|
||||||
// To skip the regeneration of historical state, the node has to generate the parent of the last finalized state.
|
// We don't need to do this for genesis.
|
||||||
|
atGenesis := s.CurrentSlot() == 0
|
||||||
|
if featureconfig.Get().NewStateMgmt && featureconfig.Get().SkipRegenHistoricalStates && !atGenesis {
|
||||||
parentRoot := bytesutil.ToBytes32(finalizedBlock.Block.ParentRoot)
|
parentRoot := bytesutil.ToBytes32(finalizedBlock.Block.ParentRoot)
|
||||||
parentState, err := s.generateState(ctx, finalizedRoot, parentRoot)
|
parentState, err := s.generateState(ctx, finalizedRoot, parentRoot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user