-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[xcm/pallet_xcm] New XCM version change improvements #3214
Labels
T6-XCM
This PR/Issue is related to XCM.
Comments
1 task
This was referenced Oct 21, 2024
github-merge-queue bot
pushed a commit
that referenced
this issue
Oct 25, 2024
Relates to: #4826 Relates to: #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` polkadot-fellows/runtimes#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 } ``` ![image](https://github.com/user-attachments/assets/f59f761b-46a7-4def-8aea-45c4e41c0a00) - [x] fix also for `RemoteLockedFungibles` - [x] fix also for `LockedFungibles` ## Follow-ups - [ ] deploy on Westend chains before XCMv5 - [ ] #6188 --------- Co-authored-by: command-bot <> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
bkontur
added a commit
that referenced
this issue
Oct 28, 2024
Relates to: #4826 Relates to: #3214 `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. - [x] create tracking issue for `polkadot-fellows` polkadot-fellows/runtimes#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 } ``` ![image](https://github.com/user-attachments/assets/f59f761b-46a7-4def-8aea-45c4e41c0a00) - [x] fix also for `RemoteLockedFungibles` - [x] fix also for `LockedFungibles` - [ ] deploy on Westend chains before XCMv5 - [ ] #6188 --------- Co-authored-by: command-bot <> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com> (cherry picked from commit efd6603)
bkontur
added a commit
that referenced
this issue
Oct 28, 2024
Relates to: #4826 Relates to: #3214 `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. - [x] create tracking issue for `polkadot-fellows` polkadot-fellows/runtimes#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 } ``` ![image](https://github.com/user-attachments/assets/f59f761b-46a7-4def-8aea-45c4e41c0a00) - [x] fix also for `RemoteLockedFungibles` - [x] fix also for `LockedFungibles` - [ ] deploy on Westend chains before XCMv5 - [ ] #6188 --------- Co-authored-by: command-bot <> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com> (cherry picked from commit efd6603)
mordamax
pushed a commit
to paritytech-stg/polkadot-sdk
that referenced
this issue
Oct 29, 2024
Relates to: paritytech#4826 Relates to: paritytech#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` polkadot-fellows/runtimes#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 } ``` ![image](https://github.com/user-attachments/assets/f59f761b-46a7-4def-8aea-45c4e41c0a00) - [x] fix also for `RemoteLockedFungibles` - [x] fix also for `LockedFungibles` ## Follow-ups - [ ] deploy on Westend chains before XCMv5 - [ ] paritytech#6188 --------- Co-authored-by: command-bot <> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
mordamax
pushed a commit
to paritytech-stg/polkadot-sdk
that referenced
this issue
Oct 29, 2024
Relates to: paritytech#4826 Relates to: paritytech#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` polkadot-fellows/runtimes#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 } ``` ![image](https://github.com/user-attachments/assets/f59f761b-46a7-4def-8aea-45c4e41c0a00) - [x] fix also for `RemoteLockedFungibles` - [x] fix also for `LockedFungibles` ## Follow-ups - [ ] deploy on Westend chains before XCMv5 - [ ] paritytech#6188 --------- Co-authored-by: command-bot <> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
All the
xcm-builder
andxcm-executor
modules are implemented withxcm::latest::prelude::*
orxcm::latest::*
. This means that when we add a new XCM version to thexcm
module and changelatest
to point to the new XCM version, it affects everything.One of the affected aspects is the XCM version handling in the
pallet_xcm
, where we store operational data withXcmVersion
(e.g.,SupportedVersion
). Currently, all data usexcm::latest::XCM_VERSION
(e.g., destination XCM versions). The only way to migrate these data is to setCurrentMigration::<T>::put(VersionMigrationStage::default());
, but this is not used anywhere, only in the old migration, which is not used.One consequence is that the "notify subscribers when the XCM version changes" feature does not work without proper migration. Yes, we have
force_xcm_version
orfn wrap_version
withfn note_unknown_version
(we have one scenario for bridges where we don't usewrap_version + note_unknown_version
, becauseSubscribeVersion
does not work over bridge - issue), which could help and/or trigger negotiation from scratch, but then the "version notify" andSubscribeVersion
become somewhat useless.We didn't encounter this issue with XCMv3 because a migration was added to the runtimes here.
Example of problem/issue
We encountered this issue on
BridgeHubRococo
. However, when we upgrade all testnet runtimes to version1.7.0
, the problem will persist across all instances. In our case, we stored some XCM versions inSupportedVersion
withXcmVersion=3
. TheBridgeHubRococo
was subsequently upgraded with runtime versions featuringXCMv4
, without any associated migration process. As a result,pallet_xcm
now usesXCM_VERSION=4
as a key to operational data, but no data were migrated toXcmVersion=4
. This has led to the malfunctioning of certain functionalities. Unfortunately, there is currently no mechanism to trigger the migration; it can only occur with another runtime upgrade that includes the necessary migration steps.TODO/Improvements (minimal)
fn try_state
function inpallet_xcm
to verify that all stored operational data has been migrated to the current XCM version, ensuring migration steps are not overlooked.MigrateTo(XcmVersion)
to thepallet_xcm
- whenever the XCM version is updated, include the corresponding migration stepMigrateTo(XcmVersion::4)
in the runtime. After the upgrade, these migration steps can be removed.Improvements (other possibilities)
(Maybe over-complicated and improvements (minimal) above are enough)
XCM_VERSION
inpallet_xcm
. Instead, create a new storage item or reusepub const CurrentXcmVersion
aspub storage CurrentXcmVersion
. This approach ensures that any changes toXCM_VERSION
won't require automatic migration by default, preventing potential disruptions. Migrations will only be necessary if a runtime chooses to upgrade to a higher version, at which point they can add the corresponding migration step or trigger an extrinsic. Note: This approach may result in additional storage reads.CurrentMigration
.MigrateTo(XcmVersion)
)SafeXcmVersion
? Which can be done just byforce_default_xcm_version
?pallet_xcm
, now we useXCM_VERSION
andLatestVersionedLocation
, maybe we should not useVersioned*
struct for storage and use justxcm::latest
and do migrations, it could pretty simplify stuffAdvertisedXcmVersion
vsCurrentXcmVersion
vsSafeXcmVersion
RemoteLockedFungibles
removeXcmVersion
[XCM]pallet_xcm
internal data changes proposal #6188The text was updated successfully, but these errors were encountered: