diff --git a/setup.py b/setup.py index 03c6b089..3ea073f0 100644 --- a/setup.py +++ b/setup.py @@ -67,11 +67,13 @@ include_package_data=True, install_requires=[ "apepay>=0.3.5,<1", + "cchecksum>=0.0.3", # lower pin only, `eth-ape` governs upper pin "click", # Use same version as eth-ape "eth-ape>=0.8.31,<1", "ethpm-types>=0.6.10", # lower pin only, `eth-ape` governs upper pin "eth-pydantic-types", # Use same version as eth-ape "exceptiongroup; python_version < '3.11'", # Used with TaskGroup + "faster-eth-utils>=2.1.0", # lower pin only, `eth-ape` governs upper pin "httpx>=0.28,<1", # Use for Cluster client, auth "jwcrypto>=1.4,<2", # Use for auth "packaging", # Use same version as eth-ape diff --git a/silverback/cluster/types.py b/silverback/cluster/types.py index ad3bf861..41ab7149 100644 --- a/silverback/cluster/types.py +++ b/silverback/cluster/types.py @@ -10,7 +10,7 @@ from ape.types import AddressType, HexBytes from cryptography.exceptions import InvalidSignature from cryptography.hazmat.primitives.hmac import HMAC, hashes -from eth_utils import to_bytes, to_int +from faster_eth_utils import to_bytes, to_int from pydantic import BaseModel, Field, computed_field, field_validator from typing_extensions import Self diff --git a/silverback/main.py b/silverback/main.py index da65c834..911ece89 100644 --- a/silverback/main.py +++ b/silverback/main.py @@ -14,8 +14,8 @@ from ape.types import AddressType, ContractLog from ape.utils import ManagerAccessMixin from eth_typing import HexStr -from eth_utils import keccak, to_hex from ethpm_types.abi import encode_topic_value +from faster_eth_utils import keccak, to_hex from packaging.version import Version from pydantic import BaseModel from taskiq import AsyncTaskiqDecoratedTask, TaskiqEvents diff --git a/silverback/runner.py b/silverback/runner.py index 4bdbf815..48801daa 100644 --- a/silverback/runner.py +++ b/silverback/runner.py @@ -13,7 +13,7 @@ from ape import chain from ape.logging import logger from ape.utils import ManagerAccessMixin -from eth_utils import to_checksum_address +from cchecksum import to_checksum_address from ethpm_types import EventABI from packaging.specifiers import SpecifierSet from packaging.version import Version diff --git a/silverback/utils.py b/silverback/utils.py index 6b513440..ad884dc6 100644 --- a/silverback/utils.py +++ b/silverback/utils.py @@ -4,7 +4,7 @@ from ape.types import HexBytes from eth_typing import HexStr -from eth_utils import to_hex +from faster_eth_utils import to_hex Topic = list[HexStr] | HexStr | None @@ -34,7 +34,13 @@ def decode_topics_from_string(encoded_topics: str) -> list[Topic]: # NOTE: Should reverse the above return _clean_trailing_nones( [ - _simplify_topic([to_hex(hexstr=t) for t in et.split(",")]) if et else None + ( + _simplify_topic( + [to_hex(hexstr=t) for t in et.split(",")] # type: ignore [arg-type] + ) + if et + else None + ) for et in encoded_topics.split(";") ] ) diff --git a/tests/test_cluster.py b/tests/test_cluster.py index 8a9a909e..c82ea362 100644 --- a/tests/test_cluster.py +++ b/tests/test_cluster.py @@ -1,4 +1,4 @@ -from eth_utils import to_checksum_address +from cchecksum import to_checksum_address from hypothesis import given from hypothesis import strategies as st from hypothesis_jsonschema import from_schema