Feat/ Move Stake Limit - #3084
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
eco-tests changed — indexer review requiredThis PR modifies files under Changed files
|
🛡️ AI Review — Skeptic (security review)VERDICT: SAFE VERY HIGH account-tier scrutiny (47-day-old account, zero public repos), mitigated by repository write access, substantial merged work, matching primary authorship, and no Gittensor association; feat/move-stake-limit → main. The added interfaces preserve signed-coldkey authorization and delegate to the established stake-transition path with bounded weight accounting. The latest ABI-vendoring commit introduces no dependency or review trust-boundary changes, and FindingsNo findings. Prior-comment reconciliation
ConclusionNo malicious behavior or security vulnerability was found in the static review. The previously resolved runtime-version concern remains addressed. 🔍 AI Review — Auditor (domain review)VERDICT: 👍 Gittensor association: UNKNOWN. Active repository contributor with write access and substantial recent merged work; reviewed with full runtime/economic scrutiny. The implementation consistently exposes No meaningful duplicate implementation was identified among the overlapping open PRs. Static review was sufficient; no runtime confirmation or auto-fix was needed. FindingsNo findings. ConclusionThe change is internally consistent, appropriately tested, and follows the established slippage-limited staking design without introducing a substantive correctness issue. |
|
🔄 AI review updated — Skeptic: VULNERABLE |
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
🔄 AI review updated — Skeptic: SAFE Auditor: 👍 |
Motivation
Moving stake between different hotkeys and subnets currently lacks the slippage protection available to limited stake swaps. This PR adds a price-limited move operation so callers can require a minimum destination-alpha/origin-alpha ratio and choose fill-or-kill or partial execution.
Closes #3081.
Changes
move_stake_limitruntime extrinsic and dispatch implementation.move_stakeintents.Behavioral impact
For cross-subnet moves,
limit_priceis the minimum acceptable destination-alpha per origin-alpha ratio scaled by1e9. Withallow_partial = false, the call fails atomically when the requested amount cannot execute within the limit. Withallow_partial = true, it moves only the amount executable before crossing the limit. Same-subnet moves continue to transfer stake directly between hotkeys.The Python
move_stakeintent now selects this limited call by default for cross-subnet moves, using the current origin/destination price ratio and configured tolerance. Users may explicitly disable slippage protection.Runtime and migration
This is a runtime API/extrinsic change with no storage migration.
runtime/src/lib.rsbumpsspec_versionfrom 447 to 448.Testing
Added focused coverage for runtime dispatch, full and partial limit behavior, chain-extension dispatch, EVM precompile dispatch, transaction fees, SDK policy and call construction, generated/indexer compatibility, and a zombienet end-to-end flow.