From 62125a0dc16ea8d782dd6f4155aa75c46289eab1 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Wed, 14 Dec 2022 21:41:54 +0700 Subject: [PATCH] save --- turbo/app/snapshots.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/turbo/app/snapshots.go b/turbo/app/snapshots.go index 91d9736f4..88d6c99dc 100644 --- a/turbo/app/snapshots.go +++ b/turbo/app/snapshots.go @@ -392,6 +392,19 @@ func doRetireCommand(cliCtx *cli.Context) error { 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") sem := semaphore.NewWeighted(int64(estimate.IndexSnapshot.Workers())) if err = agg.BuildMissedIndices(ctx, sem); err != nil {