diff --git a/beacon-chain/state/stategen/migrate.go b/beacon-chain/state/stategen/migrate.go index 177b3633a..e70325f64 100644 --- a/beacon-chain/state/stategen/migrate.go +++ b/beacon-chain/state/stategen/migrate.go @@ -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 diff --git a/beacon-chain/state/stategen/replay.go b/beacon-chain/state/stategen/replay.go index 07948a3a8..2c0ee230d 100644 --- a/beacon-chain/state/stategen/replay.go +++ b/beacon-chain/state/stategen/replay.go @@ -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.