Skip to content

Add batcher max channel duration #118

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 29, 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
13 changes: 9 additions & 4 deletions internal/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"io"
"strconv"
"strings"
"time"
)
Expand Down Expand Up @@ -33,12 +34,16 @@ func (r *RollupBoost) Name() string {
}

type OpBatcher struct {
L1Node string
L2Node string
RollupNode string
L1Node string
L2Node string
RollupNode string
MaxChannelDuration uint64
}

func (o *OpBatcher) Run(service *service, ctx *ExContext) {
if o.MaxChannelDuration == 0 {
o.MaxChannelDuration = 2
}
service.
WithImage("us-docker.pkg.dev/oplabs-tools-artifacts/images/op-batcher").
WithTag("v1.12.0-rc.1").
Expand All @@ -47,7 +52,7 @@ func (o *OpBatcher) Run(service *service, ctx *ExContext) {
"--l1-eth-rpc", Connect(o.L1Node, "http"),
"--l2-eth-rpc", Connect(o.L2Node, "http"),
"--rollup-rpc", Connect(o.RollupNode, "http"),
"--max-channel-duration=2",
"--max-channel-duration="+strconv.FormatUint(o.MaxChannelDuration, 10),
"--sub-safety-margin=4",
"--poll-interval=1s",
"--num-confirmations=1",
Expand Down
12 changes: 9 additions & 3 deletions internal/recipe_opstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ type OpRecipe struct {
// blockTime is the block time to use for the rollup
// (default is 2 seconds)
blockTime uint64

// batcherMaxChannelDuration is the maximum channel duration to use for the batcher
// (default is 2 seconds)
batcherMaxChannelDuration uint64
}

func (o *OpRecipe) Name() string {
Expand All @@ -33,6 +37,7 @@ func (o *OpRecipe) Flags() *flag.FlagSet {
flags.StringVar(&o.externalBuilder, "external-builder", "", "External builder URL")
flags.Var(&nullableUint64Value{&o.enableLatestFork}, "enable-latest-fork", "Enable latest fork isthmus (nil or empty = disabled, otherwise enabled at specified block)")
flags.Uint64Var(&o.blockTime, "block-time", defaultOpBlockTimeSeconds, "Block time to use for the rollup")
flags.Uint64Var(&o.batcherMaxChannelDuration, "batcher-max-channel-duration", 2, "Maximum channel duration to use for the batcher")
return flags
}

Expand Down Expand Up @@ -79,9 +84,10 @@ func (o *OpRecipe) Apply(ctx *ExContext, artifacts *Artifacts) *Manifest {
UseDeterministicP2PKey: o.externalBuilder != "",
})
svcManager.AddService("op-batcher", &OpBatcher{
L1Node: "el",
L2Node: "op-geth",
RollupNode: "op-node",
L1Node: "el",
L2Node: "op-geth",
RollupNode: "op-node",
MaxChannelDuration: o.batcherMaxChannelDuration,
})
return svcManager
}
Expand Down