From 7fef656138eae3afd0c3a31c982a26fddd233b28 Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Sat, 11 Jul 2026 14:50:29 +0800 Subject: [PATCH] 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. --- cmd/geth/chaincmd.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 95b0ec274e..02d944ac86 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -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?