aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-06-04 15:47:43 +0800
committerGitHub <noreply@github.com>2018-06-04 15:47:43 +0800
commit143c4341d8a2231deade6d7341c668d609bd3486 (patch)
treededba70251f89989fbdd1fdc91f0c9348af551e3 /eth
parent3f33a7c8ceeefd769a68bbcc2ed3e4ce74ddaef8 (diff)
downloaddexon-143c4341d8a2231deade6d7341c668d609bd3486.tar.gz
dexon-143c4341d8a2231deade6d7341c668d609bd3486.tar.zst
dexon-143c4341d8a2231deade6d7341c668d609bd3486.zip
core, eth, trie: streaming GC for the trie cache (#16810)
* core, eth, trie: streaming GC for the trie cache * trie: track memcache statistics
Diffstat (limited to 'eth')
-rw-r--r--eth/api_tracer.go8
-rw-r--r--eth/config.go2
2 files changed, 7 insertions, 3 deletions
diff --git a/eth/api_tracer.go b/eth/api_tracer.go
index 45a819022..61f5c71d6 100644
--- a/eth/api_tracer.go
+++ b/eth/api_tracer.go
@@ -251,7 +251,8 @@ func (api *PrivateDebugAPI) traceChain(ctx context.Context, start, end *types.Bl
// Print progress logs if long enough time elapsed
if time.Since(logged) > 8*time.Second {
if number > origin {
- log.Info("Tracing chain segment", "start", origin, "end", end.NumberU64(), "current", number, "transactions", traced, "elapsed", time.Since(begin), "memory", database.TrieDB().Size())
+ nodes, imgs := database.TrieDB().Size()
+ log.Info("Tracing chain segment", "start", origin, "end", end.NumberU64(), "current", number, "transactions", traced, "elapsed", time.Since(begin), "memory", nodes+imgs)
} else {
log.Info("Preparing state for chain trace", "block", number, "start", origin, "elapsed", time.Since(begin))
}
@@ -298,6 +299,8 @@ func (api *PrivateDebugAPI) traceChain(ctx context.Context, start, end *types.Bl
// Dereference all past tries we ourselves are done working with
database.TrieDB().Dereference(proot, common.Hash{})
proot = root
+
+ // TODO(karalabe): Do we need the preimages? Won't they accumulate too much?
}
}()
@@ -526,7 +529,8 @@ func (api *PrivateDebugAPI) computeStateDB(block *types.Block, reexec uint64) (*
database.TrieDB().Dereference(proot, common.Hash{})
proot = root
}
- log.Info("Historical state regenerated", "block", block.NumberU64(), "elapsed", time.Since(start), "size", database.TrieDB().Size())
+ nodes, imgs := database.TrieDB().Size()
+ log.Info("Historical state regenerated", "block", block.NumberU64(), "elapsed", time.Since(start), "nodes", nodes, "preimages", imgs)
return statedb, nil
}
diff --git a/eth/config.go b/eth/config.go
index dd7f42c7d..426d2bf1e 100644
--- a/eth/config.go
+++ b/eth/config.go
@@ -47,7 +47,7 @@ var DefaultConfig = Config{
LightPeers: 100,
DatabaseCache: 768,
TrieCache: 256,
- TrieTimeout: 5 * time.Minute,
+ TrieTimeout: 60 * time.Minute,
GasPrice: big.NewInt(18 * params.Shannon),
TxPool: core.DefaultTxPoolConfig,