core/state/snapshot: be very noisy if the generator hits a trie error (#28178)

This commit is contained in:
Péter Szilágyi 2023-09-22 10:27:58 +03:00 committed by GitHub
parent 03c2176a1d
commit 83f3fc2e80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -446,6 +446,10 @@ func (dl *diskLayer) generateRange(ctx *generatorContext, trieId *trie.ID, prefi
internal += time.Since(istart) internal += time.Since(istart)
} }
if iter.Err != nil { if iter.Err != nil {
// Trie errors should never happen. Still, in case of a bug, expose the
// error here, as the outer code will presume errors are interrupts, not
// some deeper issues.
log.Error("State snapshotter failed to iterate trie", "err", err)
return false, nil, iter.Err return false, nil, iter.Err
} }
// Delete all stale snapshot states remaining // Delete all stale snapshot states remaining