Skip to content

Run block builder internal with rollup-boost #96

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

Merged
merged 1 commit into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions examples/op-stack-rollup-boost.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,11 @@ The command above starts op-reth as an external block builder with the following
- `--trusted-peers`: Connects to our Op Stack's EL node using the deterministic enode address

Once op-reth is running, it will connect to the Op Stack and begin participating in block building. You can verify it's working by checking the logs of both the sequencer and op-reth for successful block proposals.

## Internal block builder

To use an internal `op-reth` as a block builder, run:

```
$ go run main.go cook opstack --external-builder op-reth
```
28 changes: 25 additions & 3 deletions internal/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ func (o *OpGeth) Ready(service *service) error {
var _ ServiceWatchdog = &OpGeth{}

func (o *OpGeth) Watchdog(out io.Writer, service *service, ctx context.Context) error {
rethURL := fmt.Sprintf("http://localhost:%d", service.MustGetPort("http").HostPort)
return watchChainHead(out, rethURL, 2*time.Second)
gethURL := fmt.Sprintf("http://localhost:%d", service.MustGetPort("http").HostPort)
return watchChainHead(out, gethURL, 2*time.Second)
}

type RethEL struct {
Expand Down Expand Up @@ -497,7 +497,22 @@ type OpReth struct {
}

func (o *OpReth) Run(service *service, ctx *ExContext) {
panic("BUG: op-reth is not implemented yet")
service.WithImage("ghcr.io/paradigmxyz/op-reth").
WithTag("nightly").
WithEntrypoint("op-reth").
WithArgs(
"node",
"--authrpc.port", `{{Port "authrpc" 8551}}`,
"--authrpc.addr", "0.0.0.0",
"--authrpc.jwtsecret", "{{.Dir}}/jwtsecret",
"--http",
"--http.addr", "0.0.0.0",
"--http.port", `{{Port "http" 8545}}`,
"--chain", "{{.Dir}}/l2-genesis.json",
"--datadir", "{{.Dir}}/data_op_reth",
"--disable-discovery",
"--color", "never",
"--port", `{{Port "rpc" 30303}}`)
}

func (o *OpReth) Name() string {
Expand All @@ -522,3 +537,10 @@ func (o *OpReth) ReleaseArtifact() *release {
},
}
}

var _ ServiceWatchdog = &OpReth{}

func (p *OpReth) Watchdog(out io.Writer, service *service, ctx context.Context) error {
rethURL := fmt.Sprintf("http://localhost:%d", service.MustGetPort("http").HostPort)
return watchChainHead(out, rethURL, 2*time.Second)
}
10 changes: 9 additions & 1 deletion internal/recipe_opstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,21 @@ func (o *OpRecipe) Apply(ctx *ExContext, artifacts *Artifacts) *Manifest {
BeaconNode: "beacon",
})

externalBuilderRef := o.externalBuilder
if o.externalBuilder == "op-reth" {
// Add a new op-reth service and connect it to Rollup-boost
svcManager.AddService("op-reth", &OpReth{})

externalBuilderRef = Connect("op-reth", "authrpc")
}

elNode := "op-geth"
if o.externalBuilder != "" {
elNode = "rollup-boost"

svcManager.AddService("rollup-boost", &RollupBoost{
ELNode: "op-geth",
Builder: o.externalBuilder,
Builder: externalBuilderRef,
})
}
svcManager.AddService("op-node", &OpNode{
Expand Down