-
Notifications
You must be signed in to change notification settings - Fork 2.3k
When deploying on main net I get "Exceeds block gas limit" #271
Comments
In your truffle.js, can you reduce rpc.gas a tiny bit and see if that helps? |
Like so? rpc: {
host: "localhost",
port: 8545
},
networks: {
"main": {
network_id: 1,
gas: 500000
}
} |
Your value (500000) seems rather low. The default value is 4712388. |
+1 |
I get the same message even when I set gas limit to 1 ether |
I'm getting the same error. Unable to migrate contracts. |
I am also having this issue. Unable to deploy contracts
Resolved by the solution found @ stackoverflow from user Matthew Schmidt
|
For me modifying the gas in truffle.js worked. |
yeeaaa @chevdor! modifying the gas in truffle.js worked for me as well :) |
If I set the gas in truffle.js to 4500000 I get out of gas. If I set it to 4750000 i get exceeds block gas limit. I could continue the trial and error binary search of the gas space, but I suspect there may be no gas number that satisfies both constraints. What do I do? |
As you describe it, your problem is with your contract constructor. |
Also had this gas deployment issue with truffle 3.4.11. Changing the gas limit didn't help me (already had mine at 4M), but two things did the trick:
|
Here's result for truffle 4.0 with testrpc, at old MetaCoin example.
But it working fine in Any idea for magic number? |
@katopz |
I get this error too, none of these gas values work for me. |
I had the same issue with truffle 4.0.1 this is my workaround
then in the
|
@ledinhhuy88 I followed the above steps you just posted, and I still got the same error (truffle version 4.0.1) |
Some of you guys have contracts that just don't deploy. Either because you have a mammoth one that has too big a bytecode or because you |
Nope, mines issue #650 and I basically followed a tutorial, so it should
compile properly.
…On Nov 5, 2017 3:57 PM, "Xavier Leprêtre" ***@***.***> wrote:
Some of you guys have contracts that just don't deploy. Either because you
have a mammoth one that has too big a bytecode or because you throw in
the constructor.
This thread is not what you are looking for.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#271 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AeABokRHqUNpsOCegfcG4Yaatox0HxhEks5sziFPgaJpZM4KC3bx>
.
|
@NateDev100 So perhaps you can remove your comments to avoid misleading subsequent visitors. |
How's it misleading? That's the error I'm getting
On Nov 6, 2017 9:19 AM, "Xavier Leprêtre" <[email protected]> wrote:
@NateDev100 <https://github.com/natedev100> So perhaps you can remove your
comments to avoid misleading subsequent visitors.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#271 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AeABooqiO2IBzO6GJ8Z4KyAdc62ealynks5szxWKgaJpZM4KC3bx>
.
|
This issue here is specifically for main net. Not just "deployment". |
Well I get the same error with main net as well so... Yeah
On Nov 6, 2017 10:54 AM, "Xavier Leprêtre" <[email protected]> wrote:
This issue here is specifically for main net. Not just "deployment".
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#271 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AeABohaNWam2tlzhkPR6mwscygZ3oTimks5szyu0gaJpZM4KC3bx>
.
|
Of course, if you get an error on any net, it has nothing to do with the net, or the main net. |
@ledinhhuy88's solution worked for me. |
In config file, try with module.exports = { it worked for me |
@flockonus solution to update testrpc worked for me. |
@sarthakmis solution resolved my issue. |
i had the same issue with either running out of gas or exceeding block gas limit (on the development-network). my contracts were big. in truffle.js maybe without optimizing they exceeded the max stack-depth?...not sure, happy it works |
I got an error message with gas:6700000. I changed it to 670000 and it worked. |
Was getting "Exceeds block gas limit" errors locally, and this fixed it. trufflesuite/truffle#271 (comment)
Just add the value of gas to manual |
I think the error is too generic and misleading. That is why it works for some people and does not for some others, because the root cause is different, but the error is same. (too generic) |
This worked for me ropsten: { |
try then truffle.js: |
Otherwise got: ``` $ truffle migrate --network ropsten Using network 'ropsten'. Running migration: 1_initial_migration.js Deploying Migrations... Error encountered, bailing. Network state unknown. Review successful transactions manually. exceeds block gas limit ``` Just copied value from this comment: trufflesuite/truffle#271 (comment)
I found that my cause of the error was missing '0x' in .deploy( ) parameter |
This issue is old. Closing for maintenance. Thanks! |
how to set gas limit to 1 ether |
Issue
I ran
truffle migrate --network main
, with my Geth running the main net. At every step, I would get:Steps to Reproduce
Do
truffle migrate
targeting the main net.Expected Behaviour
I would have thought that a reasonable amount of gas would be given to the transactions.
Actual Results
deployer.deploy(Migrations);
I got thisblock gas limit
error.deployer.deploy(Migrations, { gas: 300000 });
migrations.setCompleted(1)
, again I gotblock gas limit
..setCompleted(1)
by hand within Gethdeployer.deploy(MyContract);
I got thisblock gas limit
error.deployer.deploy(MyContract, { gas: 300000 });
migrations.setCompleted(2)
, again I gotblock gas limit
..setCompleted(2)
by hand within GethOn my Geth console, I noticed the following:
Environment
$ ~/go-ethereum/build/bin/geth version Geth Version: 1.4.12-stable-421df866 Protocol Versions: [63 62] Network Id: 1 Go Version: go1.6 OS: linux GOPATH= GOROOT=/usr/lib/go
The text was updated successfully, but these errors were encountered: