Skip to content

Commit 68754f3

Browse files
authored
cmd/utils: grant snapshot cache to trie if disabled (ethereum#21416)
* cmd/utils: grant snapshot cache to trie if disabled * eth: fix up default non-mainnet cache distribution
1 parent 5d4512b commit 68754f3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cmd/utils/flags.go

+1
Original file line numberDiff line numberDiff line change
@@ -1542,6 +1542,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
15421542
cfg.SnapshotCache = ctx.GlobalInt(CacheFlag.Name) * ctx.GlobalInt(CacheSnapshotFlag.Name) / 100
15431543
}
15441544
if !ctx.GlobalIsSet(SnapshotFlag.Name) {
1545+
cfg.TrieCleanCache += cfg.SnapshotCache
15451546
cfg.SnapshotCache = 0 // Disabled
15461547
}
15471548
if ctx.GlobalIsSet(DocRootFlag.Name) {

eth/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ var DefaultConfig = Config{
6161
LightPeers: 100,
6262
UltraLightFraction: 75,
6363
DatabaseCache: 512,
64-
TrieCleanCache: 256,
64+
TrieCleanCache: 154,
6565
TrieCleanCacheJournal: "triecache",
6666
TrieCleanCacheRejournal: 60 * time.Minute,
6767
TrieDirtyCache: 256,
6868
TrieTimeout: 60 * time.Minute,
69-
SnapshotCache: 256,
69+
SnapshotCache: 102,
7070
Miner: miner.Config{
7171
GasFloor: 8000000,
7272
GasCeil: 8000000,

0 commit comments

Comments
 (0)