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

Commit ed663c3

Browse files
vubvub
authored andcommitted
More EIP 96 stuff
1 parent 9024224 commit ed663c3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ethereum/processblock.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ def __init__(self, block, tx):
224224
self.msg = lambda msg: _apply_msg(self, msg, self.get_code(msg.code_address))
225225
self.account_exists = block.account_exists
226226
self.post_homestead_hardfork = lambda: block.number >= block.config['HOMESTEAD_FORK_BLKNUM']
227+
self.post_metropolis_hardfork = lambda: block.number >= block.config['METROPOLIS_FORK_BLKNUM']
227228

228229

229230
def apply_msg(ext, msg):

ethereum/vm.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,11 @@ def vm_execute(ext, msg, code):
384384
mem[start + i] = 0
385385
elif opcode < 0x50:
386386
if op == 'BLOCKHASH':
387-
stk.append(utils.big_endian_to_int(ext.block_hash(stk.pop())))
387+
if ext.post_metropolis_hardfork():
388+
bh_addr = ext._block.config["METROPOLIS_BLOCKHASH_STORE"]
389+
stk.append(ext.get_storage_data(bh_addr, stk.pop()))
390+
else:
391+
stk.append(utils.big_endian_to_int(ext.block_hash(stk.pop())))
388392
elif op == 'COINBASE':
389393
stk.append(utils.big_endian_to_int(ext.block_coinbase))
390394
elif op == 'TIMESTAMP':

0 commit comments

Comments
 (0)