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 diff --git a/bittensor/core/async_subtensor.py b/bittensor/core/async_subtensor.py index e40b1f4465..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,7 +1235,8 @@ async def get_balances( """ if reuse_block: block_hash = self.substrate.last_block_hash - elif not 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) @@ -1308,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") diff --git a/contrib/CONTRIBUTING.md b/contrib/CONTRIBUTING.md index 714102bfd2..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://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/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 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 = [