From 1b7bf015bd8ef2d12585602d6095a31a625c4947 Mon Sep 17 00:00:00 2001 From: Galoretka Date: Sun, 31 Aug 2025 15:50:10 +0300 Subject: [PATCH 1/7] fix broken link --- contrib/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/CONTRIBUTING.md b/contrib/CONTRIBUTING.md index 714102bfd2..6d40fc2d64 100644 --- a/contrib/CONTRIBUTING.md +++ b/contrib/CONTRIBUTING.md @@ -279,7 +279,7 @@ When you are creating an enhancement suggestion, please [include as many details #### Before Submitting An Enhancement Suggestion -* **Check the [debugging guide](./DEBUGGING.md).** for tips — you might discover that the enhancement is already available. Most importantly, check if you're using the latest version of Bittensor by pulling the latest changes from the Master branch and if you can get the desired behavior by changing [Bittensor's config settings](https://opentensor.github.io/getting-started/configuration.html). +* **Check the [debugging guide](./DEBUGGING.md).** for tips — you might discover that the enhancement is already available. Most importantly, check if you're using the latest version of Bittensor by pulling the latest changes from the Master branch and if you can get the desired behavior by changing [Bittensor's config settings](https://docs.learnbittensor.org/subnets/subnet-hyperparameters/). * **Determine which repository the problem should be reported in: if it has to do with your ML model, then it's likely [Bittensor](https://github.com/opentensor/bittensor). If you are having problems with your emissions or Blockchain, then it is in [subtensor](https://github.com/opentensor/subtensor) #### How To Submit A (Good) Feature Suggestion From a33ff4e6b9aee8b158be762edf33cacd7f95441b Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 2 Sep 2025 18:27:21 -0700 Subject: [PATCH 2/7] add missing argument --- 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 e40b1f4465..9d6d738bae 100644 --- a/bittensor/core/async_subtensor.py +++ b/bittensor/core/async_subtensor.py @@ -1236,7 +1236,7 @@ async def get_balances( if reuse_block: block_hash = self.substrate.last_block_hash elif not block_hash: - block_hash = await self.get_block_hash() + block_hash = await self.get_block_hash(block) else: block_hash = await self.determine_block_hash(block, block_hash, reuse_block) calls = [ From 471a359c1ca2121876f16dcb3dc21da63e7bd1e9 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 2 Sep 2025 19:04:06 -0700 Subject: [PATCH 3/7] make it easy --- bittensor/core/async_subtensor.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/bittensor/core/async_subtensor.py b/bittensor/core/async_subtensor.py index 9d6d738bae..ca90ba4299 100644 --- a/bittensor/core/async_subtensor.py +++ b/bittensor/core/async_subtensor.py @@ -1235,8 +1235,6 @@ async def get_balances( """ if reuse_block: block_hash = self.substrate.last_block_hash - elif not block_hash: - block_hash = await self.get_block_hash(block) else: block_hash = await self.determine_block_hash(block, block_hash, reuse_block) calls = [ From 1e31304beeba03c82d9698f955a853554301b21c Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 3 Sep 2025 13:14:27 -0700 Subject: [PATCH 4/7] bug with `if block` in case if `block=0` --- bittensor/core/async_subtensor.py | 7 +++++-- bittensor/core/subtensor.py | 2 +- bittensor/utils/mock/subtensor_mock.py | 12 ++++++------ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/bittensor/core/async_subtensor.py b/bittensor/core/async_subtensor.py index ca90ba4299..ea7ec359bb 100644 --- a/bittensor/core/async_subtensor.py +++ b/bittensor/core/async_subtensor.py @@ -343,7 +343,7 @@ async def determine_block_hash( # Return the appropriate value. if block_hash: return block_hash - if block: + if block is not None: return await self.get_block_hash(block) return None @@ -1235,6 +1235,9 @@ async def get_balances( """ if reuse_block: block_hash = self.substrate.last_block_hash + elif block_hash is None and block is None: + # Neither block nor block_hash provided, default to head + block_hash = await self.get_block_hash() else: block_hash = await self.determine_block_hash(block, block_hash, reuse_block) calls = [ @@ -1306,7 +1309,7 @@ async def get_block_hash(self, block: Optional[int] = None) -> str: Notes: See also: """ - if block: + if block is not None: return await self._get_block_hash(block) else: return await self.substrate.get_chain_head() diff --git a/bittensor/core/subtensor.py b/bittensor/core/subtensor.py index 28371fb7d6..49729d6a8b 100644 --- a/bittensor/core/subtensor.py +++ b/bittensor/core/subtensor.py @@ -746,7 +746,7 @@ def get_block_hash(self, block: Optional[int] = None) -> str: data. It is crucial for verifying transactions, ensuring data consistency, and maintaining the trustworthiness of the blockchain. """ - if block: + if block is not None: return self._get_block_hash(block) else: return self.substrate.get_chain_head() diff --git a/bittensor/utils/mock/subtensor_mock.py b/bittensor/utils/mock/subtensor_mock.py index 9773d525a4..becbd90595 100644 --- a/bittensor/utils/mock/subtensor_mock.py +++ b/bittensor/utils/mock/subtensor_mock.py @@ -581,7 +581,7 @@ def query_subtensor( ) -> MockSubtensorValue: if params is None: params = [] - if block: + if block is not None: if self.block_number < block: raise Exception("Cannot query block in the future") @@ -622,7 +622,7 @@ def query_map_subtensor( """ if params is None: params = [] - if block: + if block is not None: if self.block_number < block: raise Exception("Cannot query block in the future") @@ -668,7 +668,7 @@ def query_map_subtensor( def query_constant( self, module_name: str, constant_name: str, block: Optional[int] = None ) -> Optional[object]: - if block: + if block is not None: if self.block_number < block: raise Exception("Cannot query block in the future") @@ -697,7 +697,7 @@ def get_current_block(self) -> int: # ==== Balance RPC methods ==== def get_balance(self, address: str, block: int = None) -> "Balance": - if block: + if block is not None: if self.block_number < block: raise Exception("Cannot query block in the future") @@ -732,7 +732,7 @@ def neuron_for_uid( if uid is None: return NeuronInfo.get_null_neuron() - if block: + if block is not None: if self.block_number < block: raise Exception("Cannot query block in the future") @@ -958,7 +958,7 @@ def neuron_for_uid_lite( if uid is None: return NeuronInfoLite.get_null_neuron() - if block: + if block is not None: if self.block_number < block: raise Exception("Cannot query block in the future") From 4d9d03c2c906899a4988fa253be5c5b4132ab1c2 Mon Sep 17 00:00:00 2001 From: Galoretka Date: Fri, 5 Sep 2025 07:53:38 +0300 Subject: [PATCH 5/7] Update contrib/CONTRIBUTING.md Co-authored-by: Roman <167799377+basfroman@users.noreply.github.com> --- contrib/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/CONTRIBUTING.md b/contrib/CONTRIBUTING.md index 6d40fc2d64..c3d6ba850f 100644 --- a/contrib/CONTRIBUTING.md +++ b/contrib/CONTRIBUTING.md @@ -279,7 +279,7 @@ When you are creating an enhancement suggestion, please [include as many details #### Before Submitting An Enhancement Suggestion -* **Check the [debugging guide](./DEBUGGING.md).** for tips — you might discover that the enhancement is already available. Most importantly, check if you're using the latest version of Bittensor by pulling the latest changes from the Master branch and if you can get the desired behavior by changing [Bittensor's config settings](https://docs.learnbittensor.org/subnets/subnet-hyperparameters/). +* **Check the [debugging guide](./DEBUGGING.md).** for tips — you might discover that the enhancement is already available. Most importantly, check if you're using the latest version of Bittensor by pulling the latest changes from the Master branch and if you can get the desired behavior by changing [Bittensor's config settings](https://docs.learnbittensor.org/python-api/html/autoapi/bittensor/core/config/). * **Determine which repository the problem should be reported in: if it has to do with your ML model, then it's likely [Bittensor](https://github.com/opentensor/bittensor). If you are having problems with your emissions or Blockchain, then it is in [subtensor](https://github.com/opentensor/subtensor) #### How To Submit A (Good) Feature Suggestion From 10411316e3af07c498d44d20de865c99e01b0540 Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 5 Sep 2025 13:00:57 -0700 Subject: [PATCH 6/7] bumping version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 40a7e7f85f..cfa7b2997e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "bittensor" -version = "9.10.0" +version = "9.10.1" description = "Bittensor" readme = "README.md" authors = [ From d0b65f0b485179c8a0889a5c9d356c4db96fd49e Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 5 Sep 2025 13:04:24 -0700 Subject: [PATCH 7/7] update CHANGELOG.md --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0229e03163..4e75d83f4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 9.10.1 /2025-09-05 + +## What's Changed +* Async Get_balances at a specific block returns current block by @basfroman in https://github.com/opentensor/bittensor/pull/3043 +* Fix bug if `block==0` by @basfroman in https://github.com/opentensor/bittensor/pull/3044 +* docs: Update Bittensor documentation link by @Galoretka in https://github.com/opentensor/bittensor/pull/3040 + +## New Contributors +* @Galoretka made their first contribution in https://github.com/opentensor/bittensor/pull/3040 + +**Full Changelog**: https://github.com/opentensor/bittensor/compare/v9.10.0...v9.10.1 + ## 9.10.0 /2025-08-28 ## What's Changed