Hotfixes: Locked transfer flags to control locked alpha transfers + ema-price based emissions#2780
Hotfixes: Locked transfer flags to control locked alpha transfers + ema-price based emissions#2780gztensor wants to merge 2 commits into
Conversation
🚨🚨🚨 HOTFIX DETECTED 🚨🚨🚨It looks like you are trying to merge a hotfix PR into If you are trying to merge a hotfix PR, please complete the following essential steps:
If you do not complete these steps, your hotfix may be inadvertently removed in the future when branches are promoted to |
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE LOW contributor risk: established subtensor contributor with write permission, substantial recent PR history, no Gittensor allowlist hit found; branch is explicitly a hotfix to main. Static Skeptic review found no FindingsNo findings. ConclusionNo malicious intent or security vulnerability was identified in the diff. The runtime changes use checked/saturating arithmetic paths, signed self-service flag updates, and locked-alpha receipt checks without introducing an origin bypass or panic path. 🔍 AI Review — Auditor (domain review)VERDICT: 👍 Gittensor association UNKNOWN by allowlists; author has write permission and substantial recent subtensor PR history, so contributor-risk calibration is low. PR body is substantive and matches the implementation: price-EMA subnet emissions, root-proportion alpha injection cap, and a self-service locked-alpha receipt flag. Duplicate-work check: PR #2746 overlaps on account receiving flags, but it is a broader feature branch with unrelated runtime/tooling scope. This PR is the better candidate for the focused Spec version is bumped in the diff ( Findings
Prior-comment reconciliation
ConclusionNo blocking domain issue was found. One low-risk helper ordering issue remains from the prior review, but the PR is still appropriate to approve as a focused hotfix. 📜 Previous run (superseded)
|
| for (netuid, decaying) in decaying_locks_to_transfer.iter() { | ||
| DecayingLock::<T>::insert(new_coldkey, *netuid, *decaying); |
There was a problem hiding this comment.
[LOW] Validate locked-alpha receipt before copying decaying flags
swap_coldkey_locks copies DecayingLock entries to new_coldkey before the new AccountRejectsLockedAlpha check runs. If old_coldkey has a decaying/perpetual flag and a non-zero rolled lock, a direct helper failure can leave the destination DecayingLock mutated even though the function returns an error. The public extrinsic path appears to rely on storage-layer rollback, but the helper's own no-mutation-on-error invariant and test do not cover these flags, and a stale flag can affect the mode of later locks for that coldkey/netuid. Build rolled_locks_to_transfer and run all rejection checks first, then insert the DecayingLock entries in the commit phase with the lock moves.
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
| for (netuid, decaying) in decaying_locks_to_transfer.iter() { | ||
| DecayingLock::<T>::insert(new_coldkey, *netuid, *decaying); | ||
| } |
There was a problem hiding this comment.
[LOW] Validate locked-alpha receipt before copying decaying flags
swap_coldkey_locks still copies DecayingLock rows to new_coldkey before the locked-alpha rejection check runs. If this helper is called outside the public extrinsic's transactional storage layer, an AccountRejectsLockedAlpha error can leave destination decaying flags behind even though no locks moved. Build and validate rolled_locks_to_transfer first, then copy the decaying flags in the mutation phase after validation succeeds; add a helper-level failure assertion that DecayingLock is absent on the destination.
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
|
Replaced by #2781 |
Description
set_reject_locked_alphaallow the coldkey to set it's own reject locked alpha flag.Type of Change
Checklist
./scripts/fix_rust.shto ensure my code is formatted and linted correctly