Skip to content

Commit

Permalink
Merge pull request ethereum#770 from beaugunderson/develop
Browse files Browse the repository at this point in the history
add BLOCK_GAS_LIMIT
  • Loading branch information
Jan Xie authored Jul 12, 2017
2 parents a6875c8 + 9b829fc commit afa24f2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions ethereum/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# (block.gas_used * 6 / 5) / 1024
GASLIMIT_EMA_FACTOR=1024,
GASLIMIT_ADJMAX_FACTOR=1024,
BLOCK_GAS_LIMIT=4712388,
BLKLIM_FACTOR_NOM=3,
BLKLIM_FACTOR_DEN=2,
# Network ID
Expand Down
7 changes: 4 additions & 3 deletions ethereum/genesis_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@ def mk_genesis_block(env, **kwargs):


def mk_basic_state(alloc, header=None, env=None, executing_on_head=False):
state = State(env=env or Env(), executing_on_head=executing_on_head)
env = env or Env()
state = State(env=env, executing_on_head=executing_on_head)
if not header:
header = {
"number": 0, "gas_limit": 4712388, "gas_used": 0,
"timestamp": 1467446877, "difficulty": 1,
"number": 0, "gas_limit": env.config['BLOCK_GAS_LIMIT'],
"gas_used": 0, "timestamp": 1467446877, "difficulty": 1,
"uncles_hash": '0x'+encode_hex(BLANK_UNCLES_HASH)
}
h = BlockHeader(number=parse_as_int(header['number']),
Expand Down
2 changes: 1 addition & 1 deletion ethereum/pow/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(self, genesis=None, env=None, \
print('Initializing chain from new state based on alloc')
self.state = mk_basic_state(genesis, {
"number": kwargs.get('number', 0),
"gas_limit": kwargs.get('gas_limit', 4712388),
"gas_limit": kwargs.get('gas_limit', self.env.config['BLOCK_GAS_LIMIT']),
"gas_used": kwargs.get('gas_used', 0),
"timestamp": kwargs.get('timestamp', 1467446877),
"difficulty": kwargs.get('difficulty', 2**25),
Expand Down

0 comments on commit afa24f2

Please sign in to comment.