yellowstone-fumarole-client 0.3.0__py3-none-any.whl → 0.3.1__py3-none-any.whl

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.
@@ -1,5 +1,7 @@
1
1
  import asyncio
2
2
  import logging
3
+ from contextlib import suppress
4
+
3
5
  from yellowstone_fumarole_client.grpc_connectivity import (
4
6
  FumaroleGrpcConnector,
5
7
  )
@@ -279,10 +281,8 @@ class FumaroleClient:
279
281
  except asyncio.CancelledError:
280
282
  pass
281
283
  if exc is not None:
282
- try:
284
+ with suppress(asyncio.QueueShutDown):
283
285
  await dragonsmouth_outlet.put(exc)
284
- except asyncio.QueueShutdown:
285
- pass
286
286
  for t in pending:
287
287
  t.cancel()
288
288
  finally:
@@ -295,7 +295,7 @@ class FumaroleClient:
295
295
  try:
296
296
  while True:
297
297
  update = await dragonsmouth_outlet.get()
298
- if issubclass(type(update), Exception):
298
+ if isinstance(update, Exception):
299
299
  raise update
300
300
  yield update
301
301
  except (asyncio.CancelledError, asyncio.QueueShutDown):
@@ -1,4 +1,4 @@
1
- from typing import Mapping
1
+ from typing import Any, Mapping
2
2
 
3
3
 
4
4
  class FumaroleClientError(Exception):
@@ -14,6 +14,6 @@ class SubscribeError(FumaroleClientError):
14
14
  class DownloadSlotError(SubscribeError):
15
15
  """Exception raised for errors in the download slot process."""
16
16
 
17
- def __init__(self, message: str, ctx: Mapping[str, any]):
17
+ def __init__(self, message: str, ctx: Mapping[str, Any]):
18
18
  super().__init__(message)
19
- self.ctx = ctx
19
+ self.ctx = ctx
@@ -1,6 +1,9 @@
1
1
  # DataPlaneConn
2
2
  from abc import abstractmethod, ABC
3
3
  import asyncio
4
+ from contextlib import suppress
5
+ from typing import Any
6
+
4
7
  import grpc
5
8
  from typing import Literal, Mapping, Optional
6
9
  from collections import deque
@@ -16,7 +19,6 @@ from yellowstone_fumarole_proto.geyser_pb2 import (
16
19
  SubscribeRequest,
17
20
  SubscribeUpdate,
18
21
  SubscribeUpdateSlot,
19
- CommitmentLevel as ProtoCommitmentLevel,
20
22
  )
21
23
  from yellowstone_fumarole_proto.fumarole_pb2 import (
22
24
  ControlCommand,
@@ -30,7 +32,6 @@ from yellowstone_fumarole_proto.fumarole_pb2_grpc import (
30
32
  FumaroleStub,
31
33
  )
32
34
  from yellowstone_fumarole_client.utils.aio import Interval
33
- from yellowstone_fumarole_client.grpc_connectivity import FumaroleGrpcConnector
34
35
  from yellowstone_fumarole_client.error import SubscribeError, DownloadSlotError
35
36
  import logging
36
37
 
@@ -66,7 +67,7 @@ class DownloadBlockError:
66
67
  """Represents an error that occurred during the download of a block."""
67
68
  kind: DownloadBlockErrorKind
68
69
  message: str
69
- ctx: Mapping[str, any]
70
+ ctx: Mapping[str, Any]
70
71
 
71
72
  def into_subscribe_error(self) -> SubscribeError:
72
73
  """Convert the error into a SubscribeError."""
@@ -257,14 +258,12 @@ class AsyncioFumeDragonsmouthRuntime:
257
258
  else:
258
259
  slot = download_result.slot
259
260
  err_kind = download_result.err.kind
260
- LOGGER.error(f"Download error for slot {slot}: {download_result.err}")
261
+ LOGGER.error(f"Download error for slot {slot}: {download_result.err}")
261
262
  # If the client queue is disconnected, we don't do anything, next run iteration will close anyway.
262
263
  self.is_closed = True
263
264
  if err_kind != "OutletDisconnected":
264
- try:
265
+ with suppress(asyncio.QueueShutDown):
265
266
  await self.dragonsmouth_outlet.put(download_result.err.into_subscribe_error())
266
- except asyncio.QueueShutDown:
267
- pass
268
267
 
269
268
  async def _force_commit_offset(self):
270
269
  LOGGER.debug(f"Force committing offset {self.sm.committable_offset}")
@@ -479,7 +478,7 @@ class GrpcDownloadBlockTaskRun:
479
478
  self.dragonsmouth_oulet = dragonsmouth_oulet
480
479
 
481
480
  def map_tonic_error_code_to_download_block_error(
482
- self,
481
+ self,
483
482
  e: grpc.aio.AioRpcError
484
483
  ) -> DownloadBlockError:
485
484
  code = e.code()
@@ -550,6 +549,10 @@ class GrpcDownloadBlockTaskRun:
550
549
  err=DownloadBlockError(
551
550
  kind="OutletDisconnected",
552
551
  message="Outlet disconnected",
552
+ ctx = {
553
+ "slot": self.download_request.slot,
554
+ "block_uid": self.download_request.block_uid,
555
+ }
553
556
  ),
554
557
  )
555
558
  case "block_shard_download_finish":
@@ -580,5 +583,12 @@ class GrpcDownloadBlockTaskRun:
580
583
  return DownloadTaskResult(
581
584
  kind="Err",
582
585
  slot=self.download_request.slot,
583
- err=DownloadBlockError(kind="FailedDownload", message="Failed download"),
586
+ err=DownloadBlockError(
587
+ kind="FailedDownload",
588
+ message="Failed download",
589
+ ctx={
590
+ "slot": self.download_request.slot,
591
+ "block_uid": self.download_request.block_uid,
592
+ },
593
+ ),
584
594
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: yellowstone-fumarole-client
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Yellowstone Fumarole Python Client
5
5
  Home-page: https://github.com/rpcpool/yellowstone-fumarole
6
6
  Author: Louis-Vincent
@@ -1,9 +1,9 @@
1
- yellowstone_fumarole_client/__init__.py,sha256=Ngm4D8PMKKifrGyjg82XRfdrqOXrjtxLH6sg0YoW6Eg,14128
1
+ yellowstone_fumarole_client/__init__.py,sha256=Pp389GWtT6Br1ia2bJ9Bx--jOMoG_fL18cMg8N3HCvQ,14101
2
2
  yellowstone_fumarole_client/config.py,sha256=aclhCPUy6RO-xtXR9w8otmt1RzFZyFnbF28jk115C2g,1394
3
- yellowstone_fumarole_client/error.py,sha256=TFoy72LyzgHRwx9J7uvurB0jsnnmxbJwJaioSlUpcds,483
3
+ yellowstone_fumarole_client/error.py,sha256=85TJrHXgmFKTDddoLD4G9iexLmDlblfj_xMAwULAJUE,489
4
4
  yellowstone_fumarole_client/grpc_connectivity.py,sha256=Sex_x6_Bha0wGD7rRqr-V_slsohX1tDFeiHdqahLJ4Q,6639
5
5
  yellowstone_fumarole_client/runtime/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- yellowstone_fumarole_client/runtime/aio.py,sha256=DLdsTv9hwXov4irOTnESYENFwWX6_NpwT8xEj3yZMW4,23143
6
+ yellowstone_fumarole_client/runtime/aio.py,sha256=BdsLllgNj15nNxKdOUqEXP1RW2p8alt3x0iCwrIxFr4,23487
7
7
  yellowstone_fumarole_client/runtime/state_machine.py,sha256=eH2ARUOBdBJqk1zs9WLXD1WixqtgZX4bIdDkg1cWttA,12781
8
8
  yellowstone_fumarole_client/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  yellowstone_fumarole_client/utils/aio.py,sha256=lm_BNkPiw5CJ6FjDlQUPoCKAqY3eYFAedAJB8mhNbzE,639
@@ -18,6 +18,6 @@ yellowstone_fumarole_proto/geyser_pb2_grpc.py,sha256=JCEz0KM_jg_610HyQI_F1K4kJlR
18
18
  yellowstone_fumarole_proto/solana_storage_pb2.py,sha256=LS-P5EPyS0n1pO9_U73rA6SPlbGSTEC2qYhuS3skzA8,8443
19
19
  yellowstone_fumarole_proto/solana_storage_pb2.pyi,sha256=HivhoN4VEe_W7kB4lc2Un5AeTAv3xiKR_HLI096qmyA,13040
20
20
  yellowstone_fumarole_proto/solana_storage_pb2_grpc.py,sha256=-rb9Dr0HXohIrHrnxukYrmUYl6OCVbkQYh2-pCO6740,895
21
- yellowstone_fumarole_client-0.3.0.dist-info/METADATA,sha256=lzwP6_lZMW8HXwBgVmNBmXJq3S48CsoOkTcfQ2xsMQ4,4156
22
- yellowstone_fumarole_client-0.3.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
23
- yellowstone_fumarole_client-0.3.0.dist-info/RECORD,,
21
+ yellowstone_fumarole_client-0.3.1.dist-info/METADATA,sha256=dkCS_F5msc3zh7K3n5pNGQNESrYd07vW_SRJkeB2Wwo,4156
22
+ yellowstone_fumarole_client-0.3.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
23
+ yellowstone_fumarole_client-0.3.1.dist-info/RECORD,,