This commit is contained in:
alex.sharov 2022-12-14 21:41:54 +07:00
parent 786610df3f
commit 62125a0dc1

View File

@ -392,6 +392,19 @@ func doRetireCommand(cliCtx *cli.Context) error {
return nil return nil
} }
log.Info("Prune state history")
for i := 0; i < 1024; i++ {
if err := db.Update(ctx, func(tx kv.RwTx) error {
agg.SetTx(tx)
if err = agg.Prune(ctx, ethconfig.HistoryV3AggregationStep); err != nil {
return err
}
return err
}); err != nil {
return err
}
}
log.Info("Work on state history snapshots") log.Info("Work on state history snapshots")
sem := semaphore.NewWeighted(int64(estimate.IndexSnapshot.Workers())) sem := semaphore.NewWeighted(int64(estimate.IndexSnapshot.Workers()))
if err = agg.BuildMissedIndices(ctx, sem); err != nil { if err = agg.BuildMissedIndices(ctx, sem); err != nil {