Closed lemunozm closed 2 months ago
I like how this is implemented, thank you for taking care @lemunozm!
If nothing wrong CI should be green with the commented sections in the code
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
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks for your reviews! Should be merged once CI passes 🤞🏻
Description
Support configuring routers for inbound and outbound directions, based on a
RouterId
that identify it for both directionsMain changes of this PR:
Added
pallet-axelar-router
which connects in both directions with Axelar. It allows the configuration of different domains under Axelar for inbound and outbound messages. It is a mix ofaxelar-gateway-preocompile
androuters/axelar_evm
which will be removed.Added
RouterId
. It is likeDomain
but with information about by where the message needs to be sent.Added
MessageSender
trait andMessageReceiver
. The middleware parameter represents by where the message must be sent. Normally, it will be theRouterId
but not mandatory, it could be any subset ofRouterId
, i.e:AxelarId
.Added a
RouterSupport
trait (name can change), to allow mapping anyDomain
in a list of supported routers that can lead the message to thatDomain
. Will be used by the gateway to obtain theRouterId
list for aDomain
.Added
RouterDispatcher
in runtime level to redirect a message to the correctrouter_id
.Use case we want to support
Suppose gateway is configured with the following (dynamically configured by an operator):
AxelarXcm
AxelarEvm
SnowbridgeEvm
And the chain offers the following routers (statically configured in the runtime):
AxelarXcm
AxelarEvm
SnowbridgeEvm
OtherEvm
If a message with
Domain::Evm
needs to be sent, it must be sent only toAxelarEvm
andSnowbridgeEvm
.AxelarXcm
will not used because that router is not retrieved byfor_domain(Domain::Evm)
OtherEvm
will not used because it's not configured in the gateway