Kovan contract creation gas limit behavior

by Kristaps   Last Updated October 17, 2019 16:28 PM - source

I have a fairly large contract that I must create on Kovan network for testing. There is fairly weird behavior occurring when I am trying to create the said contract.

Behavior being: whenever transaction consumed limit goes over 6`000`000 gas the transaction fails with out of gas error (in spite of 10`000`000 gas limit specified (which was the block gas limit).

Now my contact theoretical size is around 6.8-7 million limit when created.

Here is some sample transactions: This one succeeded when I stripped away some functions from the code (unrelated to initialization): https://kovan.etherscan.io/tx/0x0d903408120c352876879d833ecfec01f7f4b8b3a17967b6f4920b4d30c9253b

This one fails (raw transaction size 58`236/2 bytes), meaning around 5.8236 million limit + some EVM specified gas costs (contract creation etc.) Which in result goes over 6 millions: https://kovan.etherscan.io/tx/0xc8a1a2d4c3c010801cd769b0325c4bf1c8dcb2bc47f76505f91dface7cb62050


  • As you can see in both cases here where plenty of room left in the block for new transaction, is there some sort of limit that I am not aware of?
  • Any tips on how to solve this issue?
  • Is this behavior chain/node specific?

Haven't actually tested this on any other chains.

I know that this is a large contract by all standards, but splitting it into more subcontracts would increase the operational cost for each transaction + increase logical complexity (ensuring only allowed actors are accessing specific public methods). On top of that it already is one part of a series of interconnected contracts.

Related Questions

Gas limit being reached when deploying

Updated February 15, 2018 14:28 PM

out of gas when deploying to test RPC and Rinkeby

Updated June 19, 2018 11:28 AM