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

Out of gas #1529

Open
shan-c opened this issue Dec 20, 2023 · 4 comments
Open

Out of gas #1529

shan-c opened this issue Dec 20, 2023 · 4 comments

Comments

@shan-c
Copy link

shan-c commented Dec 20, 2023

I've been using stargateSigningClient.simulate method for gas estimation. This estimated gas from this method is never sufficient. Especially for osmosis, there is huge gap in estimation.

const sendMsg: MsgSendEncodeObject = {
typeUrl: '/cosmos.bank.v1beta1.MsgSend',
value: {
fromAddress: senderAddress,
toAddress: address,
amount: [
{
denom,
amount,
},
],
},
};
const simulation = await signingClient.simulate(senderAddress, [sendMsg], '');

@webmaster128
Copy link
Member

This is expected. You need to add a multiplier to the result of simulate. 1.3 (i.e. +30%) used to be a good choice for a long time. Due to some changes in the SDK it is often not enough anymore and we now used 1.4 by default.

@shan-c
Copy link
Author

shan-c commented Dec 21, 2023

But for osmosis chain, the gap is huge, its like 10x

@ValarDragon
Copy link

For osmosis this has now been fixed if the ful node your interacting with is v21.1.0 or higher in version. (v21.1.2 recommended)

The problem was, there has always been a buggy code path in the SDK + Osmosis for gas simulation, and that buggy code path had more gas in it. This fix correctly makes that code path get gas tracked.

@shan-c
Copy link
Author

shan-c commented Dec 23, 2023

Can you suggest any updated rpc node ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants