triedb/pathdb: improve log

This commit is contained in:
Gary Rong 2026-03-13 13:25:10 +08:00
parent bcce50b037
commit 00acc891ca

View file

@ -148,23 +148,20 @@ func (p *indexPruner) process(tail uint64) error {
} }
pruned += pn pruned += pn
scanned += sn scanned += sn
statePruneHistoryIndexTimer.UpdateSince(start)
case typeTrienodeHistory: case typeTrienodeHistory:
pruned, scanned, err = p.prunePrefix(rawdb.TrienodeHistoryMetadataPrefix, typeTrienode, tail) pruned, scanned, err = p.prunePrefix(rawdb.TrienodeHistoryMetadataPrefix, typeTrienode, tail)
if err != nil { if err != nil {
return err return err
} }
trienodePruneHistoryIndexTimer.UpdateSince(start)
default: default:
panic("unknown history type") panic("unknown history type")
} }
if pruned > 0 { if pruned > 0 {
p.log.Debug("Pruned stale index blocks", "pruned", pruned, "scanned", scanned, "tail", tail, "elapsed", common.PrettyDuration(time.Since(start))) p.log.Info("Pruned stale index blocks", "pruned", pruned, "scanned", scanned, "tail", tail, "elapsed", common.PrettyDuration(time.Since(start)))
}
if p.typ == typeStateHistory {
statePruneHistoryIndexTimer.UpdateSince(start)
} else {
trienodePruneHistoryIndexTimer.UpdateSince(start)
} }
return nil return nil
} }