Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/state/snapshot/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,15 @@ func (dl *diskLayer) generate(stats *generatorStats) {
default:
}
if batch.ValueSize() > ethdb.IdealBatchSize || abort != nil {
// currentLocation may lost its `storageHash` part, when currentLocation
// and dl.genMarker has the same `accountHash` part and abort generation
// before this function is firstly called in onAccount function,
// which will result in ignoring updating the storage snapshot of
// that `accountHash`, thus the value in the cache of diskLayer will be an old one.
if bytes.Compare(currentLocation, dl.genMarker) < 0 {
currentLocation = dl.genMarker
}

// Flush out the batch anyway no matter it's empty or not.
// It's possible that all the states are recovered and the
// generation indeed makes progress.
Expand Down