Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

unlimitedContractSize option is not applied to calls to eth_estimateGas #3332

Open
davidmurdoch opened this issue Jul 5, 2022 · 7 comments

Comments

@davidmurdoch
Copy link
Member

Reporduction:

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

The testing script is called deploy.js.

[email protected]
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.

[email protected]
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
[email protected]
[email protected]

Originally posted by @anishnaik in #1645 (comment)

@davidmurdoch
Copy link
Member Author

@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.

@anishnaik
Copy link

Hi @davidmurdoch this makes sense! Appreciate your help.

@davidmurdoch
Copy link
Member Author

Related issue: ethereumjs/ethereumjs-monorepo#2017

@anishnaik
Copy link

@davidmurdoch any updates on this?

@davidmurdoch
Copy link
Member Author

Can you try ganache@alpha and let me know if that fixes it for you??

@anishnaik
Copy link

anishnaik commented Oct 18, 2022

Hey @davidmurdoch apologies for the delayed response. ganache@alpha worked with the above codebase :)

Is there a timeline for an official release?

@davidmurdoch
Copy link
Member Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Backlog
Development

No branches or pull requests

3 participants