-
Notifications
You must be signed in to change notification settings - Fork 804
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
Dry run xcms on bridge hubs to get forwarded xcms across the W<>R bridge #6002
base: master
Are you sure you want to change the base?
Conversation
bot fmt |
@franciscoaguirre https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7548088 was started for your command Comment |
@franciscoaguirre Command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
remote_message = messages[0].clone(); | ||
}); | ||
|
||
$sender_bridge_hub::execute_with(|| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@franciscoaguirre
I think we should be able to test or dry-run the full route: AHK -> BHK ... BHP -> AHP.
This way, in the end, we'll be able to write or run a periodic TypeScript/PAPI/whatever script that tests/simulates/dry-runs an asset transfer from AHK to AHP live, without the need to manually intervene (no chopsticks required).
I think the only missing piece is the DescendOrigin
I mentioned here. We need to trigger some pre-dispatch
, fake-message-proof-delivery
, or whatever runtime API on the bridged BridgeHub, that will ultimately append the DescendOrigin
. Let me think about it more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't the dispatch (and DescendOrigin appending) happen before sending to outbound HRMP queue? I mean outbound HRMP Q of BH will contain full XCM exactly as it goes to AH, so I don't see the problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, not exactly, bridged/target BridgeHub appends to the xcm DescendOrigin
when dispatching: https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-builder/src/universal_exports.rs#L433-L439
so the XCM in outbound Q on sender BridgeHub is not exactly the same as it comes to the target AH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but the appending DescendOrigin
we can do "offchain" (in the test, PAPI call), so this PR should be enough probably
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking of adding chopsticks tests for this under integration-tests/chopsticks/
but in another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mechanism here is actually incomplete, and the tests only test the source side of the bridge.
We need to support the full path across all hops all the way to final destination.
Proposed solutionsThis is how it looks now:
1. Add filter capabilities to the *BridgeBlobDispatcher:One possible solution would be to add some barrier/filter-like configurable capabilities to the
2. Proposed wrapper implementation with checking XCM:There is also an easy solution, we can easily add another
or maybe
3. other solution? |
Addresses #5708
Closes: #5878
The DryRunApi did not return any forwarded xcms when used on bridge hubs.
This PR completes the story of dry running an XCM across the W<>R bridge.
The tests
dry_run_transfer_to_westend_sends_xcm_to_bridge_hub
anddry_run_transfer_to_rococo_sends_xcm_to_bridge_hub
show how you can start from Asset Hub on one side of the bridge and get the message that will be executed on the Asset Hub on the other side.These two tests use the
test_dry_run_transfer_across_pk_bridge
macro.The most important implementation is
InspectMessageQueues
for pallet bridge messages.With this new implementation we can implement this on bridge hub polkadot and kusama for the P<>K bridge.
I also added a call to
clear_messages
indry_run_xcm
which was missing (it was previously only added todry_run_call
).TODO
DescendOrigin
when dispatching on BH and validateUniversalOrigin
in the XCM message when doing dispatch on BHdry-run
on the source BH should return final XCM as executed on destination AH + destination should be target AH