Skip to content

Commit 0cea5e3

Browse files
Upgrade web3 version to 6.10.0
1 parent 3cc4a53 commit 0cea5e3

File tree

3 files changed

+9
-36
lines changed

3 files changed

+9
-36
lines changed

poetry.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "sw-utils"
3-
version = "0.3.25"
3+
version = "0.3.26"
44
description = "StakeWise Python utils"
55
authors = ["StakeWise Labs <[email protected]>"]
66
license = "GPL-3.0-or-later"
@@ -12,7 +12,7 @@ milagro-bls-binding = "==1.9.0"
1212
py-ecc = "^6.0.0"
1313
ipfshttpclient = "^0.8.0a2"
1414
types-requests = "^2.28.11.15"
15-
web3 = "==6.8.0"
15+
web3 = "==6.10.0"
1616
tenacity = "==8.2.2"
1717
pyrsistent = "0.19.3"
1818

sw_utils/execution.py

+2-29
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
import contextlib
22
import logging
3-
import warnings
43
from typing import TYPE_CHECKING, Any
54

65
from eth_typing import URI
76
from web3 import AsyncWeb3
8-
from web3._utils.fee_utils import async_fee_history_priority_fee
97
from web3.eth import AsyncEth
10-
from web3.exceptions import MethodUnavailable
118
from web3.middleware import async_geth_poa_middleware
129
from web3.net import AsyncNet
1310
from web3.providers.async_rpc import AsyncHTTPProvider
14-
from web3.types import AsyncMiddleware, RPCEndpoint, RPCResponse, Wei
11+
from web3.types import AsyncMiddleware, RPCEndpoint, RPCResponse
1512

1613
from sw_utils.decorators import can_be_retried_aiohttp_error, retry_aiohttp_errors
1714

@@ -111,30 +108,6 @@ def set_retry_timeout(self, retry_timeout: int):
111108
self.retry_timeout = retry_timeout
112109

113110

114-
# pylint: disable=abstract-method
115-
class ExtendedAsyncEth(AsyncEth):
116-
"""
117-
todo: remove when PR gets merged
118-
https://github.com/ethereum/web3.py/pull/3084
119-
"""
120-
121-
@property
122-
async def max_priority_fee(self) -> Wei:
123-
"""
124-
Try to use eth_maxPriorityFeePerGas but, since this is not part
125-
of the spec and is only supported by some clients, fall back to
126-
an eth_feeHistory calculation with min and max caps.
127-
"""
128-
try:
129-
return await self._max_priority_fee()
130-
except (ValueError, MethodUnavailable):
131-
warnings.warn(
132-
'There was an issue with the method eth_maxPriorityFeePerGas. '
133-
'Calculating using eth_feeHistory.'
134-
)
135-
return await async_fee_history_priority_fee(self)
136-
137-
138111
def get_execution_client(
139112
endpoints: list[str], is_poa=False, timeout=60, retry_timeout=0
140113
) -> AsyncWeb3:
@@ -143,7 +116,7 @@ def get_execution_client(
143116
)
144117
client = AsyncWeb3(
145118
provider,
146-
modules={'eth': (ExtendedAsyncEth,), 'net': AsyncNet},
119+
modules={'eth': (AsyncEth,), 'net': AsyncNet},
147120
)
148121

149122
if is_poa:

0 commit comments

Comments
 (0)