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

Add sorting fix from terra devs #916

Closed
wants to merge 3 commits into from
Closed

Conversation

the-frey
Copy link
Contributor

It may be that @assafmo's fix is enough, but also contributing this upstream as we are going to roll with it on a fork. Credit of course goes to the Terra folks for spotting the non-determinism issue there.

@the-frey the-frey requested a review from alpe as a code owner July 28, 2022 10:07
for _, e := range events {
attributes := e.Attributes
sort.SliceStable(attributes, func(i, j int) bool {
return bytes.Compare([]byte(attributes[i].Key), []byte(attributes[j].Key)) == -1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return bytes.Compare([]byte(attributes[i].Key), []byte(attributes[j].Key)) == -1
return attributes[i].Key < attributes[j].Key

@ethanfrey
Copy link
Member

I am unsure this is needed. Please DM me where any possible reordering is possible one we restrict to just wasm messages. Otherwise, I would avoid this complexity.

@ethanfrey ethanfrey mentioned this pull request Jul 29, 2022
@ethanfrey
Copy link
Member

Replacing this with #918

Thank you very much for the contribution

@ethanfrey ethanfrey closed this Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants