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

Gov prop randomly fails when adding same denoms to accept and mandatory list #257

Open
4 tasks
zarazan opened this issue Aug 22, 2023 · 1 comment
Open
4 tasks

Comments

@zarazan
Copy link
Contributor

zarazan commented Aug 22, 2023

Summary of Bug

When passing a governance proposal to add an asset to the mandatory and accept list at the same time there is a random chance (due to the nature of golangs range map implementation) that the validation will hit the MandatoryList first. When this happens the accept list does not contain all denoms in the mandatory list and the gov prop fails. Instead of looping over the keys and using a case statement we could explicitly set the order of validation.

Code location: https://github.com/ojo-network/ojo/blob/main/x/oracle/keeper/msg_server.go#L158-L189

Another possible solution: #256


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@zarazan
Copy link
Contributor Author

zarazan commented Aug 22, 2023

When checking for equality between the accept and mandatory list the exponent IS used. This will make updating a denoms exponent difficult as well.

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

No branches or pull requests

1 participant