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.
Files changed (28) hide show
  1. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/PKG-INFO +1 -1
  2. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/base_multi_rpc_interface.py +23 -9
  3. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/pyproject.toml +2 -2
  4. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/uv.lock +1 -1
  5. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/.gitignore +0 -0
  6. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/.gitlab-ci.yml +0 -0
  7. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/CLAUDE.md +0 -0
  8. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/README.md +0 -0
  9. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/eRPC_ERROR_CODES.md +0 -0
  10. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/__init__.py +0 -0
  11. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/async_multi_rpc_interface.py +0 -0
  12. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/constants.py +0 -0
  13. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/exceptions.py +0 -0
  14. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/gas_estimation.py +0 -0
  15. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/sync_multi_rpc_interface.py +0 -0
  16. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/tx_trace.py +0 -0
  17. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/multirpc/utils.py +0 -0
  18. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/requirements.txt +0 -0
  19. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/__init__.py +0 -0
  20. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/abi.json +0 -0
  21. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/constants.py +0 -0
  22. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/contract.sol +0 -0
  23. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/pytest/conftest.py +0 -0
  24. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/pytest/test_erpc_errors.py +0 -0
  25. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/pytest/test_nonce_too_low.py +0 -0
  26. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/pytest/test_truncate_rpc_url.py +0 -0
  27. {solver_multirpc-3.2.1 → solver_multirpc-3.2.2}/tests/test.py +0 -0
  28. {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.1
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
- estimate_gas = await provider.eth.estimate_gas(tx, block_identifier=self.get_block_identifier())
323
- self._logger_params(
324
- estimate_gas=estimate_gas,
325
- estimate_gas_with_buffer=int(estimate_gas * EstimateGasLimitBuffer)
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
- nonce = await self._get_nonce(address)
588
- tx_params = await self._get_tx_params(
589
- nonce, address, gas_limit, gas_upper_bound, priority, gas_estimation_method
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.1"
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.1"
37
+ current_version = "3.2.2"
38
38
  commit = true
39
39
  tag = true
40
40
  tag_name = "v{new_version}"
@@ -1767,7 +1767,7 @@ wheels = [
1767
1767
 
1768
1768
  [[package]]
1769
1769
  name = "solver-multirpc"
1770
- version = "3.2.0"
1770
+ version = "3.2.2"
1771
1771
  source = { editable = "." }
1772
1772
  dependencies = [
1773
1773
  { name = "eth-account" },