@@ -385,7 +385,7 @@ var (
385
385
}
386
386
CachePreimagesFlag = cli.BoolTFlag {
387
387
Name : "cache.preimages" ,
388
- Usage : "Enable recording the SHA3/keccak preimages of trie keys" ,
388
+ Usage : "Enable recording the SHA3/keccak preimages of trie keys (enable by default) " ,
389
389
}
390
390
// Miner settings
391
391
MiningEnabledFlag = cli.BoolFlag {
@@ -1533,6 +1533,10 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
1533
1533
// Read the value from the flag no matter it's set or not.
1534
1534
// The default value is true.
1535
1535
cfg .Preimages = ctx .GlobalBool (CachePreimagesFlag .Name )
1536
+ if cfg .NoPruning && ! cfg .Preimages {
1537
+ cfg .Preimages = true
1538
+ log .Info ("Enable recording the key preimages for archive node" )
1539
+ }
1536
1540
if ctx .GlobalIsSet (TxLookupLimitFlag .Name ) {
1537
1541
cfg .TxLookupLimit = ctx .GlobalUint64 (TxLookupLimitFlag .Name )
1538
1542
}
@@ -1844,6 +1848,10 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readOnly bool) (chain *core.B
1844
1848
SnapshotLimit : eth .DefaultConfig .SnapshotCache ,
1845
1849
Preimages : ctx .GlobalBool (CachePreimagesFlag .Name ),
1846
1850
}
1851
+ if cache .TrieDirtyDisabled && ! cache .Preimages {
1852
+ cache .Preimages = true
1853
+ log .Info ("Enable recording the key preimages for archive node" )
1854
+ }
1847
1855
if ! ctx .GlobalIsSet (SnapshotFlag .Name ) {
1848
1856
cache .SnapshotLimit = 0 // Disabled
1849
1857
}
0 commit comments