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

Commit e1a871a

Browse files
author
Jan Xie
committed
implement EIP161 bug
1 parent 36536e3 commit e1a871a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ethereum/state.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
ACCOUNT_OUTPUTTABLE_PARAMS = ('nonce', 'balance', 'code')
2424
BLANK_HASH = utils.sha3(b'')
2525

26+
RIPEMD160_ADDR = utils.decode_hex(b'0000000000000000000000000000000000000003')
27+
28+
2629
@lru_cache(1024)
2730
def get_block(db, blockhash):
2831
"""
@@ -311,7 +314,9 @@ def revert(self, snapshot):
311314
setattr(self, addr, preval)
312315
elif root == self.trie.root_hash:
313316
self.cache[addr][key] = preval
314-
if not premod:
317+
# Sync up with Parity's EIP161 bug: keep ripemd160 modified so account cleaning will be triggered later
318+
# https://github.com/ethereum/go-ethereum/pull/3341/files#r89548312
319+
if not premod and addr != RIPEMD160_ADDR:
315320
del self.modified[addr]
316321

317322
# Converts the state tree to a dictionary

0 commit comments

Comments
 (0)