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

Minting, Staking (and many other write precompile methods) underestimate MaxGas and fail Out-of-gas using web3 libs: MMask, Blockscout or Remix... #726

Closed
tonimateos opened this issue Aug 14, 2024 · 0 comments · Fixed by #777
Labels
bug Something isn't working Grooming Needed Extra attention is needed High Priority Proposed to focus on this when other tasks are present

Comments

@tonimateos
Copy link
Contributor

tonimateos commented Aug 14, 2024

The Gas Estimation of ALL web3 libraries is insufficient for most calls to the EVM, either to the precompiles directly, or to contracts that use the precompiles.

To reproduce the error, follow [1] or [2] below. Note that in [1] incorrectly reported that the issue happens in MMask, but not in other web3 libraries. This is not correct. It happens in all cases. The reason for the comment in [1] may be due to the fact that when using some of those libraries, the maxGas is already set high enough in some config file.

Probably the reason for this bug is the same as the reason for this other reported bug

ACCEPTANCE:

  • I can mint directly using Blockscout connected to MMask (using its default mode of auto-gas-estimate) as described in [2].
  • I can do all staking actions, as described in [1], using MMask (using its default mode of auto-gas-estimate)

References:
[1]
#695

[2]
Try minting with https://sigma.explorer.laosnetwork.io/address/0x82FBe06F69c12fF804BB79D6F47d7CC4B6cFa164?tab=write_contract

If you don't do anything, it fails because the maxGas estimated by Metamask is 33K (approx)

If you manually edit MMask to use up to 35K, it works, and it ends up costing about 34K: 0x2042f02fe71e0179cff41a59f85276ddeea2bc9fc27abc87fdfde1b85c400725

In MMask you need to try to execute the TX, then click on the "edit gas" when gas settings are proposed, then Advanced --> Edit Max Gas

The nice behaviour should be that MMask estimates better, so standad online tools work out of the box.

@tonimateos tonimateos added this to LAOS Aug 14, 2024
@tonimateos tonimateos converted this from a draft issue Aug 14, 2024
@tonimateos tonimateos added bug Something isn't working Grooming Needed Extra attention is needed labels Aug 14, 2024
@tonimateos tonimateos changed the title Minting with Blockscout or Remix fails due to small underestimate of max gas used Minting (and many write operations) with Blockscout or Remix fails due to small underestimate of max gas used Aug 14, 2024
@tonimateos tonimateos changed the title Minting (and many write operations) with Blockscout or Remix fails due to small underestimate of max gas used Minting, Staking (and many other write precompile methods) underestimate MaxGas and fail Out-of-gas using web3 libs: MMask, Blockscout or Remix... Aug 23, 2024
@tonimateos tonimateos added the High Priority Proposed to focus on this when other tasks are present label Sep 5, 2024
@magecnion magecnion self-assigned this Sep 12, 2024
@asiniscalchi asiniscalchi self-assigned this Sep 13, 2024
@luispdm luispdm self-assigned this Sep 13, 2024
@luispdm luispdm assigned luispdm and unassigned luispdm Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Grooming Needed Extra attention is needed High Priority Proposed to focus on this when other tasks are present
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants