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

Implement builder constructs to build the relay contexts #3083

Closed
soareschen opened this issue Feb 15, 2023 · 0 comments · Fixed by #3094
Closed

Implement builder constructs to build the relay contexts #3083

soareschen opened this issue Feb 15, 2023 · 0 comments · Fixed by #3094
Assignees
Labels
O: relayer-next Objective: work toward relayer v2
Milestone

Comments

@soareschen
Copy link
Contributor

Summary

Currently, we have built abstraction around implementing the relay contexts, and provide concrete types such as CosmosFullRelayContext for running the relayer. However, the construction of such types is pretty complicated, as it involves calling many constructors such as OfaRelayWrapper::new(CosmosRelayWrapper::new(...)) to construct the relay context. Furthermore, there are special care need to be taken such as cloning the chain contexts for each relay context, and spawning the batch message workers.

To make it easier for users to instantiate a concrete relayer, we will make use of the same context-generic programming pattern to define builder constructs for building the relayer. At the high level, external users only need to define a builder context and implement traits like OfaBuilder to construct the relayer.

Details

The builder constructs abstract away the complexity of building programs, i.e. implementing build systems. Traditionally, we know that build systems like Make, Ninja, Bazel are complex because they need to keep track of build dependencies and create a suitable plan for building the programs. Using context-generic programming, we can manage some of those complexities within Rust itself, by defining builder traits that depends on other builder traits declaratively.

The builder constructs will help make sure that build dependencies can be constructed declaratively and reused. For instance, a chain context is built once and reused by all relay contexts, and each relay context is built once with one batch message worker running.

@soareschen soareschen added the O: relayer-next Objective: work toward relayer v2 label Feb 15, 2023
@soareschen soareschen self-assigned this Feb 15, 2023
@github-project-automation github-project-automation bot moved this to 🩹 Triage in Hermes Feb 15, 2023
@soareschen soareschen moved this from 🩹 Triage to 🏗 In progress in Hermes Feb 15, 2023
@seanchen1991 seanchen1991 added this to the v1.5 milestone Feb 15, 2023
@seanchen1991 seanchen1991 moved this from 🏗 In progress to 🔖 Needs review in Hermes Feb 21, 2023
@seanchen1991 seanchen1991 moved this from 🔖 Needs review to ✅ Done in Hermes Feb 21, 2023
@seanchen1991 seanchen1991 modified the milestones: v1.5, v1.4 Feb 21, 2023
@seanchen1991 seanchen1991 linked a pull request Feb 21, 2023 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O: relayer-next Objective: work toward relayer v2
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants