Skip to content

Commit

Permalink
limit error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-ogrady committed Nov 1, 2022
1 parent d245acd commit fc1c896
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import (
)

var emptyCodeHash = crypto.Keccak256(nil)
var logged = 0

type Code []byte

Expand Down Expand Up @@ -240,7 +241,10 @@ func (s *stateObject) GetCommittedState(db Database, key common.Hash) common.Has
snapErr := err
enc, err = s.getTrie(db).TryGet(key.Bytes())
if metrics.EnabledExpensive {
log.Warn("reading storage from trie", "snap missing", s.db.snap == nil, "err", snapErr)
if logged < 1000 {
log.Warn("reading storage from trie", "snap missing", s.db.snap == nil, "err", snapErr)
logged++
}
s.db.StorageReads += time.Since(start)
}
if err != nil {
Expand Down

0 comments on commit fc1c896

Please sign in to comment.