Skip to content

Allow clear reannouncement + clear scheduled CK swap#2506

Merged
l0r1s merged 11 commits intomainfrom
clear-scheduled-ck-swap
Mar 18, 2026
Merged

Allow clear reannouncement + clear scheduled CK swap#2506
l0r1s merged 11 commits intomainfrom
clear-scheduled-ck-swap

Conversation

@l0r1s
Copy link
Collaborator

@l0r1s l0r1s commented Mar 17, 2026

Description

  • Fix migration: migrate_coldkey_swap_scheduled_to_announcements now cancels the pallet_scheduler tasks that were scheduled under the old system, preventing stale swap_coldkey calls from executing after the migration.
  • New extrinsic: 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 ColdkeySwapScheduled entries to ColdkeySwapAnnouncements but left the original scheduled calls alive in pallet_scheduler::Agenda. This PR adds a translate_values pass that tombstones those tasks (sets them to None) while preserving all other scheduler entries in the same blocks.

The new clear_coldkey_swap_announcement extrinsic enforces two guards before removing the announcement: the caller must be the owner of the announcement, and the current block must be at or past announcement_block + ColdkeySwapAnnouncementDelay. Disputed swaps are blocked at the transaction extension level as usual.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

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

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have run ./scripts/fix_rust.sh to ensure my code is formatted and linted correctly
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshots (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.

@l0r1s l0r1s added the skip-cargo-audit This PR fails cargo audit but needs to be merged anyway label Mar 17, 2026
@l0r1s l0r1s changed the title Clear scheduled CK swap Allow clear reannouncement + clear scheduled CK swap Mar 17, 2026
@github-actions github-actions bot added the hotfix This PR needs to be merged very quickly and will likely skip testing on devnet and testnet label Mar 18, 2026
@github-actions
Copy link
Contributor

🚨🚨🚨 HOTFIX DETECTED 🚨🚨🚨

It looks like you are trying to merge a hotfix PR into main. If this isn't what you wanted to do, and you just wanted to make a regular PR, please close this PR, base your changes off the devnet-ready branch and open a new PR into devnet ready.

If you are trying to merge a hotfix PR, please complete the following essential steps:

  1. go ahead and get this PR into main merged, so we can get the change in as quickly as possible!
  2. merge main into testnet, bumping spec_version
  3. deploy testnet
  4. merge testnet into devnet, bumping spec_version
  5. deploy devnet
  6. merge devnet into devnet-ready

If you do not complete these steps, your hotfix may be inadvertently removed in the future when branches are promoted to main, so it is essential that you do so.

Copy link
Collaborator

@evgeny-s evgeny-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@l0r1s l0r1s merged commit b59e668 into main Mar 18, 2026
177 of 186 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotfix This PR needs to be merged very quickly and will likely skip testing on devnet and testnet skip-cargo-audit This PR fails cargo audit but needs to be merged anyway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants