OutOfGas
Error When Sending delegate
Action via Remix + Metamask with pallet-evm
#695
Labels
bug
Something isn't working
When sending the
delegate
action using Remix and Metamask, thepallet-evm
is raising anOutOfGas
error as shown in the PolkadotJS UI: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 is101433
, but the actual gas consumption of delegation is220440
. 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 theOutOfGas
error to be returned frompallet-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:
Acceptance Criteria
The text was updated successfully, but these errors were encountered: