When deploying on main net I get "Exceeds block gas limit"
See original GitHub issue- I’ve asked for help in the Truffle Gitter before filing this issue.
Issue
I ran truffle migrate --network main
, with my Geth running the main net. At every step, I would get:
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Exceeds block gas limit
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
- When it did
deployer.deploy(Migrations);
I got thisblock gas limit
error. - So I changed the line to
deployer.deploy(Migrations, { gas: 300000 });
- Then when it did, behind the scenes,
migrations.setCompleted(1)
, again I gotblock gas limit
. - So I did this
.setCompleted(1)
by hand within Geth - Then when it did
deployer.deploy(MyContract);
I got thisblock gas limit
error. - So I changed the line to
deployer.deploy(MyContract, { gas: 300000 });
- Then when it did, behind the scenes,
migrations.setCompleted(2)
, again I gotblock gas limit
. - So I did this
.setCompleted(2)
by hand within Geth
On my Geth console, I noticed the following:
> eth.getBlock("pending").gasLimit
4709181
// Wait for a block
> eth.getBlock("pending").gasLimit
4704588
Environment
- Operating System: AWS AMI
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
- Truffle version:
$ truffle version
Truffle v2.0.7
- Ethereum client:
$ ~/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
- node version:
$ nodejs --version
v4.5.0
- npm version:
$ npm version
{ npm: '2.15.9',
ares: '1.10.1-DEV',
http_parser: '2.7.0',
icu: '56.1',
modules: '46',
node: '4.5.0',
openssl: '1.0.2h',
uv: '1.9.1',
v8: '4.5.103.37',
zlib: '1.2.8' }
Issue Analytics
- State:
- Created 7 years ago
- Reactions:13
- Comments:37 (5 by maintainers)
Top Results From Across the Web
Out of gas & Exceeds block gas limit, but contract size <24KB
ValueError : Exceeds block gas limit. When I deploy it on the Rinkeby network, I don't get this error, same for BSC testnet....
Read more >How to get Ethereum Block Gas Limit | by Hideyoshi Moriya
Currently (May 4th 2018), Block Gas Limit in mainnet is about 8000000. In Ropsten, 4712388. It looks like fixed. NOTE: Block Gas Limit...
Read more >Out of gas & Exceeds block gas limit, but contract size <24KB
I've 2 contracts I'm trying to deploy on mainnet-fork, but I keep getting this error: VirtualMachineError: out of gas.
Read more >ethereum ganache is failing with "Exceeds block gas limit ...
It's ETH balance (not gas): web3.eth.getBalance(contractOwner).then(console.log); // this returns 99953972490000000000.
Read more >set gas limit hardhat - You.com | The search engine you control.
When I use a lower value (I slowly approached the 1.00 tx fee value to see what happened below that value), I get...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Your value (500000) seems rather low. The default value is 4712388. Try with the default or lower it to 4612388. Not sure why but it then worked on my end…
I had the same issue with truffle 4.0.1
this is my workaround
then in the
truffle.js
: