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 gas limit to osmoutils Sudo helper #7526

Closed
AlpinYukseloglu opened this issue Feb 17, 2024 · 0 comments · Fixed by #7527
Closed

Add gas limit to osmoutils Sudo helper #7526

AlpinYukseloglu opened this issue Feb 17, 2024 · 0 comments · Fixed by #7527

Comments

@AlpinYukseloglu
Copy link
Contributor

Background

Our Sudo helper in osmoutils currently allows for unbounded gas on contract calls. While this is handled properly for regular transactions, it is not properly handled for functions that are called in begin block. Adding a gas limit (even if high) to this helper would meaningfully reduce the attack surface for CW contract calls.

Suggested Design

Wrap the Sudo call below with a childCtx that has a 30M gas limit (similar to what exists for queries):

responseBz, err := contractKeeper.Sudo(ctx, sdk.MustAccAddressFromBech32(contractAddress), bz)

Acceptance Criteria

  • Gas limit is added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant