Fix migrations for pallet-xcm (#6148)
Relates to: https://github.com/paritytech/polkadot-sdk/pull/4826 Relates to: https://github.com/paritytech/polkadot-sdk/issues/3214 ## Description `pallet-xcm` stores some operational data that uses `Versioned*` XCM types. When we add a new XCM version (XV), we deprecate XV-2 and remove XV-3. Without proper migration, this can lead to issues with [undecodable storage](https://github.com/paritytech/polkadot-sdk/actions/runs/11381324568/job/31662577532?pr=6092), as was identified on the XCMv5 branch where XCMv2 was removed. This PR extends the existing `MigrateToLatestXcmVersion` to include migration for the `Queries`, `LockedFungibles`, and `RemoteLockedFungibles` storage types. Additionally, more checks were added to `try_state` for these types. ## TODO - [x] create tracking issue for `polkadot-fellows` https://github.com/polkadot-fellows/runtimes/issues/492 - [x] Add missing `MigrateToLatestXcmVersion` for westend - [x] fix pallet-xcm `Queries` - fails for Westend https://github.com/paritytech/polkadot-sdk/actions/runs/11381324568/job/31662577532?pr=6092 - `V2` was removed from `Versioned*` stuff, but we have a live data with V2 e.g. Queries - e.g. Kusama or Polkadot relay chains ``` VersionNotifier: { origin: { V2: { parents: 0 interior: { X1: { Parachain: 2,124 } } } } isActive: true } ```  - [x] fix also for `RemoteLockedFungibles` - [x] fix also for `LockedFungibles` ## Follow-ups - [ ] deploy on Westend chains before XCMv5 - [ ] https://github.com/paritytech/polkadot-sdk/issues/6188 --------- Co-authored-by: command-bot <> Co-authored-by:GitHub Action <action@github.com> Co-authored-by:
Francisco Aguirre <franciscoaguirreperez@gmail.com>
Showing
- polkadot/runtime/westend/src/lib.rs 2 additions, 0 deletionspolkadot/runtime/westend/src/lib.rs
- polkadot/xcm/docs/src/cookbook/relay_token_transactor/parachain/xcm_config.rs 1 addition, 1 deletion...c/cookbook/relay_token_transactor/parachain/xcm_config.rs
- polkadot/xcm/docs/src/cookbook/relay_token_transactor/relay_chain/xcm_config.rs 1 addition, 1 deletion...cookbook/relay_token_transactor/relay_chain/xcm_config.rs
- polkadot/xcm/pallet-xcm/src/lib.rs 40 additions, 2 deletionspolkadot/xcm/pallet-xcm/src/lib.rs
- polkadot/xcm/pallet-xcm/src/migration.rs 377 additions, 2 deletionspolkadot/xcm/pallet-xcm/src/migration.rs
- polkadot/xcm/pallet-xcm/src/tests/mod.rs 169 additions, 3 deletionspolkadot/xcm/pallet-xcm/src/tests/mod.rs
- polkadot/xcm/xcm-builder/src/asset_exchange/single_asset_adapter/mock.rs 1 addition, 1 deletion...m-builder/src/asset_exchange/single_asset_adapter/mock.rs
- polkadot/xcm/xcm-builder/src/tests/pay/mock.rs 1 addition, 2 deletionspolkadot/xcm/xcm-builder/src/tests/pay/mock.rs
- polkadot/xcm/xcm-runtime-apis/tests/mock.rs 1 addition, 2 deletionspolkadot/xcm/xcm-runtime-apis/tests/mock.rs
- prdoc/pr_6148.prdoc 17 additions, 0 deletionsprdoc/pr_6148.prdoc