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: set gas adjustment before calc (backport #4250) #4254

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 15, 2024

In CreateTx in pkg/cosmosclient/cosmosclient.go if gas is set to auto the function will calculate gas using the gasometer.

The gas adjustment is used in this calculation (at least in the cosmos sdk implementation)

https://github.com/cosmos/cosmos-sdk/blob/10465a6aabdfc9119ff187ac3ef229f33c06ab45/client/tx/tx.go#L149-L166

As the txf.WithGasAdjustment is set after the calculation the function will use the default value.

This PR moves the assignment to before the calculation so that the gas adjustment is correctly applied in the gasometer estimation.


This is an automatic backport of pull request #4250 done by Mergify.

@julienrbrt julienrbrt enabled auto-merge (squash) July 15, 2024 11:42
@julienrbrt julienrbrt merged commit 2e78235 into release/v28.x.y Jul 15, 2024
44 checks passed
@julienrbrt julienrbrt deleted the mergify/bp/release/v28.x.y/pr-4250 branch July 15, 2024 12:45
@Pantani Pantani restored the mergify/bp/release/v28.x.y/pr-4250 branch July 15, 2024 12:45
@Pantani Pantani deleted the mergify/bp/release/v28.x.y/pr-4250 branch July 15, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants