mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-23 11:57:18 +00:00
Migration should not fail process block routine (#5557)
* Continue rather than fail * Merge branch 'master' into migrate-should-not-fail-block * Merge refs/heads/master into migrate-should-not-fail-block
This commit is contained in:
parent
c69f561fb9
commit
199c50be47
@ -58,7 +58,11 @@ func (s *State) MigrateToCold(ctx context.Context, finalizedSlot uint64, finaliz
|
||||
if !s.beaconDB.HasState(ctx, r) {
|
||||
recoveredArchivedState, err := s.ComputeStateUpToSlot(ctx, stateSummary.Slot)
|
||||
if err != nil {
|
||||
return err
|
||||
// For whatever reason if node fails to generate archived state of a certain slot,
|
||||
// a node should just skip that slot rather than fail to whole process block routine.
|
||||
// Missing an archived point of a certain slot is less of a deal than failing process block.
|
||||
log.Warnf("Unable to generate archived state: %v", err)
|
||||
continue
|
||||
}
|
||||
if err := s.beaconDB.SaveState(ctx, recoveredArchivedState.Copy(), r); err != nil {
|
||||
return err
|
||||
|
@ -284,7 +284,7 @@ func (s *State) lastSavedState(ctx context.Context, slot uint64) (*state.BeaconS
|
||||
|
||||
lastSaved, err := s.beaconDB.HighestSlotStatesBelow(ctx, slot+1)
|
||||
if err != nil {
|
||||
return nil, errUnknownState
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Given this is used to query canonical state. There should only be one saved canonical block of a given slot.
|
||||
|
Loading…
Reference in New Issue
Block a user