cmd/geth: truncate BAL freezer when pruning history

pruneHistory already truncates block data from the freezer but left
block access lists behind. Also truncate ChainFreezerBALTable so
ancient BAL data stays consistent with the pruned history tail.
This commit is contained in:
Weixie Cui 2026-07-11 14:50:29 +08:00
parent 3ab52d837d
commit 7fef656138

View file

@ -782,6 +782,9 @@ func pruneHistory(ctx *cli.Context) error {
if _, err := chaindb.TruncateTail(rawdb.ChainFreezerBlockDataGroup, targetBlock); err != nil {
return fmt.Errorf("failed to truncate ancient data: %v", err)
}
if _, err := chaindb.TruncateTail(rawdb.ChainFreezerBALTable, targetBlock); err != nil {
return fmt.Errorf("failed to truncate ancient BAL data: %v", err)
}
log.Info("History pruning completed", "tail", targetBlock, "elapsed", common.PrettyDuration(time.Since(start)))
// TODO(s1na): what if there is a crash between the two prune operations?