Skip to content

Commit

Permalink
Save finalized checkpoint before migrate to cold (#7055)
Browse files Browse the repository at this point in the history
* Save finalized checkpoint before migrate to cold
* Save finalized checkpoint before migrate to cold
* Merge branch 'master' into save-checkpoint-first
  • Loading branch information
prestonvanloon authored Aug 19, 2020
1 parent 3aa95b9 commit 395ea76
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions beacon-chain/blockchain/process_block_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ func (s *Service) updateFinalized(ctx context.Context, cp *ethpb.Checkpoint) err
return err
}
s.clearInitSyncBlocks()
s.attPool.ClearSeenAtts()

if err := s.beaconDB.SaveFinalizedCheckpoint(ctx, cp); err != nil {
return err
}

s.prevFinalizedCheckpt = s.finalizedCheckpt
s.finalizedCheckpt = cp
Expand All @@ -235,9 +240,7 @@ func (s *Service) updateFinalized(ctx context.Context, cp *ethpb.Checkpoint) err
return errors.Wrap(err, "could not migrate to cold")
}

s.attPool.ClearSeenAtts()

return s.beaconDB.SaveFinalizedCheckpoint(ctx, cp)
return nil
}

// ancestor returns the block root of an ancestry block from the input block root.
Expand Down

0 comments on commit 395ea76

Please sign in to comment.