question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`unlimitedContractSize` option is not applied to calls to `eth_estimateGas`

See original GitHub issue

Reporduction:

Clone https://github.com/anishnaik/ganache-bug and checkout the bug branch.

The testing script is called deploy.js.

Ganache@7.3.2 Terminal 1

npm uninstall -g ganache-cli (if applicable)
npm install -g ganache
ganache -d -l 100000000000 --chain.allowUnlimitedContractSize --miner.callGasLimit 0x1fffffffffffff

Terminal 2

npm install
npx hardhat test deploy.js

This should fail with the following error:

  Deploy contracts for Echidna
    1) Deploy


  0 passing (110ms)
  1 failing

  1) Deploy contracts for Echidna
       Deploy:
     ProviderError: VM Exception while processing transaction: out of gas
      at HttpProvider.request (node_modules/hardhat/src/internal/core/providers/http.ts:78:19)
      at GanacheGasMultiplierProvider._getMultipliedGasEstimation (node_modules/hardhat/src/internal/core/providers/gas-providers.ts:72:59)
      at GanacheGasMultiplierProvider.request (node_modules/hardhat/src/internal/core/providers/gas-providers.ts:309:19)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

You can try to set a gasLimit for the deploy() call and if it is large enough, the test will pass.

ganache-cli@6.12.2 Terminal 1

npm uninstall -g ganache
npm install -g ganache-cli
ganache-cli -d --gasLimit 100000000000 --allowUnlimitedContractSize

Terminal 2

npx hardhat test deploy.js

This test should pass

This could also be a dependency issue in the hardhat environment?

Environment MacBook Pro w/ Apple M1 Max Hardhat v2.9.9 Ganache@7.3.2 ganache-cli@6.12.2

_Originally posted by @anishnaik in https://github.com/trufflesuite/ganache/issues/1645#issuecomment-1171642018_

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
davidmurdochcommented, Jul 5, 2022

@anishnaik I’ve found the issue. callGasLimit is working in eth_estimateGas, but allowUnlimitedContractSize is not.

estimateGas makes a copy of the VM before running the transaction in order to estimate it. The allowUnlimitedContractSize property is not copied, as you can see here:

image

There is currently no work around but I hope to get a fix in for this very soon.

0reactions
davidmurdochcommented, Oct 19, 2022

There is no timeline; we are working now to improve stability.

Read more comments on GitHub >

github_iconTop Results From Across the Web

transaction may fail or may require manual gas limit - Contracts
This script is working fine and giving me the contract address after I run ... There is an option like allowUnlimitedContractSize: true, ...
Read more >
Ganache CLI options - Truffle Suite
Ganache command line options¶. This reference describes the syntax of the Ganache command line interface (CLI) options for the Ethereum network.
Read more >
Reference | Ethereum development environment for ... - Hardhat
This parameter behaves like gas . Default value: "auto" . Note that when using ethers this value will not be applied.
Read more >
ganache-cli - npm
"allowUnlimitedContractSize" : boolean - Allows unlimited contract sizes while debugging (NOTE: this setting is often used in conjuction ...
Read more >
ganache-cli - Fig.io
Options ; -m, --mnemonic, Use a bip39 mnemonic phrase for generating a PRNG seed, which is in turn used for hierarchical deterministic (HD)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found