diff --git a/op-acceptance-tests/tests/interop/contract/init_test.go b/op-acceptance-tests/tests/interop/contract/init_test.go index 4947d860a8099..5ce543943ef62 100644 --- a/op-acceptance-tests/tests/interop/contract/init_test.go +++ b/op-acceptance-tests/tests/interop/contract/init_test.go @@ -7,5 +7,5 @@ import ( ) func TestMain(m *testing.M) { - presets.DoMain(m, presets.WithSimpleInterop()) + presets.DoMain(m, presets.WithSimpleInterop(), presets.WithRethL2EL()) } diff --git a/op-acceptance-tests/tests/interop/message/init_test.go b/op-acceptance-tests/tests/interop/message/init_test.go index 246c6f1d892fd..f89ecc56e3187 100644 --- a/op-acceptance-tests/tests/interop/message/init_test.go +++ b/op-acceptance-tests/tests/interop/message/init_test.go @@ -7,5 +7,5 @@ import ( ) func TestMain(m *testing.M) { - presets.DoMain(m, presets.WithSimpleInterop()) + presets.DoMain(m, presets.WithSimpleInterop(), presets.WithRethL2EL()) } diff --git a/op-acceptance-tests/tests/interop/prep/init_test.go b/op-acceptance-tests/tests/interop/prep/init_test.go index ad5ad19077828..cb89b47fb1e68 100644 --- a/op-acceptance-tests/tests/interop/prep/init_test.go +++ b/op-acceptance-tests/tests/interop/prep/init_test.go @@ -10,5 +10,5 @@ func TestMain(m *testing.M) { // Configure a system without interop activation. // We just want to test if we can sync with a supervisor before interop is configured. // The supervisor will not be indexing data yet before interop, and has to handle that interop is not scheduled. - presets.DoMain(m, presets.WithSimpleInterop(), presets.WithUnscheduledInterop()) + presets.DoMain(m, presets.WithSimpleInterop(), presets.WithUnscheduledInterop(), presets.WithRethL2EL()) } diff --git a/op-acceptance-tests/tests/interop/proofs-singlechain/init_test.go b/op-acceptance-tests/tests/interop/proofs-singlechain/init_test.go index a3563ca58af3e..39ecf14ba7d2f 100644 --- a/op-acceptance-tests/tests/interop/proofs-singlechain/init_test.go +++ b/op-acceptance-tests/tests/interop/proofs-singlechain/init_test.go @@ -13,5 +13,6 @@ func TestMain(m *testing.M) { presets.WithSingleChainSuperInteropSupernode(), presets.WithL2NetworkCount(1), stack.MakeCommon(sysgo.WithChallengerCannonKonaEnabled()), + presets.WithRethL2EL(), ) } diff --git a/op-acceptance-tests/tests/interop/proofs/fpp/init_test.go b/op-acceptance-tests/tests/interop/proofs/fpp/init_test.go index 5219e3f5cfa47..77cefed5c8667 100644 --- a/op-acceptance-tests/tests/interop/proofs/fpp/init_test.go +++ b/op-acceptance-tests/tests/interop/proofs/fpp/init_test.go @@ -12,5 +12,6 @@ func TestMain(m *testing.M) { presets.DoMain(m, presets.WithSuperInteropSupernode(), stack.MakeCommon(sysgo.WithChallengerCannonKonaEnabled()), + presets.WithRethL2EL(), ) } diff --git a/op-acceptance-tests/tests/interop/proofs/init_test.go b/op-acceptance-tests/tests/interop/proofs/init_test.go index 4ee350a536fc7..7ffd05a3d3c19 100644 --- a/op-acceptance-tests/tests/interop/proofs/init_test.go +++ b/op-acceptance-tests/tests/interop/proofs/init_test.go @@ -12,5 +12,6 @@ func TestMain(m *testing.M) { presets.DoMain(m, presets.WithSuperInteropSupernode(), stack.MakeCommon(sysgo.WithChallengerCannonKonaEnabled()), + presets.WithRethL2EL(), ) } diff --git a/op-acceptance-tests/tests/interop/proofs/serial/init_test.go b/op-acceptance-tests/tests/interop/proofs/serial/init_test.go index 0a8471073a80f..100857ddbd14a 100644 --- a/op-acceptance-tests/tests/interop/proofs/serial/init_test.go +++ b/op-acceptance-tests/tests/interop/proofs/serial/init_test.go @@ -12,5 +12,6 @@ func TestMain(m *testing.M) { presets.DoMain(m, presets.WithSuperInteropSupernode(), stack.MakeCommon(sysgo.WithChallengerCannonKonaEnabled()), + presets.WithRethL2EL(), ) } diff --git a/op-acceptance-tests/tests/interop/proofs/withdrawal/init_test.go b/op-acceptance-tests/tests/interop/proofs/withdrawal/init_test.go index d944f3fd7836a..455c6cc8a3d0a 100644 --- a/op-acceptance-tests/tests/interop/proofs/withdrawal/init_test.go +++ b/op-acceptance-tests/tests/interop/proofs/withdrawal/init_test.go @@ -7,5 +7,5 @@ import ( ) func TestMain(m *testing.M) { - presets.DoMain(m, presets.WithSuperInterop(), presets.WithTimeTravel()) + presets.DoMain(m, presets.WithSuperInterop(), presets.WithTimeTravel(), presets.WithRethL2EL()) } diff --git a/op-acceptance-tests/tests/interop/reorgs/init_test.go b/op-acceptance-tests/tests/interop/reorgs/init_test.go index df1ce435a198a..3f4899f223658 100644 --- a/op-acceptance-tests/tests/interop/reorgs/init_test.go +++ b/op-acceptance-tests/tests/interop/reorgs/init_test.go @@ -9,5 +9,5 @@ import ( // TestMain creates the test-setups against the shared backend func TestMain(m *testing.M) { // Other setups may be added here, hydrated from the same orchestrator - presets.DoMain(m, presets.WithSimpleInterop()) + presets.DoMain(m, presets.WithSimpleInterop(), presets.WithRethL2EL()) } diff --git a/op-acceptance-tests/tests/interop/seqwindow/init_test.go b/op-acceptance-tests/tests/interop/seqwindow/init_test.go index 1be339ff3e149..bd82d93a280d6 100644 --- a/op-acceptance-tests/tests/interop/seqwindow/init_test.go +++ b/op-acceptance-tests/tests/interop/seqwindow/init_test.go @@ -22,5 +22,6 @@ func TestMain(m *testing.M) { // in L1 block sync considerations in batcher stop or start. // So we end up having to encode block by block, so the full batch data does not get dropped. cfg.BatchType = derive.SingularBatchType - }))) + })), + presets.WithRethL2EL()) } diff --git a/op-acceptance-tests/tests/interop/smoke/init_test.go b/op-acceptance-tests/tests/interop/smoke/init_test.go index 10ba3a9457fba..e064d207653d2 100644 --- a/op-acceptance-tests/tests/interop/smoke/init_test.go +++ b/op-acceptance-tests/tests/interop/smoke/init_test.go @@ -7,5 +7,5 @@ import ( ) func TestMain(m *testing.M) { - presets.DoMain(m, presets.WithMinimal()) + presets.DoMain(m, presets.WithMinimal(), presets.WithRethL2EL()) } diff --git a/op-acceptance-tests/tests/interop/sync/multisupervisor_interop/init_test.go b/op-acceptance-tests/tests/interop/sync/multisupervisor_interop/init_test.go index 6f052d88b4d69..5de58136bbdac 100644 --- a/op-acceptance-tests/tests/interop/sync/multisupervisor_interop/init_test.go +++ b/op-acceptance-tests/tests/interop/sync/multisupervisor_interop/init_test.go @@ -15,5 +15,6 @@ func TestMain(m *testing.M) { presets.WithLogFilter(logfilter.DefaultMute( stack.KindSelector(stack.SupervisorKind).And(logfilter.Level(log.LevelInfo)).Show(), logfilter.Level(log.LevelError).Show(), - ))) + )), + presets.WithRethL2EL()) } diff --git a/op-acceptance-tests/tests/interop/sync/simple_interop/init_test.go b/op-acceptance-tests/tests/interop/sync/simple_interop/init_test.go index 72d1350b9ebc4..48dfc32dc0a84 100644 --- a/op-acceptance-tests/tests/interop/sync/simple_interop/init_test.go +++ b/op-acceptance-tests/tests/interop/sync/simple_interop/init_test.go @@ -7,5 +7,5 @@ import ( ) func TestMain(m *testing.M) { - presets.DoMain(m, presets.WithSimpleInterop()) + presets.DoMain(m, presets.WithSimpleInterop(), presets.WithRethL2EL()) } diff --git a/op-acceptance-tests/tests/interop/upgrade-no-supervisor/init_test.go b/op-acceptance-tests/tests/interop/upgrade-no-supervisor/init_test.go index dffadc30f826d..0692e24f46bf0 100644 --- a/op-acceptance-tests/tests/interop/upgrade-no-supervisor/init_test.go +++ b/op-acceptance-tests/tests/interop/upgrade-no-supervisor/init_test.go @@ -9,5 +9,6 @@ import ( func TestMain(m *testing.M) { presets.DoMain(m, presets.WithMinimalInteropNoSupervisor(), + presets.WithRethL2EL(), ) } diff --git a/op-acceptance-tests/tests/interop/upgrade-singlechain/init_test.go b/op-acceptance-tests/tests/interop/upgrade-singlechain/init_test.go index ae7ba46c9c921..0a1ae8f1212f1 100644 --- a/op-acceptance-tests/tests/interop/upgrade-singlechain/init_test.go +++ b/op-acceptance-tests/tests/interop/upgrade-singlechain/init_test.go @@ -12,5 +12,6 @@ func TestMain(m *testing.M) { presets.WithSuggestedInteropActivationOffset(30), presets.WithInteropNotAtGenesis(), presets.WithL2NetworkCount(1), // Specifically testing dependency set of 1 upgrade + presets.WithRethL2EL(), ) } diff --git a/op-acceptance-tests/tests/interop/upgrade/init_test.go b/op-acceptance-tests/tests/interop/upgrade/init_test.go index c3da262c6a52f..1a121f99c37a6 100644 --- a/op-acceptance-tests/tests/interop/upgrade/init_test.go +++ b/op-acceptance-tests/tests/interop/upgrade/init_test.go @@ -10,5 +10,6 @@ func TestMain(m *testing.M) { presets.DoMain(m, presets.WithSimpleInterop(), presets.WithSuggestedInteropActivationOffset(60), - presets.WithInteropNotAtGenesis()) + presets.WithInteropNotAtGenesis(), + presets.WithRethL2EL()) } diff --git a/op-devstack/presets/interop.go b/op-devstack/presets/interop.go index dfb8b76ba33ac..cdb7dc5e8e2ab 100644 --- a/op-devstack/presets/interop.go +++ b/op-devstack/presets/interop.go @@ -271,6 +271,12 @@ func WithL2NetworkCount(count int) stack.CommonOption { }) } +// WithRethL2EL forces all L2 EL nodes in this test suite to use op-reth instead of op-geth. +// Requires OP_RETH_EXEC_PATH environment variable to be set. +func WithRethL2EL() stack.CommonOption { + return stack.MakeCommon(sysgo.WithL2ELKind("op-reth")) +} + type MultiSupervisorInterop struct { SimpleInterop diff --git a/op-devstack/sysgo/l2_el.go b/op-devstack/sysgo/l2_el.go index 7242f6f1498be..ce19e77f07d6a 100644 --- a/op-devstack/sysgo/l2_el.go +++ b/op-devstack/sysgo/l2_el.go @@ -91,16 +91,31 @@ func (l L2ELOptionBundle) Apply(p devtest.P, id stack.L2ELNodeID, cfg *L2ELConfi } } +// WithL2ELKind sets the kind of L2 EL node to use for all L2 EL nodes in this orchestrator. +// Valid values: "op-reth", "op-geth" (default). +// This overrides the DEVSTACK_L2EL_KIND environment variable. +func WithL2ELKind(kind string) stack.Option[*Orchestrator] { + return stack.BeforeDeploy(func(o *Orchestrator) { + o.l2ELKind = kind + }) +} + // WithL2ELNode adds the default type of L2 CL node. -// The default can be configured with DEVSTACK_L2EL_KIND. +// The default can be configured with DEVSTACK_L2EL_KIND env var or WithL2ELKind option. // Tests that depend on specific types can use options like WithKonaNode and WithOpNode directly. func WithL2ELNode(id stack.L2ELNodeID, opts ...L2ELOption) stack.Option[*Orchestrator] { - switch os.Getenv("DEVSTACK_L2EL_KIND") { - case "op-reth": - return WithOpReth(id, opts...) - default: - return WithOpGeth(id, opts...) - } + return stack.AfterDeploy(func(orch *Orchestrator) { + kind := orch.l2ELKind + if kind == "" { + kind = os.Getenv("DEVSTACK_L2EL_KIND") + } + switch kind { + case "op-reth": + WithOpReth(id, opts...).AfterDeploy(orch) + default: + WithOpGeth(id, opts...).AfterDeploy(orch) + } + }) } func WithExtL2Node(id stack.L2ELNodeID, elRPCEndpoint string) stack.Option[*Orchestrator] { diff --git a/op-devstack/sysgo/orchestrator.go b/op-devstack/sysgo/orchestrator.go index ed6a6ab4f50ae..59fcdc0b5ac5c 100644 --- a/op-devstack/sysgo/orchestrator.go +++ b/op-devstack/sysgo/orchestrator.go @@ -33,6 +33,7 @@ type Orchestrator struct { proposerOptions []ProposerOption l2CLOptions L2CLOptionBundle l2ELOptions L2ELOptionBundle + l2ELKind string l2ChallengerOpts l2ChallengerOpts SyncTesterELOptions SyncTesterELOptionBundle deployerPipelineOptions []DeployerPipelineOption