From 7ac6572499e5f614b59303c9fd75da9f009e622f Mon Sep 17 00:00:00 2001 From: mkdev11 Date: Thu, 19 Feb 2026 17:48:15 +0100 Subject: [PATCH 01/12] feat(sudo): add sudo_set_sn_owner_hotkey, sudo_set_subnet_owner_hotkey, sudo_set_recycle_or_burn to HYPERPARAMS - Register three hyperparams that could not be set via arbitrary path (AdminUtils search_metadata only supports bool/u16/u64; hotkey params use AccountId). - Alias sudo_set_subnet_owner_hotkey -> same extrinsic as sudo_set_sn_owner_hotkey. - All three root-only (RootSudoOnly.TRUE), with HYPERPARAMS_METADATA. - Add unit tests for presence and alias. Closes #826 --- bittensor_cli/src/__init__.py | 21 +++++++++++++++ tests/unit_tests/test_hyperparams.py | 40 ++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 tests/unit_tests/test_hyperparams.py diff --git a/bittensor_cli/src/__init__.py b/bittensor_cli/src/__init__.py index e4de4da53..7f48e0a3e 100644 --- a/bittensor_cli/src/__init__.py +++ b/bittensor_cli/src/__init__.py @@ -683,6 +683,9 @@ class RootSudoOnly(Enum): "bonds_reset_enabled": ("sudo_set_bonds_reset_enabled", RootSudoOnly.FALSE), "transfers_enabled": ("sudo_set_toggle_transfer", RootSudoOnly.FALSE), "min_allowed_uids": ("sudo_set_min_allowed_uids", RootSudoOnly.TRUE), + "sudo_set_sn_owner_hotkey": ("sudo_set_sn_owner_hotkey", RootSudoOnly.TRUE), + "sudo_set_subnet_owner_hotkey": ("sudo_set_sn_owner_hotkey", RootSudoOnly.TRUE), + "sudo_set_recycle_or_burn": ("sudo_set_recycle_or_burn", RootSudoOnly.TRUE), # Note: These are displayed but not directly settable via HYPERPARAMS # They are derived or set via other mechanisms "alpha_high": ("", RootSudoOnly.FALSE), # Derived from alpha_values @@ -895,6 +898,24 @@ class RootSudoOnly(Enum): "owner_settable": False, "docs_link": "docs.learnbittensor.org/subnets/subnet-hyperparameters#minalloweduids", }, + "sudo_set_sn_owner_hotkey": { + "description": "Set the subnet owner hotkey (root sudo only).", + "side_effects": "Changes which hotkey is authorized as subnet owner for the given subnet.", + "owner_settable": False, + "docs_link": "docs.learnbittensor.org/subnets/subnet-hyperparameters", + }, + "sudo_set_subnet_owner_hotkey": { + "description": "Alias for sudo_set_sn_owner_hotkey; sets the subnet owner hotkey (root sudo only).", + "side_effects": "Same as sudo_set_sn_owner_hotkey.", + "owner_settable": False, + "docs_link": "docs.learnbittensor.org/subnets/subnet-hyperparameters", + }, + "sudo_set_recycle_or_burn": { + "description": "Set whether subnet TAO is recycled or burned (root sudo only).", + "side_effects": "Controls whether unstaked TAO is recycled back into the subnet or burned.", + "owner_settable": False, + "docs_link": "docs.learnbittensor.org/subnets/subnet-hyperparameters", + }, # Additional hyperparameters that appear in chain data but aren't directly settable via HYPERPARAMS "alpha_high": { "description": "High bound of the alpha range for stake calculations.", diff --git a/tests/unit_tests/test_hyperparams.py b/tests/unit_tests/test_hyperparams.py new file mode 100644 index 000000000..bbdbb6482 --- /dev/null +++ b/tests/unit_tests/test_hyperparams.py @@ -0,0 +1,40 @@ +"""Unit tests for HYPERPARAMS and HYPERPARAMS_METADATA (issue #826).""" + +from bittensor_cli.src import HYPERPARAMS, HYPERPARAMS_METADATA, RootSudoOnly + + +NEW_HYPERPARAMS_826 = { + "sudo_set_sn_owner_hotkey", + "sudo_set_subnet_owner_hotkey", + "sudo_set_recycle_or_burn", +} + + +def test_new_hyperparams_in_hyperparams(): + for key in NEW_HYPERPARAMS_826: + assert key in HYPERPARAMS, f"{key} should be in HYPERPARAMS" + extrinsic, root_only = HYPERPARAMS[key] + assert extrinsic, f"{key} must have non-empty extrinsic name" + assert root_only is RootSudoOnly.TRUE + + +def test_subnet_owner_hotkey_alias_maps_to_same_extrinsic(): + ext_sn, _ = HYPERPARAMS["sudo_set_sn_owner_hotkey"] + ext_subnet, _ = HYPERPARAMS["sudo_set_subnet_owner_hotkey"] + assert ext_sn == ext_subnet == "sudo_set_sn_owner_hotkey" + + +def test_new_hyperparams_have_metadata(): + required = {"description", "side_effects", "owner_settable", "docs_link"} + for key in NEW_HYPERPARAMS_826: + assert key in HYPERPARAMS_METADATA, f"{key} should be in HYPERPARAMS_METADATA" + meta = HYPERPARAMS_METADATA[key] + for field in required: + assert field in meta, f"{key} metadata missing '{field}'" + assert isinstance(meta["description"], str) + assert isinstance(meta["owner_settable"], bool) + + +def test_new_hyperparams_owner_settable_false(): + for key in NEW_HYPERPARAMS_826: + assert HYPERPARAMS_METADATA[key]["owner_settable"] is False From 7348ee88f42ae1ce9e4d40aee2e00d16f39bd454 Mon Sep 17 00:00:00 2001 From: mkdev11 Date: Thu, 19 Feb 2026 18:11:48 +0100 Subject: [PATCH 02/12] ci: retrigger CI checks From f97d5cc35822d85ecf6cd406eff28da5973ebf8d Mon Sep 17 00:00:00 2001 From: mkdev11 Date: Thu, 19 Feb 2026 18:16:36 +0100 Subject: [PATCH 03/12] fix(deps): add typing_extensions as explicit dependency bittensor_cli/cli.py imports Annotated from typing_extensions directly. On Python 3.13+, transitive deps (typer, etc.) no longer pull it in, causing ImportError in CI. --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 0cfe2953b..a1955935b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,7 @@ dependencies = [ "PyYAML~=6.0", "rich>=13.7,<15.0", "scalecodec==1.2.12", + "typing_extensions>=3.7.4.3", "typer>=0.16", "bittensor-wallet>=4.0.0", "packaging", From 5d2f98d558d589c26812fb63d47b92f2edf992df Mon Sep 17 00:00:00 2001 From: mkdev11 Date: Thu, 19 Feb 2026 18:23:37 +0100 Subject: [PATCH 04/12] ci: retrigger CI checks From 1d684d99a798c9bfa563ddcfef6ab8df5e4516f0 Mon Sep 17 00:00:00 2001 From: mkdev11 Date: Fri, 20 Feb 2026 13:31:41 +0100 Subject: [PATCH 05/12] Address PR review: RootSudoOnly.FALSE, naming (sn_owner_hotkey, subnet_owner_hotkey, recycle_or_burn), drop typing_extensions, move hyperparam tests to test_cli.py --- bittensor_cli/src/__init__.py | 16 +++++------ pyproject.toml | 1 - tests/unit_tests/test_cli.py | 35 ++++++++++++++++++++++++ tests/unit_tests/test_hyperparams.py | 40 ---------------------------- 4 files changed, 43 insertions(+), 49 deletions(-) delete mode 100644 tests/unit_tests/test_hyperparams.py diff --git a/bittensor_cli/src/__init__.py b/bittensor_cli/src/__init__.py index 7f48e0a3e..a33180377 100644 --- a/bittensor_cli/src/__init__.py +++ b/bittensor_cli/src/__init__.py @@ -683,9 +683,9 @@ class RootSudoOnly(Enum): "bonds_reset_enabled": ("sudo_set_bonds_reset_enabled", RootSudoOnly.FALSE), "transfers_enabled": ("sudo_set_toggle_transfer", RootSudoOnly.FALSE), "min_allowed_uids": ("sudo_set_min_allowed_uids", RootSudoOnly.TRUE), - "sudo_set_sn_owner_hotkey": ("sudo_set_sn_owner_hotkey", RootSudoOnly.TRUE), - "sudo_set_subnet_owner_hotkey": ("sudo_set_sn_owner_hotkey", RootSudoOnly.TRUE), - "sudo_set_recycle_or_burn": ("sudo_set_recycle_or_burn", RootSudoOnly.TRUE), + "sn_owner_hotkey": ("sudo_set_sn_owner_hotkey", RootSudoOnly.FALSE), + "subnet_owner_hotkey": ("sudo_set_sn_owner_hotkey", RootSudoOnly.FALSE), + "recycle_or_burn": ("sudo_set_recycle_or_burn", RootSudoOnly.FALSE), # Note: These are displayed but not directly settable via HYPERPARAMS # They are derived or set via other mechanisms "alpha_high": ("", RootSudoOnly.FALSE), # Derived from alpha_values @@ -898,19 +898,19 @@ class RootSudoOnly(Enum): "owner_settable": False, "docs_link": "docs.learnbittensor.org/subnets/subnet-hyperparameters#minalloweduids", }, - "sudo_set_sn_owner_hotkey": { + "sn_owner_hotkey": { "description": "Set the subnet owner hotkey (root sudo only).", "side_effects": "Changes which hotkey is authorized as subnet owner for the given subnet.", "owner_settable": False, "docs_link": "docs.learnbittensor.org/subnets/subnet-hyperparameters", }, - "sudo_set_subnet_owner_hotkey": { - "description": "Alias for sudo_set_sn_owner_hotkey; sets the subnet owner hotkey (root sudo only).", - "side_effects": "Same as sudo_set_sn_owner_hotkey.", + "subnet_owner_hotkey": { + "description": "Alias for sn_owner_hotkey; sets the subnet owner hotkey (root sudo only).", + "side_effects": "Same as sn_owner_hotkey.", "owner_settable": False, "docs_link": "docs.learnbittensor.org/subnets/subnet-hyperparameters", }, - "sudo_set_recycle_or_burn": { + "recycle_or_burn": { "description": "Set whether subnet TAO is recycled or burned (root sudo only).", "side_effects": "Controls whether unstaked TAO is recycled back into the subnet or burned.", "owner_settable": False, diff --git a/pyproject.toml b/pyproject.toml index a1955935b..0cfe2953b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,6 @@ dependencies = [ "PyYAML~=6.0", "rich>=13.7,<15.0", "scalecodec==1.2.12", - "typing_extensions>=3.7.4.3", "typer>=0.16", "bittensor-wallet>=4.0.0", "packaging", diff --git a/tests/unit_tests/test_cli.py b/tests/unit_tests/test_cli.py index 60cc10708..844ba5b4c 100644 --- a/tests/unit_tests/test_cli.py +++ b/tests/unit_tests/test_cli.py @@ -4,6 +4,7 @@ from async_substrate_interface import AsyncSubstrateInterface from bittensor_cli.cli import parse_mnemonic, CLIManager +from bittensor_cli.src import HYPERPARAMS, HYPERPARAMS_METADATA, RootSudoOnly from bittensor_cli.src.bittensor.extrinsics.root import ( get_current_weights_for_uid, set_root_weights_extrinsic, @@ -805,3 +806,37 @@ async def test_set_root_weights_skips_current_weights_without_prompt(): ) mock_get_current.assert_not_called() + + +# HYPERPARAMS / HYPERPARAMS_METADATA (issue #826) +NEW_HYPERPARAMS_826 = {"sn_owner_hotkey", "subnet_owner_hotkey", "recycle_or_burn"} + + +def test_new_hyperparams_in_hyperparams(): + for key in NEW_HYPERPARAMS_826: + assert key in HYPERPARAMS, f"{key} should be in HYPERPARAMS" + extrinsic, root_only = HYPERPARAMS[key] + assert extrinsic, f"{key} must have non-empty extrinsic name" + assert root_only is RootSudoOnly.FALSE + + +def test_subnet_owner_hotkey_alias_maps_to_same_extrinsic(): + ext_sn, _ = HYPERPARAMS["sn_owner_hotkey"] + ext_subnet, _ = HYPERPARAMS["subnet_owner_hotkey"] + assert ext_sn == ext_subnet == "sudo_set_sn_owner_hotkey" + + +def test_new_hyperparams_have_metadata(): + required = {"description", "side_effects", "owner_settable", "docs_link"} + for key in NEW_HYPERPARAMS_826: + assert key in HYPERPARAMS_METADATA, f"{key} should be in HYPERPARAMS_METADATA" + meta = HYPERPARAMS_METADATA[key] + for field in required: + assert field in meta, f"{key} metadata missing '{field}'" + assert isinstance(meta["description"], str) + assert isinstance(meta["owner_settable"], bool) + + +def test_new_hyperparams_owner_settable_false(): + for key in NEW_HYPERPARAMS_826: + assert HYPERPARAMS_METADATA[key]["owner_settable"] is False diff --git a/tests/unit_tests/test_hyperparams.py b/tests/unit_tests/test_hyperparams.py deleted file mode 100644 index bbdbb6482..000000000 --- a/tests/unit_tests/test_hyperparams.py +++ /dev/null @@ -1,40 +0,0 @@ -"""Unit tests for HYPERPARAMS and HYPERPARAMS_METADATA (issue #826).""" - -from bittensor_cli.src import HYPERPARAMS, HYPERPARAMS_METADATA, RootSudoOnly - - -NEW_HYPERPARAMS_826 = { - "sudo_set_sn_owner_hotkey", - "sudo_set_subnet_owner_hotkey", - "sudo_set_recycle_or_burn", -} - - -def test_new_hyperparams_in_hyperparams(): - for key in NEW_HYPERPARAMS_826: - assert key in HYPERPARAMS, f"{key} should be in HYPERPARAMS" - extrinsic, root_only = HYPERPARAMS[key] - assert extrinsic, f"{key} must have non-empty extrinsic name" - assert root_only is RootSudoOnly.TRUE - - -def test_subnet_owner_hotkey_alias_maps_to_same_extrinsic(): - ext_sn, _ = HYPERPARAMS["sudo_set_sn_owner_hotkey"] - ext_subnet, _ = HYPERPARAMS["sudo_set_subnet_owner_hotkey"] - assert ext_sn == ext_subnet == "sudo_set_sn_owner_hotkey" - - -def test_new_hyperparams_have_metadata(): - required = {"description", "side_effects", "owner_settable", "docs_link"} - for key in NEW_HYPERPARAMS_826: - assert key in HYPERPARAMS_METADATA, f"{key} should be in HYPERPARAMS_METADATA" - meta = HYPERPARAMS_METADATA[key] - for field in required: - assert field in meta, f"{key} metadata missing '{field}'" - assert isinstance(meta["description"], str) - assert isinstance(meta["owner_settable"], bool) - - -def test_new_hyperparams_owner_settable_false(): - for key in NEW_HYPERPARAMS_826: - assert HYPERPARAMS_METADATA[key]["owner_settable"] is False From 1fc0aa3b1f3a9c3a39fa75120ec430dae762cd2a Mon Sep 17 00:00:00 2001 From: mkdev11 Date: Fri, 20 Feb 2026 13:37:42 +0100 Subject: [PATCH 06/12] Use typing.Annotated instead of typing_extensions (fix e2e CI without adding dependency) --- bittensor_cli/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bittensor_cli/cli.py b/bittensor_cli/cli.py index 295232c36..3a5080d5a 100755 --- a/bittensor_cli/cli.py +++ b/bittensor_cli/cli.py @@ -32,7 +32,7 @@ from rich.prompt import FloatPrompt, Prompt, IntPrompt from rich.table import Column, Table from rich.tree import Tree -from typing_extensions import Annotated +from typing import Annotated from yaml import safe_dump, safe_load from bittensor_cli.src import ( From 93c989f8ee0750582e3e871487d076cb814800cb Mon Sep 17 00:00:00 2001 From: mkdev11 Date: Sat, 21 Feb 2026 12:33:16 +0100 Subject: [PATCH 07/12] Align metadata with RootSudoOnly.FALSE: remove 'root sudo only' from descriptions --- bittensor_cli/src/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bittensor_cli/src/__init__.py b/bittensor_cli/src/__init__.py index a33180377..e78efe2ec 100644 --- a/bittensor_cli/src/__init__.py +++ b/bittensor_cli/src/__init__.py @@ -899,19 +899,19 @@ class RootSudoOnly(Enum): "docs_link": "docs.learnbittensor.org/subnets/subnet-hyperparameters#minalloweduids", }, "sn_owner_hotkey": { - "description": "Set the subnet owner hotkey (root sudo only).", + "description": "Set the subnet owner hotkey.", "side_effects": "Changes which hotkey is authorized as subnet owner for the given subnet.", "owner_settable": False, "docs_link": "docs.learnbittensor.org/subnets/subnet-hyperparameters", }, "subnet_owner_hotkey": { - "description": "Alias for sn_owner_hotkey; sets the subnet owner hotkey (root sudo only).", + "description": "Alias for sn_owner_hotkey; sets the subnet owner hotkey.", "side_effects": "Same as sn_owner_hotkey.", "owner_settable": False, "docs_link": "docs.learnbittensor.org/subnets/subnet-hyperparameters", }, "recycle_or_burn": { - "description": "Set whether subnet TAO is recycled or burned (root sudo only).", + "description": "Set whether subnet TAO is recycled or burned.", "side_effects": "Controls whether unstaked TAO is recycled back into the subnet or burned.", "owner_settable": False, "docs_link": "docs.learnbittensor.org/subnets/subnet-hyperparameters", From a11cab2cad9d207c6fddd0c971241a3dfc9ce4fc Mon Sep 17 00:00:00 2001 From: mkdev11 Date: Sat, 21 Feb 2026 14:06:26 +0100 Subject: [PATCH 08/12] chore: empty commit to rerun CI From 58dc234e01d0f04d81b628e8100baa471b9ef2f4 Mon Sep 17 00:00:00 2001 From: mkdev11 Date: Sat, 21 Feb 2026 15:25:52 +0100 Subject: [PATCH 09/12] fix: set RootSudoOnly.TRUE for new hyperparams and add unit tests Address reviewer feedback: sn_owner_hotkey, subnet_owner_hotkey, and recycle_or_burn are root sudo only operations, so RootSudoOnly must be TRUE. Add unit tests verifying the new hyperparameters and their metadata. --- bittensor_cli/src/__init__.py | 6 ++--- tests/unit_tests/test_hyperparams.py | 40 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 tests/unit_tests/test_hyperparams.py diff --git a/bittensor_cli/src/__init__.py b/bittensor_cli/src/__init__.py index e78efe2ec..dcf0dce47 100644 --- a/bittensor_cli/src/__init__.py +++ b/bittensor_cli/src/__init__.py @@ -683,9 +683,9 @@ class RootSudoOnly(Enum): "bonds_reset_enabled": ("sudo_set_bonds_reset_enabled", RootSudoOnly.FALSE), "transfers_enabled": ("sudo_set_toggle_transfer", RootSudoOnly.FALSE), "min_allowed_uids": ("sudo_set_min_allowed_uids", RootSudoOnly.TRUE), - "sn_owner_hotkey": ("sudo_set_sn_owner_hotkey", RootSudoOnly.FALSE), - "subnet_owner_hotkey": ("sudo_set_sn_owner_hotkey", RootSudoOnly.FALSE), - "recycle_or_burn": ("sudo_set_recycle_or_burn", RootSudoOnly.FALSE), + "sn_owner_hotkey": ("sudo_set_sn_owner_hotkey", RootSudoOnly.TRUE), + "subnet_owner_hotkey": ("sudo_set_sn_owner_hotkey", RootSudoOnly.TRUE), + "recycle_or_burn": ("sudo_set_recycle_or_burn", RootSudoOnly.TRUE), # Note: These are displayed but not directly settable via HYPERPARAMS # They are derived or set via other mechanisms "alpha_high": ("", RootSudoOnly.FALSE), # Derived from alpha_values diff --git a/tests/unit_tests/test_hyperparams.py b/tests/unit_tests/test_hyperparams.py new file mode 100644 index 000000000..ba58d2ac6 --- /dev/null +++ b/tests/unit_tests/test_hyperparams.py @@ -0,0 +1,40 @@ +"""Unit tests for HYPERPARAMS and HYPERPARAMS_METADATA (issue #826).""" + +from bittensor_cli.src import HYPERPARAMS, HYPERPARAMS_METADATA, RootSudoOnly + + +NEW_HYPERPARAMS_826 = { + "sn_owner_hotkey", + "subnet_owner_hotkey", + "recycle_or_burn", +} + + +def test_new_hyperparams_in_hyperparams(): + for key in NEW_HYPERPARAMS_826: + assert key in HYPERPARAMS, f"{key} should be in HYPERPARAMS" + extrinsic, root_only = HYPERPARAMS[key] + assert extrinsic, f"{key} must have non-empty extrinsic name" + assert root_only is RootSudoOnly.TRUE + + +def test_subnet_owner_hotkey_alias_maps_to_same_extrinsic(): + ext_sn, _ = HYPERPARAMS["sn_owner_hotkey"] + ext_subnet, _ = HYPERPARAMS["subnet_owner_hotkey"] + assert ext_sn == ext_subnet == "sudo_set_sn_owner_hotkey" + + +def test_new_hyperparams_have_metadata(): + required = {"description", "side_effects", "owner_settable", "docs_link"} + for key in NEW_HYPERPARAMS_826: + assert key in HYPERPARAMS_METADATA, f"{key} should be in HYPERPARAMS_METADATA" + meta = HYPERPARAMS_METADATA[key] + for field in required: + assert field in meta, f"{key} metadata missing '{field}'" + assert isinstance(meta["description"], str) + assert isinstance(meta["owner_settable"], bool) + + +def test_new_hyperparams_owner_settable_false(): + for key in NEW_HYPERPARAMS_826: + assert HYPERPARAMS_METADATA[key]["owner_settable"] is False From ba63c277c7c5395d1e84a7f3a3f614b489e9f488 Mon Sep 17 00:00:00 2001 From: mkdev11 Date: Sat, 21 Feb 2026 15:28:30 +0100 Subject: [PATCH 10/12] fix: set owner_settable=True and RootSudoOnly.FALSE for new hyperparams Per reviewer feedback: sn_owner_hotkey, subnet_owner_hotkey, and recycle_or_burn are owner-settable hyperparameters, not root sudo only. --- bittensor_cli/src/__init__.py | 12 ++++++------ tests/unit_tests/test_hyperparams.py | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bittensor_cli/src/__init__.py b/bittensor_cli/src/__init__.py index dcf0dce47..bbbbb3151 100644 --- a/bittensor_cli/src/__init__.py +++ b/bittensor_cli/src/__init__.py @@ -683,9 +683,9 @@ class RootSudoOnly(Enum): "bonds_reset_enabled": ("sudo_set_bonds_reset_enabled", RootSudoOnly.FALSE), "transfers_enabled": ("sudo_set_toggle_transfer", RootSudoOnly.FALSE), "min_allowed_uids": ("sudo_set_min_allowed_uids", RootSudoOnly.TRUE), - "sn_owner_hotkey": ("sudo_set_sn_owner_hotkey", RootSudoOnly.TRUE), - "subnet_owner_hotkey": ("sudo_set_sn_owner_hotkey", RootSudoOnly.TRUE), - "recycle_or_burn": ("sudo_set_recycle_or_burn", RootSudoOnly.TRUE), + "sn_owner_hotkey": ("sudo_set_sn_owner_hotkey", RootSudoOnly.FALSE), + "subnet_owner_hotkey": ("sudo_set_sn_owner_hotkey", RootSudoOnly.FALSE), + "recycle_or_burn": ("sudo_set_recycle_or_burn", RootSudoOnly.FALSE), # Note: These are displayed but not directly settable via HYPERPARAMS # They are derived or set via other mechanisms "alpha_high": ("", RootSudoOnly.FALSE), # Derived from alpha_values @@ -901,19 +901,19 @@ class RootSudoOnly(Enum): "sn_owner_hotkey": { "description": "Set the subnet owner hotkey.", "side_effects": "Changes which hotkey is authorized as subnet owner for the given subnet.", - "owner_settable": False, + "owner_settable": True, "docs_link": "docs.learnbittensor.org/subnets/subnet-hyperparameters", }, "subnet_owner_hotkey": { "description": "Alias for sn_owner_hotkey; sets the subnet owner hotkey.", "side_effects": "Same as sn_owner_hotkey.", - "owner_settable": False, + "owner_settable": True, "docs_link": "docs.learnbittensor.org/subnets/subnet-hyperparameters", }, "recycle_or_burn": { "description": "Set whether subnet TAO is recycled or burned.", "side_effects": "Controls whether unstaked TAO is recycled back into the subnet or burned.", - "owner_settable": False, + "owner_settable": True, "docs_link": "docs.learnbittensor.org/subnets/subnet-hyperparameters", }, # Additional hyperparameters that appear in chain data but aren't directly settable via HYPERPARAMS diff --git a/tests/unit_tests/test_hyperparams.py b/tests/unit_tests/test_hyperparams.py index ba58d2ac6..8f6b42647 100644 --- a/tests/unit_tests/test_hyperparams.py +++ b/tests/unit_tests/test_hyperparams.py @@ -15,7 +15,7 @@ def test_new_hyperparams_in_hyperparams(): assert key in HYPERPARAMS, f"{key} should be in HYPERPARAMS" extrinsic, root_only = HYPERPARAMS[key] assert extrinsic, f"{key} must have non-empty extrinsic name" - assert root_only is RootSudoOnly.TRUE + assert root_only is RootSudoOnly.FALSE def test_subnet_owner_hotkey_alias_maps_to_same_extrinsic(): @@ -35,6 +35,6 @@ def test_new_hyperparams_have_metadata(): assert isinstance(meta["owner_settable"], bool) -def test_new_hyperparams_owner_settable_false(): +def test_new_hyperparams_owner_settable_true(): for key in NEW_HYPERPARAMS_826: - assert HYPERPARAMS_METADATA[key]["owner_settable"] is False + assert HYPERPARAMS_METADATA[key]["owner_settable"] is True From 561478a1d12c99de4899ce39bf70106021b281c6 Mon Sep 17 00:00:00 2001 From: mkdev11 Date: Sat, 21 Feb 2026 15:31:21 +0100 Subject: [PATCH 11/12] fix: update test_cli.py to assert owner_settable is True --- tests/unit_tests/test_cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/test_cli.py b/tests/unit_tests/test_cli.py index 844ba5b4c..9c1c3d996 100644 --- a/tests/unit_tests/test_cli.py +++ b/tests/unit_tests/test_cli.py @@ -837,6 +837,6 @@ def test_new_hyperparams_have_metadata(): assert isinstance(meta["owner_settable"], bool) -def test_new_hyperparams_owner_settable_false(): +def test_new_hyperparams_owner_settable_true(): for key in NEW_HYPERPARAMS_826: - assert HYPERPARAMS_METADATA[key]["owner_settable"] is False + assert HYPERPARAMS_METADATA[key]["owner_settable"] is True From 9a624c89e137495eef1611a78eb8bf56bd973825 Mon Sep 17 00:00:00 2001 From: mkdev11 Date: Sat, 21 Feb 2026 19:30:17 +0100 Subject: [PATCH 12/12] trigger CI