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

eth_call with gasPrice attempts to execute with huge gas limit and fails if account is short ETH #10451

Closed
MicahZoltu opened this issue Feb 15, 2021 · 3 comments
Labels
Sev2-normal Normal severity; minor loss of service or inconvenience. type-bug Something isn't working

Comments

@MicahZoltu
Copy link

Describe the bug
Attempting to do an eth_call to MetaMask via default Ethereum Mainnet endpoint with a gasPrice field set will result in the call being executed like a normal transaction but with 125,000,000 gas limit. If the source account doesn't have enough ETH to over gasPrice * 125,000,000 then the call will fail.

Note: The error is thrown as an object, rather than an Error which means no stack trace which makes it very hard to debug.

Steps to reproduce (REQUIRED)

window.ethereum.request({method: 'eth_call', params: [{from: '0x0000000000000000000000000000000000000010', to: '0x0000000000000000000000000000000000000010', value: '0x0', gasPrice: '0x174876e800'}]}).catch(console.error)

Output:

{"code":-32000,"message":"err: insufficient funds for gas * price + value: address 0x0000000000000000000000000000000000000010 have 4443062158440 want 12498792000000000000 (supplied gas 124987920)"}

Expected behavior
The call is executed with the GASPRICE opcode set to 0x174876e800 but it doesn't attempt to actually spend ETH on gas.

Browser details (please complete the following information):

  • OS: Windows 10
  • Hardware Wallet: N/A
  • Browser: Firefox and Chrome
  • MetaMask Version: 9.0.5

Additional context (Error Messages, etc.)
I suspect the real issue is in whatever client is backing MetaMask's "Ethereum Mainnet" network. I know this bug doesn't occur when using my own Nethermind node, but I don't know what MM is using.

@MicahZoltu
Copy link
Author

Appears to be an issue with go-ethereum: ethereum/go-ethereum#21108

@jacobc-eth jacobc-eth added Sev2-normal Normal severity; minor loss of service or inconvenience. type-bug Something isn't working labels Feb 16, 2021
@danjm
Copy link
Contributor

danjm commented Mar 1, 2021

Seems related to #9967

@Gudahtt
Copy link
Member

Gudahtt commented Mar 2, 2021

Thanks for investigating this @MicahZoltu ! We are using Infura, which uses go-ethereum as you discovered.

I just double-checked how we're handling this to ensure the default gas limit being imposed isn't our fault, and I'm fairly certain it isn't. Unfortunately your only recourse may be to appeal go-ethereum, as you have in that comment. I'll close this issue, as it's not clear how we could mitigate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sev2-normal Normal severity; minor loss of service or inconvenience. type-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants