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
5 changes: 5 additions & 0 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ spec:
# Node Type
nodeType: "sequencer" # sequencer, replica

# Sequencer Reference (only for replica nodes)
sequencerRef:
name: "op-mainnet-sequencer" # Name of the sequencer OpNode
namespace: "optimism-system" # Optional, defaults to same namespace

# op-node Configuration
opNode:
# Sync Configuration
Expand Down
17 changes: 17 additions & 0 deletions api/v1alpha1/opnode_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ type OpNodeSpec struct {
// +kubebuilder:validation:Enum=sequencer;replica
NodeType string `json:"nodeType"`

// SequencerRef references the sequencer OpNode (only for replica nodes)
// This field is optional when L2RpcUrl is set for external sequencer connections
SequencerRef *SequencerReference `json:"sequencerRef,omitempty"`

// L2RpcUrl is the external L2 RPC URL for connecting to an external sequencer
// This is typically used for replica nodes connecting to external networks (e.g., Sepolia)
// When set, SequencerRef is optional
L2RpcUrl string `json:"l2RpcUrl,omitempty"`

// OpNode configuration
OpNode OpNodeConfig `json:"opNode,omitempty"`

Expand All @@ -54,6 +63,14 @@ type OptimismNetworkRef struct {
Namespace string `json:"namespace,omitempty"`
}

// SequencerReference defines a reference to the sequencer OpNode
type SequencerReference struct {
// Name of the sequencer OpNode
Name string `json:"name"`
// Namespace of the sequencer OpNode (optional, defaults to same namespace)
Namespace string `json:"namespace,omitempty"`
}

// OpNodeConfig defines op-node specific configuration
type OpNodeConfig struct {
// Sync configuration
Expand Down
20 changes: 20 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions config/crd/bases/optimism.optimism.io_opnodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ spec:
spec:
description: OpNodeSpec defines the desired state of OpNode
properties:
l2RpcUrl:
description: |-
L2RpcUrl is the external L2 RPC URL for connecting to an external sequencer
This is typically used for replica nodes connecting to external networks (e.g., Sepolia)
When set, SequencerRef is optional
type: string
nodeType:
description: NodeType specifies whether this is a sequencer or replica
node
Expand Down Expand Up @@ -497,6 +503,21 @@ spec:
type: object
type: object
type: object
sequencerRef:
description: |-
SequencerRef references the sequencer OpNode (only for replica nodes)
This field is optional when L2RpcUrl is set for external sequencer connections
properties:
name:
description: Name of the sequencer OpNode
type: string
namespace:
description: Namespace of the sequencer OpNode (optional, defaults
to same namespace)
type: string
required:
- name
type: object
service:
description: Service configuration
properties:
Expand Down
1 change: 1 addition & 0 deletions config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
resources:
- optimism_v1alpha1_optimismnetwork.yaml
- optimism_v1alpha1_opnode.yaml
- optimism_v1alpha1_opnode_sepolia_replica.yaml
- optimism_v1alpha1_opbatcher.yaml
- optimism_v1alpha1_opproposer.yaml
- optimism_v1alpha1_opchallenger.yaml
Expand Down
5 changes: 5 additions & 0 deletions config/samples/optimism_v1alpha1_opnode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ spec:
# Node type: sequencer or replica
nodeType: replica

# Sequencer reference (only for replica nodes)
sequencerRef:
name: "op-sepolia-sequencer" # Name of the sequencer OpNode
# namespace: "default" # Optional: specify if sequencer is in different namespace

# op-node configuration
opNode:
syncMode: execution-layer
Expand Down
150 changes: 150 additions & 0 deletions config/samples/optimism_v1alpha1_opnode_sepolia_replica.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
apiVersion: optimism.optimism.io/v1alpha1
kind: OpNode
metadata:
labels:
app.kubernetes.io/name: op-stack-operator
app.kubernetes.io/managed-by: kustomize
name: op-sepolia-replica
namespace: optimism-system
spec:
# Reference to the OptimismNetwork
optimismNetworkRef:
name: op-sepolia
namespace: optimism-system

# Node type: replica (not sequencer)
nodeType: replica

# External L2 RPC URL for connecting to Sepolia sequencer
# This makes sequencerRef optional for external networks
l2RpcUrl: "https://sepolia.optimism.io"

# op-node configuration
opNode:
syncMode: execution-layer

# P2P configuration for replica nodes (discovery enabled)
p2p:
enabled: true
listenPort: 9003
discovery:
enabled: true
bootnodes:
- "enr:-J64QBwRaIb3wBrF0tHOGmWGmAu0s_lZYtR7JzXP2eVGLwUq7iyKyeJyDJ8-wWcq4PY-cASaYqMJx7X_WL5_qwKUrGCGAZGOXTNFgmlkgnY0gmlwhLTNlcqJc2VjcDI1NmsxoQLwQIJn3aAa3xzjgGV1c0mckx9smwLaIvwHYXWnzPRrUYN0Y3CC"
peerScoring:
enabled: true
bandwidthLimit: "10MB"
privateKey:
generate: true

# RPC configuration
rpc:
enabled: true
host: "0.0.0.0"
port: 9545
enableAdmin: false
cors:
origins: ["*"]
methods: ["GET", "POST"]

# Engine API configuration
engine:
jwtSecret:
generate: true
endpoint: "http://127.0.0.1:8551"

# op-geth configuration
opGeth:
network: "op-sepolia"
dataDir: "/data/geth"

# Storage configuration (adjust size based on needs)
storage:
size: "100Gi"
storageClass: "standard"
accessMode: "ReadWriteOnce"

# Sync configuration
syncMode: "snap"
gcMode: "full"
stateScheme: "path"
cache: 4096
dbEngine: "pebble"

# Network configuration
networking:
http:
enabled: true
host: "0.0.0.0"
port: 8545
apis: ["web3", "eth", "net", "debug"]
cors:
origins: ["*"]
methods: ["GET", "POST"]

ws:
enabled: true
host: "0.0.0.0"
port: 8546
apis: ["web3", "eth", "net"]
origins: ["*"]

authrpc:
host: "127.0.0.1"
port: 8551
apis: ["engine", "eth"]

p2p:
port: 30303
maxPeers: 50
noDiscovery: false

# Transaction pool configuration
txpool:
noLocals: true
journal: "transactions.rlp"
lifetime: "1h"
priceBump: 10
accountSlots: 16
globalSlots: 5120
accountQueue: 64
globalQueue: 1024

# Rollup-specific configuration
rollup:
disableTxPoolGossip: false
computePendingBlock: false

# Resource configuration (adjust based on node requirements)
resources:
opNode:
requests:
cpu: "500m"
memory: "1Gi"
limits:
cpu: "2000m"
memory: "4Gi"
opGeth:
requests:
cpu: "1000m"
memory: "4Gi"
limits:
cpu: "4000m"
memory: "16Gi"

# Service configuration
service:
type: ClusterIP
ports:
- name: "geth-http"
port: 8545
targetPort: 8545
protocol: "TCP"
- name: "geth-ws"
port: 8546
targetPort: 8546
protocol: "TCP"
- name: "node-rpc"
port: 9545
targetPort: 9545
protocol: "TCP"
70 changes: 32 additions & 38 deletions config/samples/optimism_v1alpha1_optimismnetwork.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,60 @@ apiVersion: optimism.optimism.io/v1alpha1
kind: OptimismNetwork
metadata:
labels:
app.kubernetes.io/name: optimismnetwork
app.kubernetes.io/instance: op-sepolia
app.kubernetes.io/part-of: op-stack-operator
app.kubernetes.io/name: op-stack-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: op-stack-operator
name: op-sepolia
namespace: optimism-system
name: optimismnetwork-sample
spec:
# Network Configuration
# Network configuration
networkName: "op-sepolia"
chainID: 11155420
l1ChainID: 11155111

# L1 RPC Configuration (required by all components)
l1RpcUrl: "https://eth-sepolia.g.alchemy.com/v2/zeFYT4eQdrTCht4MM6BhQFqWzZ81QO8O"
l1BeaconUrl: "https://sepolia-beacon.example.com"
l1RpcTimeout: "10s"

# Network-specific Configuration Files
# L1 configuration
l1RpcUrl: "https://rpc.sepolia.org"
l1BeaconUrl: "https://beacon.sepolia.org"
l1RpcTimeout: 30s
# Rollup configuration
rollupConfig:
autoDiscover: true # Controller will generate rollup config

autoDiscover: true

# L2 Genesis configuration
l2Genesis:
autoDiscover: true # Controller will generate genesis config

# Contract Address Discovery
autoDiscover: true
# Contract address discovery
contractAddresses:
discoveryMethod: "auto" # auto, superchain-registry, well-known, manual
cacheTimeout: "24h"

# Optional: If you know the SystemConfig address, it helps with discovery
systemConfigAddr: "0x034edD2A225f7f429A63E0f1D2084B9E0A93b538"

# Shared Configuration for all components
discoveryMethod: "auto"
cacheTimeout: 1h

# Shared configuration for all components
sharedConfig:
# Logging
# Logging configuration
logging:
level: "info"
format: "logfmt"
color: false

# Metrics
# Metrics configuration
metrics:
enabled: true
port: 7300
path: "/metrics"

# Resource Defaults (can be overridden by individual components)
# Default resource requirements
resources:
requests:
cpu: "100m"
memory: "256Mi"
cpu: "500m"
memory: "1Gi"
limits:
cpu: "1000m"
memory: "2Gi"

# Security
cpu: "2000m"
memory: "4Gi"
# Security configuration
security:
runAsNonRoot: true
runAsUser: 1000
fsGroup: 1000
seccompProfile:
type: "RuntimeDefault"
type: RuntimeDefault
Loading
Loading