1

I am entirely unsure what the root cause is, but every time I use web3.eth.estimateGas with my call's parameters, it results in the last blocks gas limit as the result (~8 million). I have even tested with a normal transaction which should result in 21,000 gas, but gives around 8 million. Not sure if a limitation of using infura nodes or a implementation issue.

// Get the gas estimate for the current transaction
window.web3.eth.estimateGas({
  from: transactionData.params[0].from,
  to: transactionData.params[0].to,
  data: transactionData.params[0].data,
  value: transactionData.params[0].value,
  nonce: transactionData.params[0].nonce
}, function(error, result) {
  console.log(result)l
}

Here is more specifically the way I am calling the API. Any suggestions?

UPDATE: I have a workaround, instead of using web3, I directly call Infura's eth_estiamteGas with a https POST. https://infura.io/docs/ethereum/json-rpc/eth_estimateGas

2

My guess would be this is the way to indicate that the transaction you are about to check is considered to be invalid for some reason, a.k.a. indicated by using 8 mil. gas, a.k.a. the maximum that's possible, a.k.a. to cause "out of gas".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.