Skip to content

Commit b007412

Browse files
fjlkaralabe
authored andcommitted
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.
1 parent da41a72 commit b007412

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

core/blockchain.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -926,13 +926,9 @@ func (bc *BlockChain) WriteBlockWithState(block *types.Block, receipts []*types.
926926
if chosen < lastWrite+triesInMemory {
927927
switch {
928928
case size >= 2*limit:
929-
log.Error("Trie memory critical, forcing to disk", "size", size, "limit", limit, "optimum", float64(chosen-lastWrite)/triesInMemory)
929+
log.Warn("State memory usage too high, committing", "size", size, "limit", limit, "optimum", float64(chosen-lastWrite)/triesInMemory)
930930
case bc.gcproc >= 2*bc.cacheConfig.TrieTimeLimit:
931-
log.Error("Trie timing critical, forcing to disk", "time", bc.gcproc, "allowance", bc.cacheConfig.TrieTimeLimit, "optimum", float64(chosen-lastWrite)/triesInMemory)
932-
case size > limit:
933-
log.Warn("Trie memory at dangerous levels", "size", size, "limit", limit, "optimum", float64(chosen-lastWrite)/triesInMemory)
934-
case bc.gcproc > bc.cacheConfig.TrieTimeLimit:
935-
log.Warn("Trie timing at dangerous levels", "time", bc.gcproc, "limit", bc.cacheConfig.TrieTimeLimit, "optimum", float64(chosen-lastWrite)/triesInMemory)
931+
log.Info("State in memory for too long, committing", "time", bc.gcproc, "allowance", bc.cacheConfig.TrieTimeLimit, "optimum", float64(chosen-lastWrite)/triesInMemory)
936932
}
937933
}
938934
// If optimum or critical limits reached, write to disk

0 commit comments

Comments
 (0)