Skip to content
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

Refactor: Remove overusage of DomainAddress #1979

Closed
wants to merge 3 commits into from

Conversation

lemunozm
Copy link
Contributor

@lemunozm lemunozm commented Aug 19, 2024

Description

We were overusing DomainAddress in places where we did not really need it, generating extra complexity that offuscate some parts of the codebase (i.e affecting to how the forwarder needs to be implemented).

Change list:

  • Simplify sending/receiving methods:
    • Sending methods use as origin an AccountId instead of DomainAddress.
    • Receiving methods use as origin a Domain instead of DomainAddress.
  • Move gateway::Allowlist storage for instances its methods from the gateway to the axelar-router.
    • The reason: we need to check if the address is valid or not as soon as possible. Doing it in the gateway is late. We want to only forward messages (which is reached before the gateway) for allowed instances.
    • This check could not be super ideal here. i.e, in the future, several routers can use the same allowlist information. If that is the case, this should be extracted as a precondition or as a new entity in the chain:
      • axelar-router -> (new) allowlist-checker -> deserializer -> forwarder -> gatewat -> lp

@lemunozm lemunozm added I2-bug The code fails to follow expected behaviour. I6-refactoring Code needs refactoring. labels Aug 19, 2024
@lemunozm lemunozm self-assigned this Aug 19, 2024
@lemunozm lemunozm removed the I2-bug The code fails to follow expected behaviour. label Aug 19, 2024
@lemunozm
Copy link
Contributor Author

Will create another one more clean to evaluate the diffs

@lemunozm lemunozm closed this Aug 21, 2024
@lemunozm
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I6-refactoring Code needs refactoring.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant