Skip to content

Default subnet emission off on registration#2787

Merged
sam0x17 merged 2 commits into
mainfrom
feat/default-subnet-emission-off
Jun 23, 2026
Merged

Default subnet emission off on registration#2787
sam0x17 merged 2 commits into
mainfrom
feat/default-subnet-emission-off

Conversation

@unconst

@unconst unconst commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • New subnets registered via do_register_network now start with SubnetEmissionEnabled set to false, so pool-side emission must be explicitly enabled instead of relying on the DefaultTrue storage value.
  • Subnets created through init_new_network (e.g. the add_network test helper) are unaffected, as that path still sets emission to true.
  • Updated the two coinbase tests that register a dynamic network and expect emission to be on (test_coinbase_tao_issuance_base, test_coinbase_v3_liquidity_update) to enable emission explicitly.

Test plan

  • cargo test -p pallet-subtensor --lib (previously 2 failures, now green)
  • cargo test -p pallet-admin-utils -p subtensor-chain-extensions -p subtensor-transaction-fee --lib

Made with Cursor

New subnets registered via do_register_network now start with
SubnetEmissionEnabled set to false so emission must be explicitly
enabled, rather than relying on the storage default of true.

Update the two coinbase tests that registered a dynamic network and
expected emission to be on by enabling it explicitly.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added the hotfix This PR needs to be merged very quickly and will likely skip testing on devnet and testnet label Jun 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚨🚨🚨 HOTFIX DETECTED 🚨🚨🚨

It looks like you are trying to merge a hotfix PR into main. If this isn't what you wanted to do, and you just wanted to make a regular PR, please close this PR, base your changes off the devnet-ready branch and open a new PR into devnet ready.

If you are trying to merge a hotfix PR, please complete the following essential steps:

  1. go ahead and get this PR into main merged, so we can get the change in as quickly as possible!
  2. merge main into testnet, bumping spec_version
  3. deploy testnet
  4. merge testnet into devnet, bumping spec_version
  5. deploy devnet
  6. merge devnet into devnet-ready

If you do not complete these steps, your hotfix may be inadvertently removed in the future when branches are promoted to main, so it is essential that you do so.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

BASELINE scrutiny: established write-permission contributor; no Gittensor allowlist hit; main-targeting PR has hotfix label/rationale and includes one maintainer spec-bump commit.

Reviewed the trusted instructions, prior Skeptic comment, prefetched PR metadata, author signals, changed-file list, and full diff. The PR does not modify .github/ai-review/*, .github/copilot-instructions.md, workflows, dependencies, Cargo.lock, or build scripts. The runtime-affecting change is limited to an explicit SubnetEmissionEnabled storage write for newly registered dynamic subnets plus the required spec_version bump.

Findings

No findings.

Conclusion

No malicious behavior or security vulnerability found in the changed lines. The new default-off emission flag is deterministic, introduces no panic/arithmetic/origin surface, and leaves the existing root-only admin toggle path unchanged.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

Author is not in the trusted Gittensor allowlists but has write permission and substantial prior subtensor history; PR is labeled hotfix to main.

Reviewed the pre-fetched PR metadata, body, prior Auditor sticky, author context, overlapping PR list, and the three-file diff. The implementation matches the PR body: public dynamic subnet registration now explicitly overrides SubnetEmissionEnabled to false after init_new_network initializes normal subnet defaults, while the direct/test initialization path continues to set the flag to true.

No duplicate open PR appears to be a better candidate. The overlapping PRs are broader propagation, transfer-flag, governance, or unrelated subnet/economic changes rather than this default-off registration hotfix.

No auto-fixes were applied. The PR already bumps runtime/src/lib.rs spec_version from 421 to 422.

Findings

No findings.

Conclusion

The change is narrow, covered by adjusted coinbase expectations, and does not introduce a new extrinsic, migration, panic source, origin change, or arithmetic path. I found no domain blockers in the changed lines.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@gztensor gztensor added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Jun 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@sam0x17 sam0x17 merged commit e367ae6 into main Jun 23, 2026
34 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotfix This PR needs to be merged very quickly and will likely skip testing on devnet and testnet skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants