diff --git a/erigon-lib/state/domain.go b/erigon-lib/state/domain.go index ada40acbb02..b64a99e0051 100644 --- a/erigon-lib/state/domain.go +++ b/erigon-lib/state/domain.go @@ -1962,7 +1962,6 @@ func (dt *DomainRoTx) Prune(ctx context.Context, rwTx kv.RwTx, step, txFrom, txT stat.Values++ stat.MaxStep = max(stat.MaxStep, is) stat.MinStep = min(stat.MinStep, is) - mxPruneSizeDomain.Inc() k, v, err = keysCursor.Prev() @@ -1977,6 +1976,8 @@ func (dt *DomainRoTx) Prune(ctx context.Context, rwTx kv.RwTx, step, txFrom, txT default: } } + mxPruneSizeDomain.AddUint64(stat.Values) + if err := SaveExecV3PruneProgress(rwTx, dt.d.keysTable, nil); err != nil { return stat, fmt.Errorf("save domain pruning progress: %s, %w", dt.d.filenameBase, err) } diff --git a/erigon-lib/state/history.go b/erigon-lib/state/history.go index 638b72ed1ac..603f293d4c0 100644 --- a/erigon-lib/state/history.go +++ b/erigon-lib/state/history.go @@ -1066,6 +1066,7 @@ func (ht *HistoryRoTx) Prune(ctx context.Context, rwTx kv.RwTx, txFrom, txTo, li defer valsC.Close() } + var pruned int pruneValue := func(k, txnm []byte) error { txNum := binary.BigEndian.Uint64(txnm) if txNum >= txTo || txNum < txFrom { //[txFrom; txTo), but in this case idx record @@ -1090,9 +1091,10 @@ func (ht *HistoryRoTx) Prune(ctx context.Context, rwTx kv.RwTx, txFrom, txTo, li } } - mxPruneSizeHistory.Inc() + pruned++ return nil } + mxPruneSizeHistory.AddInt(pruned) if !forced && ht.h.dontProduceHistoryFiles { forced = true // or index.CanPrune will return false cuz no snapshots made