-
Notifications
You must be signed in to change notification settings - Fork 84
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
Support for bidirectional routers #1958
Conversation
ade0460
to
329c861
Compare
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.
Overall, the design looks really good! I am mostly curious on how to extend this to support message relaying, see my long comment.
I like how this is implemented, thank you for taking care @lemunozm! |
ac5671c
to
e7a7ebe
Compare
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.
List of pendings todos
c4423aa
to
88c6558
Compare
If nothing wrong CI should be green with the commented sections in the code |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ 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 ☔ View full report in Codecov by Sentry. |
6c1b30f
to
a59c6aa
Compare
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.
Super straight-forward and clear - awesome work! A few nits and one question regarding a test.
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.
LS(uper)M(ega)GTM!
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 multi router PR is based on this and I'm super happy with everything so far.
Awesome job @lemunozm!
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