From 3569a922f728cbdcfbed25f2d2046bd852cebe28 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Fri, 1 Nov 2024 16:31:04 -0500 Subject: [PATCH 01/10] feat: upgrade web3 --- setup.py | 13 ++++++------- src/ape_accounts/accounts.py | 2 +- src/ape_ethereum/provider.py | 10 +++------- src/ape_node/provider.py | 2 +- src/ape_test/accounts.py | 2 +- tests/functional/geth/test_provider.py | 2 +- 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/setup.py b/setup.py index 2a3a65f98d..ab2daf8310 100644 --- a/setup.py +++ b/setup.py @@ -118,15 +118,14 @@ "urllib3>=2.0.0,<3", "watchdog>=3.0,<4", # ** Dependencies maintained by Ethereum Foundation ** - # All version pins dependent on web3[tester] - "eth-abi", - "eth-account", - "eth-typing>=3.5.2,<4", - "eth-utils", - "hexbytes", + "eth-abi>=5.1.0,<6", + "eth-account>=0.13.4,<0.14", + "eth-typing>=5.0.1,<6", + "eth-utils>=5.1.0,<6", + "hexbytes>=1.2.1,<2", "py-geth>=5.1.0,<6", "trie>=3.0.1,<4", # Peer: stricter pin needed for uv support. - "web3[tester]>=6.17.2,<7", + "web3[tester]>=7.6.0,<8", # ** Dependencies maintained by ApeWorX ** "eip712>=0.2.10,<0.3", "ethpm-types>=0.6.19,<0.7", diff --git a/src/ape_accounts/accounts.py b/src/ape_accounts/accounts.py index 7dd0bae941..47d4949e9b 100644 --- a/src/ape_accounts/accounts.py +++ b/src/ape_accounts/accounts.py @@ -255,7 +255,7 @@ def sign_raw_msghash(self, msghash: HexBytes) -> Optional[MessageSignature]: # Also, we have already warned the user about the safety. with warnings.catch_warnings(): warnings.simplefilter("ignore") - signed_msg = EthAccount.signHash(msghash, self.__key) + signed_msg = EthAccount.unsafe_sign_hash(msghash, self.__key) return MessageSignature( v=signed_msg.v, diff --git a/src/ape_ethereum/provider.py b/src/ape_ethereum/provider.py index eba0c2d3cc..95cd239977 100644 --- a/src/ape_ethereum/provider.py +++ b/src/ape_ethereum/provider.py @@ -19,9 +19,7 @@ from evmchains import PUBLIC_CHAIN_META, get_random_rpc from pydantic.dataclasses import dataclass from requests import HTTPError -from web3 import HTTPProvider, IPCProvider, Web3 -from web3 import WebsocketProvider as WebSocketProvider -from web3._utils.http import construct_user_agent +from web3 import HTTPProvider, IPCProvider, Web3, WebSocketProvider from web3.exceptions import ContractLogicError as Web3ContractLogicError from web3.exceptions import ( ExtraDataLengthError, @@ -30,7 +28,7 @@ TransactionNotFound, ) from web3.gas_strategies.rpc import rpc_gas_price_strategy -from web3.middleware import geth_poa_middleware as ExtraDataToPOAMiddleware +from web3.middleware import ExtraDataToPOAMiddleware from web3.middleware.validation import MAX_EXTRADATA_LENGTH from web3.providers import AutoProvider from web3.providers.auto import load_provider_from_environment @@ -1326,9 +1324,7 @@ class EthereumNodeProvider(Web3Provider, ABC): name: str = "node" # NOTE: Appends user-agent to base User-Agent string. - request_header: dict = { - "User-Agent": construct_user_agent(str(HTTPProvider)), - } + request_header: dict = {} @property def uri(self) -> str: diff --git a/src/ape_node/provider.py b/src/ape_node/provider.py index e7b49415ac..ccffadf44a 100644 --- a/src/ape_node/provider.py +++ b/src/ape_node/provider.py @@ -13,7 +13,7 @@ from pydantic import field_validator from pydantic_settings import SettingsConfigDict from requests.exceptions import ConnectionError -from web3.middleware import geth_poa_middleware as ExtraDataToPOAMiddleware +from web3.middleware import ExtraDataToPOAMiddleware from ape.api.config import PluginConfig from ape.api.providers import SubprocessProvider, TestProviderAPI diff --git a/src/ape_test/accounts.py b/src/ape_test/accounts.py index 43c46a29fd..c2490d34bc 100644 --- a/src/ape_test/accounts.py +++ b/src/ape_test/accounts.py @@ -166,7 +166,7 @@ def sign_transaction( def sign_raw_msghash(self, msghash: HexBytes) -> MessageSignature: with warnings.catch_warnings(): warnings.simplefilter("ignore") - signed_msg = EthAccount.signHash(msghash, self.private_key) + signed_msg = EthAccount.unsafe_sign_hash(msghash, self.private_key) return MessageSignature( v=signed_msg.v, diff --git a/tests/functional/geth/test_provider.py b/tests/functional/geth/test_provider.py index 3b7a8bee7c..05e0f1cc6a 100644 --- a/tests/functional/geth/test_provider.py +++ b/tests/functional/geth/test_provider.py @@ -11,7 +11,7 @@ from web3 import AutoProvider, Web3 from web3.exceptions import ContractLogicError as Web3ContractLogicError from web3.exceptions import ExtraDataLengthError -from web3.middleware import geth_poa_middleware as ExtraDataToPOAMiddleware +from web3.middleware import ExtraDataToPOAMiddleware from web3.providers import HTTPProvider from ape.exceptions import ( From 5273714d0392d6aa8d791cd89daa285021eaa4d2 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Mon, 2 Dec 2024 16:03:30 -0600 Subject: [PATCH 02/10] test: update tests --- tests/functional/test_ecosystem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/test_ecosystem.py b/tests/functional/test_ecosystem.py index f93d27a464..304611d2a6 100644 --- a/tests/functional/test_ecosystem.py +++ b/tests/functional/test_ecosystem.py @@ -1188,11 +1188,11 @@ def get_calltree(self) -> CallTreeNode: { "name": "NumberChange", "calldata": { - "b": "0x3e..404b", + "b": "0x3ee0..404b", "prevNum": 0, "dynData": '"Dynamic"', "newNum": 123, - "dynIndexed": "0x9f..a94d", + "dynIndexed": "0x9f3d..a94d", }, } ] From eda83eb3533e149c89d6b88520eb53f6b1a7a5b1 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Mon, 2 Dec 2024 16:16:12 -0600 Subject: [PATCH 03/10] feat: make work on both --- src/ape/utils/_web3_compat.py | 22 ++++++++++++++++++++++ src/ape_ethereum/provider.py | 2 +- src/ape_node/provider.py | 2 +- tests/functional/geth/test_provider.py | 2 +- 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 src/ape/utils/_web3_compat.py diff --git a/src/ape/utils/_web3_compat.py b/src/ape/utils/_web3_compat.py new file mode 100644 index 0000000000..b915e679c0 --- /dev/null +++ b/src/ape/utils/_web3_compat.py @@ -0,0 +1,22 @@ +from eth_account import Account as EthAccount + +try: + # Web3 v7 + from web3.middleware import ExtraDataToPOAMiddleware # type: ignore +except ImportError: + from web3.middleware import geth_poa_middleware as ExtraDataToPOAMiddleware # type: ignore + + +def sign_hash(msghash, private_key): + try: + # Web3 v7 + return EthAccount.unsafe_sign_hash(msghash, private_key) # type: ignore + except AttributeError: + # Web3 v6 + return EthAccount.signHash(msghash, private_key) # type: ignore + + +__all__ = [ + "ExtraDataToPOAMiddleware", + "sign_hash", +] diff --git a/src/ape_ethereum/provider.py b/src/ape_ethereum/provider.py index 95cd239977..4524bde318 100644 --- a/src/ape_ethereum/provider.py +++ b/src/ape_ethereum/provider.py @@ -28,7 +28,6 @@ TransactionNotFound, ) from web3.gas_strategies.rpc import rpc_gas_price_strategy -from web3.middleware import ExtraDataToPOAMiddleware from web3.middleware.validation import MAX_EXTRADATA_LENGTH from web3.providers import AutoProvider from web3.providers.auto import load_provider_from_environment @@ -57,6 +56,7 @@ from ape.types.events import ContractLog, LogFilter from ape.types.gas import AutoGasLimit from ape.types.trace import SourceTraceback +from ape.utils._web3_compat import ExtraDataToPOAMiddleware from ape.utils.basemodel import ManagerAccessMixin from ape.utils.misc import DEFAULT_MAX_RETRIES_TX, gas_estimation_error_message, to_int from ape_ethereum._print import CONSOLE_ADDRESS, console_contract diff --git a/src/ape_node/provider.py b/src/ape_node/provider.py index ccffadf44a..63ff0b8279 100644 --- a/src/ape_node/provider.py +++ b/src/ape_node/provider.py @@ -13,11 +13,11 @@ from pydantic import field_validator from pydantic_settings import SettingsConfigDict from requests.exceptions import ConnectionError -from web3.middleware import ExtraDataToPOAMiddleware from ape.api.config import PluginConfig from ape.api.providers import SubprocessProvider, TestProviderAPI from ape.logging import LogLevel, logger +from ape.utils._web3_compat import ExtraDataToPOAMiddleware from ape.utils.misc import ZERO_ADDRESS, log_instead_of_fail, raises_not_implemented from ape.utils.process import JoinableQueue, spawn from ape.utils.testing import ( diff --git a/tests/functional/geth/test_provider.py b/tests/functional/geth/test_provider.py index 05e0f1cc6a..a8e49e82c1 100644 --- a/tests/functional/geth/test_provider.py +++ b/tests/functional/geth/test_provider.py @@ -11,7 +11,6 @@ from web3 import AutoProvider, Web3 from web3.exceptions import ContractLogicError as Web3ContractLogicError from web3.exceptions import ExtraDataLengthError -from web3.middleware import ExtraDataToPOAMiddleware from web3.providers import HTTPProvider from ape.exceptions import ( @@ -26,6 +25,7 @@ VirtualMachineError, ) from ape.utils import to_int +from ape.utils._web3_compat import ExtraDataToPOAMiddleware from ape_ethereum.ecosystem import Block from ape_ethereum.provider import DEFAULT_SETTINGS, EthereumNodeProvider from ape_ethereum.trace import TraceApproach From 96e3f9d6e27fc8b0f20b74ae6020d80769a4b164 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Mon, 2 Dec 2024 16:34:20 -0600 Subject: [PATCH 04/10] fix: pin adjust --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index ab2daf8310..167ca2426f 100644 --- a/setup.py +++ b/setup.py @@ -120,12 +120,12 @@ # ** Dependencies maintained by Ethereum Foundation ** "eth-abi>=5.1.0,<6", "eth-account>=0.13.4,<0.14", - "eth-typing>=5.0.1,<6", + "eth-typing>=3.5.2,<6", "eth-utils>=5.1.0,<6", "hexbytes>=1.2.1,<2", "py-geth>=5.1.0,<6", "trie>=3.0.1,<4", # Peer: stricter pin needed for uv support. - "web3[tester]>=7.6.0,<8", + "web3[tester]>=6.20.3,<8", # ** Dependencies maintained by ApeWorX ** "eip712>=0.2.10,<0.3", "ethpm-types>=0.6.19,<0.7", From c8038fc85eb87dd05a4bd9e7f0e776162694b2df Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Mon, 2 Dec 2024 16:40:52 -0600 Subject: [PATCH 05/10] feat: websocket provider --- src/ape/utils/_web3_compat.py | 6 ++++++ src/ape_ethereum/provider.py | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ape/utils/_web3_compat.py b/src/ape/utils/_web3_compat.py index b915e679c0..d6d3b498a8 100644 --- a/src/ape/utils/_web3_compat.py +++ b/src/ape/utils/_web3_compat.py @@ -6,6 +6,11 @@ except ImportError: from web3.middleware import geth_poa_middleware as ExtraDataToPOAMiddleware # type: ignore +try: + from web3.providers import WebsocketProviderV2 as WebsocketProvider # type: ignore +except ImportError: + from web3.providers import WebSocketProvider as WebsocketProvider # type: ignore + def sign_hash(msghash, private_key): try: @@ -19,4 +24,5 @@ def sign_hash(msghash, private_key): __all__ = [ "ExtraDataToPOAMiddleware", "sign_hash", + "WebsocketProvider", ] diff --git a/src/ape_ethereum/provider.py b/src/ape_ethereum/provider.py index 4524bde318..ebcfd13915 100644 --- a/src/ape_ethereum/provider.py +++ b/src/ape_ethereum/provider.py @@ -19,7 +19,7 @@ from evmchains import PUBLIC_CHAIN_META, get_random_rpc from pydantic.dataclasses import dataclass from requests import HTTPError -from web3 import HTTPProvider, IPCProvider, Web3, WebSocketProvider +from web3 import HTTPProvider, IPCProvider, Web3 from web3.exceptions import ContractLogicError as Web3ContractLogicError from web3.exceptions import ( ExtraDataLengthError, @@ -56,7 +56,7 @@ from ape.types.events import ContractLog, LogFilter from ape.types.gas import AutoGasLimit from ape.types.trace import SourceTraceback -from ape.utils._web3_compat import ExtraDataToPOAMiddleware +from ape.utils._web3_compat import ExtraDataToPOAMiddleware, WebsocketProvider from ape.utils.basemodel import ManagerAccessMixin from ape.utils.misc import DEFAULT_MAX_RETRIES_TX, gas_estimation_error_message, to_int from ape_ethereum._print import CONSOLE_ADDRESS, console_contract @@ -1615,7 +1615,7 @@ def _create_web3( providers.append(lambda: HTTPProvider(endpoint_uri=http, request_kwargs=request_kwargs)) if ws := ws_uri: - providers.append(lambda: WebSocketProvider(endpoint_uri=ws)) + providers.append(lambda: WebsocketProvider(endpoint_uri=ws)) provider = AutoProvider(potential_providers=providers) return Web3(provider) From c310ddfe275b0adcc8f7fa2d31e4ce03d70ebb8a Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Mon, 2 Dec 2024 19:17:00 -0600 Subject: [PATCH 06/10] fix: req header --- src/ape_ethereum/provider.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ape_ethereum/provider.py b/src/ape_ethereum/provider.py index ebcfd13915..9f886af8c3 100644 --- a/src/ape_ethereum/provider.py +++ b/src/ape_ethereum/provider.py @@ -20,12 +20,14 @@ from pydantic.dataclasses import dataclass from requests import HTTPError from web3 import HTTPProvider, IPCProvider, Web3 +from web3 import __version__ as web3_version from web3.exceptions import ContractLogicError as Web3ContractLogicError from web3.exceptions import ( ExtraDataLengthError, MethodUnavailable, TimeExhausted, TransactionNotFound, + Web3RPCError, ) from web3.gas_strategies.rpc import rpc_gas_price_strategy from web3.middleware.validation import MAX_EXTRADATA_LENGTH @@ -1032,7 +1034,7 @@ def send_transaction(self, txn: TransactionAPI) -> ReceiptAPI: if txn_hash is None: txn_hash = to_hex(self.web3.eth.send_raw_transaction(txn.serialize_transaction())) - except (ValueError, Web3ContractLogicError) as err: + except (ValueError, Web3ContractLogicError, Web3RPCError) as err: vm_err = self.get_virtual_machine_error( err, txn=txn, set_ape_traceback=txn.raise_on_revert ) @@ -1324,7 +1326,7 @@ class EthereumNodeProvider(Web3Provider, ABC): name: str = "node" # NOTE: Appends user-agent to base User-Agent string. - request_header: dict = {} + request_header: dict = {"User-Agent": f"EthereumNodeProvider/web3.py/{web3_version}"} @property def uri(self) -> str: From a1a16471db87739671d6058c121039738ffdccf8 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Tue, 3 Dec 2024 17:26:02 -0600 Subject: [PATCH 07/10] fix: conditions --- src/ape_accounts/accounts.py | 3 +- src/ape_ethereum/provider.py | 98 ++++++++++++++++++++---------------- src/ape_test/accounts.py | 3 +- 3 files changed, 58 insertions(+), 46 deletions(-) diff --git a/src/ape_accounts/accounts.py b/src/ape_accounts/accounts.py index 47d4949e9b..cec087b505 100644 --- a/src/ape_accounts/accounts.py +++ b/src/ape_accounts/accounts.py @@ -18,6 +18,7 @@ from ape.exceptions import AccountsError from ape.logging import logger from ape.types.signatures import MessageSignature, SignableMessage, TransactionSignature +from ape.utils._web3_compat import sign_hash from ape.utils.basemodel import ManagerAccessMixin from ape.utils.misc import log_instead_of_fail from ape.utils.validators import _validate_account_alias, _validate_account_passphrase @@ -255,7 +256,7 @@ def sign_raw_msghash(self, msghash: HexBytes) -> Optional[MessageSignature]: # Also, we have already warned the user about the safety. with warnings.catch_warnings(): warnings.simplefilter("ignore") - signed_msg = EthAccount.unsafe_sign_hash(msghash, self.__key) + signed_msg = sign_hash(msghash, self.__key) return MessageSignature( v=signed_msg.v, diff --git a/src/ape_ethereum/provider.py b/src/ape_ethereum/provider.py index 9f886af8c3..67229db3ed 100644 --- a/src/ape_ethereum/provider.py +++ b/src/ape_ethereum/provider.py @@ -27,8 +27,13 @@ MethodUnavailable, TimeExhausted, TransactionNotFound, - Web3RPCError, ) + +try: + from web3.exceptions import Web3RPCError +except ImportError: + Web3RPCError = ValueError + from web3.gas_strategies.rpc import rpc_gas_price_strategy from web3.middleware.validation import MAX_EXTRADATA_LENGTH from web3.providers import AutoProvider @@ -124,6 +129,24 @@ def assert_web3_provider_uri_env_var_not_set(): ) +def _post_send_transaction(tx: TransactionAPI, receipt: ReceiptAPI): + """Execute post-transaction ops""" + + # TODO: Optional configuration? + if tx.receiver and Address(tx.receiver).is_contract: + # Look for and print any contract logging + try: + receipt.show_debug_logs() + except TransactionNotFound: + # Receipt never published. Likely failed. + pass + except Exception as err: + # Avoid letting debug logs causes program crashes. + logger.debug(f"Unable to show debug logs: {err}") + + logger.info(f"Confirmed {receipt.txn_hash} (total fees paid = {receipt.total_fees_paid})") + + class Web3Provider(ProviderAPI, ABC): """ A base provider mixin class that uses the @@ -160,7 +183,7 @@ def post_tx_hook(send_tx): @wraps(send_tx) def send_tx_wrapper(self, txn: TransactionAPI) -> ReceiptAPI: receipt = send_tx(self, txn) - self._post_send_transaction(txn, receipt) + _post_send_transaction(txn, receipt) return receipt return send_tx_wrapper @@ -1006,35 +1029,9 @@ def prepare_transaction(self, txn: TransactionAPI) -> TransactionAPI: def send_transaction(self, txn: TransactionAPI) -> ReceiptAPI: vm_err = None txn_data = None - txn_hash = None try: - if txn.sender is not None and txn.signature is None: - # Missing signature, user likely trying to use an unlocked account. - attempt_send = True - if ( - self.network.is_dev - and txn.sender not in self.account_manager.test_accounts._impersonated_accounts - ): - try: - self.account_manager.test_accounts.impersonate_account(txn.sender) - except NotImplementedError: - # Unable to impersonate. Try sending as raw-tx. - attempt_send = False - - if attempt_send: - # For some reason, some nodes have issues with integer-types. - txn_data = { - k: to_hex(v) if isinstance(v, int) else v - for k, v in txn.model_dump(by_alias=True, mode="json").items() - } - tx_params = cast(TxParams, txn_data) - txn_hash = to_hex(self.web3.eth.send_transaction(tx_params)) - # else: attempt raw tx - - if txn_hash is None: - txn_hash = to_hex(self.web3.eth.send_raw_transaction(txn.serialize_transaction())) - - except (ValueError, Web3ContractLogicError, Web3RPCError) as err: + txn_hash = self._send_transaction(txn) + except (Web3RPCError, Web3ContractLogicError) as err: vm_err = self.get_virtual_machine_error( err, txn=txn, set_ape_traceback=txn.raise_on_revert ) @@ -1102,22 +1099,35 @@ def send_transaction(self, txn: TransactionAPI) -> ReceiptAPI: return receipt - def _post_send_transaction(self, tx: TransactionAPI, receipt: ReceiptAPI): - """Execute post-transaction ops""" + def _send_transaction(self, txn: TransactionAPI) -> str: + txn_hash = None + if txn.sender is not None and txn.signature is None: + # Missing signature, user likely trying to use an unlocked account. + attempt_send = True + if ( + self.network.is_dev + and txn.sender not in self.account_manager.test_accounts._impersonated_accounts + ): + try: + self.account_manager.test_accounts.impersonate_account(txn.sender) + except NotImplementedError: + # Unable to impersonate. Try sending as raw-tx. + attempt_send = False + + if attempt_send: + # For some reason, some nodes have issues with integer-types. + txn_data = { + k: to_hex(v) if isinstance(v, int) else v + for k, v in txn.model_dump(by_alias=True, mode="json").items() + } + tx_params = cast(TxParams, txn_data) + txn_hash = to_hex(self.web3.eth.send_transaction(tx_params)) + # else: attempt raw tx - # TODO: Optional configuration? - if tx.receiver and Address(tx.receiver).is_contract: - # Look for and print any contract logging - try: - receipt.show_debug_logs() - except TransactionNotFound: - # Receipt never published. Likely failed. - pass - except Exception as err: - # Avoid letting debug logs causes program crashes. - logger.debug(f"Unable to show debug logs: {err}") + if txn_hash is None: + txn_hash = to_hex(self.web3.eth.send_raw_transaction(txn.serialize_transaction())) - logger.info(f"Confirmed {receipt.txn_hash} (total fees paid = {receipt.total_fees_paid})") + return txn_hash def _post_connect(self): # Register the console contract for trace enrichment diff --git a/src/ape_test/accounts.py b/src/ape_test/accounts.py index c2490d34bc..a0abea03a5 100644 --- a/src/ape_test/accounts.py +++ b/src/ape_test/accounts.py @@ -13,6 +13,7 @@ from ape.api.accounts import TestAccountAPI, TestAccountContainerAPI from ape.exceptions import ProviderNotConnectedError, SignatureError from ape.types.signatures import MessageSignature, TransactionSignature +from ape.utils._web3_compat import sign_hash from ape.utils.testing import ( DEFAULT_NUMBER_OF_TEST_ACCOUNTS, DEFAULT_TEST_HD_PATH, @@ -166,7 +167,7 @@ def sign_transaction( def sign_raw_msghash(self, msghash: HexBytes) -> MessageSignature: with warnings.catch_warnings(): warnings.simplefilter("ignore") - signed_msg = EthAccount.unsafe_sign_hash(msghash, self.private_key) + signed_msg = sign_hash(msghash, self.private_key) return MessageSignature( v=signed_msg.v, From 4ec244cd98bd3f9a4dbb772dade5ab08c5b89b99 Mon Sep 17 00:00:00 2001 From: Evan <163005762+evan-quest@users.noreply.github.com> Date: Tue, 3 Dec 2024 20:55:44 -0500 Subject: [PATCH 08/10] chore: add no type on ValueError --- src/ape_ethereum/provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ape_ethereum/provider.py b/src/ape_ethereum/provider.py index 67229db3ed..7fbb254f2d 100644 --- a/src/ape_ethereum/provider.py +++ b/src/ape_ethereum/provider.py @@ -32,7 +32,7 @@ try: from web3.exceptions import Web3RPCError except ImportError: - Web3RPCError = ValueError + Web3RPCError = ValueError # type: ignore from web3.gas_strategies.rpc import rpc_gas_price_strategy from web3.middleware.validation import MAX_EXTRADATA_LENGTH From 968b0bb9159f4da0b3bd530d70b75cab6cd1a2f2 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Wed, 4 Dec 2024 14:42:24 -0600 Subject: [PATCH 09/10] chore: loosen rest of pins --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 167ca2426f..c7edd842e8 100644 --- a/setup.py +++ b/setup.py @@ -119,11 +119,11 @@ "watchdog>=3.0,<4", # ** Dependencies maintained by Ethereum Foundation ** "eth-abi>=5.1.0,<6", - "eth-account>=0.13.4,<0.14", + "eth-account>=0.11.3,<0.14", "eth-typing>=3.5.2,<6", - "eth-utils>=5.1.0,<6", - "hexbytes>=1.2.1,<2", - "py-geth>=5.1.0,<6", + "eth-utils>=2.1.0,<6", + "hexbytes>=0.3.1,<2", + "py-geth>=3.14.0,<6", "trie>=3.0.1,<4", # Peer: stricter pin needed for uv support. "web3[tester]>=6.20.3,<8", # ** Dependencies maintained by ApeWorX ** From ff049b9e17d015feddb84975ae1f8299bf3587ce Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Wed, 4 Dec 2024 18:27:53 -0600 Subject: [PATCH 10/10] fix: w3pin --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c7edd842e8..e824254b3c 100644 --- a/setup.py +++ b/setup.py @@ -125,7 +125,7 @@ "hexbytes>=0.3.1,<2", "py-geth>=3.14.0,<6", "trie>=3.0.1,<4", # Peer: stricter pin needed for uv support. - "web3[tester]>=6.20.3,<8", + "web3[tester]>=6.20.1,<8", # ** Dependencies maintained by ApeWorX ** "eip712>=0.2.10,<0.3", "ethpm-types>=0.6.19,<0.7",