yellowstone-fumarole-client 0.2.1__tar.gz → 0.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 (22) hide show
  1. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/PKG-INFO +1 -1
  2. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/pyproject.toml +1 -1
  3. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_client/runtime/aio.py +10 -0
  4. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_client/runtime/state_machine.py +3 -1
  5. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/README.md +0 -0
  6. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_client/__init__.py +0 -0
  7. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_client/config.py +0 -0
  8. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_client/grpc_connectivity.py +0 -0
  9. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_client/runtime/__init__.py +0 -0
  10. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_client/utils/__init__.py +0 -0
  11. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_client/utils/aio.py +0 -0
  12. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_client/utils/collections.py +0 -0
  13. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_proto/__init__.py +0 -0
  14. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_proto/fumarole_pb2.py +0 -0
  15. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_proto/fumarole_pb2.pyi +0 -0
  16. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_proto/fumarole_pb2_grpc.py +0 -0
  17. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_proto/geyser_pb2.py +0 -0
  18. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_proto/geyser_pb2.pyi +0 -0
  19. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_proto/geyser_pb2_grpc.py +0 -0
  20. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_proto/solana_storage_pb2.py +0 -0
  21. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_proto/solana_storage_pb2.pyi +0 -0
  22. {yellowstone_fumarole_client-0.2.1 → yellowstone_fumarole_client-0.2.2}/yellowstone_fumarole_proto/solana_storage_pb2_grpc.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: yellowstone-fumarole-client
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Yellowstone Fumarole Python Client
5
5
  Home-page: https://github.com/rpcpool/yellowstone-fumarole
6
6
  Author: Louis-Vincent
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "yellowstone-fumarole-client"
3
- version = "0.2.1"
3
+ version = "0.2.2"
4
4
  homepage = "https://github.com/rpcpool/yellowstone-fumarole"
5
5
  repository = "https://github.com/rpcpool/yellowstone-fumarole"
6
6
  description = "Yellowstone Fumarole Python Client"
@@ -133,6 +133,8 @@ class AsyncioFumeDragonsmouthRuntime:
133
133
  self.commit_interval = commit_interval
134
134
  self.gc_interval = gc_interval
135
135
  self.max_concurrent_download = max_concurrent_download
136
+ self.poll_hist_inflight = False
137
+ self.commit_offset_inflight = False
136
138
 
137
139
  # holds metadata about the download task
138
140
  self.download_tasks = dict()
@@ -167,10 +169,12 @@ class AsyncioFumeDragonsmouthRuntime:
167
169
 
168
170
  match response_field:
169
171
  case "poll_hist":
172
+ self.poll_hist_inflight = False
170
173
  poll_hist = control_response.poll_hist
171
174
  LOGGER.debug(f"Received poll history {len(poll_hist.events)} events")
172
175
  self.sm.queue_blockchain_event(poll_hist.events)
173
176
  case "commit_offset":
177
+ self.commit_offset_inflight = False
174
178
  commit_offset = control_response.commit_offset
175
179
  LOGGER.debug(f"Received commit offset: {commit_offset}")
176
180
  self.sm.update_committed_offset(commit_offset.offset)
@@ -181,9 +185,12 @@ class AsyncioFumeDragonsmouthRuntime:
181
185
 
182
186
  async def poll_history_if_needed(self):
183
187
  """Poll the history if the state machine needs new events."""
188
+ if self.poll_hist_inflight:
189
+ return
184
190
  if self.sm.need_new_blockchain_events():
185
191
  cmd = self._build_poll_history_cmd(self.sm.committable_offset)
186
192
  await self.control_plane_tx.put(cmd)
193
+ self.poll_hist_inflight = True
187
194
 
188
195
  def commitment_level(self):
189
196
  """Gets the commitment level from the subscribe request."""
@@ -241,9 +248,12 @@ class AsyncioFumeDragonsmouthRuntime:
241
248
 
242
249
  async def _commit_offset(self):
243
250
  self.last_commit = time.time()
251
+ if self.commit_offset_inflight:
252
+ return
244
253
  if self.sm.last_committed_offset < self.sm.committable_offset:
245
254
  LOGGER.debug(f"Committing offset {self.sm.committable_offset}")
246
255
  await self._force_commit_offset()
256
+ self.commit_offset_inflight = True
247
257
 
248
258
  async def _drain_slot_status(self):
249
259
  """Drains the slot status from the state machine and sends updates to the Dragonsmouth outlet."""
@@ -322,4 +322,6 @@ class FumaroleSM:
322
322
 
323
323
  def need_new_blockchain_events(self) -> bool:
324
324
  """Check if new blockchain events are needed."""
325
- return not self.slot_status_update_queue and not self.blocked_slot_status_update
325
+ MINIMUM_UNPROCESSED_BLOCKCHAIN_EVENT = 10
326
+ return len(self.unprocessed_blockchain_event) < MINIMUM_UNPROCESSED_BLOCKCHAIN_EVENT \
327
+ or (not self.slot_status_update_queue and not self.blocked_slot_status_update)