Skip to content

Commit f48829d

Browse files
authored
Merge pull request #715 from opentensor/release/9.15.3
Release/9.15.3
2 parents 7c7d582 + aee16d1 commit f48829d

File tree

13 files changed

+110
-69
lines changed

13 files changed

+110
-69
lines changed

.github/workflows/e2e-subtensor-tests.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,6 @@ jobs:
8484
with:
8585
python-version: 3.13
8686

87-
- name: install dependencies
88-
run: |
89-
uv venv .venv
90-
source .venv/bin/activate
91-
uv pip install .[dev]
92-
9387
- name: Download Cached Docker Image
9488
uses: actions/download-artifact@v4
9589
with:
@@ -100,5 +94,4 @@ jobs:
10094

10195
- name: Run tests
10296
run: |
103-
source .venv/bin/activate
10497
uv run pytest ${{ matrix.test-file }} -s

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Changelog
22

3+
## 9.15.3 /2025-11-17
4+
5+
## What's Changed
6+
* fix missing classifiers, migrate to flit by @branchvincent in https://github.com/opentensor/btcli/pull/698
7+
* Removes subvortex as the project is gone. by @thewhaleking in https://github.com/opentensor/btcli/pull/708
8+
* Small Bug Fixes by @thewhaleking in https://github.com/opentensor/btcli/pull/712:
9+
* Ensures that net_claimable is always a Balance object in get_claimable_stakes_for_coldkey
10+
* Checks that the HK owner isn't the genesis address
11+
* Clearly show the totals in st list as representing staked vs total incl free
12+
* Prevents a race condition which could freeze the console for extrinsic submission
13+
* docs: fix typos in some files by @Edge-Seven in https://github.com/opentensor/btcli/pull/711
14+
* Fix table width visual bug in stake move command by @BANADDA in https://github.com/opentensor/btcli/pull/709
15+
* Fix: Decode account id in `btcli swap-check` by @ibraheem-abe in https://github.com/opentensor/btcli/pull/714
16+
17+
## New Contributors
18+
* @branchvincent made their first contribution in https://github.com/opentensor/btcli/pull/698
19+
* @Edge-Seven made their first contribution in https://github.com/opentensor/btcli/pull/711
20+
* @BANADDA made their first contribution in https://github.com/opentensor/btcli/pull/709
21+
22+
**Full Changelog**: https://github.com/opentensor/btcli/compare/v9.15.2...v9.15.3
23+
324
## 9.15.2 /2025-11-05
425

526
## What's Changed

MANIFEST.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

bittensor_cli/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6135,7 +6135,7 @@ def subnets_price(
61356135
self.verbosity_handler(quiet=quiet, verbose=verbose, json_output=json_output)
61366136

61376137
subtensor = self.initialize_chain(network)
6138-
non_archives = ["finney", "latent-lite", "subvortex"]
6138+
non_archives = ["finney", "latent-lite"]
61396139
if not current_only and subtensor.network in non_archives + [
61406140
Constants.network_map[x] for x in non_archives
61416141
]:

bittensor_cli/src/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,18 @@ class Constants:
99
"finney",
1010
"test",
1111
"archive",
12-
"subvortex",
1312
"rao",
1413
"dev",
1514
"latent-lite",
1615
]
1716
finney_entrypoint = "wss://entrypoint-finney.opentensor.ai:443"
1817
finney_test_entrypoint = "wss://test.finney.opentensor.ai:443"
1918
archive_entrypoint = "wss://archive.chain.opentensor.ai:443"
20-
subvortex_entrypoint = "ws://subvortex.info:9944"
2119
local_entrypoint = "ws://127.0.0.1:9944"
2220
rao_entrypoint = "wss://rao.chain.opentensor.ai:443"
2321
dev_entrypoint = "wss://dev.chain.opentensor.ai:443"
24-
local_entrypoint = "ws://127.0.0.1:9944"
2522
latent_lite_entrypoint = "wss://lite.sub.latent.to:443"
26-
lite_nodes = [finney_entrypoint, subvortex_entrypoint, latent_lite_entrypoint]
23+
lite_nodes = [finney_entrypoint, latent_lite_entrypoint]
2724
network_map = {
2825
"finney": finney_entrypoint,
2926
"test": finney_test_entrypoint,
@@ -32,7 +29,6 @@ class Constants:
3229
"dev": dev_entrypoint,
3330
"rao": rao_entrypoint,
3431
"latent-lite": latent_lite_entrypoint,
35-
"subvortex": subvortex_entrypoint,
3632
}
3733
genesis_block_hash_map = {
3834
"finney": "0x2f0555cc76fc2840a25a6ea3b9637146806f1f44b090c175ffde2a7e5ab36c03",

bittensor_cli/src/bittensor/extrinsics/transfer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
from async_substrate_interface.errors import SubstrateRequestException
88

99
from bittensor_cli.src.bittensor.balances import Balance
10-
from bittensor_cli.src.bittensor.subtensor_interface import SubtensorInterface
10+
from bittensor_cli.src.bittensor.subtensor_interface import (
11+
SubtensorInterface,
12+
GENESIS_ADDRESS,
13+
)
1114
from bittensor_cli.src.bittensor.utils import (
1215
console,
1316
err_console,
@@ -173,7 +176,7 @@ async def do_transfer() -> tuple[bool, str, str, AsyncExtrinsicReceipt]:
173176
# Ask before moving on.
174177
if prompt:
175178
hk_owner = await subtensor.get_hotkey_owner(destination, check_exists=False)
176-
if hk_owner and hk_owner != destination:
179+
if hk_owner and hk_owner not in (destination, GENESIS_ADDRESS):
177180
if not Confirm.ask(
178181
f"The destination appears to be a hotkey, owned by [bright_magenta]{hk_owner}[/bright_magenta]. "
179182
f"Only proceed if you are absolutely sure that [bright_magenta]{destination}[/bright_magenta] is the "

bittensor_cli/src/bittensor/subtensor_interface.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
get_hotkey_pub_ss58,
4646
)
4747

48+
GENESIS_ADDRESS = "5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM"
49+
4850

4951
class ParamWithTypes(TypedDict):
5052
name: str # Name of the parameter.
@@ -118,6 +120,7 @@ def __init__(self, network, use_disk_cache: bool = False):
118120
ss58_format=SS58_FORMAT,
119121
type_registry=TYPE_REGISTRY,
120122
chain_name="Bittensor",
123+
ws_shutdown_timer=None,
121124
)
122125

123126
def __str__(self):
@@ -1116,7 +1119,7 @@ async def does_hotkey_exist(
11161119
block_hash=block_hash,
11171120
reuse_block_hash=reuse_block,
11181121
)
1119-
return_val = result != "5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM"
1122+
return_val = result != GENESIS_ADDRESS
11201123
return return_val
11211124

11221125
async def get_hotkey_owner(
@@ -2103,7 +2106,7 @@ async def get_claimable_stakes_for_coldkey(
21032106
if not stakes_info:
21042107
return {}
21052108

2106-
root_stakes = {}
2109+
root_stakes: dict[str, Balance] = {}
21072110
for stake_info in stakes_info:
21082111
if stake_info.netuid == 0 and stake_info.stake.rao > 0:
21092112
root_stakes[stake_info.hotkey_ss58] = stake_info.stake
@@ -2149,8 +2152,8 @@ async def get_claimable_stakes_for_coldkey(
21492152
self.substrate.query_multi(batch_claimed_calls, block_hash=block_hash),
21502153
)
21512154

2152-
claimable_rates = {}
2153-
claimed_amounts = {}
2155+
claimable_rates: dict[str, dict[int, float]] = {}
2156+
claimed_amounts: dict[tuple[str, int], Balance] = {}
21542157
for idx, (_, result) in enumerate(batch_claimable):
21552158
hotkey = unique_hotkeys[idx]
21562159
if result:
@@ -2166,12 +2169,17 @@ async def get_claimable_stakes_for_coldkey(
21662169

21672170
# Calculate the claimable stake for each pair
21682171
results = {}
2172+
already_claimed: Balance
2173+
net_claimable: Balance
2174+
rate: float
2175+
root_stake: Balance
2176+
claimable_stake: Balance
21692177
for hotkey, netuid in target_pairs:
21702178
root_stake = root_stakes[hotkey]
2171-
rate = claimable_rates[hotkey].get(netuid, 0)
2179+
rate = claimable_rates[hotkey].get(netuid, 0.0)
21722180
claimable_stake = rate * root_stake
2173-
already_claimed = claimed_amounts.get((hotkey, netuid), 0)
2174-
net_claimable = max(claimable_stake - already_claimed, 0)
2181+
already_claimed = claimed_amounts.get((hotkey, netuid), Balance(0))
2182+
net_claimable = max(claimable_stake - already_claimed, Balance(0))
21752183
if hotkey not in results:
21762184
results[hotkey] = {}
21772185
results[hotkey][netuid] = net_claimable.set_unit(netuid)

bittensor_cli/src/commands/stake/list.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def define_table(
153153

154154
def create_table(
155155
hotkey_: str,
156-
substakes: list[StakeInfo],
156+
substakes_: list[StakeInfo],
157157
claimable_amounts_: dict[str, dict[int, Balance]],
158158
):
159159
name_ = (
@@ -164,9 +164,9 @@ def create_table(
164164
rows = []
165165
total_tao_value_ = Balance(0)
166166
total_swapped_tao_value_ = Balance(0)
167-
root_stakes = [s for s in substakes if s.netuid == 0]
167+
root_stakes = [s for s in substakes_ if s.netuid == 0]
168168
other_stakes = sorted(
169-
[s for s in substakes if s.netuid != 0],
169+
[s for s in substakes_ if s.netuid != 0],
170170
key=lambda x: dynamic_info[x.netuid]
171171
.alpha_to_tao(Balance.from_rao(int(x.stake.rao)).set_unit(x.netuid))
172172
.tao,
@@ -626,7 +626,7 @@ def format_cell(
626626
input()
627627

628628
total_tao_value = (
629-
f"τ {millify_tao(all_hks_tao_value.tao)}"
629+
f"τ {millify_tao(all_hks_tao_value.tao + balance.tao)}"
630630
if not verbose
631631
else all_hks_tao_value
632632
)
@@ -638,10 +638,14 @@ def format_cell(
638638
console.print("\n\n")
639639
console.print(
640640
f"Wallet:\n"
641-
f" Coldkey SS58: [{COLOR_PALETTE['GENERAL']['COLDKEY']}]{coldkey_address}[/{COLOR_PALETTE['GENERAL']['COLDKEY']}]\n"
642-
f" Free Balance: [{COLOR_PALETTE['GENERAL']['BALANCE']}]{balance}[/{COLOR_PALETTE['GENERAL']['BALANCE']}]\n"
643-
f" Total TAO Value ({Balance.unit}): [{COLOR_PALETTE['GENERAL']['BALANCE']}]{total_tao_value}[/{COLOR_PALETTE['GENERAL']['BALANCE']}]"
644-
# f"\n Total TAO Swapped Value ({Balance.unit}): [{COLOR_PALETTE['GENERAL']['BALANCE']}]{total_swapped_tao_value}[/{COLOR_PALETTE['GENERAL']['BALANCE']}]"
641+
f" Coldkey SS58: "
642+
f"[{COLOR_PALETTE.G.CK}]{coldkey_address}[/{COLOR_PALETTE.G.CK}]\n"
643+
f" Free Balance: "
644+
f"[{COLOR_PALETTE.G.BALANCE}]{balance}[/{COLOR_PALETTE.G.BALANCE}]\n"
645+
f" Total TAO Swapped Value ({Balance.unit}): "
646+
f"[{COLOR_PALETTE.G.BALANCE}]{total_swapped_tao_value}[/{COLOR_PALETTE.G.BALANCE}]\n"
647+
f" Total TAO Value (including free balance) ({Balance.unit}): "
648+
f"[{COLOR_PALETTE.G.BALANCE}]{total_tao_value}[/{COLOR_PALETTE.G.BALANCE}]\n"
645649
)
646650
dict_output["free_balance"] = balance.tao
647651
dict_output["total_tao_value"] = all_hks_tao_value.tao

bittensor_cli/src/commands/stake/move.py

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,39 +108,58 @@ async def display_stake_movement_cross_subnets(
108108
)
109109

110110
table.add_column(
111-
"origin netuid", justify="center", style=COLOR_PALETTE["GENERAL"]["SYMBOL"]
111+
"origin netuid",
112+
justify="center",
113+
style=COLOR_PALETTE["GENERAL"]["SYMBOL"],
114+
max_width=14,
112115
)
113116
table.add_column(
114-
"origin hotkey", justify="center", style=COLOR_PALETTE["GENERAL"]["HOTKEY"]
117+
"origin hotkey",
118+
justify="center",
119+
style=COLOR_PALETTE["GENERAL"]["HOTKEY"],
120+
max_width=15,
115121
)
116122
table.add_column(
117-
"dest netuid", justify="center", style=COLOR_PALETTE["GENERAL"]["SYMBOL"]
123+
"dest netuid",
124+
justify="center",
125+
style=COLOR_PALETTE["GENERAL"]["SYMBOL"],
126+
max_width=12,
118127
)
119128
table.add_column(
120-
"dest hotkey", justify="center", style=COLOR_PALETTE["GENERAL"]["HOTKEY"]
129+
"dest hotkey",
130+
justify="center",
131+
style=COLOR_PALETTE["GENERAL"]["HOTKEY"],
132+
max_width=15,
121133
)
122134
table.add_column(
123135
f"amount ({Balance.get_unit(origin_netuid)})",
124136
justify="center",
125137
style=COLOR_PALETTE["STAKE"]["TAO"],
138+
max_width=18,
126139
)
127140
table.add_column(
128141
f"rate ({Balance.get_unit(destination_netuid)}/{Balance.get_unit(origin_netuid)})",
129142
justify="center",
130143
style=COLOR_PALETTE["POOLS"]["RATE"],
144+
max_width=20,
131145
)
132146
table.add_column(
133147
f"received ({Balance.get_unit(destination_netuid)})",
134148
justify="center",
135149
style=COLOR_PALETTE["POOLS"]["TAO_EQUIV"],
150+
max_width=18,
136151
)
137152
table.add_column(
138153
f"Fee ({Balance.get_unit(origin_netuid)})",
139154
justify="center",
140155
style=COLOR_PALETTE["STAKE"]["STAKE_AMOUNT"],
156+
max_width=15,
141157
)
142158
table.add_column(
143-
"Extrinsic Fee (τ)", justify="center", style=COLOR_PALETTE.STAKE.TAO
159+
"Extrinsic Fee (τ)",
160+
justify="center",
161+
style=COLOR_PALETTE.STAKE.TAO,
162+
max_width=18,
144163
)
145164

146165
table.add_row(

bittensor_cli/src/commands/wallets.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@
3030
)
3131
from bittensor_cli.src.bittensor.extrinsics.transfer import transfer_extrinsic
3232
from bittensor_cli.src.bittensor.networking import int_to_ip
33-
from bittensor_cli.src.bittensor.subtensor_interface import SubtensorInterface
33+
from bittensor_cli.src.bittensor.subtensor_interface import (
34+
SubtensorInterface,
35+
GENESIS_ADDRESS,
36+
)
3437
from bittensor_cli.src.bittensor.utils import (
3538
RAO_PER_TAO,
3639
console,
@@ -2261,10 +2264,8 @@ async def check_swap_status(
22612264
chain_reported_completion_block, destination_address = await subtensor.query(
22622265
"SubtensorModule", "ColdkeySwapScheduled", [origin_ss58]
22632266
)
2264-
if (
2265-
chain_reported_completion_block != 0
2266-
and destination_address != "5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM"
2267-
):
2267+
destination_address = decode_account_id(destination_address[0])
2268+
if chain_reported_completion_block != 0 and destination_address != GENESIS_ADDRESS:
22682269
is_pending = True
22692270
else:
22702271
is_pending = False

0 commit comments

Comments
 (0)