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 the logic interacting with protocol contracts into a declarative design #2920

Open
lumtis opened this issue Sep 25, 2024 · 0 comments
Labels
m:crosschain refactor zetaclient Issues related to ZetaClient

Comments

@lumtis
Copy link
Member

lumtis commented Sep 25, 2024

Idea

ZetaCore (interacting with ZEVM protocol contracts) and ZetaClient (interacting with connected chain protocol contracts) could have a declarative design to define how they interact with the protocol contract.

Right now the design is more imperative in the sense they define "parse" and "sign/call" functions for the reading inbounds and writing outbounds for each of the different interactions.

A declarative approach would be to define a single parse, sign (ZetaClient) and call (ZetaCore) function and two slices:

  • the events to parse for inbounds
  • the tx to send for outbounds

Reasoning

In the future we might make improvement in the protocol contracts: improving the interface, adding new gateway functions, etc..
While gateway contracts are upgradable for faster iteration, changes in the interface still need update in the protocol (and upgrades). This design would allow faster iteration, making changes in the repo minimal so patch releases could be performed more securely.

Going further

Explore the idea of pushing inbound events and outbound txs in the store, so new interface could be supported without upgrades.

@lumtis lumtis added zetaclient Issues related to ZetaClient refactor m:crosschain labels Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
m:crosschain refactor zetaclient Issues related to ZetaClient
Projects
None yet
Development

No branches or pull requests

1 participant