Revert "cmd: no need to indexing the whole blocks in pbss archive"

This reverts commit 6af5201747.

Signed-off-by: Delweng <delweng@gmail.com>
This commit is contained in:
Delweng 2025-06-27 16:03:00 +08:00
parent 97794855b4
commit 3f3ac943ac

View file

@ -1656,18 +1656,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
log.Warn("The flag --txlookuplimit is deprecated and will be removed, please use --history.transactions") log.Warn("The flag --txlookuplimit is deprecated and will be removed, please use --history.transactions")
cfg.TransactionHistory = ctx.Uint64(TxLookupLimitFlag.Name) cfg.TransactionHistory = ctx.Uint64(TxLookupLimitFlag.Name)
} }
if ctx.String(GCModeFlag.Name) == "archive" {
if ctx.String(GCModeFlag.Name) == "archive" && cfg.TransactionHistory != 0 && ctx.IsSet(DataDirFlag.Name) { if cfg.TransactionHistory != 0 {
chaindb := tryMakeReadOnlyDatabase(ctx, stack)
scheme, err := rawdb.ParseStateScheme(cfg.StateScheme, chaindb)
if err != nil {
Fatalf("%v", err)
}
if scheme == rawdb.HashScheme {
cfg.TransactionHistory = 0 cfg.TransactionHistory = 0
log.Warn("Disabled transaction unindexing for archive node with hash state scheme") log.Warn("Disabled transaction unindexing for archive node")
} }
chaindb.Close()
} }
if ctx.IsSet(LogHistoryFlag.Name) { if ctx.IsSet(LogHistoryFlag.Name) {
cfg.LogHistory = ctx.Uint64(LogHistoryFlag.Name) cfg.LogHistory = ctx.Uint64(LogHistoryFlag.Name)