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: unique constraint violation for group policy sim genesis #15943

Merged

Conversation

gjermundgaraba
Copy link
Contributor

Description

Closes: #15741

Checks if the group policy address has been used already, skip or retry if it has been used already.

I didn't add a changelog nor any additional tests, but if you want those things too, I would be happy to do so.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

Thank you! I think, as noted in the issue, we should as well remove the seed override.

@gjermundgaraba
Copy link
Contributor Author

Thank you! I think, as noted in the issue, we should as well remove the seed override.

Remove the seed override? Do you mean something like checking if the seed(s) is set in the flag use that instead of the random seed?

config.Seed = rand.Int63()

Or do you mean not making it random anymore at all?

@julienrbrt
Copy link
Member

Thank you! I think, as noted in the issue, we should as well remove the seed override.

Remove the seed override? Do you mean something like checking if the seed(s) is set in the flag use that instead of the random seed?


config.Seed = rand.Int63()

Or do you mean not making it random anymore at all?

Yea, the first one. It was pretty confusing the seed passed was getting overwritten.

@gjermundgaraba
Copy link
Contributor Author

Makes sense, should I just check if the value is not set to the default value (move 42 into a const) and then only run 1 round on that seed (rather than 3 times on the same seed/other random seeds)?

flag.Int64Var(&FlagSeedValue, "Seed", 42, "simulation random seed")

@julienrbrt
Copy link
Member

Makes sense, should I just check if the value is not set to the default value (move 42 into a const) and then only run 1 round on that seed (rather than 3 times on the same seed/other random seeds)?

flag.Int64Var(&FlagSeedValue, "Seed", 42, "simulation random seed")

Sounds good!

@github-actions github-actions bot added the C:CLI label Apr 25, 2023
@julienrbrt julienrbrt added the backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release label Apr 25, 2023
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the rationale for these changes?

Copy link
Member

Choose a reason for hiding this comment

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

The rationale is that there was confusion about what runsim outputs as seed and the seed that test is actually using (#14833)

@julienrbrt julienrbrt added this pull request to the merge queue Apr 26, 2023
Merged via the queue into cosmos:main with commit e59c4a8 Apr 26, 2023
mergify bot pushed a commit that referenced this pull request Apr 26, 2023
(cherry picked from commit e59c4a8)

# Conflicts:
#	simapp/sim_test.go
julienrbrt added a commit that referenced this pull request Apr 26, 2023
#15943) (#15951)

Co-authored-by: Gjermund Garaba <gjermund@garaba.net>
Co-authored-by: Julien Robert <julien@rbrt.fr>
larry0x pushed a commit to larry0x/cosmos-sdk that referenced this pull request May 22, 2023
roy-dydx pushed a commit to dydxprotocol/cosmos-sdk that referenced this pull request Jul 11, 2023
cosmos#15943) (cosmos#15951)

Co-authored-by: Gjermund Garaba <gjermund@garaba.net>
Co-authored-by: Julien Robert <julien@rbrt.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release C:CLI C:Simulations C:x/group
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: flaky simulation test: unique constraint violation
4 participants