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

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2025-06-27 02:00:31 +00:00
parent 668c3a7278
commit 6af5201747

View file

@ -1656,11 +1656,18 @@ 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 cfg.TransactionHistory != 0 { if ctx.String(GCModeFlag.Name) == "archive" && cfg.TransactionHistory != 0 && ctx.IsSet(DataDirFlag.Name) {
cfg.TransactionHistory = 0 chaindb := tryMakeReadOnlyDatabase(ctx, stack)
log.Warn("Disabled transaction unindexing for archive node") scheme, err := rawdb.ParseStateScheme(cfg.StateScheme, chaindb)
if err != nil {
Fatalf("%v", err)
} }
if scheme == rawdb.HashScheme {
cfg.TransactionHistory = 0
log.Warn("Disabled transaction unindexing for archive node with hash state scheme")
}
chaindb.Close()
} }
if ctx.IsSet(LogHistoryFlag.Name) { if ctx.IsSet(LogHistoryFlag.Name) {
cfg.LogHistory = ctx.Uint64(LogHistoryFlag.Name) cfg.LogHistory = ctx.Uint64(LogHistoryFlag.Name)