Skip to content
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
11 changes: 10 additions & 1 deletion op-devstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,13 @@ The following environment variables can be used to configure devstack:
- `DEVSTACK_ORCHESTRATOR`: Configures the preferred orchestrator kind (see Orchestrator interface section above).
- `DEVSTACK_KEYS_SALT`: Seeds the keys generated with `NewHDWallet`. This is useful for "isolating" test runs, and might be needed to reproduce CI and/or acceptance test runs. It can be any string, including the empty one to use the "usual" devkeys.
- `DEVNET_ENV_URL`: Used when `DEVSTACK_ORCHESTRATOR=sysext` to specify the network descriptor URL.
- `DEVNET_EXPECT_PRECONDITIONS_MET`: This can be set of force test failures when their pre-conditions are not met, which would otherwise result in them being skipped. This is helpful in particular for runs that do intend to run specific tests (as opposed to whatever is available). `op-acceptor` does set that variable, for example.
- `DEVNET_EXPECT_PRECONDITIONS_MET`: This can be set of force test failures when their pre-conditions are not met, which would otherwise result in them being skipped. This is helpful in particular for runs that do intend to run specific tests (as opposed to whatever is available). `op-acceptor` does set that variable, for example.

Rust stack env vars:
- `DEVSTACK_L2CL_KIND=kona` to select kona as default L2 CL node
- `DEVSTACK_L2EL_KIND=op-reth` to select op-reth as default L2 EL node
- `KONA_NODE_EXEC_PATH=/home/USERHERE/projects/kona/target/debug/kona-node` to select the kona-node executable to run
- `OP_RETH_EXEC_PATH=/home/USERHERE/projects/reth/target/release/op-reth` to select the op-reth executable to run

Other useful env vars:
- `DISABLE_OP_E2E_LEGACY=true` to disable the op-e2e package from loading build-artifacts that are not used by devstack.
27 changes: 13 additions & 14 deletions op-devstack/presets/cl_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,30 @@ import (
"github.com/ethereum-optimism/optimism/op-devstack/devtest"
"github.com/ethereum-optimism/optimism/op-devstack/stack"
"github.com/ethereum-optimism/optimism/op-devstack/sysgo"
"github.com/ethereum-optimism/optimism/op-node/config"
"github.com/ethereum-optimism/optimism/op-node/rollup/sync"
)

func WithExecutionLayerSyncOnVerifiers() stack.CommonOption {
return stack.MakeCommon(
sysgo.WithL2CLOption(func(_ devtest.P, id stack.L2CLNodeID, cfg *config.Config) {
// Can't enable ELSync on the sequencer or it will never start sequencing because
// ELSync needs to receive gossip from the sequencer to drive the sync
if !cfg.Driver.SequencerEnabled {
cfg.Sync.SyncMode = sync.ELSync
}
}))
sysgo.WithGlobalL2CLOption(sysgo.L2CLOptionFn(
func(_ devtest.P, id stack.L2CLNodeID, cfg *sysgo.L2CLConfig) {
cfg.VerifierSyncMode = sync.ELSync
})))
}

func WithConsensusLayerSync() stack.CommonOption {
return stack.MakeCommon(
sysgo.WithL2CLOption(func(_ devtest.P, id stack.L2CLNodeID, cfg *config.Config) {
cfg.Sync.SyncMode = sync.CLSync
}))
sysgo.WithGlobalL2CLOption(sysgo.L2CLOptionFn(
func(_ devtest.P, id stack.L2CLNodeID, cfg *sysgo.L2CLConfig) {
cfg.SequencerSyncMode = sync.CLSync
cfg.VerifierSyncMode = sync.CLSync
})))
}

func WithSafeDBEnabled() stack.CommonOption {
return stack.MakeCommon(
sysgo.WithL2CLOption(func(p devtest.P, _ stack.L2CLNodeID, cfg *config.Config) {
cfg.SafeDBPath = p.TempDir()
}))
sysgo.WithGlobalL2CLOption(sysgo.L2CLOptionFn(
func(p devtest.P, id stack.L2CLNodeID, cfg *sysgo.L2CLConfig) {
cfg.SafeDBPath = p.TempDir()
})))
}
16 changes: 9 additions & 7 deletions op-devstack/stack/match/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,21 @@ const (
LabelVendor = "vendor"
)

type L2ELVendor string
type Vendor string

const (
OpReth L2ELVendor = "op-reth"
OpGeth L2ELVendor = "op-geth"
Proxyd L2ELVendor = "proxyd"
FlashblocksWebsocketProxy L2ELVendor = "flashblocks-websocket-proxy"
OpReth Vendor = "op-reth"
OpGeth Vendor = "op-geth"
Proxyd Vendor = "proxyd"
FlashblocksWebsocketProxy Vendor = "flashblocks-websocket-proxy"
OpNode Vendor = "op-node"
KonaNode Vendor = "kona-node"
)

func (v L2ELVendor) Match(elems []stack.L2ELNode) []stack.L2ELNode {
func (v Vendor) Match(elems []stack.L2ELNode) []stack.L2ELNode {
return WithLabel[stack.L2ELNodeID, stack.L2ELNode](LabelVendor, string(v)).Match(elems)
}

func (v L2ELVendor) String() string {
func (v Vendor) String() string {
return string(v)
}
6 changes: 4 additions & 2 deletions op-devstack/sysgo/control_plane_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,16 @@ func testL2CLRestart(ids DefaultInteropSystemIDs, system stack.System, control s
// stop L2CL
control.L2CLNodeState(ids.L2ACL, stack.Stop)

// L2CL API will not work since L2CL stopped
// L2CL API will still kind of work, it is not functioning,
// but since L2CL is behind a proxy, the proxy is still online, and may create a different error.
// The dial will be accepted, and the connection then closed, once the connection behind the proxy fails.
{
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
_, err := retry.Do[*eth.SyncStatus](ctx, 10, retry.Fixed(time.Millisecond*500), func() (*eth.SyncStatus, error) {
return seqA.RollupAPI().SyncStatus(ctx)
})
cancel()
require.Error(t, err)
require.Error(t, err, "should not be able to get sync-status when node behind proxy is offline")
}

// restart L2CL
Expand Down
2 changes: 1 addition & 1 deletion op-devstack/sysgo/faucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func WithFaucets(l1ELs []stack.L1ELNodeID, l2ELs []stack.L2ELNodeID) stack.Optio
require.True(ok, "need L2 EL for faucet", elID)

faucets[id] = &fconf.FaucetEntry{
ELRPC: endpoint.MustRPC{Value: endpoint.URL(el.userRPC)},
ELRPC: endpoint.MustRPC{Value: endpoint.URL(el.UserRPC())},
ChainID: elID.ChainID(),
TxCfg: fconf.TxManagerConfig{
PrivateKey: funderKeyStr,
Expand Down
8 changes: 4 additions & 4 deletions op-devstack/sysgo/l2_batcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ func WithBatcher(batcherID stack.L2BatcherID, l1ELID stack.L1ELNodeID, l2CLID st

batcherCLIConfig := &bss.CLIConfig{
L1EthRpc: l1EL.userRPC,
L2EthRpc: []string{l2EL.userRPC},
RollupRpc: []string{l2CL.userRPC},
L2EthRpc: []string{l2EL.UserRPC()},
RollupRpc: []string{l2CL.UserRPC()},
MaxPendingTransactions: 1,
MaxChannelDuration: 1,
MaxL1TxSize: 120_000,
Expand Down Expand Up @@ -133,8 +133,8 @@ func WithBatcher(batcherID stack.L2BatcherID, l1ELID stack.L1ELNodeID, l2CLID st
service: batcher,
rpc: batcher.HTTPEndpoint(),
l1RPC: l1EL.userRPC,
l2CLRPC: l2CL.userRPC,
l2ELRPC: l2EL.userRPC,
l2CLRPC: l2CL.UserRPC(),
l2ELRPC: l2EL.UserRPC(),
}
orch.batchers.Set(batcherID, b)
})
Expand Down
4 changes: 2 additions & 2 deletions op-devstack/sysgo/l2_challenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func WithL2ChallengerPostDeploy(orch *Orchestrator, challengerID stack.L2Challen
for i, l2ELID := range l2ELIDs {
l2EL, ok := orch.l2ELs.Get(l2ELID)
require.True(ok)
l2ELRPCs[i] = l2EL.userRPC
l2ELRPCs[i] = l2EL.UserRPC()
}
cluster, ok := orch.clusters.Get(*clusterID)
require.True(ok)
Expand Down Expand Up @@ -143,7 +143,7 @@ func WithL2ChallengerPostDeploy(orch *Orchestrator, challengerID stack.L2Challen
l2EL, ok := orch.l2ELs.Get(l2ELID)
require.True(ok)
prestateVariant := shared.MTCannonVariant
cfg, err = shared.NewPreInteropChallengerConfig(dir, l1EL.userRPC, l1CL.beaconHTTPAddr, l2CL.userRPC, l2EL.userRPC,
cfg, err = shared.NewPreInteropChallengerConfig(dir, l1EL.userRPC, l1CL.beaconHTTPAddr, l2CL.UserRPC(), l2EL.UserRPC(),
shared.WithFactoryAddress(disputeGameFactoryAddr),
shared.WithPrivKey(challengerSecret),
shared.WithCannonConfig(rollupCfgs, l2Geneses, prestateVariant),
Expand Down
Loading