reuse canonical alpha iterator helper #2929
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE VERY HIGH scrutiny due to a <30-day-old account and sparse public profile, mitigated by repository write permission; no Gittensor association. Branch: reuse-alpha-iterator-swap-hotkey -> staging. Static analysis confirms that FindingsNo findings. ConclusionThe small mechanical refactor is behaviorally equivalent to the removed code and introduces no security vulnerability or malicious behavior. 🔍 AI Review — Auditor (domain review)VERDICT: 👍 Gittensor association: UNKNOWN by the prescribed allowlists/merged-PR heuristic; author has repository write access but a very new account, so the refactor received heightened static scrutiny. PR body was empty/trivial; the Auditor has auto-filled it. Please review. The replacement is behaviorally equivalent: both implementations iterate legacy The overlapping PRs (#2759 and #2745) are broad, unrelated features rather than duplicate implementations. No spec-version bump applies to the FindingsNo findings. ConclusionThe PR safely reuses the canonical iterator without changing merge precedence or output ordering. It is ready to merge. |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
Motivation
prepare_hotkey_stakeduplicated the legacy/V2 alpha-row merge already implemented byalpha_iter_single_prefix. Keeping two copies of this logic risks their precedence or conversion behavior diverging over time.Changes
Alpha/AlphaV2merge inpallets/subtensor/src/swap/swap_hotkey.rswithSelf::alpha_iter_single_prefix(old_hotkey).(coldkey, netuid)key.Behavioral impact
This is a behavior-preserving refactor. Hotkey swaps continue to collect the same stake positions and group the same coldkeys by subnet; no storage layout or economic logic changes.
Migration and runtime version
No migration is required. The PR targets
staging, which has no network spec-version check, so nospec_versionbump is needed.Testing
Static equivalence was verified against the implementation of
alpha_iter_single_prefix. No targeted runtime test was required because the change delegates to the existing canonical helper without altering its inputs or outputs.