mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 00:27:38 +00:00
f3b49d4eaf
* Revert "Modify the algorithm of `updateFinalizedBlockRoots` (#13486)"
This reverts commit 32fb183392
.
* migration to fix index corruption from pr 13486
* bail as soon as we see 10 epochs without the bug
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com>
29 lines
501 B
Go
29 lines
501 B
Go
package kv
|
|
|
|
import (
|
|
"context"
|
|
|
|
bolt "go.etcd.io/bbolt"
|
|
)
|
|
|
|
var migrationCompleted = []byte("done")
|
|
|
|
type migration func(context.Context, *bolt.DB) error
|
|
|
|
var migrations = []migration{
|
|
migrateArchivedIndex,
|
|
migrateBlockSlotIndex,
|
|
migrateStateValidators,
|
|
migrateFinalizedParent,
|
|
}
|
|
|
|
// RunMigrations defined in the migrations array.
|
|
func (s *Store) RunMigrations(ctx context.Context) error {
|
|
for _, m := range migrations {
|
|
if err := m(ctx, s.db); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|