[asset-hubs/bridge-hubs] Bridging Polkadot Asset Hub <-> Kusama Asset Hub to enable asset transfer of KSMs/DOTs#1352
Closed
bkontur wants to merge 22 commits into
Closed
[asset-hubs/bridge-hubs] Bridging Polkadot Asset Hub <-> Kusama Asset Hub to enable asset transfer of KSMs/DOTs#1352bkontur wants to merge 22 commits into
bkontur wants to merge 22 commits into
Conversation
a8a89fc to
1da09f0
Compare
svyatonik
approved these changes
Sep 4, 2023
acatangiu
reviewed
Sep 4, 2023
d7f71a3 to
fd705a8
Compare
acatangiu
approved these changes
Sep 5, 2023
b66e64e to
bd94e75
Compare
Add xcm routing configuration for bridging between Polkadot Asset Hub <-> Kusama Asset Hub. We explicitly allow only reserve based transfer for KSM/DOT to cross-consensus AssetHubs and nothing else at first (start defensively). We can later allow whatever (ETH, TrustBackedAssets, ForeignAssets, PoolAssets ...). Add tests for simulation: - `limited_reserve_transfer_assets` with `pallet_xcm` both ways - handling `ReserveAssetDeposisted` on both sides Add local zomienet run for: - reserve based transfer of KSMs from AHK to AHP - reserve based transfer of DOTs from AHP to AHK (check parachains/runtimes/bridge-hubs/README.md in this PR) Signed-off-by: Branislav Kontur <bkontur@gmail.com> Signed-off-by: Adrian Catangiu <adrian@parity.io>
Change XCM routing configuration for bridging from unpaid to paid version. Paid version means that origin (besides extrinsic fees) pays delivery fees at source Asset Hub and also Asset Hub sovereign account pays for execution of `ExportMessage` instruction at local Bridge Hub. Change XCM bridging router from `UnpaidRemoteExporter` to `ToPolkadotXcmRouter` and `ToKusamaXcmRouter` which are pallet instances of new module `pallet-xcm-bridge-hub-router`. The main thing that the pallet `pallet-xcm-bridge-hub-router` offers is the dynamic message fee, that is computed based on the bridge queues state. It starts exponentially increasing if the queue between this chain and the sibling/child bridge hub is congested. More about dynamic fees and back-preasure for v1 can be found [here](paritytech/parity-bridges-common#2294). Signed-off-by: Branislav Kontur <bkontur@gmail.com> Signed-off-by: Adrian Catangiu <adrian@parity.io> Signed-off-by: Svyatoslav Nikolsky <svyatonik@gmail.com> Co-authored-by: Adrian Catangiu <adrian@parity.io> Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
…lay, para) chains Add bridging pallets to Bridge Hub runtime configuration: - `pallet-bridge-grandpa` is an on-chain GRANDPA light client, used for verifying GRANDPA finality proofs on-chain. - `pallet-bridge-parachains` is a Parachain finality module. - `pallet-bridge-messages` module that allows sending and receiving messages using lane concept. - `pallet-bridge-relayers` module that is used to store relayer rewards. Kusma Bridge Hub and Polkadot Bridge Hub runtimes are configred with those pallets in the way that: - allows to verify bridged relay chain GRANDPA finality proofs, e.g. Kusama Bridge Hub can track and verify Polkadot relay chain GRANDPA proofs and Polkadot Bridge Hub can track and verify Kusama relay chain GRANDPA proofs. - allows to verify bridged parachain finality proofs e.g. Kusama Bridge Hub can track and verify Polkadot Bridge Hub proofs and vice versa. - allows to relay messages between them which can be verified with mentioned finality modules. Add tests for simulation: - handling `ExportMessage` on both sides - handling message dispatch and routing to target on both side - relayer can submit proofs with `submit_finality_proof` / `submit_parachain_heads` and relay messages with `receive_messages_proof` To the lane concept mentioned above, actual bridging configuration allows to send/relay/receive messages only with one hard-coded lane `[0, 0, 0, 0]`, which is dedicated lane for Kusama Asset Hub and Polkadot Asset Hub communication. Next stage will be focused on adding support to allow bridging between arbitrary parachains. More about [Bridges V2](https://github.com/paritytech/parity-bridges-common/milestone/17). Signed-off-by: Branislav Kontur <bkontur@gmail.com> Signed-off-by: Adrian Catangiu <adrian@parity.io> Signed-off-by: Svyatoslav Nikolsky <svyatonik@gmail.com> Signed-off-by: Serban Iorga <serban@parity.io> Co-authored-by: Adrian Catangiu <adrian@parity.io> Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com> Co-authored-by: Serban Iorga <serban@parity.io>
…upport Add congestion detection to the Bridge Hub runtimes and report congestion status to the sending chain. Bridge Hub's `ExportMessage` handling is extended with check if outbound message queue is congested, if so then `CongestedMessage` signal is sent to the sending chain's relevant `pallet-xcm-bridge-hub-router` pallet instance, where dynamic fees factor is processed. When then same Bridge Hub receives message delivery confirmation, there is a another check is outbound queue is still congested, if not then `UncongestedMessage` signal is sent to the sending chain's relevant `pallet-xcm-bridge-hub-router` pallet instance. `pallet-bridge-messages`'s `receive_messages_proof` does another check for congestion or back-preassure with checking status of underlaying XCMP queue (`cumulus_pallet_xcmp_queue::bridging::OutboundXcmpChannelCongestionStatusProvider`). If we cannot deliver a message to the target, then `receive_messages_proof` returns error and Bridge Hub does not allow to receive new bridged messages. More about congestion detection [here](paritytech/parity-bridges-common#2318). Signed-off-by: Branislav Kontur <bkontur@gmail.com> Signed-off-by: Adrian Catangiu <adrian@parity.io> Signed-off-by: Svyatoslav Nikolsky <svyatonik@gmail.com> Signed-off-by: Serban Iorga <serban@parity.io> Co-authored-by: Adrian Catangiu <adrian@parity.io> Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com> Co-authored-by: Serban Iorga <serban@parity.io>
Update cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/bridge_hub_config.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/bridge_hub_config.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/bridge_hub_config.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <adrian@parity.io> Fmt + one any to all Co-authored-by: Adrian Catangiu <adrian@parity.io>
bd94e75 to
867321c
Compare
3 tasks
4 tasks
14 tasks
|
This pull request has been mentioned on Polkadot Forum. There might be relevant details there: https://forum.polkadot.network/t/polkadot-kusama-bridge/2971/5 |
8 tasks
11 tasks
15 tasks
Contributor
|
closing in favor of polkadot-fellows/runtimes#108 |
bkchr
pushed a commit
that referenced
this pull request
Apr 10, 2024
…ubmit transactions (#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
This was referenced Jun 5, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adding bridging capabilities to the Polkadot and Kusama Bridge Hub runtimes and XCM routing configuration for bridging between Polkadot Asset Hub <-> Kusama Asset Hub in order to allow asset transfer between Asset Hubs.
Motivation
Main goal of these changes is to setup bridge between system parachains Kusama Asset Hub vs Polkadot Asset Hub. We explicitly allow only reserve based transfer for KSM/DOT to cross-consensus AssetHubs and nothing else at first (start defensively). We can later allow whatever (ETH, TrustBackedAssets, ForeignAssets, PoolAssets ...).
Explanation
Please, check first four commits with detailed description
Testing
Adds tests for simulation:
limited_reserve_transfer_assetswithpallet_xcmboth waysReserveAssetDeposistedon both sidesExportMessageon both sidessubmit_finality_proof/submit_parachain_headsand relay messages withreceive_messages_proofAdds local zombienet run for:
(check parachains/runtimes/bridge-hubs/README.md in this PR)
Future Directions and Related Material
Next stage will be focused on adding support to allow bridging between arbitrary parachains More about Bridges V2.
More about dynamic fees and back-preasure for v1 can be found here.
This is a migration (without commit history) of original PRs in cumulus:
TODO
cumulus/parachains/runtimes/bridge-hubs/README.mdfor local runpolkadot-fellowsMigrate asset transfer over bridge topolkadot-fellowsparity-bridges-common#2541