You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
eth_estimategas function will return invalid params error when running on Infura Kovan network. This happen when calling a Smart Contract function without specifying gas limit. I think it is an error because transaction is not reverting and will complete successfully when gas limit is provided.
This is kovan tx for which gas estimate is failing: Kovan Etherscan
Error message returned from Infura:
(node:23402) UnhandledPromiseRejectionWarning: Error: cannot estimate gas; transaction may fail or may require manual gas limit (error={"reason":"processing response error","code":"SERVER_ERROR","body":"{\"jsonrpc\":\"2.0\",\"id\":88,\"error\":{\"code\":-32602,\"message\":\"Invalid params\"}}","error":{"code":-32602},"requestBody":"{\"method\":\"eth_estimateGas\",\"params\":[{\"gasPrice\":\"0x165a0bc00\",\"type\":\"0x0\",\"from\":\"0x06f0462a9694c96e6c727797b8737b94b3ff5df4\",\"to\":\"0x6f652a2ec26bb3aaefae6fa9d18c9c5d3288e4d1\",\"data\":\"0x3209e9e60000000000000000000000000000000000000000000000000853a0d2313c0000\"}],\"id\":88,\"jsonrpc\":\"2.0\"}","requestMethod":"POST","url":"https://kovan.infura.io/v3/24ef6eb261d244fe8418a4c0dd3a8765"}, tx={"data":"0x3209e9e60000000000000000000000000000000000000000000000000853a0d2313c0000","to":{},"from":"0x06F0462a9694C96E6c727797B8737B94b3ff5dF4","gasPrice":{"type":"BigNumber","hex":"0x0165a0bc00"},"type":0,"nonce":{},"gasLimit":{},"chainId":{}}, code=UNPREDICTABLE_GAS_LIMIT, version=abstract-signer/5.4.0)
at Logger.makeError (/home/robertmagier/projects/DJE/CoinFlip/node_modules/@ethersproject/logger/lib/index.js:187:21)
at Logger.throwError (/home/robertmagier/projects/DJE/CoinFlip/node_modules/@ethersproject/logger/lib/index.js:196:20)
at /home/robertmagier/projects/DJE/CoinFlip/node_modules/@ethersproject/abstract-signer/lib/index.js:353:47
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Promise.all (index 6)
I tried exactly same scenario on rinkeby and it works without problems, eth_gasestimate works fine.
Ethers version 5.4.1
The text was updated successfully, but these errors were encountered:
Yes this is a problem, it's due to the type: 0 included. Seems infura is not happy with it.
awaitnewethers.providers.InfuraProvider('kovan').estimateGas({from: ethers.constants.AddressZero,to: ethers.constants.AddressZero,type: 0// if this is excluded then the query works})
Edit: even alchemy doesn't like that. type: 0 is also not accepted in an eth_call.
Oh yes. Sorry, I did not tag this issue in the fix. Please check out #1766 for more details.
You are absolutely correct, the issue was missing Berlin support. The JsonRpcProvider now detects non-eip-1559 networks and drops the type of is is 0.
This was addressed in 5.4.3.
I’ll close this issue and let the other issue handle any issues people have. I’ll close that ticket in a few days after people have had a chance to complain. :)
Describe the bug
eth_estimategas function will return invalid params error when running on Infura Kovan network. This happen when calling a Smart Contract function without specifying gas limit. I think it is an error because transaction is not reverting and will complete successfully when gas limit is provided.
This is kovan tx for which gas estimate is failing: Kovan Etherscan
Error message returned from Infura:
I tried exactly same scenario on rinkeby and it works without problems, eth_gasestimate works fine.
Ethers version 5.4.1
The text was updated successfully, but these errors were encountered: