-
Notifications
You must be signed in to change notification settings - Fork 129
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
Investigate how XCM version upgrade will affect the bridge #2500
Comments
Needs a brainstorm session after V1 launch |
Design behind that: https://www.polkadot.network/blog/xcm-part-two-versioning-and-compatibility . It doesn't have much technical details, which are important in our case, though. Two other important things that we know now (thanks to @bkontur @acatangiu ):
So it looks like we:
|
HRMP has |
I am going to write some tests (with xcm emulator) above branch with XCMv4. Also try to add When xcm versioned flow works, then lets explore subscriptions. |
…ity and XCM upgrades Addressing: paritytech/parity-bridges-common#2500 paritytech/parity-bridges-common#2794
…ity and XCM upgrades Addressing: paritytech/parity-bridges-common#2500 paritytech/parity-bridges-common#2794
Fixed, so I am closing this. I summarized all the details around TL;DR: I disconnected Additionally, I had to make |
…ity and XCM upgrades Addressing: paritytech/parity-bridges-common#2500 paritytech/parity-bridges-common#2794
This is great Brani, nice work! Can you also look at Snowbridge pallets and if they also support XCM version upgrades? |
Relates to: paritytech/parity-bridges-common#2451 Closes: paritytech/parity-bridges-common#2500 ## Summary Now, the bridging pallet supports only static lanes, which means lanes that are hard-coded in the runtime files. This PR fixes that and adds support for dynamic, also known as permissionless, lanes. This means that allowed origins (relay chain, sibling parachains) can open and close bridges (through BridgeHubs) with another bridged (substrate-like) consensus using just `xcm::Transact` and `OriginKind::Xcm`. _This PR is based on the migrated code from the Bridges V2 [branch](#4427) from the old `parity-bridges-common` [repo](https://github.com/paritytech/parity-bridges-common/tree/bridges-v2)._ ## Explanation Please read [bridges/modules/xcm-bridge-hub/src/lib.rs](https://github.com/paritytech/polkadot-sdk/blob/149b0ac2ce43fba197988f2642032fa24dd8289a/bridges/modules/xcm-bridge-hub/src/lib.rs#L17-L136) to understand how managing bridges works. The basic concepts around `BridgeId` and `LaneId` are also explained there. ## TODO - [x] search and fix for comment: `// TODO:(bridges-v2) - most of that stuff was introduced with free header execution: https://github.com/paritytech/polkadot-sdk/pull/4102` - more info in the comment [bellow](#4427 (comment)) - [x] TODO: there's only one impl of `EnsureOrigin<Success = Location>` ## TODO - not blocking review **benchmarking:** - [x] regenerate all relevant weights for BH/AH runtimes - [ ] regenerate default weights for bridging pallets e.g. `modules/messages/src/weights.rs` - [ ] add benchmarks for `xcm-bridge-hub` pallet #5550 **testing:** - [ ] add xcm-emulator tests for Rococo/Penpal to Westend/Penpal with full opening channel and sending/receiving `xcm::Transact` **migrations:** - [x] add migrations for BridgeHubRococo/Westend paritytech/parity-bridges-common#2794 (to be reusable for P/K bridge) - [x] check also storage migration, if needed for pallets - [ ] migration for XCM type (optional) - [x] migration for static lanes to the dynamic (reuse for fellows) **investigation:** - [ ] revisit paritytech/parity-bridges-common#2380 - [ ] check congestion around `LocalXcmChannelManager` and `OutboundLanesCongestedSignals` impls - #5551 - to be reusable for polkadot-fellows - return `report_bridge_status` was remove, so we need to `XcmpQueue` alternative? --------- Signed-off-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com> Co-authored-by: command-bot <> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Relates to: paritytech/parity-bridges-common#2451 Closes: paritytech/parity-bridges-common#2500 ## Summary Now, the bridging pallet supports only static lanes, which means lanes that are hard-coded in the runtime files. This PR fixes that and adds support for dynamic, also known as permissionless, lanes. This means that allowed origins (relay chain, sibling parachains) can open and close bridges (through BridgeHubs) with another bridged (substrate-like) consensus using just `xcm::Transact` and `OriginKind::Xcm`. _This PR is based on the migrated code from the Bridges V2 [branch](#4427) from the old `parity-bridges-common` [repo](https://github.com/paritytech/parity-bridges-common/tree/bridges-v2)._ ## Explanation Please read [bridges/modules/xcm-bridge-hub/src/lib.rs](https://github.com/paritytech/polkadot-sdk/blob/149b0ac2ce43fba197988f2642032fa24dd8289a/bridges/modules/xcm-bridge-hub/src/lib.rs#L17-L136) to understand how managing bridges works. The basic concepts around `BridgeId` and `LaneId` are also explained there. ## TODO - [x] search and fix for comment: `// TODO:(bridges-v2) - most of that stuff was introduced with free header execution: https://github.com/paritytech/polkadot-sdk/pull/4102` - more info in the comment [bellow](#4427 (comment)) - [x] TODO: there's only one impl of `EnsureOrigin<Success = Location>` ## TODO - not blocking review **benchmarking:** - [x] regenerate all relevant weights for BH/AH runtimes - [ ] regenerate default weights for bridging pallets e.g. `modules/messages/src/weights.rs` - [ ] add benchmarks for `xcm-bridge-hub` pallet #5550 **testing:** - [ ] add xcm-emulator tests for Rococo/Penpal to Westend/Penpal with full opening channel and sending/receiving `xcm::Transact` **migrations:** - [x] add migrations for BridgeHubRococo/Westend paritytech/parity-bridges-common#2794 (to be reusable for P/K bridge) - [x] check also storage migration, if needed for pallets - [ ] migration for XCM type (optional) - [x] migration for static lanes to the dynamic (reuse for fellows) **investigation:** - [ ] revisit paritytech/parity-bridges-common#2380 - [ ] check congestion around `LocalXcmChannelManager` and `OutboundLanesCongestedSignals` impls - #5551 - to be reusable for polkadot-fellows - return `report_bridge_status` was remove, so we need to `XcmpQueue` alternative? --------- Signed-off-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com> Co-authored-by: command-bot <> Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
Recenty
LaneId
underlying type has been migrated from[u8; 4]
toH256
. The idea was that we can doblake2_256(ord(<universal-location-of-bridge-side-1, universal-location-of-bridge-side-2>)
and it is guaranteed to be the same at both sides of the bridge. So we won't need any coordination between connected parachains - they could just say we want to connect to to<other-parachain-universal-location>
and the lane id will be derived automatically.I was assuming that we'll pass two
MultiLocation
s toLaneId::new()
. But the problem (that I've missed initially) is thatMultiLocation
is not thexcm::MultiLocation
. It is thexcm::v3::MultiLocation
. So if we'll ever migrate to XCM v4, theLaneId
will change. If we'll dig up here a bit, we'll find another problems. What if source parachain is using the XCMv3 and bridge hub uses XCMv4. WhichMultiLocation
shall we use? How (and when/if) do we need to to coordinate XCM version upgrades?So far I've introduced the separate
BridgeId
in #2261. The idea behind this type is that it'll be used in communications between bridge hub and its sibling/parent source chain. TheLaneId
will be used (as before) in cross-consensus communications. Apart from simple type separation, it'd allow us for example to have some storage map ofBridgeId => LaneId
and keep the previousLaneId
if XCM version will be upgraded. However, I'm not sure if that's the right way to handle the upgrade - maybe we simply need to continue with newLaneId
, which matches the newBridgeId
.We need to investigate how XCM upgrade will affect our identifiers and the whole bridge infrastructure as well.
UPD: by infrastructure I mean - can the chains that are using our BH upgrade XCM version and keep using the unupgraded bridge? Can BH be upgraded without waiting for other chains to upgrade? Can XCM version be upgraded on both bridge hubs independently, or we need to sync it?
The text was updated successfully, but these errors were encountered: