Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add Bridges to xcm-emulator #2812

Merged

Conversation

NachoPal
Copy link
Contributor

@NachoPal NachoPal commented Jul 3, 2023

Adding bridging capabilities to xcm-emulator.

The bridge that a Network is expecting is any type that implements the BridgeMessageHandler trait. In this way we decouple xcm-emulator from the particular Bridge implementation for BridgeHub, avoiding also the need of importing all related packages (bp_messages, pallet_bridge_messages, etc). In addition, this approach would allow other teams to add their own Bridge implementations to the Network.

The BridgeHub transport layer has been mocked, abstracting out all the unnecessary complexity related to Relayers and proofs.

In the PR have been added other improvements:

  • More logs (dmp, ump and hrmp)
  • Network trait refactoring
  • decl_test_sender_receiver_accounts_parameter_types macro

@paritytech-ci paritytech-ci requested a review from a team July 3, 2023 10:35
@NachoPal NachoPal added B0-silent Changes should not be mentioned in any release notes T7-system_parachains This PR/Issue is related to System Parachains. A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. labels Jul 3, 2023
@NachoPal
Copy link
Contributor Author

NachoPal commented Jul 3, 2023

bot fmt

@command-bot
Copy link

command-bot bot commented Jul 3, 2023

@NachoPal https://gitlab.parity.io/parity/mirrors/cumulus/-/jobs/3108369 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/cumulus/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 11-5de37e9a-619e-422f-bb81-7e44ee31817a to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Jul 3, 2023

@NachoPal Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/cumulus/-/jobs/3108369 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/cumulus/-/jobs/3108369/artifacts/download.

@NachoPal
Copy link
Contributor Author

NachoPal commented Jul 3, 2023

bot fmt

@command-bot
Copy link

command-bot bot commented Jul 3, 2023

@NachoPal https://gitlab.parity.io/parity/mirrors/cumulus/-/jobs/3108705 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/cumulus/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 12-1cc863b0-0535-44fa-b3c0-e383c5907eaf to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Jul 3, 2023

@NachoPal Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/cumulus/-/jobs/3108705 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/cumulus/-/jobs/3108705/artifacts/download.

@NachoPal
Copy link
Contributor Author

NachoPal commented Jul 3, 2023

bot fmt

@command-bot
Copy link

command-bot bot commented Jul 3, 2023

@NachoPal https://gitlab.parity.io/parity/mirrors/cumulus/-/jobs/3108859 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/cumulus/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 13-3d2c3f53-d6f3-4fe4-96bf-e604627abbe7 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Jul 3, 2023

@NachoPal Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/cumulus/-/jobs/3108859 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/cumulus/-/jobs/3108859/artifacts/download.

@@ -102,6 +102,18 @@ impl TypeId for LaneId {
const TYPE_ID: [u8; 4] = *b"blan";
}

impl From<LaneId> for u32 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NachoPal @svyatonik
I am not sure about this, can we move this out of bridges substree?
Because then we need to backport it back to bridges repo and also in new version LaneId has a different type: https://github.com/paritytech/parity-bridges-common/pull/2221/files#diff-836b204328629e6af4b33c2a34ae41191cab06cf89c066e31bdb7085314fcda1L185-R203

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed there's probably a better way to do this.

Copy link
Contributor Author

@NachoPal NachoPal Jul 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is implementing From for LaneId or the fact that LaneId is going to change? I do not think it is harmful to implement an extra From for a new type.

I could try to locally (as part of the BridgeHubMessageHandler impl) wrap LaneId in a new type and implement the From trait for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could try to locally (as part of the BridgeHubMessageHandler impl) wrap LaneId in a new type and implement the From trait for it.

@bkontur @gilescope Check it out

@paritytech-ci paritytech-ci requested a review from a team July 3, 2023 13:29
@NachoPal
Copy link
Contributor Author

NachoPal commented Jul 4, 2023

bot fmt

@command-bot
Copy link

command-bot bot commented Jul 4, 2023

@NachoPal https://gitlab.parity.io/parity/mirrors/cumulus/-/jobs/3122354 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/cumulus/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 1-0858910d-7e97-4473-bd78-6e98b7652165 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Jul 4, 2023

@NachoPal Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/cumulus/-/jobs/3122354 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/cumulus/-/jobs/3122354/artifacts/download.

@NachoPal
Copy link
Contributor Author

NachoPal commented Jul 5, 2023

bot merge

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. T7-system_parachains This PR/Issue is related to System Parachains.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants