Skip to content

Commit

Permalink
Revert "core/state/pruner: track number of skipped items during state…
Browse files Browse the repository at this point in the history
… pruning (ethereum#28368)"

This reverts commit 225b77f.
  • Loading branch information
devopsbo3 committed Nov 10, 2023
1 parent 8314e9d commit 190c6c8
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions core/state/pruner/pruner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
// theory will never ever be visited again.
var (
skipped, count int
size common.StorageSize
pstart = time.Now()
logged = time.Now()
batch = maindb.NewBatch()
iter = maindb.NewIterator(nil, nil)
count int
size common.StorageSize
pstart = time.Now()
logged = time.Now()
batch = maindb.NewBatch()
iter = maindb.NewIterator(nil, nil)
)
for iter.Next() {
key := iter.Key()
Expand All @@ -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))
} else {
if stateBloom.Contain(checkKey) {
skipped += 1
continue
}
}
Expand All @@ -166,7 +165,7 @@ func prune(snaptree *snapshot.Tree, root common.Hash, maindb ethdb.Database, sta
eta = time.Duration(left/speed) * time.Millisecond
}
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))
logged = time.Now()
}
Expand Down

0 comments on commit 190c6c8

Please sign in to comment.