Merged
Conversation
59d349c to
2f1ad59
Compare
shamil-gadelshin
approved these changes
Jan 26, 2026
| } | ||
| } | ||
| // TODO: move into tx extension pipeline but require node upgrade | ||
| CheckColdkeySwap::<T>::new().validate( |
Collaborator
There was a problem hiding this comment.
Why do we need a node upgraded for this? Isn't it a runtime configuration?
Also, the current implementation works with EVM implicitly. It will stop working when adding to the tx extension pipeline without changing the EVM extensions.
Collaborator
Author
There was a problem hiding this comment.
Adding a new transaction extension require updating the MEV shield code because it uses the pipeline here
sam0x17
approved these changes
Jan 27, 2026
Contributor
|
@opentensor/cerebrum / @opentensor/gyrus / @opentensor/cortex breaking change detected! Please prepare accordingly! |
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.
Closes #2230
Summary
This PR refactors the coldkey swap mechanism from a scheduler-based system to an announcement-based system with a configurable delay period. This change improves security, simplifies the codebase, and provides better transparency for coldkey swap operations.
Key Changes
1. New Announcement-Based Flow
announce_coldkey_swap: Users must first announce their intention to swap coldkeys by providing a hash of the new coldkeyswap_coldkey_announced: After the announcement delay period, users can execute the swap by providing the actual new coldkey2. Configuration Changes
InitialColdkeySwapScheduleDuration→InitialColdkeySwapAnnouncementDelayInitialColdkeySwapRescheduleDuration(no longer needed)ColdkeySwapScheduledmap →ColdkeySwapAnnouncementsmap3. Refactored Core Swap Logic
do_swap_coldkey: Consolidated swap logic with clearer separation of concernstransfer_subnet_ownershiptransfer_auto_stake_destinationtransfer_coldkey_staketransfer_staking_hotkeystransfer_hotkeys_ownership4. Updated
swap_coldkeyExtrinsicDispatchResultinstead ofDispatchResultWithPostInfo5. Admin Utilities
sudo_set_coldkey_swap_schedule_duration(call index 54)sudo_set_coldkey_swap_announcement_delay(call index 84)remove_coldkey_swap_announcement(call index 127) - root-only removal of announcements6. Events
ColdkeySwapScheduledColdkeySwapAnnounced- emitted when an announcement is madeColdkeySwapAnnouncementRemoved- emitted when an announcement is removedColdkeySwapAnnouncementDelaySet(renamed fromColdkeySwapScheduleDurationSet)7. Error Handling
ColdkeyIsInArbitration,SwapAlreadyScheduled,FailedToSchedule,ColdkeySwapReannouncedTooEarlyColdkeySwapAnnouncementNotFoundColdkeySwapTooEarlyAnnouncedColdkeyHashDoesNotMatchDeprecated(for the oldschedule_swap_coldkeycall)8. Transaction Extension
CustomTransactionError::ColdkeyInSwapSchedule→ColdkeySwapAnnounced9. Migration
migrate_coldkey_swap_scheduled_to_announcementsto migrate existing scheduled swaps to the new announcement systemscheduled_time - delayso swaps can execute at the originally scheduled timeBenefits
swap_coldkeycallBreaking Changes
schedule_swap_coldkeyextrinsic is deprecated and will return an errorMigration Path
For users with existing scheduled coldkey swaps:
swap_coldkey_announced