gas required exceeds allowance or always failing transaction on Geth private blockchain but works fine in others
Asked Answered
I

1

8

I have created a private blockchain using geth. I also have a contract in which there is a function which call another function it third contract to set an address. I can call this function on Local blockchains like testRPC and Ganache blockchain, Even it works in TestNet. But Once I setup the private blockchain using (geth). I get this error:

Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?

gas required exceeds allowance or always failing transaction

I have enough ETH in the caller account and also

  • I have enough ETH in the caller account and also
  • GasLimit is high enough
  • The functions does not have any loop or fancy operation, setting an address and some condition checks
  • The node is an Ubuntu 16.04
  • geth -v --> 1.8.12-stable
 // in contract 1 
 function func(address addr) public returns (bool result) {
    Cantract2 c = Cantract2(addr);
    if (!c.setAddress(..)) {
       return false;
    }
       .....
    return true;
  }
Ilene answered 13/7, 2018 at 22:25 Comment(5)
How much total gas is it consuming when it works and what is your block gas limit in your genesis.json?Murguia
@AdamKipnis , sorry for late reply between 32636 - 47375 , in genesis I tried even very high limits even 12000000 ...Ilene
"gas required exceeds allowance or always failing transaction" means the contract will throw an error and revert can you provide the full contract and what parameters you are trying to send.Proto
Hey, did you solve this issue?Iy
Can you retest with the current master of go-ethereum? We have improved the way in which estimate gas reports why a call fails. See github.com/ethereum/go-ethereum/pull/20830Fiend
P
1

You might want to check the genesis file/chain specification of your private test chain.

There is a variable called block gas limit that affects how much gas you can spend on each block. I recall that the default value used to be very low back in the days and maybe you are using such a config. What you could do:

  • check the block gas limit in the dev chain configuration and increase it as to your needs
  • or let the local test chain run for some time as the client will vote up the default block gas limit slowly, allowing you for larger transactions per block
Phonemics answered 22/9, 2021 at 7:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.