Ganache-cli: (Bug) ganache-cli throws "Out of gas" even with big `--gasLimit`

Created on 27 Feb 2019  路  3Comments  路  Source: trufflesuite/ganache-cli

When we run ganache-cli with --gasLimit 0xfffffffffff cli parameter and then run truffle unit tests, one of the big contracts doesn't want to be deployed because of "Out of gas" exception.

The gas needed to deploy that contract is ~6700000.

The gas option which is set in truffle.js is 7000000 (we also tried 8000000, 9000000, 10000000).

We also tried to set --gasLimit to 12000000.

So, it seems that the gasLimit parameter for ganache-cli doesn't work properly.

Steps to Reproduce

1) Clone or download this repo tree.

2) Perform the next commands:

$ npm i
$ npm run test

3) You will see the error. It happens on this line of unit tests. Note that --gasLimit is set to a big value 0xfffffffffff and the gas in truffle.js is set to 7000000.

4) You can also run the next commands in separate consoles to see the output of ganache-cli:

Console 1:

$ node_modules/.bin/ganache-cli --gasLimit 0xfffffffffff --port 8544

Console 2:

$ node_modules/.bin/truffle test --network test

Context

Please help us to figure out with this issue ASAP. We can't write and use unit tests for our contracts until this issue is solved.

Environment

enhancement good first time contribution help wanted priority-low

Most helpful comment

Just to say I've been struggling today with the same problem for a while until I discovered this issue and @varasev's solution. I'd definitely encourage this being made clearer in the error messaging somewhere!

All 3 comments

Seems the --allowUnlimitedContractSize solves the issue. The contract size exceeds 24 Kb. Sorry for false assumption. Closing the issue.

Going to reopen this issue because I think there is an opportunity for us to be more clear as to what is actually happening here in our error messages. @varasev, thanks for taking the time to open it and follow up with the solution!

Just to say I've been struggling today with the same problem for a while until I discovered this issue and @varasev's solution. I'd definitely encourage this being made clearer in the error messaging somewhere!

Was this page helpful?
0 / 5 - 0 ratings