From 86547e4770da45ce62cfeb78b653e43b9202c135 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Sat, 27 Sep 2025 19:28:43 +0000 Subject: [PATCH 01/12] feat: implement faster-eth-utils --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 03c6b089..ad950982 100644 --- a/setup.py +++ b/setup.py @@ -72,6 +72,7 @@ "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 From a5067c6d5920afb133664bdb1341c09a4853247a Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Sat, 27 Sep 2025 19:28:43 +0000 Subject: [PATCH 02/12] Update utils.py --- silverback/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/silverback/utils.py b/silverback/utils.py index 6b513440..fabfaf4c 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 From 29398b68df377fd2417db5ba94c52fdef4a75fd4 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Sat, 27 Sep 2025 19:28:43 +0000 Subject: [PATCH 03/12] Update runner.py --- silverback/runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From f051766046d20890646c48aeb947573378ceae31 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Sat, 27 Sep 2025 19:28:43 +0000 Subject: [PATCH 04/12] Update main.py --- silverback/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/silverback/main.py b/silverback/main.py index 7ae12c59..7b0df592 100644 --- a/silverback/main.py +++ b/silverback/main.py @@ -14,7 +14,7 @@ from ape.types import AddressType, ContractLog from ape.utils import ManagerAccessMixin from eth_typing import HexStr -from eth_utils import keccak, to_hex +from faster_eth_utils import keccak, to_hex from ethpm_types.abi import encode_topic_value from packaging.version import Version from pydantic import BaseModel From e8da5180eec6d4e12195d55b5beebcc465a34229 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Sat, 27 Sep 2025 19:28:43 +0000 Subject: [PATCH 05/12] Update types.py --- silverback/cluster/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From f22d5b1a02739060c395736a7e6d5f34b49f3a4e Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Sat, 27 Sep 2025 19:28:43 +0000 Subject: [PATCH 06/12] Update test_cluster.py --- tests/test_cluster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 45194cd5d47a780a717171425141cd16e0f0894f Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Sat, 27 Sep 2025 19:28:43 +0000 Subject: [PATCH 07/12] Update setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index ad950982..3ea073f0 100644 --- a/setup.py +++ b/setup.py @@ -67,6 +67,7 @@ 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 From cd70ace3c9c8f53772f482e701092dfad9c775d9 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Sat, 27 Sep 2025 19:28:43 +0000 Subject: [PATCH 08/12] Update main.py --- silverback/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/silverback/main.py b/silverback/main.py index 7b0df592..fb5bf5c1 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 faster_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 From a85a84ee0de6831dee5baebf0f376319aa2e3237 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Sat, 27 Sep 2025 19:28:43 +0000 Subject: [PATCH 09/12] fix mypy err --- silverback/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/silverback/utils.py b/silverback/utils.py index fabfaf4c..10a80a0a 100644 --- a/silverback/utils.py +++ b/silverback/utils.py @@ -34,7 +34,7 @@ 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(",")]) if et else None # type: ignore [arg-type] for et in encoded_topics.split(";") ] ) From b14a0517b7b13f116da80dba1b0d08eeefc39167 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Sat, 27 Sep 2025 19:28:43 +0000 Subject: [PATCH 10/12] noqa: E501 --- silverback/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/silverback/utils.py b/silverback/utils.py index 10a80a0a..ee502ffb 100644 --- a/silverback/utils.py +++ b/silverback/utils.py @@ -34,7 +34,7 @@ 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 # type: ignore [arg-type] + _simplify_topic([to_hex(hexstr=t) for t in et.split(",")]) if et else None # type: ignore [arg-type] noqa: E501 for et in encoded_topics.split(";") ] ) From 51da6c66db8f00b6c075f45a65f648b9aaceeadc Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Sat, 27 Sep 2025 19:28:43 +0000 Subject: [PATCH 11/12] lint --- silverback/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/silverback/utils.py b/silverback/utils.py index ee502ffb..938e86bb 100644 --- a/silverback/utils.py +++ b/silverback/utils.py @@ -34,7 +34,9 @@ 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 # type: ignore [arg-type] noqa: E501 + _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(";") ] ) From b95a572f8eb1384fe3ffe2e09844e4ed3c377b15 Mon Sep 17 00:00:00 2001 From: BobTheBuidler Date: Sat, 27 Sep 2025 19:37:28 +0000 Subject: [PATCH 12/12] lint --- silverback/utils.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/silverback/utils.py b/silverback/utils.py index 938e86bb..ad884dc6 100644 --- a/silverback/utils.py +++ b/silverback/utils.py @@ -34,9 +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(",")] # type: ignore [arg-type] - ) 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(";") ] )