Skip to content

Custom dust collection type in subtensor#2707

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

Custom dust collection type in subtensor#2707
gztensor wants to merge 8 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; branch feat/account-dust-collection -> devnet-ready.

The diff is targeted runtime/accounting work with no .github/, dependency, Cargo.lock, or build-script changes. The previous blocker is addressed: runtime/src/lib.rs now bumps spec_version from 417 to 418 while wiring Balances DustRemoval into Subtensor accounting.

Findings

No findings.

Prior-comment reconciliation

  • 85628505: addressedruntime/src/lib.rs now bumps spec_version from 417 to 418 in the same diff that changes the Balances DustRemoval runtime wiring.

Conclusion

No malicious pattern or exploitable security vulnerability found in the static diff. The prior runtime-version issue has been fixed, so the PR is clear from the Skeptic perspective.


📜 Previous run (superseded)
Sev File Finding Status
HIGH runtime/src/lib.rs:479 Bump spec_version for this runtime behavior change ✅ Addressed
runtime/src/lib.rs now bumps spec_version from 417 to 418 in the same diff that changes the Balances DustRemoval runtime wiring.

🔍 AI Review — Auditor (domain review)

VERDICT: 👍

Gittensor UNKNOWN: no allowlist hit; author is an established repo writer with high recent subtensor contribution volume, so review focused on correctness rather than intent.

No blocking domain findings. The dust accounting change moves Subtensor TotalIssuance adjustment into the Balances DustRemoval hook, keeps the migration bounded to fixed migration keys, and includes coverage for the runtime dust path and migration idempotence.

Description discrepancy: the diff also carries an unrelated hotkey-swap ownership-check change in pallets/subtensor/src/swap/swap_hotkey.rs from a separate commit. That behavior is not mentioned in the PR body; I did not find a blocker in the hunk, but the PR description should ideally acknowledge it or the branch should drop it before merge.

Verification: attempted targeted tests for runtime/tests/balances_dust.rs and test_migrate_fix_total_issuance_evm_fees, but cargo could not start in this sandbox because rustup/cargo attempted to write dependency/toolchain state under read-only /home/runner/.rustup and /home/runner/.cargo. The devnet spec-version RPC lookup also failed DNS resolution here. No auto-fixes were applied.

Findings

No findings.

Conclusion

Approve. The runtime-affecting dust-accounting change has a spec bump in the diff, a bounded migration path, and focused test coverage; remaining risk is limited to tests/live spec check that could not be executed in this sandbox.

@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: 👍

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