[Ethereum] Transaction cost exceeds current gas limit. (Take II)

gas-limitgenesisparityprivate-blockchain

I am working on a private blockchain using Parity. I have changed the gasLimit parameter to read "4712388" instead of the default (0x1388) and when I try to truffle migrate a contract, I get this error:

[-32010] Transaction cost exceeds current gas limit. Limit: 4700036,
got: 4712388. Try decreasing supplied gas.

Q1: Where does this 4700036 value come from? Be specific. What actual chain spec parameter handles this?

Q2: Can you confirm that this is taken from a different place than the gasLimit parameter, which is set to 4712388?

EDIT: Weeks, later, I have a new issue. It's possible this relates to my other question:

Why would gasLimit be read as 4,700,036 instead of 4,712,388?

Best Answer

The genesis.json file provides the initial gas limit for the first block in the chain, but this can be adjusted a little bit with each block. By default Parity gradually adjusts in line with the amount of gas actually used in transactions, so if you have a barely-used private chain it will keep decreasing.

To prevent it dropping below 4712388, run Parity with --gas-floor-target 4712388.

Related Topic