From b007412db165e22640eb4cef6cb41013f54ddd32 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Tue, 13 Feb 2018 14:12:55 +0100 Subject: [PATCH] core: soften up state memory force-commit log messages (#16080) Talk about "state" instead of "trie timing", "trie memory" and remove the overzealous warning when the limit is just reached. Since the time limit is always reached on slow machines, move the message to info level so users don't freak out about internal details. --- core/blockchain.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index e498dedefc..4ae0e4f4ec 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -926,13 +926,9 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types. if chosen < lastWrite+triesInMemory { switch { case size >= 2*limit: - log.Error("Trie memory critical, forcing to disk", "size", size, "limit", limit, "optimum", float64(chosen-lastWrite)/triesInMemory) + log.Warn("State memory usage too high, committing", "size", size, "limit", limit, "optimum", float64(chosen-lastWrite)/triesInMemory) case bc.gcproc >= 2*bc.cacheConfig.TrieTimeLimit: - log.Error("Trie timing critical, forcing to disk", "time", bc.gcproc, "allowance", bc.cacheConfig.TrieTimeLimit, "optimum", float64(chosen-lastWrite)/triesInMemory) - case size > limit: - log.Warn("Trie memory at dangerous levels", "size", size, "limit", limit, "optimum", float64(chosen-lastWrite)/triesInMemory) - case bc.gcproc > bc.cacheConfig.TrieTimeLimit: - log.Warn("Trie timing at dangerous levels", "time", bc.gcproc, "limit", bc.cacheConfig.TrieTimeLimit, "optimum", float64(chosen-lastWrite)/triesInMemory) + log.Info("State in memory for too long, committing", "time", bc.gcproc, "allowance", bc.cacheConfig.TrieTimeLimit, "optimum", float64(chosen-lastWrite)/triesInMemory) } } // If optimum or critical limits reached, write to disk