Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: orm/*, store/*: fix non-determinism from map iteration #12751

Merged
merged 2 commits into from
Jul 27, 2022

Conversation

odeke-em
Copy link
Collaborator

Reported by informalsystems/gosec's map iteration pass, this
change fixes non-determinism from iterating with a map, whose
definition in the Go spec guarantees that the order of keys
and values presented during iteration will be randomized.

Fixes #12428
Fixes #12430
Fixes #12431

/cc @kirbyquerby @elias-orijtech

Reported by informalsystems/gosec's map iteration pass, this
change fixes non-determinism from iterating with a map, whose
definition in the Go spec guarantees that the order of keys
and values presented during iteration will be randomized.

Fixes #12428
Fixes #12430
Fixes #12431
@odeke-em odeke-em requested a review from a team as a code owner July 27, 2022 17:32
@codecov
Copy link

codecov bot commented Jul 27, 2022

Codecov Report

Merging #12751 (08abcd0) into main (37e765d) will increase coverage by 0.66%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12751      +/-   ##
==========================================
+ Coverage   56.43%   57.10%   +0.66%     
==========================================
  Files         659      692      +33     
  Lines       56186    59567    +3381     
==========================================
+ Hits        31708    34014    +2306     
- Misses      21926    22682     +756     
- Partials     2552     2871     +319     
Impacted Files Coverage Δ
orm/model/ormdb/json.go 62.92% <100.00%> (ø)
store/v2alpha1/multi/migration.go 67.34% <100.00%> (+6.37%) ⬆️
store/v2alpha1/multi/store.go 76.44% <100.00%> (+0.28%) ⬆️
x/distribution/simulation/operations.go 80.85% <0.00%> (-9.58%) ⬇️
cosmovisor/logger.go
cosmovisor/cmd/cosmovisor/help.go
cosmovisor/cmd/cosmovisor/version.go
cosmovisor/cmd/cosmovisor/run.go
cosmovisor/cmd/cosmovisor/init.go
cosmovisor/cmd/cosmovisor/main.go
... and 52 more

@julienrbrt julienrbrt merged commit 2f4faa5 into main Jul 27, 2022
@julienrbrt julienrbrt deleted the all-fix-map-iteration-non-determinism branch July 27, 2022 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment