You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 asOfaRelayWrapper::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.
The text was updated successfully, but these errors were encountered: