Skip to content

Comments

feat: Add hyperparams: sudo_set_sn_owner_hotkey, sudo_set_subnet_owner_hotkey, sudo_set_recycle_or_burn#827

Open
MkDev11 wants to merge 12 commits intoopentensor:mainfrom
MkDev11:feat/add-hyperparams-826
Open

feat: Add hyperparams: sudo_set_sn_owner_hotkey, sudo_set_subnet_owner_hotkey, sudo_set_recycle_or_burn#827
MkDev11 wants to merge 12 commits intoopentensor:mainfrom
MkDev11:feat/add-hyperparams-826

Conversation

@MkDev11
Copy link
Contributor

@MkDev11 MkDev11 commented Feb 19, 2026

Summary

Adds three hyperparameters as first-class CLI params so they can be set via btcli sudo set --param <name> --value <value>. They were previously unreachable because the arbitrary path only supports bool/u16/u64 and a single pallet.

Closes #826

Type of change

  • New feature (non-breaking)
  • Bug fix (hyperparams were invalid when set via arbitrary path)

What's changed

Param Description
sudo_set_sn_owner_hotkey Set subnet owner hotkey (root sudo only); value = SS58 hotkey
sudo_set_subnet_owner_hotkey Alias of above (same extrinsic)
sudo_set_recycle_or_burn Set recycle vs burn for subnet TAO (root sudo only); value = bool
  • bittensor_cli/src/__init__.py: Added all three to HYPERPARAMS (alias maps to same extrinsic) and HYPERPARAMS_METADATA (descriptions, side_effects, owner_settable=False, docs_link).
  • tests/unit_tests/test_hyperparams.py: New tests for presence in HYPERPARAMS, alias→same extrinsic, metadata, and owner_settable False.

No changes to sudo.py; existing first-class path already handles single extra arg (SS58 or bool).

Testing

Unit tests (hyperparams)

$ uv run pytest tests/unit_tests/test_hyperparams.py -v
============================= test session starts ==============================
platform linux -- Python 3.13.9, pytest-9.0.2, pluggy-1.6.0
collected 4 items

tests/unit_tests/test_hyperparams.py::test_new_hyperparams_in_hyperparams PASSED [ 25%]
tests/unit_tests/test_hyperparams.py::test_subnet_owner_hotkey_alias_maps_to_same_extrinsic PASSED [ 50%]
tests/unit_tests/test_hyperparams.py::test_new_hyperparams_have_metadata PASSED [ 75%]
tests/unit_tests/test_hyperparams.py::test_new_hyperparams_owner_settable_false PASSED [100%]

============================== 4 passed in 0.30s ===============================

Full unit test suite

$ uv run pytest tests/unit_tests/ -v
======================= 61 passed, 13 warnings in 0.44s ========================

Lint

$ uv run ruff check bittensor_cli/src/__init__.py tests/unit_tests/test_hyperparams.py
All checks passed!

Checklist

  • Code follows project style (ruff).
  • Self-reviewed changes.
  • New unit tests added; all unit tests pass.
  • No new warnings introduced by these changes.
  • Issue referenced in title/description (Closes Add more hyperparams #826).

…y, 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 opentensor#826
@MkDev11
Copy link
Contributor Author

MkDev11 commented Feb 19, 2026

@thewhaleking could you please review the PR and let me know your feedback? thanks.

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.
@MkDev11
Copy link
Contributor Author

MkDev11 commented Feb 19, 2026

The E2E tests are failing due to a CI infrastructure issue: the subtensor-localnet Docker artifact is corrupt (only 7.5KB), causing docker load to fail.

@thewhaleking thewhaleking requested a review from a team February 20, 2026 11:10
…t_owner_hotkey, recycle_or_burn), drop typing_extensions, move hyperparam tests to test_cli.py
@MkDev11 MkDev11 requested a review from thewhaleking February 20, 2026 12:49
@MkDev11 MkDev11 requested a review from thewhaleking February 21, 2026 13:00
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.
Per reviewer feedback: sn_owner_hotkey, subnet_owner_hotkey, and
recycle_or_burn are owner-settable hyperparameters, not root sudo only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add more hyperparams

2 participants