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: check denom of SpendLimit #292

Merged
merged 3 commits into from
Jul 21, 2022
Merged

Conversation

czarcas7ic
Copy link
Member

@czarcas7ic czarcas7ic commented Jul 20, 2022

Closes: osmosis-labs/osmosis#2170

What is the purpose of the change

This PR fixes a small bug in the Authz simulator code found when running extended simulations.

Brief Changelog

  • Checks that the coins being sent through Authz are a subset of the denoms allotted through the SpendLimit

Testing and Verifying

This change is already covered by existing tests

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes? no
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? no
  • How is the feature or change documented? not applicable

@czarcas7ic
Copy link
Member Author

czarcas7ic commented Jul 20, 2022

Once merged I will backport to https://github.com/osmosis-labs/cosmos-sdk/tree/v0.45.0x-osmo-v11 and then update our go.mod on osmosis

Unless we want to wait since its such a small change, but extended sim runs will continue to fail until this is added

@czarcas7ic
Copy link
Member Author

Hmm, I am actually still getting

    simulate.go:263: error on block  274/1000, operation (522/766) from x/authz:
        requested amount is more than spend limit: insufficient funds [cosmos/cosmos-sdk/types/errors/errors.go:273]
        Comment: requested amount is more than spend limit: insufficient funds

with this branch

@czarcas7ic
Copy link
Member Author

I believe we need to actually change this to the following:

if !sendAuth.SpendLimit.IsAllGTE(coins) || !coins.DenomsSubsetOf(sendAuth.SpendLimit) {
	return simtypes.NoOpMsg(authz.ModuleName, TypeMsgExec, "over spend limit"), nil, nil
}

Please lmk if that makes sense

@ValarDragon
Copy link
Member

Your suggested change in comment looks correct to me

@alexanderbez alexanderbez merged commit 0aca1df into osmosis-main Jul 21, 2022
@alexanderbez alexanderbez deleted the adam/authz-sim-patch branch July 21, 2022 08:27
mergify bot pushed a commit that referenced this pull request Jul 21, 2022
czarcas7ic added a commit that referenced this pull request Jul 21, 2022
(cherry picked from commit 0aca1df)

Co-authored-by: Adam Tucker <adam@osmosis.team>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Fix Authz simulation code
3 participants