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

Allow tolerance parameter for estimated gas fees #1

Closed
TorstenStueber opened this issue Feb 26, 2024 · 0 comments · Fixed by #2
Closed

Allow tolerance parameter for estimated gas fees #1

TorstenStueber opened this issue Feb 26, 2024 · 0 comments · Fixed by #2
Assignees

Comments

@TorstenStueber
Copy link
Member

I observed that the estimated gas fee for a contract call can sometimes not be sufficient. More precisely, when the required gas for a contract call is estimated using the RPC call and then the contract call is executed with the estimated gas as a specified limit, then in some circumstances the call is not successful and returns an OutOfGas error.

An example of such a call happened in Foucoco block 1,145,719.

This is unexpected and I suppose that either 1) this is a gas estimation bug in pallet-contracts (see, e.g., the over estimation fixes [1], [2], [3], [4]) or 2) it is just generally naive to assume that the required gas between estimation and actually executing the call would be exactly the same in all circumstances.

Therefore, this library should add some tolerance to the specified gas limits. The tolerance should be in percent and should be specifiable by the caller. The default should be 10% tolerance.

@TorstenStueber TorstenStueber self-assigned this Feb 26, 2024
@TorstenStueber TorstenStueber linked a pull request Feb 26, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant