diff options
author | Péter Szilágyi <peterke@gmail.com> | 2019-04-02 22:03:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-02 22:03:12 +0800 |
commit | e14f8a408c17fd6c57d769cd4635ad6cc8bde769 (patch) | |
tree | ba0d75fe1d1797be2322366e3d74cc54f77a6184 /cmd/utils | |
parent | 88d7119ebb7bcb38e16f0feb571c98f2197d7cf3 (diff) | |
parent | ed34a5e08a475fdf1b3116b1f17879411bfe411d (diff) | |
download | go-tangerine-e14f8a408c17fd6c57d769cd4635ad6cc8bde769.tar go-tangerine-e14f8a408c17fd6c57d769cd4635ad6cc8bde769.tar.gz go-tangerine-e14f8a408c17fd6c57d769cd4635ad6cc8bde769.tar.bz2 go-tangerine-e14f8a408c17fd6c57d769cd4635ad6cc8bde769.tar.lz go-tangerine-e14f8a408c17fd6c57d769cd4635ad6cc8bde769.tar.xz go-tangerine-e14f8a408c17fd6c57d769cd4635ad6cc8bde769.tar.zst go-tangerine-e14f8a408c17fd6c57d769cd4635ad6cc8bde769.zip |
Merge pull request #19328 from karalabe/preload
core: prefetch next block state concurrently
Diffstat (limited to 'cmd/utils')
-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 959002e02..2ce3a8801 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 |