diff --git a/VERSION b/VERSION index de9a5512..3f5820b5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.9.8 +4.9.9 diff --git a/gas/__init__.py b/gas/__init__.py index 72689c2b..5635b1b8 100644 --- a/gas/__init__.py +++ b/gas/__init__.py @@ -1,4 +1,4 @@ -__version__ = "4.9.8" +__version__ = "4.9.9" version_split = __version__.split(".") __spec_version__ = ( diff --git a/gas/evaluation/miner_type_tracker.py b/gas/evaluation/miner_type_tracker.py index 48b27615..4c2d78bf 100644 --- a/gas/evaluation/miner_type_tracker.py +++ b/gas/evaluation/miner_type_tracker.py @@ -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 ], diff --git a/gas/utils/metagraph.py b/gas/utils/metagraph.py index eaf9ee36..c848ad9d 100644 --- a/gas/utils/metagraph.py +++ b/gas/utils/metagraph.py @@ -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}") @@ -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) diff --git a/neurons/validator/validator.py b/neurons/validator/validator.py index b466c013..89a63f96 100644 --- a/neurons/validator/validator.py +++ b/neurons/validator/validator.py @@ -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):