Revert "core/state/pruner: track number of skipped items during state pruning (#28368)"

This reverts commit 225b77fe49.
This commit is contained in:
devopsbo3 2023-11-10 12:27:53 -06:00 committed by GitHub
parent 8314e9d740
commit 190c6c8923

View file

@ -125,12 +125,12 @@ func prune(snaptree *snapshot.Tree, root common.Hash, maindb ethdb.Database, sta
// dangling node is the state root is super low. So the dangling nodes in // dangling node is the state root is super low. So the dangling nodes in
// theory will never ever be visited again. // theory will never ever be visited again.
var ( var (
skipped, count int count int
size common.StorageSize size common.StorageSize
pstart = time.Now() pstart = time.Now()
logged = time.Now() logged = time.Now()
batch = maindb.NewBatch() batch = maindb.NewBatch()
iter = maindb.NewIterator(nil, nil) iter = maindb.NewIterator(nil, nil)
) )
for iter.Next() { for iter.Next() {
key := iter.Key() key := iter.Key()
@ -149,7 +149,6 @@ func prune(snaptree *snapshot.Tree, root common.Hash, maindb ethdb.Database, sta
log.Debug("Forcibly delete the middle state roots", "hash", common.BytesToHash(checkKey)) log.Debug("Forcibly delete the middle state roots", "hash", common.BytesToHash(checkKey))
} else { } else {
if stateBloom.Contain(checkKey) { if stateBloom.Contain(checkKey) {
skipped += 1
continue continue
} }
} }
@ -166,7 +165,7 @@ func prune(snaptree *snapshot.Tree, root common.Hash, maindb ethdb.Database, sta
eta = time.Duration(left/speed) * time.Millisecond eta = time.Duration(left/speed) * time.Millisecond
} }
if time.Since(logged) > 8*time.Second { if time.Since(logged) > 8*time.Second {
log.Info("Pruning state data", "nodes", count, "skipped", skipped, "size", size, log.Info("Pruning state data", "nodes", count, "size", size,
"elapsed", common.PrettyDuration(time.Since(pstart)), "eta", common.PrettyDuration(eta)) "elapsed", common.PrettyDuration(time.Since(pstart)), "eta", common.PrettyDuration(eta))
logged = time.Now() logged = time.Now()
} }