diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-10-19 19:55:13 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-10-19 19:55:13 +0800 |
commit | 4f46bd19d0b123327596785dc3975d5e4008d761 (patch) | |
tree | 669ad5ec53b1408885465c5c3affb38e99f82b5e /cmd/utils | |
parent | ca49510e6dd40e78e3e6827c6c4d7b2a3ec8ef5b (diff) | |
download | dexon-4f46bd19d0b123327596785dc3975d5e4008d761.tar dexon-4f46bd19d0b123327596785dc3975d5e4008d761.tar.gz dexon-4f46bd19d0b123327596785dc3975d5e4008d761.tar.bz2 dexon-4f46bd19d0b123327596785dc3975d5e4008d761.tar.lz dexon-4f46bd19d0b123327596785dc3975d5e4008d761.tar.xz dexon-4f46bd19d0b123327596785dc3975d5e4008d761.tar.zst dexon-4f46bd19d0b123327596785dc3975d5e4008d761.zip |
cmd, core/state: allow configurable trie cache generations
Diffstat (limited to 'cmd/utils')
-rw-r--r-- | cmd/utils/flags.go | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 0c5206a17..1859f735d 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -141,11 +141,6 @@ var ( Usage: "Document Root for HTTPClient file scheme", Value: DirectoryString{homeDir()}, } - CacheFlag = cli.IntFlag{ - Name: "cache", - Usage: "Megabytes of memory allocated to internal caching (min 16MB / database forced)", - Value: 128, - } FastSyncFlag = cli.BoolFlag{ Name: "fast", Usage: "Enable fast syncing through state downloads", @@ -154,6 +149,17 @@ var ( Name: "lightkdf", Usage: "Reduce key-derivation RAM & CPU usage at some expense of KDF strength", } + // Performance tuning settings + CacheFlag = cli.IntFlag{ + Name: "cache", + Usage: "Megabytes of memory allocated to internal caching (min 16MB / database forced)", + Value: 128, + } + TrieCacheGenFlag = cli.IntFlag{ + Name: "trie-cache-gens", + Usage: "Number of trie node generations to keep in memory", + Value: int(state.MaxTrieCacheGen), + } // Fork settings SupportDAOFork = cli.BoolFlag{ Name: "support-dao-fork", @@ -721,6 +727,10 @@ func RegisterEthService(ctx *cli.Context, stack *node.Node, extra []byte) { } ethConf.PowTest = true } + // Override any global options pertaining to the Ethereum protocol + if gen := ctx.GlobalInt(TrieCacheGenFlag.Name); gen > 0 { + state.MaxTrieCacheGen = uint16(gen) + } if err := stack.Register(func(ctx *node.ServiceContext) (node.Service, error) { return eth.New(ctx, ethConf) |