solver-multirpc 3.2.1__tar.gz → 3.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/PKG-INFO +1 -1
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/base_multi_rpc_interface.py +23 -9
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/pyproject.toml +2 -2
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/uv.lock +1 -1
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/.gitignore +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/.gitlab-ci.yml +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/CLAUDE.md +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/README.md +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/eRPC_ERROR_CODES.md +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/__init__.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/async_multi_rpc_interface.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/constants.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/exceptions.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/gas_estimation.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/sync_multi_rpc_interface.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/tx_trace.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/utils.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/requirements.txt +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/__init__.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/abi.json +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/constants.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/contract.sol +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/pytest/conftest.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/pytest/test_erpc_errors.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/pytest/test_nonce_too_low.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/pytest/test_truncate_rpc_url.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/test.py +0 -0
- {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/test_settings.py.example +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: solver-multirpc
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.2
|
|
4
4
|
Summary: A robust Python library for interacting with Ethereum smart contracts via multiple RPC endpoints, ensuring reliability, availability, and load distribution with automatic retries on failure.
|
|
5
5
|
Author-email: rorschach <rorschach45001@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -106,6 +106,17 @@ class BaseMultiRpc(ABC):
|
|
|
106
106
|
yield
|
|
107
107
|
return _noop()
|
|
108
108
|
|
|
109
|
+
@staticmethod
|
|
110
|
+
def _apm_span_decorator(name: str, span_type: str = "custom", span_subtype: str = "rpc"):
|
|
111
|
+
from functools import wraps
|
|
112
|
+
def decorator(func):
|
|
113
|
+
@wraps(func)
|
|
114
|
+
async def wrapper(self, *args, **kwargs):
|
|
115
|
+
async with self._apm_span(name, span_type, span_subtype):
|
|
116
|
+
return await func(self, *args, **kwargs)
|
|
117
|
+
return wrapper
|
|
118
|
+
return decorator
|
|
119
|
+
|
|
109
120
|
def _logger_params(self, **kwargs) -> None:
|
|
110
121
|
if self.apm:
|
|
111
122
|
self.apm.span_label(**{f"Mrpc_{key}": _item for key, _item in kwargs.items()})
|
|
@@ -319,11 +330,12 @@ class BaseMultiRpc(ABC):
|
|
|
319
330
|
account: LocalAccount = Account.from_key(signer_private_key)
|
|
320
331
|
if enable_estimate_gas_limit:
|
|
321
332
|
del tx['gas']
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
333
|
+
async with self._apm_span("estimate_gas"):
|
|
334
|
+
estimate_gas = await provider.eth.estimate_gas(tx, block_identifier=self.get_block_identifier())
|
|
335
|
+
self._logger_params(
|
|
336
|
+
estimate_gas=estimate_gas,
|
|
337
|
+
estimate_gas_with_buffer=int(estimate_gas * EstimateGasLimitBuffer)
|
|
338
|
+
)
|
|
327
339
|
return account.sign_transaction({**tx, 'gas': int(estimate_gas * EstimateGasLimitBuffer)})
|
|
328
340
|
return account.sign_transaction(tx)
|
|
329
341
|
except Exception as e:
|
|
@@ -584,10 +596,12 @@ class BaseMultiRpc(ABC):
|
|
|
584
596
|
async def _call_tx_function(self, address: str, gas_limit: int, gas_upper_bound: int, priority: TxPriority,
|
|
585
597
|
gas_estimation_method: GasEstimationMethod,
|
|
586
598
|
enable_estimate_gas_limit: Optional[bool] = None, **kwargs):
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
599
|
+
async with self._apm_span("_get_nonce"):
|
|
600
|
+
nonce = await self._get_nonce(address)
|
|
601
|
+
async with self._apm_span("_get_tx_params(gas_estimation)"):
|
|
602
|
+
tx_params = await self._get_tx_params(
|
|
603
|
+
nonce, address, gas_limit, gas_upper_bound, priority, gas_estimation_method
|
|
604
|
+
)
|
|
591
605
|
last_error = None
|
|
592
606
|
enable_estimate_gas_limit = self.enable_estimate_gas_limit if enable_estimate_gas_limit is None \
|
|
593
607
|
else enable_estimate_gas_limit
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "solver-multirpc"
|
|
3
|
-
version = "3.2.
|
|
3
|
+
version = "3.2.2"
|
|
4
4
|
description = "A robust Python library for interacting with Ethereum smart contracts via multiple RPC endpoints, ensuring reliability, availability, and load distribution with automatic retries on failure."
|
|
5
5
|
authors = [{ name = "rorschach", email = "rorschach45001@gmail.com" }]
|
|
6
6
|
license = { text = "MIT" }
|
|
@@ -34,7 +34,7 @@ asyncio_mode = "strict"
|
|
|
34
34
|
testpaths = ["tests/pytest"]
|
|
35
35
|
|
|
36
36
|
[tool.bumpversion]
|
|
37
|
-
current_version = "3.2.
|
|
37
|
+
current_version = "3.2.2"
|
|
38
38
|
commit = true
|
|
39
39
|
tag = true
|
|
40
40
|
tag_name = "v{new_version}"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|