Skip to content

Commit

Permalink
Backport cosmos#13530
Browse files Browse the repository at this point in the history
  • Loading branch information
RavenXce committed Dec 1, 2022
1 parent 64b84ff commit 3724930
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,16 @@ func commitStores(version int64, storeMap map[types.StoreKey]types.CommitKVStore
storeInfos := make([]types.StoreInfo, 0, len(storeMap))

for key, store := range storeMap {
commitID := store.Commit()
last := store.LastCommitID()

// If a commit event execution is interrupted, a new iavl store's version will be larger than the rootmulti's metadata, when the block is replayed, we should avoid committing that iavl store again.
var commitID types.CommitID
if last.Version >= version {
last.Version = version
commitID = last
} else {
commitID = store.Commit()
}

if store.GetStoreType() == types.StoreTypeTransient {
continue
Expand Down

0 comments on commit 3724930

Please sign in to comment.