Skip to content

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
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 <[email protected]>
Co-authored-by: Julien Robert <[email protected]>
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