Skip to content

Commit eb664be

Browse files
bkontursvyatonikfranciscoaguirre
authored andcommitted
[bridges-v2] Permissionless lanes (#4949)
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>
1 parent 83cf39d commit eb664be

148 files changed

Lines changed: 9454 additions & 4489 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 41 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bridges/bin/runtime-common/Cargo.toml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ bp-polkadot-core = { workspace = true }
2525
bp-relayers = { workspace = true }
2626
bp-runtime = { workspace = true }
2727
bp-xcm-bridge-hub = { workspace = true }
28-
bp-xcm-bridge-hub-router = { workspace = true }
2928
pallet-bridge-grandpa = { workspace = true }
3029
pallet-bridge-messages = { workspace = true }
3130
pallet-bridge-parachains = { workspace = true }
@@ -43,12 +42,15 @@ sp-trie = { optional = true, workspace = true }
4342

4443
# Polkadot dependencies
4544
xcm = { workspace = true }
46-
xcm-builder = { workspace = true }
4745

4846
[dev-dependencies]
4947
bp-test-utils = { workspace = true }
5048
pallet-balances = { workspace = true }
51-
pallet-bridge-messages = { features = ["std", "test-helpers"], workspace = true }
49+
pallet-bridge-messages = { features = [
50+
"std",
51+
"test-helpers",
52+
], workspace = true }
53+
sp-core = { workspace = true }
5254

5355
[features]
5456
default = ["std"]
@@ -60,7 +62,6 @@ std = [
6062
"bp-relayers/std",
6163
"bp-runtime/std",
6264
"bp-test-utils/std",
63-
"bp-xcm-bridge-hub-router/std",
6465
"bp-xcm-bridge-hub/std",
6566
"codec/std",
6667
"frame-support/std",
@@ -74,12 +75,12 @@ std = [
7475
"pallet-transaction-payment/std",
7576
"pallet-utility/std",
7677
"scale-info/std",
78+
"sp-core/std",
7779
"sp-io/std",
7880
"sp-runtime/std",
7981
"sp-std/std",
8082
"sp-trie/std",
8183
"tuplex/std",
82-
"xcm-builder/std",
8384
"xcm/std",
8485
]
8586
runtime-benchmarks = [
@@ -95,10 +96,6 @@ runtime-benchmarks = [
9596
"pallet-utility/runtime-benchmarks",
9697
"sp-runtime/runtime-benchmarks",
9798
"sp-trie",
98-
"xcm-builder/runtime-benchmarks",
9999
]
100100
integrity-test = ["static_assertions"]
101-
test-helpers = [
102-
"bp-runtime/test-helpers",
103-
"sp-trie",
104-
]
101+
test-helpers = ["bp-runtime/test-helpers", "sp-trie"]

0 commit comments

Comments
 (0)