Skip to content

Commit

Permalink
Add statedb error and prefetcher logs (ava-labs#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbuchwald authored Aug 19, 2022
1 parent 6886427 commit eee9ef7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1078,6 +1078,9 @@ func (bc *BlockChain) insertBlock(block *types.Block, writes bool) error {
// transactions and probabilistically some of the account/storage trie nodes.
// Process block using the parent state as reference point
receipts, logs, usedGas, err := bc.processor.Process(block, parent, statedb, bc.vmConfig)
if serr := statedb.Error(); serr != nil {
log.Error("statedb error encountered", "err", serr, "number", block.Number(), "hash", block.Hash())
}
if err != nil {
bc.reportBlock(block, receipts, err)
return err
Expand Down
5 changes: 4 additions & 1 deletion core/state/trie_prefetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,10 @@ func (sf *subfetcher) loop() {
if _, ok := sf.seen[string(task)]; ok {
sf.dups++
} else {
sf.trie.TryGet(task)
_, err := sf.trie.TryGet(task)
if err != nil {
log.Error("Trie prefetcher failed fetching", "root", sf.root, "err", err)
}
sf.seen[string(task)] = struct{}{}
}
}
Expand Down

0 comments on commit eee9ef7

Please sign in to comment.