Skip to content
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 4 additions & 3 deletions bittensor/core/async_subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -1308,7 +1309,7 @@ async def get_block_hash(self, block: Optional[int] = None) -> str:
Notes:
See also: <https://docs.learnbittensor.org/glossary#block>
"""
if block:
if block is not None:
return await self._get_block_hash(block)
else:
return await self.substrate.get_chain_head()
Expand Down
2 changes: 1 addition & 1 deletion bittensor/core/subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
12 changes: 6 additions & 6 deletions bittensor/utils/mock/subtensor_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion contrib/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
Loading