-
Notifications
You must be signed in to change notification settings - Fork 808
truffle migrate requires infinite gas #960
Comments
Off the top of my head, I believe you're hitting the max contract bytecode size. EIP-170 started a limit of Perhaps turning on the optimizer in your Truffle config will help; here's an example: https://truffleframework.com/docs/truffle/reference/configuration#solc EDIT: I'm just now seeing you have the optimizer enabled with 1000 runs. I take that all back haha. I'll try to reproduce this on Tuesday. Thanks for the bug report! |
Thanks @seesemichaelj , this seems plausible. However, other than stripping my contract down, which is already barely naked at the moment, what other options do I have for a storage contract? At the same time, I'll see if I can nudge the Ethereum core dev team to agree to raise the size limit to bring it more closely inline with the 8M gas limit. |
@jerryji There was much deliberation about the size for the EIP (conversation here: ethereum/EIPs#170) back in August 2017; I doubt it's changing anytime soon, but feel free to try! The limit isn't a limit of how much storage you can use, it's about the size of the deployable bytecode. In the Here's your current number of bytes per contract:
You can see here in However, it turns out your
Your new bytecodes after the change (make sure you add the
Give that a shot and let me know if it works or not! |
@seesemichaelj you are the hero! The optimizer correction saved my life. On a side note, I didn't try to invent the syntax, it was copied from the truffle v5.0.0-beta.0 release page https://github.com/trufflesuite/truffle/releases/tag/v5.0.0-beta.0 --
Do you think I should file a bug report with truffle? Thanks again. |
If you're sure you're using Truffle v5 (do a |
The attached contract package can not be deployed due to (seemingly infinity) high gas required. However, commenting out any trivial function makes it deployable at 6.6M gas. So the deployment gas used seems to jump at a certain point.
Expected Behavior
Well, the contract should be deployable
Current Behavior
"truffle migrate --reset" fails with the following error --
comment out any function, such as getMsgSenderBalance() at line 73 and run "truffle migrate --reset" and it will succeed --
Possible Solution
I have no clue yet
Steps to Reproduce (for bugs)
ethwalldata.zip
Context
Not able to deploy contracts
Your Environment
The text was updated successfully, but these errors were encountered: