Closed maht0rz closed 1 year ago
Can you please explain in your mental model, which of these new packages depends on our existing ones and what of these modules will be used where?
Can you please explain in your mental model, which of these new packages depends on our existing ones and what of these modules will be used where?
The @yab/sdk
package should contain user facing stuff, i envision a scenario where someone uses our 'starter kit' or a plain nodejs project and installs maybe only @yab/sdk
and that will let them access AppChain
and everything else they need for quick local development experience.
Subsequently i think all actual appchains, should publish their own packages based on @yab/sdk, exposing their configured appChains such as @my-app-chain/sdk
which will export a ready to use app chain with all runtime code ready to be used etc.
@yab/common
should contain things that are re-used by our other packages, that could be the ModuleContainer
or specific helper types, perhaps even the newly planned method decorator or zk program creation logic. We have at least three packages that have somewhat similar dependencies so they should live here.
This PR introduces
ModuleContainer
, a generic way to provide modular components across our stack.Sequencer
,Runtime
andAppChain
have been migrated to adhere to the new modularity concepts.Furthermore, two new packages have been introduced:
@yab/common
, holds code shared among other packages such asModuleContainer
@yab/sdk
, composes other packages into a user facing package, exposesAppChain
.This PR has a lot of file changes since the mixup in modularity between Runtime and Sequencer had far reaching implications. The easiest way to review this PR is by looking at the following files:
common/test/config/ModuleContainer.test.ts
, tests how the module container behavessdk/test/appChain/AppChain.test.ts
, tests how Runtime and Sequencer are composed into an AppChain, including configurabilitysequencer/test/sequencer/executor/Sequencer.test.ts
showcases how the newly migrated Sequencer inherits the new ModuleContainerAdditionally there were notable changes to both
@runtimeModule()
and@sequencerModule()
decorators, they were simplified down to a point where they enforce extension ofRuntimeModule
andSequencerModule
respectively.