Handle dust in order_swap.rs and leasing.rs to sync TI#2754
Conversation
hotkey-swap check `new_hotkey`
Use Fireactions runners for self-hosted CI jobs
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE BASELINE scrutiny: gztensor has write permission, an established account, and substantial prior subtensor history; branch fix/dust-handling -> devnet-ready. Reviewed the full pre-fetched diff statically. The PR does not modify FindingsNo findings. ConclusionNo malicious behavior or security vulnerability was found in the diff. The runtime-facing changes are narrow and use existing checked/saturating patterns without introducing new panic sources, origin-check bypasses, or supply-chain changes. 🔍 AI Review — Auditor (domain review)VERDICT: 👎 Gittensor association: LIKELY by heuristic; author is not allowlisted, but has write permission and extensive recent subtensor PR history. The dust-handling direction is correct: the changed call sites route TAO movement through Description discrepancies: the PR body only describes dust handling, but the branch also carries broad workflow runner-label changes and a No auto-fixes were applied. I attempted the devnet Findings
ConclusionBlocking because the leasing path now performs extra storage work per contributor without updating the extrinsic weight. That needs to be reweighted or explicitly accounted for before merge. |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
| contributor_refund.into(), | ||
| Preservation::Expendable, | ||
| )?; | ||
| Self::transfer_tao(&lease_coldkey, &contributor, contributor_refund.into())?; |
There was a problem hiding this comment.
[HIGH] Update leasing weight for per-contributor issuance accounting
This refund loop now calls Self::transfer_tao, which does more storage work than the previous direct Currency::transfer: it checks the source balance, reads Balances total issuance before and after, and can mutate Subtensor TotalIssuance when dust is burned. Because this runs once per contributor, register_leased_network(k) gained O(k) additional reads and possible writes, but SubnetLeasingWeightInfo::do_register_leased_network and the generated benchmark weight were not updated. Re-benchmark/update the weight or manually add the extra DB reads/writes so the extrinsic is not underweighted at high MaxContributors.
There was a problem hiding this comment.
Bad review. Direct Currency::transfer does not update subtensor pallet TotalIssuance if it burns dust.
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👎 |
Description
When
Currency::is directly used to transfer or withdraw TAO, it may burn dust and not decrease subtensor pallet total issuance. Fixing all across codebase.Related Issue(s)
OrderSwapInterface::transfer_taoburns dust at origin without decrementing subtensor::TotalIssuance #2738Type of Change
Checklist
./scripts/fix_rust.shto ensure my code is formatted and linted correctly