aboutsummaryrefslogtreecommitdiffstats
path: root/eth/api_tracer.go
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/api_tracer.go
parent3f33a7c8ceeefd769a68bbcc2ed3e4ce74ddaef8 (diff)
downloaddexon-143c4341d8a2231deade6d7341c668d609bd3486.tar
dexon-143c4341d8a2231deade6d7341c668d609bd3486.tar.gz
dexon-143c4341d8a2231deade6d7341c668d609bd3486.tar.bz2
dexon-143c4341d8a2231deade6d7341c668d609bd3486.tar.lz
dexon-143c4341d8a2231deade6d7341c668d609bd3486.tar.xz
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/api_tracer.go')
-rw-r--r--eth/api_tracer.go8
1 files changed, 6 insertions, 2 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
}