Skip to content

Commit de964b4

Browse files
authored
Merge pull request #3072 from opentensor/release/9.11.1
Release/9.11.1
2 parents 2e7988d + 01b09ec commit de964b4

File tree

6 files changed

+105
-25
lines changed

6 files changed

+105
-25
lines changed

CHANGELOG.md

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

3+
## 9.11.1 /2025-09-25
4+
5+
## What's Changed
6+
* Fix bug with unlocking keypair in mechanism extrinsics by @basfroman in https://github.com/opentensor/bittensor/pull/3070
7+
* Changelog + bumping version 9.11.1 by @basfroman in https://github.com/opentensor/bittensor/pull/3071
8+
9+
**Full Changelog**: https://github.com/opentensor/bittensor/compare/v9.11.0...v9.11.1
10+
311
## 9.11.0 /2025-09-25
412

513
## What's Changed

bittensor/core/extrinsics/asyncex/mechanism.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ async def commit_mechanism_weights_extrinsic(
5454
`message` is a string value describing the success or potential error.
5555
"""
5656
try:
57-
unlock = unlock_key(wallet, raise_error=raise_error)
57+
signing_keypair = "hotkey"
58+
unlock = unlock_key(
59+
wallet=wallet, raise_error=raise_error, unlock_type=signing_keypair
60+
)
5861
if not unlock.success:
5962
logging.error(unlock.message)
6063
return False, unlock.message
@@ -86,8 +89,8 @@ async def commit_mechanism_weights_extrinsic(
8689
wait_for_finalization=wait_for_finalization,
8790
use_nonce=True,
8891
period=period,
89-
sign_with="hotkey",
90-
nonce_key="hotkey",
92+
sign_with=signing_keypair,
93+
nonce_key=signing_keypair,
9194
raise_error=raise_error,
9295
)
9396

@@ -146,7 +149,10 @@ async def commit_timelocked_mechanism_weights_extrinsic(
146149
`message` is a string value describing the success or potential error.
147150
"""
148151
try:
149-
unlock = unlock_key(wallet, raise_error=raise_error)
152+
signing_keypair = "hotkey"
153+
unlock = unlock_key(
154+
wallet=wallet, raise_error=raise_error, unlock_type=signing_keypair
155+
)
150156
if not unlock.success:
151157
logging.error(unlock.message)
152158
return False, unlock.message
@@ -193,8 +199,8 @@ async def commit_timelocked_mechanism_weights_extrinsic(
193199
wait_for_finalization=wait_for_finalization,
194200
use_nonce=True,
195201
period=period,
196-
sign_with="hotkey",
197-
nonce_key="hotkey",
202+
sign_with=signing_keypair,
203+
nonce_key=signing_keypair,
198204
raise_error=raise_error,
199205
)
200206

@@ -252,7 +258,10 @@ async def reveal_mechanism_weights_extrinsic(
252258
`message` is a string value describing the success or potential error.
253259
"""
254260
try:
255-
unlock = unlock_key(wallet, raise_error=raise_error)
261+
signing_keypair = "hotkey"
262+
unlock = unlock_key(
263+
wallet=wallet, raise_error=raise_error, unlock_type=signing_keypair
264+
)
256265
if not unlock.success:
257266
logging.error(unlock.message)
258267
return False, unlock.message
@@ -278,8 +287,8 @@ async def reveal_mechanism_weights_extrinsic(
278287
wait_for_finalization=wait_for_finalization,
279288
use_nonce=True,
280289
period=period,
281-
sign_with="hotkey",
282-
nonce_key="hotkey",
290+
sign_with=signing_keypair,
291+
nonce_key=signing_keypair,
283292
raise_error=raise_error,
284293
)
285294

@@ -335,7 +344,10 @@ async def set_mechanism_weights_extrinsic(
335344
`message` is a string value describing the success or potential error.
336345
"""
337346
try:
338-
unlock = unlock_key(wallet, raise_error=raise_error)
347+
signing_keypair = "hotkey"
348+
unlock = unlock_key(
349+
wallet=wallet, raise_error=raise_error, unlock_type=signing_keypair
350+
)
339351
if not unlock.success:
340352
logging.error(unlock.message)
341353
return False, unlock.message
@@ -361,8 +373,8 @@ async def set_mechanism_weights_extrinsic(
361373
wait_for_finalization=wait_for_finalization,
362374
period=period,
363375
use_nonce=True,
364-
nonce_key="hotkey",
365-
sign_with="hotkey",
376+
nonce_key=signing_keypair,
377+
sign_with=signing_keypair,
366378
raise_error=raise_error,
367379
)
368380

bittensor/core/extrinsics/mechanism.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ def commit_mechanism_weights_extrinsic(
5454
`message` is a string value describing the success or potential error.
5555
"""
5656
try:
57-
unlock = unlock_key(wallet, raise_error=raise_error)
57+
signing_keypair = "hotkey"
58+
unlock = unlock_key(
59+
wallet=wallet, raise_error=raise_error, unlock_type=signing_keypair
60+
)
5861
if not unlock.success:
5962
logging.error(unlock.message)
6063
return False, unlock.message
@@ -86,8 +89,8 @@ def commit_mechanism_weights_extrinsic(
8689
wait_for_finalization=wait_for_finalization,
8790
use_nonce=True,
8891
period=period,
89-
sign_with="hotkey",
90-
nonce_key="hotkey",
92+
sign_with=signing_keypair,
93+
nonce_key=signing_keypair,
9194
raise_error=raise_error,
9295
)
9396

@@ -146,7 +149,10 @@ def commit_timelocked_mechanism_weights_extrinsic(
146149
`message` is a string value describing the success or potential error.
147150
"""
148151
try:
149-
unlock = unlock_key(wallet, raise_error=raise_error)
152+
signing_keypair = "hotkey"
153+
unlock = unlock_key(
154+
wallet=wallet, raise_error=raise_error, unlock_type=signing_keypair
155+
)
150156
if not unlock.success:
151157
logging.error(unlock.message)
152158
return False, unlock.message
@@ -193,8 +199,8 @@ def commit_timelocked_mechanism_weights_extrinsic(
193199
wait_for_finalization=wait_for_finalization,
194200
use_nonce=True,
195201
period=period,
196-
sign_with="hotkey",
197-
nonce_key="hotkey",
202+
sign_with=signing_keypair,
203+
nonce_key=signing_keypair,
198204
raise_error=raise_error,
199205
)
200206

@@ -252,7 +258,10 @@ def reveal_mechanism_weights_extrinsic(
252258
`message` is a string value describing the success or potential error.
253259
"""
254260
try:
255-
unlock = unlock_key(wallet, raise_error=raise_error)
261+
signing_keypair = "hotkey"
262+
unlock = unlock_key(
263+
wallet=wallet, raise_error=raise_error, unlock_type=signing_keypair
264+
)
256265
if not unlock.success:
257266
logging.error(unlock.message)
258267
return False, unlock.message
@@ -278,8 +287,8 @@ def reveal_mechanism_weights_extrinsic(
278287
wait_for_finalization=wait_for_finalization,
279288
use_nonce=True,
280289
period=period,
281-
sign_with="hotkey",
282-
nonce_key="hotkey",
290+
sign_with=signing_keypair,
291+
nonce_key=signing_keypair,
283292
raise_error=raise_error,
284293
)
285294

@@ -335,7 +344,10 @@ def set_mechanism_weights_extrinsic(
335344
`message` is a string value describing the success or potential error.
336345
"""
337346
try:
338-
unlock = unlock_key(wallet, raise_error=raise_error)
347+
signing_keypair = "hotkey"
348+
unlock = unlock_key(
349+
wallet=wallet, raise_error=raise_error, unlock_type=signing_keypair
350+
)
339351
if not unlock.success:
340352
logging.error(unlock.message)
341353
return False, unlock.message
@@ -361,8 +373,8 @@ def set_mechanism_weights_extrinsic(
361373
wait_for_finalization=wait_for_finalization,
362374
period=period,
363375
use_nonce=True,
364-
nonce_key="hotkey",
365-
sign_with="hotkey",
376+
sign_with=signing_keypair,
377+
nonce_key=signing_keypair,
366378
raise_error=raise_error,
367379
)
368380

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "bittensor"
7-
version = "9.11.0"
7+
version = "9.11.1"
88
description = "Bittensor"
99
readme = "README.md"
1010
authors = [

tests/unit_tests/extrinsics/asyncex/test_sub_subnet.py renamed to tests/unit_tests/extrinsics/asyncex/test_mechanisms.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ async def test_commit_mechanism_weights_extrinsic(mocker, subtensor, fake_wallet
1414
weights = []
1515
salt = []
1616

17+
mocked_unlock_key = mocker.patch.object(
18+
mechanism, "unlock_key", return_value=mocker.Mock(success=True)
19+
)
1720
mocked_get_mechanism_storage_index = mocker.patch.object(
1821
mechanism, "get_mechid_storage_index"
1922
)
@@ -35,6 +38,9 @@ async def test_commit_mechanism_weights_extrinsic(mocker, subtensor, fake_wallet
3538
)
3639

3740
# Asserts
41+
mocked_unlock_key.assert_called_once_with(
42+
wallet=fake_wallet, raise_error=False, unlock_type="hotkey"
43+
)
3844
mocked_get_mechanism_storage_index.assert_called_once_with(
3945
netuid=netuid, mechid=mechid
4046
)
@@ -83,6 +89,9 @@ async def test_commit_timelocked_mechanism_weights_extrinsic(
8389
weights = []
8490
block_time = mocker.Mock()
8591

92+
mocked_unlock_key = mocker.patch.object(
93+
mechanism, "unlock_key", return_value=mocker.Mock(success=True)
94+
)
8695
mocked_convert_and_normalize_weights_and_uids = mocker.patch.object(
8796
mechanism,
8897
"convert_and_normalize_weights_and_uids",
@@ -122,6 +131,9 @@ async def test_commit_timelocked_mechanism_weights_extrinsic(
122131
)
123132

124133
# Asserts
134+
mocked_unlock_key.assert_called_once_with(
135+
wallet=fake_wallet, raise_error=False, unlock_type="hotkey"
136+
)
125137
mocked_convert_and_normalize_weights_and_uids.assert_called_once_with(uids, weights)
126138
mocked_get_mechanism_storage_index.assert_called_once_with(
127139
netuid=netuid, mechid=mechid
@@ -174,6 +186,9 @@ async def test_reveal_mechanism_weights_extrinsic(mocker, subtensor, fake_wallet
174186
weights = []
175187
salt = []
176188

189+
mocked_unlock_key = mocker.patch.object(
190+
mechanism, "unlock_key", return_value=mocker.Mock(success=True)
191+
)
177192
mocked_convert_and_normalize_weights_and_uids = mocker.patch.object(
178193
mechanism,
179194
"convert_and_normalize_weights_and_uids",
@@ -197,6 +212,9 @@ async def test_reveal_mechanism_weights_extrinsic(mocker, subtensor, fake_wallet
197212
)
198213

199214
# Asserts
215+
mocked_unlock_key.assert_called_once_with(
216+
wallet=fake_wallet, raise_error=False, unlock_type="hotkey"
217+
)
200218
mocked_convert_and_normalize_weights_and_uids.assert_called_once_with(uids, weights)
201219
mocked_compose_call.assert_awaited_once_with(
202220
call_module="SubtensorModule",
@@ -235,6 +253,9 @@ async def test_mechanism_sub_weights_extrinsic(mocker, subtensor, fake_wallet):
235253
uids = []
236254
weights = []
237255

256+
mocked_unlock_key = mocker.patch.object(
257+
mechanism, "unlock_key", return_value=mocker.Mock(success=True)
258+
)
238259
mocked_convert_and_normalize_weights_and_uids = mocker.patch.object(
239260
mechanism,
240261
"convert_and_normalize_weights_and_uids",
@@ -262,6 +283,9 @@ async def test_mechanism_sub_weights_extrinsic(mocker, subtensor, fake_wallet):
262283
)
263284

264285
# Asserts
286+
mocked_unlock_key.assert_called_once_with(
287+
wallet=fake_wallet, raise_error=False, unlock_type="hotkey"
288+
)
265289
mocked_convert_and_normalize_weights_and_uids.assert_called_once_with(uids, weights)
266290
mocked_compose_call.assert_awaited_once_with(
267291
call_module="SubtensorModule",

tests/unit_tests/extrinsics/test_sub_subnet.py renamed to tests/unit_tests/extrinsics/test_mechanisms.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ def test_commit_mechanism_weights_extrinsic(mocker, subtensor, fake_wallet):
1313
weights = []
1414
salt = []
1515

16+
mocked_unlock_key = mocker.patch.object(
17+
mechanism, "unlock_key", return_value=mocker.Mock(success=True)
18+
)
1619
mocked_get_sub_subnet_storage_index = mocker.patch.object(
1720
mechanism, "get_mechid_storage_index"
1821
)
@@ -34,6 +37,9 @@ def test_commit_mechanism_weights_extrinsic(mocker, subtensor, fake_wallet):
3437
)
3538

3639
# Asserts
40+
mocked_unlock_key.assert_called_once_with(
41+
wallet=fake_wallet, raise_error=False, unlock_type="hotkey"
42+
)
3743
mocked_get_sub_subnet_storage_index.assert_called_once_with(
3844
netuid=netuid, mechid=mechid
3945
)
@@ -79,6 +85,9 @@ def test_commit_timelocked_mechanism_weights_extrinsic(mocker, subtensor, fake_w
7985
weights = []
8086
block_time = mocker.Mock()
8187

88+
mocked_unlock_key = mocker.patch.object(
89+
mechanism, "unlock_key", return_value=mocker.Mock(success=True)
90+
)
8291
mocked_convert_and_normalize_weights_and_uids = mocker.patch.object(
8392
mechanism,
8493
"convert_and_normalize_weights_and_uids",
@@ -118,6 +127,9 @@ def test_commit_timelocked_mechanism_weights_extrinsic(mocker, subtensor, fake_w
118127
)
119128

120129
# Asserts
130+
mocked_unlock_key.assert_called_once_with(
131+
wallet=fake_wallet, raise_error=False, unlock_type="hotkey"
132+
)
121133
mocked_convert_and_normalize_weights_and_uids.assert_called_once_with(uids, weights)
122134
mocked_get_sub_subnet_storage_index.assert_called_once_with(
123135
netuid=netuid, mechid=mechid
@@ -169,6 +181,9 @@ def test_reveal_mechanism_weights_extrinsic(mocker, subtensor, fake_wallet):
169181
weights = []
170182
salt = []
171183

184+
mocked_unlock_key = mocker.patch.object(
185+
mechanism, "unlock_key", return_value=mocker.Mock(success=True)
186+
)
172187
mocked_convert_and_normalize_weights_and_uids = mocker.patch.object(
173188
mechanism,
174189
"convert_and_normalize_weights_and_uids",
@@ -192,6 +207,9 @@ def test_reveal_mechanism_weights_extrinsic(mocker, subtensor, fake_wallet):
192207
)
193208

194209
# Asserts
210+
mocked_unlock_key.assert_called_once_with(
211+
wallet=fake_wallet, raise_error=False, unlock_type="hotkey"
212+
)
195213
mocked_convert_and_normalize_weights_and_uids.assert_called_once_with(uids, weights)
196214
mocked_compose_call.assert_called_once_with(
197215
call_module="SubtensorModule",
@@ -229,6 +247,9 @@ def test_mechanism_sub_weights_extrinsic(mocker, subtensor, fake_wallet):
229247
uids = []
230248
weights = []
231249

250+
mocked_unlock_key = mocker.patch.object(
251+
mechanism, "unlock_key", return_value=mocker.Mock(success=True)
252+
)
232253
mocked_convert_and_normalize_weights_and_uids = mocker.patch.object(
233254
mechanism,
234255
"convert_and_normalize_weights_and_uids",
@@ -256,6 +277,9 @@ def test_mechanism_sub_weights_extrinsic(mocker, subtensor, fake_wallet):
256277
)
257278

258279
# Asserts
280+
mocked_unlock_key.assert_called_once_with(
281+
wallet=fake_wallet, raise_error=False, unlock_type="hotkey"
282+
)
259283
mocked_convert_and_normalize_weights_and_uids.assert_called_once_with(uids, weights)
260284
mocked_compose_call.assert_called_once_with(
261285
call_module="SubtensorModule",

0 commit comments

Comments
 (0)