mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 11:20:45 +00:00
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:
parent
3ab52d837d
commit
7fef656138
1 changed files with 3 additions and 0 deletions
|
|
@ -782,6 +782,9 @@ func pruneHistory(ctx *cli.Context) error {
|
||||||
if _, err := chaindb.TruncateTail(rawdb.ChainFreezerBlockDataGroup, targetBlock); err != nil {
|
if _, err := chaindb.TruncateTail(rawdb.ChainFreezerBlockDataGroup, targetBlock); err != nil {
|
||||||
return fmt.Errorf("failed to truncate ancient data: %v", err)
|
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)))
|
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?
|
// TODO(s1na): what if there is a crash between the two prune operations?
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue