Skip to content

feat: add disassociate_hotkey - #3148

Draft
Rapiiidooo wants to merge 5 commits into
RaoFoundation:mainfrom
Rapiiidooo:feat/disassociate-hotkey-v2
Draft

feat: add disassociate_hotkey#3148
Rapiiidooo wants to merge 5 commits into
RaoFoundation:mainfrom
Rapiiidooo:feat/disassociate-hotkey-v2

Conversation

@Rapiiidooo

@Rapiiidooo Rapiiidooo commented Sep 9, 2026

Copy link
Copy Markdown

Description

Adds disassociate_hotkey(hotkey, max_items) so a coldkey can release an idle hotkey and allow another coldkey to associate it. The call checks ownership, registrations, stake, collateral, reward entitlements and active or pending relationships before clearing ownership and inactive autostake references. Cooldowns, swap lineage and EVM associations are preserved.

Includes pallet and E2E tests, a benchmark and proxy restrictions. Regression coverage includes inbound pending child links and work limits across multiple parents on the same subnet.

Ownership changes and user-visible consequences

Beyond retiring unused or compromised hotkeys, this change enables an individual hotkey to be released and associated with a different coldkey, without transferring the original owner’s other hotkeys. This could facilitate transferring or selling individual hotkeys once they are idle.

A familiar hotkey address could therefore represent a different operator after deregistration and reassociation. Someone staking again based on that address’s previous reputation could end up supporting an operator they did not intend to support.

The current owning coldkey must sign the release. The hotkey must have no subnet registrations, collateral, outstanding reward entitlements, or active or pending relationships.

Deregistration does not remove delegators’ stake. If any stake remains on the hotkey, including third-party stake on any subnet, disassociate_hotkey fails with HotkeyHasOutstandingStake and leaves ownership unchanged. This extrinsic does not unstake, refund, or detach those positions. They must already have been withdrawn or moved through the existing staking mechanisms before release can succeed. Residual zero-valued stake entries also block release until they have been cleaned up.

Validation

  • Passed: cargo fmt --check --all, pnpm run fmt in ts-tests, and git diff --check.
  • Functional tests and reference benchmarks are left to CI, per repository guidance.

Before merge

  • Bound storage reads on rejected calls and replace the fallback with measured weights. Existing vectors are still read in full before an insufficient max_items is rejected. The current storage layout does not provide an independently readable size bound.
  • Run functional CI and satisfy the runtime version gate; the branch and mainnet both report spec_version = 455.

Remove the shared index tracking, storage proof argument, and changes to existing staking, swap, migration and limit-order operations. Keep ownership checks, cleanup, proxy restrictions, the dedicated benchmark and focused tests in disassociate_hotkey.

The work limit bounds decoded entries and cleanup. The host still reads existing Vec storage values in full, so their storage proof size is not bounded by max_items. Dedicated weight measurements and execution tests remain for CI.
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

@Rapiiidooo is attempting to deploy a commit to the RaoFoundation Team on Vercel.

A member of the Team first needs to authorize it.

Check every pending parent row before cleanup, including inbound links, and count each row in the work budget. Cover the five-child case in the benchmark and add pallet and E2E regressions. Reuse HotKeyAlreadyRegisteredInSubNet instead of adding a duplicate error.

The existing unbounded vector reads and their weight accounting remain unresolved; this commit does not change shared index writers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant