Regen historical state: don't skip saving historical state (#5712)

* Save every state at archived point
* Merge branch 'master' into save-every-state
This commit is contained in:
terence tsao 2020-05-01 17:36:54 -07:00 committed by GitHub
parent 37f2a04e51
commit 973fa9f326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,7 +122,7 @@ func (kv *Store) regenHistoricalStates(ctx context.Context) error {
if len(blocks) > 0 {
// Save the historical root, state and highest index to the DB.
if helpers.IsEpochStart(currentState.Slot()) && currentState.Slot()%slotsPerArchivedPoint == 0 && blocks[len(blocks)-1].Block.Slot&slotsPerArchivedPoint == 0 {
if helpers.IsEpochStart(currentState.Slot()) && currentState.Slot()%slotsPerArchivedPoint == 0 {
if err := kv.saveArchivedInfo(ctx, currentState.Copy(), blocks, i); err != nil {
return err
}