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

OutOfGas Error When Sending delegate Action via Remix + Metamask with pallet-evm #695

Open
magecnion opened this issue Jul 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@magecnion
Copy link
Contributor

magecnion commented Jul 29, 2024

When sending the delegate action using Remix and Metamask, the pallet-evm is raising an OutOfGas error as shown in the PolkadotJS UI:
image

When performing the same action using web3 libraries, the issue does not occur. Setting a fixed amount of gas allows everything to work fine. The problem is that Metamask sets the gas amount to be used by getting such value from a previous call to eth_estimateGas. The estimation returned for the delegation call is 101433, but the actual gas consumption of delegation is 220440. As a result, when using Metamask, the gas value is lower than the actual gas used, causing the call to run out of gas and the OutOfGas error to be returned from pallet-evm.

The workaround is to set a sufficiently high fixed amount of gas to ensure that we don't run out of gas during execution.

A brief investigation has been done, and it has been observed that Moonbeam forked all the EVM-related projects. Moonbeam introduced the concept of storage growth related to gas, see. Further investigation is needed to determine if the differences in estimation stem from this.

Another calls that did run out of gas:

  • delegateWithAutoCompound
  • delegatorBondMore
  • scheduleDelegatorBondLess
  • scheduleRevokeDelegation
  • cancelDelegationRequest
  • executeDelegationRequest
  • candidateBondMore
  • executeCandidateBondLess
  • goOnline
  • goOffline

Acceptance Criteria

  • As a Metamask user, I want to perform all staking actions using the gas value obtained from the estimation. This way, I don't have to set any fixed value to prevent running out of gas.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant