Skip to content

Subnet Protocol Alpha Accounting#2645

Merged
sam0x17 merged 15 commits into
devnet-readyfrom
chain-buy-cache
Jun 1, 2026
Merged

Subnet Protocol Alpha Accounting#2645
sam0x17 merged 15 commits into
devnet-readyfrom
chain-buy-cache

Conversation

@JohnReedV
Copy link
Copy Markdown
Contributor

Description

This PR adds protocol-owned alpha accounting for subnet chain buys and includes that alpha in subnet deregistration settlement.

  • Stops recycling alpha bought during protocol TAO buys
  • Adds per-subnet cached protocol alpha accounting
  • Includes protocol alpha-in and cached protocol alpha in deregistration pro-rata settlement
  • Clears cached protocol alpha when a subnet is dissolved
  • Updates tests for the new deregistration settlement behavior

@JohnReedV JohnReedV added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label May 7, 2026
Comment thread pallets/subtensor/src/coinbase/run_coinbase.rs
@github-actions github-actions Bot mentioned this pull request May 21, 2026
4 tasks
gztensor
gztensor previously approved these changes May 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 26, 2026

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

Baseline scrutiny: established Opentensor contributor with repo write permission; branch chain-buy-cache -> devnet-ready; no trusted Gittensor allowlist hit.

Static review only. The PR does not modify .github/, dependency manifests, lockfiles, or build scripts. I reviewed the protocol-alpha cache, deregistration settlement changes, storage cleanup, arithmetic, generated weight deltas, and contributor/commit signals for malicious behavior, panic surface, origin bypasses, supply-chain risk, hidden activation conditions, and fund-flow security regressions; I did not find a Skeptic-blocking issue.

The known dissolve weight-accounting mismatch remains an Auditor-tracked domain finding, not a Skeptic security finding here because the affected calls are root-only.

Findings

No findings.

Conclusion

No malicious behavior or security vulnerability was found in the reviewed diff.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

Established opentensor contributor with repo write permission and long subtensor history; Gittensor association UNKNOWN from trusted allowlists.

PR body is substantive and matches the implementation. I did not find a duplicate-work concern among the overlapping open PRs; the overlaps appear to be adjacent subtensor/runtime churn rather than competing implementations.

git diff --check passed. I did not run targeted Rust tests because the carried-forward issue is a static weight-accounting mismatch. Spec-version auto-fix was not applied because the devnet RPC host could not be resolved from this sandbox, so I could not safely compare local spec_version: 412 against live devnet.

Findings

Sev File Finding
MEDIUM pallets/subtensor/src/staking/remove_stake.rs:477 Update dissolve weights for protocol-alpha storage inline

Prior-comment reconciliation

  • 1969a08a: not addressedSubnetProtocolAlpha is still absent from the hard-coded dissolve_network / root_dissolve_network weight accounting; the weights remain reads(6) / writes(31).

Conclusion

The protocol-alpha accounting change is consistent with the PR description and has focused tests for coinbase caching and deregistration settlement. The carried-forward weight-accounting issue remains medium severity because the affected dissolve calls are root-only, so I am not blocking merge on it.


📜 Previous run (superseded)
Sev File Finding Status
MEDIUM pallets/subtensor/src/staking/remove_stake.rs:477 Update dissolve weights for protocol-alpha storage ➡️ Carried forward to current findings
SubnetProtocolAlpha is still absent from the hard-coded dissolve_network / root_dissolve_network weight accounting; the weights remain reads(6) / writes(31).

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread pallets/subtensor/src/staking/remove_stake.rs
@github-actions
Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread pallets/subtensor/src/staking/remove_stake.rs
@github-actions
Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread pallets/subtensor/src/staking/remove_stake.rs
@github-actions
Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread pallets/subtensor/src/staking/remove_stake.rs
@github-actions
Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread pallets/subtensor/src/staking/remove_stake.rs
@github-actions
Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@sam0x17 sam0x17 merged commit 26585d7 into devnet-ready Jun 1, 2026
220 of 221 checks passed
This was referenced Jun 1, 2026
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.

4 participants