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 #4250

Merged
merged 1 commit into from
Jul 15, 2024
Merged

Conversation

shapeshed
Copy link
Contributor

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.

@julienrbrt julienrbrt enabled auto-merge (squash) July 15, 2024 09:56
@julienrbrt julienrbrt added the skip-changelog Don't check changelog for new entries label Jul 15, 2024
@julienrbrt julienrbrt merged commit 4b57603 into ignite:main Jul 15, 2024
47 of 49 checks passed
mergify bot pushed a commit that referenced this pull request Jul 15, 2024
julienrbrt added a commit that referenced this pull request Jul 15, 2024
* fix: set gas adjustment before calc (#4250)

(cherry picked from commit 4b57603)

* changelog

---------

Co-authored-by: shapeshed <george@shapeshed.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v28.x.y Backport to v28.x.y component:ci CI/CD workflow and automated jobs. component:configs component:packages skip-changelog Don't check changelog for new entries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants