From d65ad92ecd1c18225a841da59bcd2f46a34d4da9 Mon Sep 17 00:00:00 2001 From: bdhimes Date: Wed, 8 Oct 2025 22:38:11 +0200 Subject: [PATCH 1/2] Update type hint/docstring for ws_shutdown_timer --- bittensor/core/async_subtensor.py | 6 ++++-- bittensor/core/subtensor_api/__init__.py | 5 +++-- pyproject.toml | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/bittensor/core/async_subtensor.py b/bittensor/core/async_subtensor.py index f79ac72558..2d42bc4816 100644 --- a/bittensor/core/async_subtensor.py +++ b/bittensor/core/async_subtensor.py @@ -155,7 +155,7 @@ def __init__( retry_forever: bool = False, _mock: bool = False, archive_endpoints: Optional[list[str]] = None, - websocket_shutdown_timer: float = 5.0, + websocket_shutdown_timer: Optional[float] = 5.0, ): """Initializes an AsyncSubtensor instance for blockchain interaction. @@ -172,7 +172,9 @@ def __init__( cases where you are requesting a block that is too old for your current (presumably lite) node. Defaults to ``None``. websocket_shutdown_timer: Amount of time, in seconds, to wait after the last response from the chain to - close the connection. Defaults to ``5.0``. + close the connection. Defaults to ``5.0``. Passing `None` will disable to automatic shutdown process + entirely. + Returns: None diff --git a/bittensor/core/subtensor_api/__init__.py b/bittensor/core/subtensor_api/__init__.py index 5ae0bf7134..9806110a34 100644 --- a/bittensor/core/subtensor_api/__init__.py +++ b/bittensor/core/subtensor_api/__init__.py @@ -32,7 +32,8 @@ class SubtensorApi: archive_endpoints: Similar to fallback_endpoints, but specifically only archive nodes. Will be used in cases where you are requesting a block that is too old for your current (presumably lite) node. Defaults to `None` websocket_shutdown_timer: Amount of time, in seconds, to wait after the last response from the chain to close - the connection. Only applicable to AsyncSubtensor. + the connection. Only applicable to AsyncSubtensor. If `None` is passed to this, the automatic shutdown + process is disabled. Example: # sync version @@ -80,7 +81,7 @@ def __init__( log_verbose: bool = False, mock: bool = False, archive_endpoints: Optional[list[str]] = None, - websocket_shutdown_timer: float = 5.0, + websocket_shutdown_timer: Optional[float] = 5.0, ): self.network = network self._fallback_endpoints = fallback_endpoints diff --git a/pyproject.toml b/pyproject.toml index 88c4f68616..7732b25eb9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ dependencies = [ "uvicorn", "bittensor-drand>=1.0.0,<2.0.0", "bittensor-wallet>=4.0.0,<5.0", - "async-substrate-interface>=1.5.4" + "async-substrate-interface>=1.5.6" ] [project.optional-dependencies] From d201019fa3ce7c7306aced391f55be485275f321 Mon Sep 17 00:00:00 2001 From: Roman <167799377+basfroman@users.noreply.github.com> Date: Thu, 9 Oct 2025 17:37:28 -0700 Subject: [PATCH 2/2] Update bittensor/core/async_subtensor.py --- bittensor/core/async_subtensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bittensor/core/async_subtensor.py b/bittensor/core/async_subtensor.py index 2d42bc4816..50851218a4 100644 --- a/bittensor/core/async_subtensor.py +++ b/bittensor/core/async_subtensor.py @@ -172,7 +172,7 @@ def __init__( cases where you are requesting a block that is too old for your current (presumably lite) node. Defaults to ``None``. websocket_shutdown_timer: Amount of time, in seconds, to wait after the last response from the chain to - close the connection. Defaults to ``5.0``. Passing `None` will disable to automatic shutdown process + close the connection. Passing `None` will disable to automatic shutdown process entirely. Returns: