-
Notifications
You must be signed in to change notification settings - Fork 732
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
Ensure xcm versions over bridge (on sending chains) #2481
Conversation
bot bench cumulus-bridge-hubs --runtime=bridge-hub-rococo --subcommand=xcm --pallet=pallet_xcm_benchmarks::generic |
bot bench cumulus-bridge-hubs --runtime=bridge-hub-rococo --subcommand=xcm --pallet=pallet_xcm_benchmarks::generic |
bot bench cumulus-bridge-hubs --runtime=bridge-hub-rococo --subcommand=xcm --pallet=pallet_xcm_benchmarks::generic |
bot bench cumulus-bridge-hubs --runtime=bridge-hub-westend --subcommand=xcm --pallet=pallet_xcm_benchmarks::generic |
…idge-hub-rococo --runtime_dir=bridge-hubs --target_dir=cumulus --pallet=pallet_xcm_benchmarks::generic
@bkontur Command |
.../parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/send_xcm.rs
Outdated
Show resolved
Hide resolved
bot fmt |
@bkontur https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4692219 was started for your command Comment |
@bkontur Command |
bot fmt |
@bkontur https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4694083 was started for your command Comment |
@bkontur Command |
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/polkadot-kusama-bridge/2971/8 |
Summary
This pull request proposes a solution for improved control of the versioned XCM flow over the bridge (across different consensus chains) and resolves the situation where the sending chain/consensus has already migrated to a higher XCM version than the receiving chain/consensus.
Problem/Motivation
The current flow over the bridge involves a transfer from AssetHubRococo (AHR) to BridgeHubRococo (BHR) to BridgeHubWestend (BHW) and finally to AssetHubWestend (AHW), beginning with a reserve-backed transfer on AHR.
In this process:
AHR sends XCM
ExportMessage
throughXcmpQueue
, incorporating XCM version checks using theWrapVersion
feature, influenced bypallet_xcm::SupportedVersion
(managed bypallet_xcm::force_xcm_version
or version discovery).BHR handles the
ExportMessage
instruction, utilizing the latest XCM version. TheHaulBlobExporter
converts the inner XCM toVersionedXcm::from
, also using the latest XCM version.However, challenges arise:
VersionedXcm::from
usesVersionedXcm::V4
variant, causing encoding issues for BHW.Solution
This pull request introduces the following solutions:
New trait
CheckVersion
- added to thexcm
module and exposingpallet_xcm::SupportedVersion
. This enhancement allows checking the actual XCM version for desired destinations outside of thepallet_xcm
module.Version Check in
HaulBlobExporter
usesCheckVersion
to check known/configured destination versions, ensuring compatibility. For example, in the scenario mentioned, BHR can store the version3
for BHW. If BHR is on XCMv4, it will attempt to downgrade the message to version3
instead of using the latest version4
.Version Check in
pallet-xcm-bridge-hub-router
- this check ensures compatibility with the real destination's XCM version, preventing the unnecessary sending of messages to the local bridge hub if versions are incompatible.These additions aim to improve the control and compatibility of XCM flows over the bridge and addressing issues related to version mismatches.
Possible alternative solution
(More investigation is needed, and at the very least, it should extend to XCMv4/5. If this proves to be a viable option, I can open an RFC for XCM.).
Add the
XcmVersion
attribute to theExportMessage
so that the sending chain can determine, based on what is stored inpallet_xcm::SupportedVersion
, the version the destination is using. This way, we may not need to handle the version inHaulBlobExporter
.Future Directions
This PR does not fix version discovery over bridge, further investigation will be conducted here: #2417.
TODO
pallet_xcm
mock for tests uses hard-coded XCM version2
- change to 3 or lastest?pallet-xcm-bridge-hub-router
ExportMessage
force_xcm_version(dest, version)
Part of: paritytech/parity-bridges-common#2719