Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration should not fail process block routine #5557

Merged
merged 3 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion beacon-chain/state/stategen/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/state/stategen/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down