Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gas limit for deployment #12

Open
graup opened this issue May 30, 2016 · 8 comments
Open

Gas limit for deployment #12

graup opened this issue May 30, 2016 · 8 comments

Comments

@graup
Copy link
Collaborator

graup commented May 30, 2016

gas: config.gasLimit,

Hi, I am wondering if we could use estimateGas instead of this. We are trying to use it for deployment on a real (test) net and sometimes run into gas problems. I don't know if this is the problem, but it could be connected. I think the official Ethereum wallet deploys contracts with estimateGas() + 20000.

@uzyn
Copy link
Owner

uzyn commented May 30, 2016

What is the error that you got?

If I'm not mistaken, gasLimit >= estimateGas().

But yeah, I think set default to estimateGas() + 20000 is better than setting the default at block max.

@kyroy
Copy link

kyroy commented Jun 1, 2016

@graup said, we had some deployment problems, but they now randomly disappeared.

Module build failed: Error: The contract code couldn't be stored, please check your gas amount.

(This message doesn't mean that the problem is the gas amount.)

@uzyn
Copy link
Owner

uzyn commented Jun 3, 2016

Have you managed to identify this issue?

Could it be because the primary account does not have enough eth to cover the gas amount that's specified, especially since the original code is using max.

@graup it makes sense to set default gas to estimateGas() instead of max. You want to submit a PR?

@kyroy
Copy link

kyroy commented Jun 3, 2016

Here is our main account on the testnet
http://testnet.etherscan.io/address/0x78ab9626dff0dbd0b4a14eddad8f24d53c801a8a

@uzyn
Copy link
Owner

uzyn commented Jul 7, 2016

Is this issue still relevant?

If you have managed to solve it, please do submit a PR or share on how it's solved.

Thanks.

@graup
Copy link
Collaborator Author

graup commented Jul 7, 2016

For our tests, we solved it increasing the gas limit. Testrpc now offers an option for that. The raised limit is recognised by the loader.

At this point I am not sure if we should still change the implementation to estimateGas. Do you see any advantages?

@uzyn
Copy link
Owner

uzyn commented Jul 8, 2016

I think it's still beneficial to update estimateGas to be based on actual estimated gas than protocol's max gas limit for a few reasons:

  1. testrpc or other simulator's broken gas limit.
  2. The limit might be too high on actual live network that the deploying account may not have enough ETH for.

@graup
Copy link
Collaborator Author

graup commented Jul 8, 2016

I agree. I will look into implementing this change then.

There were, however, some issues with that in testrpc:
trufflesuite/ganache-cli-archive#86
trufflesuite/ganache-cli-archive#58

I need to test that this actually works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants