Skip to content

Conversation

@ferranbt
Copy link
Collaborator

@ferranbt ferranbt commented Jan 15, 2026

This PR is a followup on #304 and a way to fix #305. Before, the components would append their services to the manifest. Now, each component explicitely creates a Component object which contains Services and other Component objects. We create a nested hierarchy of Components and Services.

This is useful because we can instantiate the same Component with a different namespace later on like:

component := NewComponent("multi-builder")
component.AddComponent(ctx, "builder1", Builder{})
component.AddComponent(ctx, "builder2", Builder{})

or

component := NewComponent("op-stack-conductor")

for i := 0; i < 5; i++ {
    component.AddComponent(ctx, fmt.Sprintf("server-%d", i), OpConductorServer{})
}

@ferranbt ferranbt requested a review from canercidam as a code owner January 15, 2026 14:04
@metachris metachris requested a review from Copilot January 16, 2026 10:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a component wrapper system to organize services into a nested hierarchy, replacing the previous pattern where components directly appended services to the manifest. Each component now explicitly creates a Component object containing services and other components, enabling reusable component instantiation with different namespaces.

Changes:

  • Refactored Apply methods across all components and recipes to return *Component instead of modifying a manifest directly
  • Updated Manifest creation to accept a root Component and flatten its hierarchy into services
  • Changed recipe and component interfaces to work with *ExContext instead of *Manifest

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
playground/manifest.go Introduces Component struct and ComponentGen interface, refactors manifest construction to accept and flatten component hierarchies
playground/components.go Updates all component Apply methods to create and return Component instances instead of modifying manifest
playground/recipe_opstack.go Refactors OpRecipe to build and return component hierarchy
playground/recipe_l1.go Refactors L1Recipe to build and return component hierarchy
playground/recipe_buildernet.go Refactors BuilderNetRecipe to compose components
playground/manifest_test.go Updates test to use new component-based manifest construction
playground/components_test.go Updates test framework to work with new component pattern
playground/docs.go Updates documentation generation to use new component approach
playground/catalog.go Changes component registration type from Component to ComponentGen
main.go Updates main execution flow to create manifest from returned components

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

func (r *RollupBoost) Apply(manifest *Manifest) {
service := manifest.NewService("rollup-boost").
func (r *RollupBoost) Apply(ctx *ExContext) *Component {
component := NewComponent("bproxy")
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The component name "bproxy" appears to be a copy-paste error - this is the RollupBoost component, not BProxy. The component name should be "rollup-boost" to match the service name and component purpose.

Suggested change
component := NewComponent("bproxy")
component := NewComponent("rollup-boost")

Copilot uses AI. Check for mistakes.
func (o *OpRbuilder) Apply(manifest *Manifest) {
service := manifest.NewService("op-rbuilder").
func (o *OpRbuilder) Apply(ctx *ExContext) *Component {
component := NewComponent("bproxy")
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The component name "bproxy" is incorrect for OpRbuilder. The component name should be "op-rbuilder" to match the service name and component purpose.

Suggested change
component := NewComponent("bproxy")
component := NewComponent("op-rbuilder")

Copilot uses AI. Check for mistakes.

func (f *FlashblocksRPC) Apply(manifest *Manifest) {
func (f *FlashblocksRPC) Apply(ctx *ExContext) *Component {
component := NewComponent("bproxy")
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The component name "bproxy" is incorrect for FlashblocksRPC. The component name should be "flashblocks-rpc" to match the service name and component purpose.

Suggested change
component := NewComponent("bproxy")
component := NewComponent("flashblocks-rpc")

Copilot uses AI. Check for mistakes.
func (w *WebsocketProxy) Apply(manifest *Manifest) {
manifest.NewService("websocket-proxy").
func (w *WebsocketProxy) Apply(ctx *ExContext) *Component {
component := NewComponent("webproxy")
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The component name "webproxy" should be "websocket-proxy" to match the service name and maintain consistency with component naming conventions.

Suggested change
component := NewComponent("webproxy")
component := NewComponent("websocket-proxy")

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot use the same service twice

1 participant