Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit afa24f2

Browse files
author
Jan Xie
authored
Merge pull request #770 from beaugunderson/develop
add BLOCK_GAS_LIMIT
2 parents a6875c8 + 9b829fc commit afa24f2

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

ethereum/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
# (block.gas_used * 6 / 5) / 1024
2828
GASLIMIT_EMA_FACTOR=1024,
2929
GASLIMIT_ADJMAX_FACTOR=1024,
30+
BLOCK_GAS_LIMIT=4712388,
3031
BLKLIM_FACTOR_NOM=3,
3132
BLKLIM_FACTOR_DEN=2,
3233
# Network ID

ethereum/genesis_helpers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,12 @@ def mk_genesis_block(env, **kwargs):
107107

108108

109109
def mk_basic_state(alloc, header=None, env=None, executing_on_head=False):
110-
state = State(env=env or Env(), executing_on_head=executing_on_head)
110+
env = env or Env()
111+
state = State(env=env, executing_on_head=executing_on_head)
111112
if not header:
112113
header = {
113-
"number": 0, "gas_limit": 4712388, "gas_used": 0,
114-
"timestamp": 1467446877, "difficulty": 1,
114+
"number": 0, "gas_limit": env.config['BLOCK_GAS_LIMIT'],
115+
"gas_used": 0, "timestamp": 1467446877, "difficulty": 1,
115116
"uncles_hash": '0x'+encode_hex(BLANK_UNCLES_HASH)
116117
}
117118
h = BlockHeader(number=parse_as_int(header['number']),

ethereum/pow/chain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(self, genesis=None, env=None, \
6060
print('Initializing chain from new state based on alloc')
6161
self.state = mk_basic_state(genesis, {
6262
"number": kwargs.get('number', 0),
63-
"gas_limit": kwargs.get('gas_limit', 4712388),
63+
"gas_limit": kwargs.get('gas_limit', self.env.config['BLOCK_GAS_LIMIT']),
6464
"gas_used": kwargs.get('gas_used', 0),
6565
"timestamp": kwargs.get('timestamp', 1467446877),
6666
"difficulty": kwargs.get('difficulty', 2**25),

0 commit comments

Comments
 (0)