Skip to content

Commit

Permalink
fix: checksum cache race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Dec 29, 2024
1 parent 3c74ba5 commit e4f9bf3
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions evmspec/structs/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,7 @@ def as_address(self) -> Address:
f"This {type(self).__name__} does not represent an address", self
)

# there is a race condition in the cache expire function due to
# my hacky removal of the threading.Lock from ttl_cache, but
# the race condition can be ignored for our use-case
# TODO move this fix somewhere more appropriate
while True:
try:
return Address.checksum(self[-20:].hex())
except KeyError:
pass
return Address.checksum(self[-20:].hex())

@property
def as_uint8(self) -> uints.uint8:
Expand Down

0 comments on commit e4f9bf3

Please sign in to comment.