Skip to content

Commit 623d45a

Browse files
committed
enable preimage for hash only
Signed-off-by: Delweng <[email protected]>
1 parent db92f7c commit 623d45a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmd/utils/flags.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,9 +1634,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
16341634
}
16351635
// Read the value from the flag no matter if it's set or not.
16361636
cfg.Preimages = ctx.Bool(CachePreimagesFlag.Name)
1637-
if cfg.NoPruning && !cfg.Preimages {
1637+
// Only check the user's input for hash mode here; path is the default scheme,
1638+
// so we don't need to check the actual database scheme.
1639+
if cfg.NoPruning && !cfg.Preimages && ctx.String(StateSchemeFlag.Name) == rawdb.HashScheme {
16381640
cfg.Preimages = true
1639-
log.Info("Enabling recording of key preimages since archive mode is used")
1641+
log.Info("Enabling recording of key preimages: required for archive mode with hash state scheme")
16401642
}
16411643
if ctx.IsSet(StateHistoryFlag.Name) {
16421644
cfg.StateHistory = ctx.Uint64(StateHistoryFlag.Name)

0 commit comments

Comments
 (0)