diff options
author | Péter Szilágyi <peterke@gmail.com> | 2019-04-01 16:52:11 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-04-01 16:52:11 +0800 |
commit | ed34a5e08a475fdf1b3116b1f17879411bfe411d (patch) | |
tree | 0d607cefe0a735400cb5cadf2949cd588f3b39a7 /cmd/utils/flags.go | |
parent | bb9631c399392577b1d69a1e8f88a2ccbd05e4e1 (diff) | |
download | go-tangerine-ed34a5e08a475fdf1b3116b1f17879411bfe411d.tar go-tangerine-ed34a5e08a475fdf1b3116b1f17879411bfe411d.tar.gz go-tangerine-ed34a5e08a475fdf1b3116b1f17879411bfe411d.tar.bz2 go-tangerine-ed34a5e08a475fdf1b3116b1f17879411bfe411d.tar.lz go-tangerine-ed34a5e08a475fdf1b3116b1f17879411bfe411d.tar.xz go-tangerine-ed34a5e08a475fdf1b3116b1f17879411bfe411d.tar.zst go-tangerine-ed34a5e08a475fdf1b3116b1f17879411bfe411d.zip |
cmd, core, eth: support disabling the concurrent state prefetcher
Diffstat (limited to 'cmd/utils/flags.go')
-rw-r--r-- | cmd/utils/flags.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index bf433242e..bff301579 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -349,6 +349,10 @@ var ( Usage: "Percentage of cache memory allowance to use for trie pruning (default = 25% full mode, 0% archive mode)", Value: 25, } + CacheNoPrefetchFlag = cli.BoolFlag{ + Name: "cache.noprefetch", + Usage: "Disable heuristic state prefetch during block import (less CPU and disk IO, more time waiting for data)", + } // Miner settings MiningEnabledFlag = cli.BoolFlag{ Name: "mine", @@ -1336,6 +1340,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) { Fatalf("--%s must be either 'full' or 'archive'", GCModeFlag.Name) } cfg.NoPruning = ctx.GlobalString(GCModeFlag.Name) == "archive" + cfg.NoPrefetch = ctx.GlobalBool(CacheNoPrefetchFlag.Name) if ctx.GlobalIsSet(CacheFlag.Name) || ctx.GlobalIsSet(CacheTrieFlag.Name) { cfg.TrieCleanCache = ctx.GlobalInt(CacheFlag.Name) * ctx.GlobalInt(CacheTrieFlag.Name) / 100 @@ -1595,10 +1600,11 @@ func MakeChain(ctx *cli.Context, stack *node.Node) (chain *core.BlockChain, chai Fatalf("--%s must be either 'full' or 'archive'", GCModeFlag.Name) } cache := &core.CacheConfig{ - Disabled: ctx.GlobalString(GCModeFlag.Name) == "archive", - TrieCleanLimit: eth.DefaultConfig.TrieCleanCache, - TrieDirtyLimit: eth.DefaultConfig.TrieDirtyCache, - TrieTimeLimit: eth.DefaultConfig.TrieTimeout, + TrieCleanLimit: eth.DefaultConfig.TrieCleanCache, + TrieCleanNoPrefetch: ctx.GlobalBool(CacheNoPrefetchFlag.Name), + TrieDirtyLimit: eth.DefaultConfig.TrieDirtyCache, + TrieDirtyDisabled: ctx.GlobalString(GCModeFlag.Name) == "archive", + TrieTimeLimit: eth.DefaultConfig.TrieTimeout, } if ctx.GlobalIsSet(CacheFlag.Name) || ctx.GlobalIsSet(CacheTrieFlag.Name) { cache.TrieCleanLimit = ctx.GlobalInt(CacheFlag.Name) * ctx.GlobalInt(CacheTrieFlag.Name) / 100 |