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

A problem about gas limit #3760

Closed
ShawnyXiao opened this issue Mar 8, 2017 · 2 comments
Closed

A problem about gas limit #3760

ShawnyXiao opened this issue Mar 8, 2017 · 2 comments

Comments

@ShawnyXiao
Copy link

I'm encountering a problem. I want to build a private Ethereum blockchain. So I create a file, named genesis.json:

{
  "alloc": {},
  "coinbase": "0x0000000000000000000000000000000000000000",
  "difficulty": "0x2000",
  "extraData": "Inplus Genesis Block",
  "gasLimit": "0xffffffff",
  "nonce": "0x0000000000000042",
  "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "timestamp": "0x00"
}

Note that gas limit is set the max value 0xffffffff, equals with 4294967295 in dec. But when I deploy a huge contract, which needs about 3864853195 gas, I get an error that Exceeds block gas limit undefined. It makes me strange that 3864853195 is absolutely less than 4294967295, but why I get this error.

Please tell me how to solve it. Thank you.

@karalabe
Copy link
Member

karalabe commented Mar 8, 2017

While mining, the miner can choose to push the gas limit up by a bit, or to bring it down by a bit. The default behavior is that if blocks are full, the limit is pushed up, whereas it blocks are empty, the limit is pushed downwards towards a baseline. This baseline by default is 4.7M. You can change it with --targetgaslimit when starting your miner.

@ShawnyXiao
Copy link
Author

Thank you. I have solved it. ^^

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

2 participants