Skip to content

A problem about gas limit #3760

Closed
Closed
@ShawnyXiao

Description

@ShawnyXiao

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.

Activity

karalabe

karalabe commented on Mar 8, 2017

@karalabe
Member

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

ShawnyXiao commented on Mar 9, 2017

@ShawnyXiao
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @karalabe@ShawnyXiao

        Issue actions

          A problem about gas limit · Issue #3760 · ethereum/go-ethereum