feat: add disassociate_hotkey - #3148
Draft
Rapiiidooo wants to merge 5 commits into
Draft
Conversation
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.
|
@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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_hotkeyfails withHotkeyHasOutstandingStakeand 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
cargo fmt --check --all,pnpm run fmtints-tests, andgit diff --check.Before merge
max_itemsis rejected. The current storage layout does not provide an independently readable size bound.spec_version = 455.