Skip to content

Switch subnet emissions to price-based shares#2779

Merged
unconst merged 2 commits into
testnetfrom
price-based-testnet
Jun 22, 2026
Merged

Switch subnet emissions to price-based shares#2779
unconst merged 2 commits into
testnetfrom
price-based-testnet

Conversation

@gztensor

Copy link
Copy Markdown
Contributor

Description

Switch subnet emissions to price-based shares and root-proportion injection cap

  • get_shares now uses the subnet price EMA (SubnetMovingPrice) so emission is proportional to normalized price over emit-enabled subnets.
  • Alpha injection cap is now root_proportion * alpha_emission, so older subnets (lower root proportion) transition from liquidity injection to chain buys.
  • Update/repair affected emission tests; drop obsolete TAO-flow share tests.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run ./scripts/fix_rust.sh to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

…ection cap

- get_shares now uses the subnet price EMA (SubnetMovingPrice) so emission is
  proportional to normalized price over emit-enabled subnets.
- Alpha injection cap is now root_proportion * alpha_emission, so older subnets
  (lower root proportion) transition from liquidity injection to chain buys.
- Update/repair affected emission tests; drop obsolete TAO-flow share tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gztensor gztensor self-assigned this Jun 22, 2026
@gztensor gztensor added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Jun 22, 2026
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

🛡️ AI Review — Skeptic (security review)

VERDICT: VULNERABLE

BASELINE scrutiny: gztensor has repo write permission and substantial prior subtensor activity; PR is price-based-testnet targeting testnet directly.

No malicious code pattern found in the runtime diff itself: no new dependencies, no .github/ai-review/* or copilot-instruction changes, no new runtime unwrap/expect/unsafe, and the changed arithmetic uses checked or saturating fixed-point operations. The remaining blocker is the target branch path.

Findings

Sev File Finding
HIGH PR metadata: baseRefName=testnet, headRefName=price-based-testnet Feature branch targets testnet outside the approved promotion flow (off-diff)

Other findings

  • [HIGH] Feature branch targets testnet outside the approved promotion flow (PR metadata: baseRefName=testnet, headRefName=price-based-testnet) — The trusted branch policy says non-deployment PRs must target devnet-ready, and testnet should only receive promoted deployment changes in the staged flow. This PR is a feature/economic runtime change (Switch subnet emissions to price-based shares) from price-based-testnet directly into testnet, which bypasses the normal promotion path. Retarget through the approved flow, or document and obtain approval for a deployment/hotfix exception before merging.

Prior-comment reconciliation

  • c1320fba: not addressed — Current PR metadata still shows baseRefName=testnet and headRefName=price-based-testnet, with no fetched PR-body/comment justification for an approved deployment or hotfix exception.

Conclusion

This appears to be a legitimate economic runtime change, but it still targets testnet directly from a feature branch instead of following the approved promotion flow. That branch-policy bypass remains a merge blocker until the PR is retargeted or explicitly justified as an approved deployment/hotfix exception.


📜 Previous run (superseded)
Sev File Finding Status
HIGH PR metadata: baseRefName=testnet, headRefName=price-based-testnet Feature branch targets testnet outside the approved promotion flow ➡️ Carried forward to current findings
Current PR metadata still shows baseRefName=testnet and headRefName=price-based-testnet, with no fetched PR-body/comment justification for an approved deployment or hotfix exception.

# 🔍 AI Review — Auditor (domain review) has not yet run on this PR.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@unconst unconst merged commit 9321b12 into testnet Jun 22, 2026
229 of 233 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants