Skip to content

Commit

Permalink
Fix envvar configuration for keccak caches
Browse files Browse the repository at this point in the history
  • Loading branch information
Uxio0 committed Mar 18, 2024
1 parent 52acd5e commit 6f4eebb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gnosis/eth/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_empty_tx_params() -> TxParams:
}


@lru_cache(maxsize=os.environ.get("CACHE_KECCAK", None))
@lru_cache(maxsize=int(os.getenv("CACHE_KECCAK", 512)))
def _keccak_256(value: bytes) -> bytes:
return keccak_256(value)

Expand Down Expand Up @@ -87,7 +87,7 @@ def _build_checksum_address(
)


@lru_cache(maxsize=os.environ.get("CACHE_CHECKSUM_ADDRESS", None))
@lru_cache(maxsize=int(os.getenv("CACHE_CHECKSUM_ADDRESS", 1_000_000_000)))
def _fast_to_checksum_address(address: HexAddress):
address_hash = fast_keccak_hex(address.encode())
return _build_checksum_address(address, address_hash)
Expand Down

0 comments on commit 6f4eebb

Please sign in to comment.