Skip to content

Commit 4e73adc

Browse files
authored
Run block builder internal with rollup-boost (#96)
1 parent 80b8807 commit 4e73adc

File tree

3 files changed

+42
-4
lines changed

3 files changed

+42
-4
lines changed

examples/op-stack-rollup-boost.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,11 @@ The command above starts op-reth as an external block builder with the following
4545
- `--trusted-peers`: Connects to our Op Stack's EL node using the deterministic enode address
4646

4747
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.
48+
49+
## Internal block builder
50+
51+
To use an internal `op-reth` as a block builder, run:
52+
53+
```
54+
$ go run main.go cook opstack --external-builder op-reth
55+
```

internal/components.go

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ func (o *OpGeth) Ready(service *service) error {
195195
var _ ServiceWatchdog = &OpGeth{}
196196

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

202202
type RethEL struct {
@@ -497,7 +497,22 @@ type OpReth struct {
497497
}
498498

499499
func (o *OpReth) Run(service *service, ctx *ExContext) {
500-
panic("BUG: op-reth is not implemented yet")
500+
service.WithImage("ghcr.io/paradigmxyz/op-reth").
501+
WithTag("nightly").
502+
WithEntrypoint("op-reth").
503+
WithArgs(
504+
"node",
505+
"--authrpc.port", `{{Port "authrpc" 8551}}`,
506+
"--authrpc.addr", "0.0.0.0",
507+
"--authrpc.jwtsecret", "{{.Dir}}/jwtsecret",
508+
"--http",
509+
"--http.addr", "0.0.0.0",
510+
"--http.port", `{{Port "http" 8545}}`,
511+
"--chain", "{{.Dir}}/l2-genesis.json",
512+
"--datadir", "{{.Dir}}/data_op_reth",
513+
"--disable-discovery",
514+
"--color", "never",
515+
"--port", `{{Port "rpc" 30303}}`)
501516
}
502517

503518
func (o *OpReth) Name() string {
@@ -522,3 +537,10 @@ func (o *OpReth) ReleaseArtifact() *release {
522537
},
523538
}
524539
}
540+
541+
var _ ServiceWatchdog = &OpReth{}
542+
543+
func (p *OpReth) Watchdog(out io.Writer, service *service, ctx context.Context) error {
544+
rethURL := fmt.Sprintf("http://localhost:%d", service.MustGetPort("http").HostPort)
545+
return watchChainHead(out, rethURL, 2*time.Second)
546+
}

internal/recipe_opstack.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,21 @@ func (o *OpRecipe) Apply(ctx *ExContext, artifacts *Artifacts) *Manifest {
4747
BeaconNode: "beacon",
4848
})
4949

50+
externalBuilderRef := o.externalBuilder
51+
if o.externalBuilder == "op-reth" {
52+
// Add a new op-reth service and connect it to Rollup-boost
53+
svcManager.AddService("op-reth", &OpReth{})
54+
55+
externalBuilderRef = Connect("op-reth", "authrpc")
56+
}
57+
5058
elNode := "op-geth"
5159
if o.externalBuilder != "" {
5260
elNode = "rollup-boost"
5361

5462
svcManager.AddService("rollup-boost", &RollupBoost{
5563
ELNode: "op-geth",
56-
Builder: o.externalBuilder,
64+
Builder: externalBuilderRef,
5765
})
5866
}
5967
svcManager.AddService("op-node", &OpNode{

0 commit comments

Comments
 (0)