From 91eec1251c06727581063cd7e942ba913d806971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 14 Mar 2019 15:25:12 +0200 Subject: cmd, core, eth, trie: get rid of trie cache generations (#19262) * cmd, core, eth, trie: get rid of trie cache generations * core, trie: get rid of remainder of cache gen boilerplate --- cmd/geth/chaincmd.go | 4 ---- cmd/geth/main.go | 1 - cmd/geth/usage.go | 1 - cmd/utils/flags.go | 10 ---------- 4 files changed, 16 deletions(-) (limited to 'cmd') diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index f0e5d2619..72aace1c6 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -35,7 +35,6 @@ import ( "github.com/ethereum/go-ethereum/eth/downloader" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" - "github.com/ethereum/go-ethereum/trie" "gopkg.in/urfave/cli.v1" ) @@ -261,9 +260,6 @@ func importChain(ctx *cli.Context) error { } fmt.Println(ioStats) - fmt.Printf("Trie cache misses: %d\n", trie.CacheMisses()) - fmt.Printf("Trie cache unloads: %d\n\n", trie.CacheUnloads()) - // Print the memory statistics used by the importing mem := new(runtime.MemStats) runtime.ReadMemStats(mem) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index a331abc9f..f966905a9 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -102,7 +102,6 @@ var ( utils.CacheDatabaseFlag, utils.CacheTrieFlag, utils.CacheGCFlag, - utils.TrieCacheGenFlag, utils.ListenPortFlag, utils.MaxPeersFlag, utils.MaxPendingPeersFlag, diff --git a/cmd/geth/usage.go b/cmd/geth/usage.go index 0338e447e..a4787fff2 100644 --- a/cmd/geth/usage.go +++ b/cmd/geth/usage.go @@ -139,7 +139,6 @@ var AppHelpFlagGroups = []flagGroup{ utils.CacheDatabaseFlag, utils.CacheTrieFlag, utils.CacheGCFlag, - utils.TrieCacheGenFlag, }, }, { diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index deb6df364..b648f958b 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -37,7 +37,6 @@ import ( "github.com/ethereum/go-ethereum/consensus/clique" "github.com/ethereum/go-ethereum/consensus/ethash" "github.com/ethereum/go-ethereum/core" - "github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/dashboard" @@ -350,11 +349,6 @@ var ( Usage: "Percentage of cache memory allowance to use for trie pruning (default = 25% full mode, 0% archive mode)", Value: 25, } - TrieCacheGenFlag = cli.IntFlag{ - Name: "trie-cache-gens", - Usage: "Number of trie node generations to keep in memory", - Value: int(state.MaxTrieCacheGen), - } // Miner settings MiningEnabledFlag = cli.BoolFlag{ Name: "mine", @@ -1432,10 +1426,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) { cfg.MinerGasPrice = big.NewInt(1) } } - // TODO(fjl): move trie cache generations into config - if gen := ctx.GlobalInt(TrieCacheGenFlag.Name); gen > 0 { - state.MaxTrieCacheGen = uint16(gen) - } } // SetDashboardConfig applies dashboard related command line flags to the config. -- cgit v1.2.3