Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.9.8
4.9.9
2 changes: 1 addition & 1 deletion gas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "4.9.8"
__version__ = "4.9.9"

version_split = __version__.split(".")
__spec_version__ = (
Expand Down
4 changes: 4 additions & 0 deletions gas/evaluation/miner_type_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ async def update_miner_types(self, miner_uids: Optional[List[int]] = None, force
session,
self.wallet.hotkey,
self.config.neuron.miner_total_timeout,
# Unreachable axons drop packets rather than refuse;
# without a connect bound they hold the sweep open
# until the total timeout.
sock_connect_timeout=10,
)
for uid in miner_uids
],
Expand Down
13 changes: 12 additions & 1 deletion gas/utils/metagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def __init__(self, url: str, ss58_format: int, type_registry: dict):
self.type_registry = type_registry
self.running = False
self.task = None
self._callback_tasks = set()

async def _connect_and_subscribe(self, callback: Callable):
bt.logging.info(f"Connecting to async substrate: {self.url}")
Expand Down Expand Up @@ -166,9 +167,19 @@ async def _run_subscription_attempt(self, callback: Callable):
"""Run one subscription attempt and always reap its child tasks."""
block_received = asyncio.Event()

def _reap_callback_task(task):
self._callback_tasks.discard(task)
if not task.cancelled() and task.exception() is not None:
bt.logging.error(f"Block callback task failed: {task.exception()}")

async def tracked_callback(block):
block_received.set()
await callback(block)
# Detach callbacks from header processing: a slow callback (e.g.
# the miner-type sweep) must not stall the subscription and trip
# the staleness watchdog, which cancels this attempt's tasks.
task = asyncio.create_task(callback(block))
self._callback_tasks.add(task)
task.add_done_callback(_reap_callback_task)

subscription_task = asyncio.create_task(
self._connect_and_subscribe(tracked_callback)
Expand Down
3 changes: 2 additions & 1 deletion neurons/validator/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ async def run(self):
"\N{GRINNING FACE WITH SMILING EYES}",
f"Initialization Complete. Validator starting at block: {self.subtensor.block}",
)
await self.set_weights(0)
# await self.set_weights(0)
# await self.issue_generator_challenge(0)
while not self.exit_context.isExiting:
self.step += 1
if self.config.autoupdate and (self.step == 0 or not self.step % 300):
Expand Down
Loading