diff --git a/CHANGELOG.md b/CHANGELOG.md index 2de9127aae..5e0aad63f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -100,6 +100,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ empty coins slice before it is used to create `banktype.MsgSend`. * (x/auth/tx) [#12474](https://github.com/cosmos/cosmos-sdk/pull/12474) Remove condition in GetTxsEvent that disallowed multiple equal signs, which would break event queries with base64 strings (i.e. query by signature). * [#12448](https://github.com/cosmos/cosmos-sdk/pull/12448) Start telemetry independently from the API server. +* (store/rootmulti) [#12487](https://github.com/cosmos/cosmos-sdk/pull/12487) Fix non-deterministic map iteration. ## [v0.46.0-rc1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.0-rc1) - 2022-05-23 diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index d31cb2e42b..7a046959f9 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -907,8 +907,17 @@ func (rs *Store) loadCommitStoreFromParams(key types.StoreKey, id types.CommitID } func (rs *Store) buildCommitInfo(version int64) *types.CommitInfo { + keys := make([]types.StoreKey, 0, len(rs.stores)) + for key := range rs.stores { + keys = append(keys, key) + } + sort.Slice(keys, func(i, j int) bool { + return keys[i].Name() < keys[j].Name() + }) + storeInfos := []types.StoreInfo{} - for key, store := range rs.stores { + for _, key := range keys { + store := rs.stores[key] if store.GetStoreType() == types.StoreTypeTransient { continue }