Skip to content

Custom dust collection type in subtensor#2707

Open
gztensor wants to merge 10 commits into
devnet-readyfrom
feat/account-dust-collection
Open

Custom dust collection type in subtensor#2707
gztensor wants to merge 10 commits into
devnet-readyfrom
feat/account-dust-collection

Conversation

@gztensor

@gztensor gztensor commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds a subtensor pallet type implementation for dust collection that reflects dust collection in subtensor TotalIssuance. Also, it adds a migration that syncs total issuance of subtensor pallet to the source of truth in balances pallet.

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

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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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 runtime/src/lib.rs
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

LOW scrutiny: established repo writer with write permission, substantial contribution history, no Gittensor allowlist hit; one non-author merge-from-base commit noted; branch feat/account-dust-collection -> devnet-ready.

Static review used only trusted instructions and prefetched local context. The PR diff is limited to runtime/accounting changes: Balances dust removal now adjusts Subtensor TotalIssuance, the migration remains bounded to fixed migration keys, and the runtime wires the Balances DustRemoval hook. No .github/, dependency, Cargo.lock, or build-script changes are present in the PR diff. The previously noted conflict markers are no longer present in the current diff/worktree scan.

Findings

No findings.

Conclusion

No malicious pattern or exploitable security vulnerability found in the static diff.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

Gittensor UNKNOWN: no allowlist hit; author has repo write permission and substantial recent Subtensor contribution history.

Duplicate-work check: #2754 is the only topical overlap from the prefetched open-PR list (Handle dust in order_swap.rs and leasing.rs to sync TI). This PR is the better candidate because the runtime-level Balances DustRemoval hook covers dust collection globally instead of patching individual call sites. Recommend closing or rebasing #2754 if its remaining changes only duplicate this accounting fix.

Spec version is bumped to 426. The prior committed conflict markers are no longer present, and git diff --check passes. I did not run cargo tests because no current finding required runtime confirmation; a cargo metadata probe was also blocked by rustup trying to write under the read-only home directory.

Findings

No findings.

Prior-comment reconciliation

  • ad284ed9: addressed — The conflict markers previously reported in pallets/subtensor/src/lib.rs are no longer present in the current diff/worktree scan.

Conclusion

Approve. The PR now wires dust removal into Subtensor total issuance at the runtime boundary, includes a bounded reset migration path, and adds focused coverage for the balances dust case.


📜 Previous run (superseded)
Sev File Finding Status
HIGH pallets/subtensor/src/lib.rs:88 Resolve committed conflict markers ✅ Addressed
The conflict markers previously reported in pallets/subtensor/src/lib.rs are no longer present in the current diff/worktree scan.

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@gztensor gztensor self-assigned this Jun 5, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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 runtime/src/lib.rs
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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 runtime/src/lib.rs
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

sam0x17
sam0x17 previously approved these changes Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

sam0x17
sam0x17 previously approved these changes Jun 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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/lib.rs Outdated
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

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.

3 participants