Allow clear reannouncement + clear scheduled CK swap#2506
Merged
Conversation
shamil-gadelshin
approved these changes
Mar 18, 2026
Contributor
🚨🚨🚨 HOTFIX DETECTED 🚨🚨🚨It looks like you are trying to merge a hotfix PR into If you are trying to merge a hotfix PR, please complete the following essential steps:
If you do not complete these steps, your hotfix may be inadvertently removed in the future when branches are promoted to |
evgeny-s
reviewed
Mar 18, 2026
evgeny-s
reviewed
Mar 18, 2026
evgeny-s
reviewed
Mar 18, 2026
pallets/subtensor/src/migrations/migrate_coldkey_swap_scheduled_to_announcements.rs
Outdated
Show resolved
Hide resolved
JohnReedV
approved these changes
Mar 18, 2026
gztensor
approved these changes
Mar 18, 2026
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
migrate_coldkey_swap_scheduled_to_announcementsnow cancels thepallet_schedulertasks that were scheduled under the old system, preventing staleswap_coldkeycalls from executing after the migration.clear_coldkey_swap_announcement(call index 133) lets a coldkey voluntarily withdraw its own swap announcement once the reannouncement delay has elapsed.Details
The previous migration converted
ColdkeySwapScheduledentries toColdkeySwapAnnouncementsbut left the original scheduled calls alive inpallet_scheduler::Agenda. This PR adds atranslate_valuespass that tombstones those tasks (sets them toNone) while preserving all other scheduler entries in the same blocks.The new
clear_coldkey_swap_announcementextrinsic enforces two guards before removing the announcement: the caller must be the owner of the announcement, and the current block must be at or pastannouncement_block + ColdkeySwapAnnouncementDelay. Disputed swaps are blocked at the transaction extension level as usual.Type of Change
Breaking Change
If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.
Checklist
./scripts/fix_rust.shto ensure my code is formatted and linted correctlyScreenshots (if applicable)
Please include any relevant screenshots or GIFs that demonstrate the changes made.
Additional Notes
Please provide any additional information or context that may be helpful for reviewers.