centrifuge / centrifuge-chain

Centrifuge Chain: the layer-1 blockchain for real-world assets, built on Substrate.
https://centrifuge.io
GNU Lesser General Public License v3.0
182 stars 81 forks source link

Support for bidirectional routers #1958

Closed lemunozm closed 2 months ago

lemunozm commented 2 months ago

Description

Support configuring routers for inbound and outbound directions, based on a RouterId that identify it for both directions

Main changes of this PR:

Use case we want to support

Suppose gateway is configured with the following (dynamically configured by an operator):

And the chain offers the following routers (statically configured in the runtime):

If a message with Domain::Evm needs to be sent, it must be sent only to AxelarEvm and SnowbridgeEvm.

cdamian commented 2 months ago

I like how this is implemented, thank you for taking care @lemunozm!

lemunozm commented 2 months ago

If nothing wrong CI should be green with the commented sections in the code

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 50.81967% with 60 lines in your changes missing coverage. Please review.

Project coverage is 47.63%. Comparing base (3def5e9) to head (a59c6aa).

Files Patch % Lines
pallets/axelar-router/src/lib.rs 72.22% 20 Missing :warning:
pallets/liquidity-pools-gateway/src/lib.rs 0.00% 15 Missing :warning:
runtime/common/src/routing.rs 0.00% 15 Missing :warning:
libs/mocks/src/router_message.rs 62.50% 3 Missing :warning:
runtime/altair/src/lib.rs 0.00% 2 Missing :warning:
runtime/centrifuge/src/lib.rs 0.00% 2 Missing :warning:
runtime/development/src/lib.rs 0.00% 2 Missing :warning:
runtime/common/src/gateway.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1958 +/- ## ========================================== - Coverage 48.11% 47.63% -0.48% ========================================== Files 183 183 Lines 12926 12904 -22 ========================================== - Hits 6219 6147 -72 - Misses 6707 6757 +50 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

lemunozm commented 2 months ago

Thanks for your reviews! Should be merged once CI passes 🤞🏻