-
Notifications
You must be signed in to change notification settings - Fork 607
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: {overflow}
bug when querying cosmwasmpool spot price
#6710
Conversation
Important Notice This PR modifies an in-repo Go module. It is one of:
The dependent Go modules, especially the root one, will have to be Please follow the instructions below:
Please let us know if you need any help. |
{overflow}
bug when querying cosmwasmpool spot price{overflow}
bug when querying cosmwasmpool spot price
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
high level ack, would like one other as well before merge. thanks boss 👍
@@ -51,6 +54,7 @@ func Query[T any, K any](ctx sdk.Context, wasmKeeper WasmKeeper, contractAddress | |||
return response, err | |||
} | |||
|
|||
ctx = ctx.WithGasMeter(storetypes.NewGasMeter(wasmKeeper.QueryGasLimit())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is in consensus, then this is state breaking. I think protorev handled this, let me see if I can find a link. (Basically what happens if this query out of gas's)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only used in cosmwasmpool for CalcInAmountGivenOut (and the other dir)
can someone sanity check those are only used in queries? If so looks good to merge imo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im pretty sure this is called within consensus :/
SwapExactAmountOut -> RouteExactAmountOut -> createMultihopExpectedSwapOuts -> swapModule.CalcInAmtGivenOut
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I think so to. And transmuter pools are active
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to merge with the caveat that dev mentioned that this is state breaking
* fix cosmwasm query helper gas limit * update osmoutils version * update changelog
What is the purpose of the change
Fix
{overflow}
bug when querying cosmwasmpool spot price.This is caused by mapping sdk gas to wasmvm gas which normal gas limit will likely cause overflow due to high number.
The fix is to use
queryGasLimit
from wasmkeeper to keep the vm gas underuint64
.Testing and Verifying
Verified that querying spotprice from transmuter v2.0.0 cosmwasmpool has no issue.
Documentation and Release Note
Unreleased
section ofCHANGELOG.md
?