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

feat(cosmos): dynamic gas price and gas limit #1894

Merged
merged 2 commits into from
Jul 5, 2023
Merged

Conversation

onur-ozkan
Copy link
Member

@onur-ozkan onur-ozkan commented Jul 3, 2023

IBC and standard withdrawals for Cosmos now allow users to specify the gas price and gas limit for each transaction. You can do this by including the following information in the RPC payloads:

"fee": {
    "type": "CosmosGas",
    "gas_limit": 125000,
    "gas_price": 0.25
}

e.g. payload in the integration test:
https://github.com/KomodoPlatform/atomicDEX-API/blob/af74b50b2714cf77c576e4a85c858e4b2a36191b/mm2src/mm2_main/tests/mm2_tests/tendermint_tests.rs#L162-L171

Determining the gas price to be used:

1- From the RPC payload.
2- From the coins configuration.
3- A default value of 0.25, which is currently hardcoded in the source code.

Higher prior always overrides the others.

Resolves #1847

cc @yurii-khi @tonymorony

Signed-off-by: ozkanonur <work@onurozkan.dev>
@onur-ozkan onur-ozkan added the in progress Changes will be made from the author label Jul 3, 2023
Signed-off-by: ozkanonur <work@onurozkan.dev>
@onur-ozkan onur-ozkan added under review and removed in progress Changes will be made from the author labels Jul 3, 2023
@onur-ozkan onur-ozkan requested a review from shamardy July 3, 2023 20:13
@onur-ozkan onur-ozkan self-assigned this Jul 3, 2023
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the fix!

@shamardy shamardy requested a review from yurii-khi July 4, 2023 00:31
@shamardy shamardy merged commit 806ac63 into dev Jul 5, 2023
@shamardy shamardy deleted the cosmos-gas-price-upgrade branch July 5, 2023 13:55
laruh pushed a commit that referenced this pull request Jul 6, 2023
IBC and standard withdrawals for Cosmos now allow users to specify the gas price and gas limit for each transaction
---------

Signed-off-by: ozkanonur <work@onurozkan.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants