Skip to content
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

Add support for P<>K bridge #741

Open
green-jay opened this issue Apr 23, 2024 · 7 comments
Open

Add support for P<>K bridge #741

green-jay opened this issue Apr 23, 2024 · 7 comments

Comments

@green-jay
Copy link

Goal:
Allow simulating transactions between Polkadot<>Kusama

@xlc
Copy link
Member

xlc commented Apr 23, 2024

related #695 #681

@xlc
Copy link
Member

xlc commented Jun 13, 2024

Here is an example tx from mainnet that could be used for testing purpose:
Source @ Asset Hub Kusama: https://assethub-kusama.subscan.io/block/7144107
Relayed @ Bridge Hub Kusama: https://bridgehub-kusama.subscan.io/block/3481382?tab=event
Received @ Bridge Hub Polkadot: https://bridgehub-polkadot.subscan.io/block/2764368?tab=extrinsic
Dest @ Asset Hub Polkadot: https://assethub-polkadot.subscan.io/block/6445172?tab=event&event=6445172-1

The bridge message pallet requires proof for relayed messages and I don't think we can easily spoof it without modify the upstream code. However, what it does eventually is to just dispatch some XCM, which we maybe able to do without using the bridge message pallet.

So the work that needs to be done are:

  • Detect bridge events BridgeKusamaMessages.MessagesAccepted / BridgePolkadotMessages.MessagesAccepted
  • Take the XCM out somehow
  • Identify the dest parachain
  • Dispatch the XCM somehow on dest bridge hub???
  • Profit

@bkontur
Copy link

bkontur commented Jun 13, 2024

* Detect bridge events `BridgeKusamaMessages.MessagesAccepted` / `BridgePolkadotMessages.MessagesAccepted`

* Take the XCM out somehow

* Identify the dest parachain

* Dispatch the XCM somehow on dest bridge hub???

The message should be stored in the bridge message queue as encoded bytes: https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-builder/src/universal_exports.rs#L381-L387.
But I think if we by-pass the real relay (message proofs) and "directly" trigger XCM dispatch on the dest BH, we won't test the real transport, which is also important here.

@bkontur
Copy link

bkontur commented Jun 13, 2024

for by-passing, it should be possible to read XCM on the source BH: OutboundLanes and OutboundMessages

but not sure how to by-pass everything, maybe trigger XCM dispatch on the target BH with DMP/HRMP either enqueue_inbound_downward_messages or 'enqueue_inbound_horizontal_messages' - prepare some "valid" storage data with set_storage or set_validation_data or whatever

@xlc
Copy link
Member

xlc commented Jun 13, 2024

we can inject DMP/HRMP to the target BH but unsure if we can mimic the exact same XCM behaviour compare to dispatched by the message pallet

@xlc
Copy link
Member

xlc commented Jun 14, 2024

blocked by paritytech/polkadot-sdk#4793

@green-jay
Copy link
Author

hello, any ETA on this? we would like to E2E test Kusama root track bridging to Hydration on Polkadot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants