Commit eb664be
[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
- bridges
- bin/runtime-common
- src
- extensions
- chains
- chain-bridge-hub-rococo
- src
- chain-bridge-hub-westend
- src
- docs
- modules
- grandpa/src
- messages
- src
- tests
- parachains/src
- relayers
- src
- extension
- xcm-bridge-hub-router
- src
- xcm-bridge-hub
- src
- primitives
- header-chain/src
- messages
- src
- parachains/src
- polkadot-core
- relayers
- src
- runtime
- src
- xcm-bridge-hub-router
- src
- xcm-bridge-hub
- src
- relays
- client-substrate
- lib-substrate-relay
- src
- cli
- relay_headers_and_messages
- messages
- on_demand
- parachains
- messages/src
- parachains/src
- cumulus
- pallets/xcmp-queue/src
- parachains
- integration-tests/emulated
- chains/parachains/assets
- asset-hub-rococo
- src
- asset-hub-westend
- src
- common
- src
- tests/bridges
- bridge-hub-rococo
- src/tests
- bridge-hub-westend
- src/tests
- runtimes
- assets
- asset-hub-rococo
- src
- weights
- xcm
- tests
- asset-hub-westend
- src
- weights
- xcm
- tests
- test-utils/src
- bridge-hubs
- bridge-hub-rococo
- src
- weights
- tests
- bridge-hub-westend
- src
- weights
- tests
- common
- src
- test-utils
- src
- test_cases
- test_data
- test-utils/src
- xcm/xcm-emulator/src
- prdoc
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | | - | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
51 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
63 | | - | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
82 | | - | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | | - | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 101 | + | |
0 commit comments