-
Notifications
You must be signed in to change notification settings - Fork 697
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
[asset-hubs/bridge-hubs] Bridging Polkadot Asset Hub <-> Kusama Asset Hub to enable asset transfer of KSMs/DOTs #1352
Closed
Conversation
This file contains 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
bkontur
added
T6-XCM
This PR/Issue is related to XCM.
T9-cumulus
This PR/Issue is related to cumulus.
T15-bridges
This PR/Issue is related to bridges.
labels
Sep 1, 2023
bkontur
force-pushed
the
bko-bridging-kusama-polkadot-assets
branch
4 times, most recently
from
September 4, 2023 11:44
a8a89fc
to
1da09f0
Compare
svyatonik
approved these changes
Sep 4, 2023
acatangiu
reviewed
Sep 4, 2023
cumulus/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs
Outdated
Show resolved
Hide resolved
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/bridge_hub_config.rs
Outdated
Show resolved
Hide resolved
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs
Outdated
Show resolved
Hide resolved
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/bridge_hub_config.rs
Outdated
Show resolved
Hide resolved
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/bridge_hub_config.rs
Outdated
Show resolved
Hide resolved
cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs
Outdated
Show resolved
Hide resolved
bkontur
force-pushed
the
bko-bridging-kusama-polkadot-assets
branch
5 times, most recently
from
September 5, 2023 11:13
d7f71a3
to
fd705a8
Compare
acatangiu
approved these changes
Sep 5, 2023
bkontur
force-pushed
the
bko-bridging-kusama-polkadot-assets
branch
3 times, most recently
from
September 5, 2023 11:44
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 <[email protected]> Signed-off-by: Adrian Catangiu <[email protected]>
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 <[email protected]> Signed-off-by: Adrian Catangiu <[email protected]> Signed-off-by: Svyatoslav Nikolsky <[email protected]> Co-authored-by: Adrian Catangiu <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]>
…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 <[email protected]> Signed-off-by: Adrian Catangiu <[email protected]> Signed-off-by: Svyatoslav Nikolsky <[email protected]> Signed-off-by: Serban Iorga <[email protected]> Co-authored-by: Adrian Catangiu <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]> Co-authored-by: Serban Iorga <[email protected]>
…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 <[email protected]> Signed-off-by: Adrian Catangiu <[email protected]> Signed-off-by: Svyatoslav Nikolsky <[email protected]> Signed-off-by: Serban Iorga <[email protected]> Co-authored-by: Adrian Catangiu <[email protected]> Co-authored-by: Svyatoslav Nikolsky <[email protected]> Co-authored-by: Serban Iorga <[email protected]>
Update cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/bridge_hub_config.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/bridge_hub_config.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/bridge_hub_config.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/assets/asset-hub-polkadot/src/xcm_config.rs Co-authored-by: Adrian Catangiu <[email protected]> Update cumulus/parachains/runtimes/assets/common/src/matching.rs Co-authored-by: Adrian Catangiu <[email protected]> Fmt + one any to all Co-authored-by: Adrian Catangiu <[email protected]>
bkontur
force-pushed
the
bko-bridging-kusama-polkadot-assets
branch
from
September 5, 2023 12:40
bd94e75
to
867321c
Compare
3 tasks
8 tasks
11 tasks
15 tasks
closing in favor of polkadot-fellows/runtimes#108 |
serban300
pushed a commit
to serban300/polkadot-sdk
that referenced
this pull request
Apr 8, 2024
…ubmit transactions (paritytech#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
serban300
pushed a commit
to serban300/polkadot-sdk
that referenced
this pull request
Apr 8, 2024
…ubmit transactions (paritytech#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
serban300
pushed a commit
to serban300/polkadot-sdk
that referenced
this pull request
Apr 8, 2024
…ubmit transactions (paritytech#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
serban300
pushed a commit
to serban300/polkadot-sdk
that referenced
this pull request
Apr 8, 2024
…ubmit transactions (paritytech#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
serban300
pushed a commit
to serban300/polkadot-sdk
that referenced
this pull request
Apr 9, 2024
…ubmit transactions (paritytech#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
serban300
pushed a commit
to serban300/polkadot-sdk
that referenced
this pull request
Apr 9, 2024
…ubmit transactions (paritytech#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
serban300
pushed a commit
to serban300/polkadot-sdk
that referenced
this pull request
Apr 9, 2024
…ubmit transactions (paritytech#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
serban300
pushed a commit
to serban300/polkadot-sdk
that referenced
this pull request
Apr 9, 2024
…ubmit transactions (paritytech#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
serban300
pushed a commit
to serban300/polkadot-sdk
that referenced
this pull request
Apr 9, 2024
…ubmit transactions (paritytech#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
serban300
pushed a commit
to serban300/polkadot-sdk
that referenced
this pull request
Apr 9, 2024
…ubmit transactions (paritytech#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
serban300
pushed a commit
to serban300/polkadot-sdk
that referenced
this pull request
Apr 10, 2024
…ubmit transactions (paritytech#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
serban300
pushed a commit
to serban300/polkadot-sdk
that referenced
this pull request
Apr 10, 2024
…ubmit transactions (paritytech#1352) * CheckBridgedBlockNumber signed extension to reject duplicate header submit transactions * fix depends_on
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
T6-XCM
This PR/Issue is related to XCM.
T9-cumulus
This PR/Issue is related to cumulus.
T15-bridges
This PR/Issue is related to bridges.
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_assets
withpallet_xcm
both waysReserveAssetDeposisted
on both sidesExportMessage
on both sidessubmit_finality_proof
/submit_parachain_heads
and relay messages withreceive_messages_proof
Adds 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.md
for local runpolkadot-fellows
Migrate asset transfer over bridge topolkadot-fellows
parity-bridges-common#2541