Im testing a really big smart contract using Truffle and Ganache-cli for my test blockchain.
The Ganache-cli configuration im using is this:
ganache-cli --allowUnlimitedContractSize -l 471238800 -d
It allows unlimited contract size and a block gas limit of 471238800.
The deployment and testing of the smart contract with this setup works fine. According to the transaction data, deployment of the smart contract costs 17928724 gas. This is a value 26x inferior to the block gas limit i set.
However if i lower the block gas limit even just a bit (i.e. 460 mil gas instead of 471) when i launch my ganache-cli test blockchain, Truffle throws me 'Error: Exceeds block gas limit' upon attempting to deploy the contract in the very first transaction.
Why is this happening? Any ideas?
Heres the successful transaction log:
Transaction:0x18f0da70b2fafca9c8d5682208f2a4606c5da5dfe38272fe30b659be021c7770 Contract created: 0xe78a0f7e598cc8b0bb87894b0f60dd2a88d6a8ab Gas usage: 17928724 Block Number: 1 Block Time: Sat Mar 23 2019 21:36:29 GMT+0000 (Western European Standard Time)