sysgo

package
v1.18.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2026 License: MIT Imports: 145 Imported by: 0

Documentation

Overview

Moved from fb_OPRbuilderNode_real.go

Index

Constants

View Source
const DevstackL1ELKindEnvVar = "DEVSTACK_L1EL_KIND"
View Source
const GethExecPathEnvVar = "SYSGO_GETH_EXEC_PATH"

Variables

View Source
var (
	DefaultL1ID  = eth.ChainIDFromUInt64(900)
	DefaultL2AID = eth.ChainIDFromUInt64(901)
	DefaultL2BID = eth.ChainIDFromUInt64(902)
)

Functions

func ConnectP2P

func ConnectP2P(ctx context.Context, require *testreq.Assertions, initiator RpcCaller, acceptor RpcCaller, trusted bool)

ConnectP2P creates a p2p peer connection between node1 and node2.

func DisconnectP2P

func DisconnectP2P(ctx context.Context, require *testreq.Assertions, initiator RpcCaller, acceptor RpcCaller)

DisconnectP2P disconnects a p2p peer connection between node1 and node2.

func FlakyOnKonaNode

func FlakyOnKonaNode(t devtest.T, reason string)

func FlakyOnOpReth

func FlakyOnOpReth(t devtest.T, reason string)

func GetP2PClient

func GetP2PClient(ctx context.Context, logger log.Logger, l2CLNode L2CLNode) (*sources.P2PClient, error)

func GetPeerInfo

func GetPeerInfo(ctx context.Context, p2pClient *sources.P2PClient) (*apis.PeerInfo, error)

func GetPeers

func GetPeers(ctx context.Context, p2pClient *sources.P2PClient) (*apis.PeerDump, error)

func LocalArtifacts

func LocalArtifacts(t devtest.T) *artifacts.Locator

func OPContractsManagerMigratorABI

func OPContractsManagerMigratorABI() (*abi.ABI, error)

OPContractsManagerMigratorABI loads the ABI for the OPContractsManagerMigrator contract from the forge artifact file.

func PrestateForGameType

func PrestateForGameType(t devtest.CommonT, gameType gameTypes.GameType) common.Hash

func ProxyAddr

func ProxyAddr(require *testreq.Assertions, urlStr string) string

func SkipOnKonaNode

func SkipOnKonaNode(t devtest.T, reason string)

SkipOnKonaNode skips the test when the L2 consensus layer is kona-node

func SkipOnOpGeth

func SkipOnOpGeth(t devtest.T, reason string)

SkipOnOpGeth skips the test when the L2 execution layer is op-geth

func SkipOnOpReth

func SkipOnOpReth(t devtest.T, reason string)

SkipOnOpReth skips the test when the L2 execution layer is op-reth

func WithDefaultBPOBlobSchedule

func WithDefaultBPOBlobSchedule(_ devtest.T, _ devkeys.Keys, builder intentbuilder.Builder)

func WithEcotoneAtGenesis

func WithEcotoneAtGenesis(p devtest.T, _ devkeys.Keys, builder intentbuilder.Builder)

func WithJovianAtGenesis

func WithJovianAtGenesis(p devtest.T, _ devkeys.Keys, builder intentbuilder.Builder)

func WithKarstAtGenesis

func WithKarstAtGenesis(p devtest.T, _ devkeys.Keys, builder intentbuilder.Builder)

func ZKDisputeGameConfigForRuntime added in v1.17.0

func ZKDisputeGameConfigForRuntime(t devtest.CommonT) *embedded.ZKDisputeGameConfig

ZKDisputeGameConfigForRuntime returns a ZKDisputeGameConfig for use in devstack/test environments. The verifier is set to address(0) as a placeholder; real deployments must supply a valid verifier.

Types

type BatcherOption

type BatcherOption func(target ComponentTarget, cfg *bss.CLIConfig)

type ComponentTarget

type ComponentTarget struct {
	Name    string
	ChainID eth.ChainID
}

func NewComponentTarget

func NewComponentTarget(name string, chainID eth.ChainID) ComponentTarget

func (ComponentTarget) String

func (t ComponentTarget) String() string

type Conductor

type Conductor struct {
	// contains filtered or unexported fields
}

func (*Conductor) ConsensusEndpoint

func (c *Conductor) ConsensusEndpoint() string

func (*Conductor) HTTPEndpoint

func (c *Conductor) HTTPEndpoint() string

func (*Conductor) ServerID

func (c *Conductor) ServerID() string

type ContractPaths

type ContractPaths struct {
	// must be absolute paths, without file:// prefix
	FoundryArtifacts string
	SourceMap        string
}

type DeployerOption

type DeployerOption func(p devtest.T, keys devkeys.Keys, builder intentbuilder.Builder)

func WithCommons

func WithCommons(l1ChainID eth.ChainID) DeployerOption

func WithCustomGasToken

func WithCustomGasToken(name, symbol string, initialLiquidity *big.Int, liquidityControllerOwner common.Address) DeployerOption

func WithDAFootprintGasScalar

func WithDAFootprintGasScalar(scalar uint16, l2ChainIDs ...eth.ChainID) DeployerOption

WithDAFootprintGasScalar sets the DA footprint gas scalar with which the networks identified by l2ChainIDs will be launched. If there are no l2ChainIDs provided, all L2 networks are set with scalar.

func WithDevFeatureEnabled

func WithDevFeatureEnabled(flag common.Hash) DeployerOption

WithDevFeatureEnabled adds a feature as enabled in the dev feature bitmap

func WithDisputeGameFinalityDelaySeconds

func WithDisputeGameFinalityDelaySeconds(seconds uint64) DeployerOption

func WithEmbeddedContractSources

func WithEmbeddedContractSources() DeployerOption

func WithFinalizationPeriodSeconds

func WithFinalizationPeriodSeconds(n uint64) DeployerOption

WithFinalizationPeriodSeconds overrides the number of L1 blocks in a sequencing window, applied to all L2s.

func WithForkAtL1Genesis

func WithForkAtL1Genesis(fork forks.Fork) DeployerOption

func WithForkAtL1Offset

func WithForkAtL1Offset(fork forks.Fork, offset uint64) DeployerOption

func WithGuardianMatchL1PAO

func WithGuardianMatchL1PAO() DeployerOption

func WithHardforkSequentialActivation

func WithHardforkSequentialActivation(startFork, endFork opforks.Name, delta *uint64) DeployerOption

WithHardforkSequentialActivation configures a deployment such that L2 chains activate hardforks sequentially, starting from startFork and continuing until (including) endFork. Each successive fork is scheduled at an increasing offset.

func WithInteropAtGenesis

func WithInteropAtGenesis() DeployerOption

WithInteropAtGenesis activates interop at genesis for all known L2s

func WithKarstAtOffset

func WithKarstAtOffset(offset *uint64) DeployerOption

func WithL2BlockTimes

func WithL2BlockTimes(blockTimes map[eth.ChainID]uint64) DeployerOption

WithL2BlockTimes sets per-chain L2 block times. The map keys are L2 chain IDs and values are the desired block time in seconds for that chain.

func WithL2GasLimit

func WithL2GasLimit(gasLimit uint64) DeployerOption

func WithLocalContractSources

func WithLocalContractSources() DeployerOption

func WithLocalContractSourcesAt

func WithLocalContractSourcesAt(artifactsPath string) DeployerOption

WithLocalContractSourcesAt configures the deployer to load both L1 and L2 contract artifacts from the given local contracts-bedrock checkout or forge-artifacts directory.

func WithPrefundedL2

func WithPrefundedL2(l1ChainID, l2ChainID eth.ChainID) DeployerOption

func WithProofMaturityDelaySeconds

func WithProofMaturityDelaySeconds(n uint64) DeployerOption

func WithSequencingWindow

func WithSequencingWindow(n uint64) DeployerOption

WithSequencingWindow overrides the number of L1 blocks in a sequencing window, applied to all L2s.

type DeployerPipelineOption

type DeployerPipelineOption func(wb *worldBuilder, intent *state.Intent, cfg *deployer.ApplyPipelineOpts)

func WithDeployerCacheDir

func WithDeployerCacheDir(dirPath string) DeployerPipelineOption

func WithDeployerMatchL1PAO

func WithDeployerMatchL1PAO() DeployerPipelineOption

type DisputeGameConfigV2

type DisputeGameConfigV2 struct {
	Enabled  bool
	InitBond *big.Int
	GameType uint32
	GameArgs []byte
}

V2 structs for OPCM >= 7.0.0 (using IOPContractsManagerMigrator interface)

type ELNodeIdentity

type ELNodeIdentity struct {
	Key  *ecdsa.PrivateKey
	Port int
}

func NewELNodeIdentity

func NewELNodeIdentity(port int) *ELNodeIdentity

func (*ELNodeIdentity) KeyHex

func (id *ELNodeIdentity) KeyHex() string

type FakePoS

type FakePoS struct {
	// contains filtered or unexported fields
}

func (*FakePoS) Start

func (f *FakePoS) Start()

func (*FakePoS) Stop

func (f *FakePoS) Stop()

type FlashblocksRuntimeSupport

type FlashblocksRuntimeSupport struct {
	Builder     *OPRBuilderNode
	RollupBoost *RollupBoostNode
}

type InteropFilter

type InteropFilter struct {
	// contains filtered or unexported fields
}

InteropFilter wraps an in-process op-interop-filter service for devstack. Follows the same pattern as OpSupervisor (supervisor_op.go).

func (*InteropFilter) FailsafeEnabled

func (f *InteropFilter) FailsafeEnabled() bool

FailsafeEnabled returns the current failsafe state.

func (*InteropFilter) HTTPEndpoint

func (f *InteropFilter) HTTPEndpoint() string

HTTPEndpoint returns the service's actual RPC endpoint (e.g. "http://127.0.0.1:12345"). The caller is responsible for proxying if needed.

func (*InteropFilter) Ready

func (f *InteropFilter) Ready() bool

Ready returns true once all chain ingesters have backfilled.

func (*InteropFilter) SetFailsafeEnabled

func (f *InteropFilter) SetFailsafeEnabled(enabled bool)

SetFailsafeEnabled toggles failsafe mode directly on the backend. No admin RPC or JWT needed — this is the in-process advantage.

func (*InteropFilter) Stop

func (f *InteropFilter) Stop()

Stop gracefully shuts down the interop filter service.

func (*InteropFilter) WaitForReady

func (f *InteropFilter) WaitForReady(t devtest.T, timeout time.Duration)

WaitForReady blocks until all chain ingesters have backfilled or the timeout expires. Call this after the supernode/CL layer has started so that blocks are being produced.

type KonaNode

type KonaNode struct {
	// contains filtered or unexported fields
}

func (*KonaNode) InteropRPC

func (k *KonaNode) InteropRPC() (endpoint string, jwtSecret eth.Bytes32)

func (*KonaNode) Start

func (k *KonaNode) Start()

func (*KonaNode) Stop

func (k *KonaNode) Stop()

Stop stops the kona node. warning: no restarts supported yet, since the RPC port is not remembered.

func (*KonaNode) UserRPC

func (k *KonaNode) UserRPC() string

type KonaSupervisor

type KonaSupervisor struct {
	// contains filtered or unexported fields
}

func (*KonaSupervisor) Start

func (s *KonaSupervisor) Start()

func (*KonaSupervisor) Stop

func (s *KonaSupervisor) Stop()

func (*KonaSupervisor) UserRPC

func (s *KonaSupervisor) UserRPC() string

type L1CLNode

type L1CLNode struct {
	// contains filtered or unexported fields
}

func (*L1CLNode) BeaconHTTPAddr

func (n *L1CLNode) BeaconHTTPAddr() string

func (*L1CLNode) FakePoS

func (n *L1CLNode) FakePoS() stack.Lifecycle

type L1ELNode

type L1ELNode interface {
	UserRPC() string
	AuthRPC() string
	// contains filtered or unexported methods
}

type L1Geth

type L1Geth struct {
	// contains filtered or unexported fields
}

func (*L1Geth) AuthRPC

func (g *L1Geth) AuthRPC() string

func (*L1Geth) UserRPC

func (g *L1Geth) UserRPC() string

type L1Network

type L1Network struct {
	// contains filtered or unexported fields
}

func (*L1Network) ChainConfig

func (n *L1Network) ChainConfig() *params.ChainConfig

func (*L1Network) ChainID

func (n *L1Network) ChainID() eth.ChainID

func (*L1Network) Genesis added in v1.18.0

func (n *L1Network) Genesis() *core.Genesis

func (*L1Network) Name

func (n *L1Network) Name() string

type L2Batcher

type L2Batcher struct {
	// contains filtered or unexported fields
}

func (*L2Batcher) UserRPC

func (b *L2Batcher) UserRPC() string

type L2CLConfig

type L2CLConfig struct {
	// SyncMode to run, if this is a sequencer
	SequencerSyncMode nodeSync.Mode
	// SyncMode to run, if this is a verifier
	VerifierSyncMode nodeSync.Mode

	// SafeDBPath is the path to the safe DB to use. Disabled if empty.
	SafeDBPath string

	IsSequencer  bool
	IndexingMode bool

	// EnableReqRespSync is the flag to enable/disable req-resp sync.
	EnableReqRespSync bool

	// UseReqRespSync controls whether to use the req-resp sync protocol. EnableReqRespSync == false && UseReqRespSync == true is not allowed, and node will fail to start.
	UseReqRespSync bool

	// NoDiscovery is the flag to enable/disable discovery
	NoDiscovery bool

	FollowSource string

	// OffsetELSafe retracts safe and finalized from the EL-sync tip by floor(OffsetELSafe / L2BlockTime) blocks.
	OffsetELSafe time.Duration
}

func DefaultL2CLConfig

func DefaultL2CLConfig() *L2CLConfig

type L2CLNode

type L2CLNode interface {
	stack.Lifecycle
	UserRPC() string
	InteropRPC() (endpoint string, jwtSecret eth.Bytes32)
}

type L2CLOption

type L2CLOption interface {
	Apply(p devtest.T, target ComponentTarget, cfg *L2CLConfig)
}

func L2CLFollowSource

func L2CLFollowSource(source string) L2CLOption

func L2CLIndexing

func L2CLIndexing() L2CLOption

func L2CLSequencer

func L2CLSequencer() L2CLOption

type L2CLOptionBundle

type L2CLOptionBundle []L2CLOption

L2CLOptionBundle a list of multiple L2CLOption, to all be applied in order.

func (L2CLOptionBundle) Apply

func (l L2CLOptionBundle) Apply(p devtest.T, target ComponentTarget, cfg *L2CLConfig)

type L2CLOptionFn

type L2CLOptionFn func(p devtest.T, target ComponentTarget, cfg *L2CLConfig)

func (L2CLOptionFn) Apply

func (fn L2CLOptionFn) Apply(p devtest.T, target ComponentTarget, cfg *L2CLConfig)

type L2Challenger

type L2Challenger struct {
	// contains filtered or unexported fields
}

func (*L2Challenger) Config

func (p *L2Challenger) Config() *config.Config

type L2Deployment

type L2Deployment struct {
	// contains filtered or unexported fields
}

func (*L2Deployment) DisputeGameFactoryProxyAddr

func (d *L2Deployment) DisputeGameFactoryProxyAddr() common.Address

func (*L2Deployment) L1StandardBridgeProxyAddr

func (d *L2Deployment) L1StandardBridgeProxyAddr() common.Address

func (*L2Deployment) PermissionlessDelayedWETHProxyAddr

func (d *L2Deployment) PermissionlessDelayedWETHProxyAddr() common.Address

func (*L2Deployment) ProxyAdminAddr

func (d *L2Deployment) ProxyAdminAddr() common.Address

func (*L2Deployment) SystemConfigProxyAddr

func (d *L2Deployment) SystemConfigProxyAddr() common.Address

type L2ELConfig

type L2ELConfig struct {
	P2PAddr       string
	P2PPort       int
	P2PNodeKeyHex string
	StaticPeers   []string
	TrustedPeers  []string
	ProofHistory  bool
}

func DefaultL2ELConfig

func DefaultL2ELConfig() *L2ELConfig

type L2ELNode

type L2ELNode interface {
	stack.Lifecycle
	UserRPC() string
	EngineRPC() string
	JWTPath() string
}

type L2ELOption

type L2ELOption interface {
	Apply(p devtest.T, target ComponentTarget, cfg *L2ELConfig)
}

func L2ELWithP2PConfig

func L2ELWithP2PConfig(addr string, port int, nodeKeyHex string, staticPeers, trustedPeers []string) L2ELOption

L2ELWithP2PConfig sets deterministic P2P identity and static peers for the L2 EL.

func L2ELWithProofHistory

func L2ELWithProofHistory(enable bool) L2ELOption

type L2ELOptionBundle

type L2ELOptionBundle []L2ELOption

L2ELOptionBundle a list of multiple L2ELOption, to all be applied in order.

func (L2ELOptionBundle) Apply

func (l L2ELOptionBundle) Apply(p devtest.T, target ComponentTarget, cfg *L2ELConfig)

type L2ELOptionFn

type L2ELOptionFn func(p devtest.T, target ComponentTarget, cfg *L2ELConfig)

func (L2ELOptionFn) Apply

func (fn L2ELOptionFn) Apply(p devtest.T, target ComponentTarget, cfg *L2ELConfig)

type L2MetricsRegistrar

type L2MetricsRegistrar interface {
	RegisterL2MetricsTargets(serviceName string, endpoints ...PrometheusMetricsTarget)
}

type L2Network

type L2Network struct {
	// contains filtered or unexported fields
}

func (*L2Network) ChainConfig

func (c *L2Network) ChainConfig() *params.ChainConfig

func (*L2Network) ChainID

func (c *L2Network) ChainID() eth.ChainID

func (*L2Network) Deployment

func (c *L2Network) Deployment() stack.L2Deployment

func (*L2Network) Keys

func (c *L2Network) Keys() devkeys.Keys

func (*L2Network) L1ChainID

func (c *L2Network) L1ChainID() eth.ChainID

func (*L2Network) Name

func (c *L2Network) Name() string

func (*L2Network) RollupConfig

func (c *L2Network) RollupConfig() *rollup.Config

type L2Proposer

type L2Proposer struct {
	// contains filtered or unexported fields
}

type MigrateInputV2

type MigrateInputV2 struct {
	ChainSystemConfigs        []common.Address
	DisputeGameConfigs        []DisputeGameConfigV2
	StartingAnchorRoot        Proposal
	StartingRespectedGameType uint32
}

type MixedL2CLKind

type MixedL2CLKind string
const (
	MixedL2CLOpNode MixedL2CLKind = "op-node"
	MixedL2CLKona   MixedL2CLKind = "kona-node"
)

type MixedL2ELKind

type MixedL2ELKind string
const (
	MixedL2ELOpGeth   MixedL2ELKind = "op-geth"
	MixedL2ELOpReth   MixedL2ELKind = "op-reth"
	MixedL2ELOpRethV2 MixedL2ELKind = "op-reth-proof-v2"
)

type MixedSingleChainNodeRefs

type MixedSingleChainNodeRefs struct {
	Spec MixedSingleChainNodeSpec
	EL   L2ELNode
	CL   L2CLNode
}

type MixedSingleChainNodeSpec

type MixedSingleChainNodeSpec struct {
	ELKey       string
	CLKey       string
	ELKind      MixedL2ELKind
	CLKind      MixedL2CLKind
	IsSequencer bool
}

type MixedSingleChainPresetConfig

type MixedSingleChainPresetConfig struct {
	NodeSpecs                  []MixedSingleChainNodeSpec
	WithTestSequencer          bool
	TestSequencerName          string
	LocalContractArtifactsPath string
	DeployerOptions            []DeployerOption
	BatcherOptions             []BatcherOption
	OpRethOptions              []OpRethOption
}

type MixedSingleChainRuntime

type MixedSingleChainRuntime struct {
	L1Network     *L1Network
	L1EL          *L1Geth
	L1CL          *L1CLNode
	L2Network     *L2Network
	Nodes         []MixedSingleChainNodeRefs
	L2Batcher     *L2Batcher
	FaucetService *faucet.Service
	TestSequencer *TestSequencerRuntime
}

type MultiChainNodeRuntime

type MultiChainNodeRuntime struct {
	Name      string
	Network   *L2Network
	EL        L2ELNode
	CL        L2CLNode
	Batcher   *L2Batcher
	Proposer  *L2Proposer
	Followers map[string]*SingleChainNodeRuntime
}

type MultiChainRuntime

type MultiChainRuntime struct {
	Keys          devkeys.Keys
	Migration     *interopMigrationState
	FullConfigSet depset.FullConfigSetMerged
	DependencySet depset.DependencySet

	L1Network *L1Network
	L1EL      *L1Geth
	L1CL      *L1CLNode

	Chains map[string]*MultiChainNodeRuntime

	PrimarySupervisor   Supervisor
	SecondarySupervisor Supervisor
	Supernode           *SuperNode

	FaucetService      *faucet.Service
	TimeTravel         *clock.AdvancingClock
	TestSequencer      *TestSequencerRuntime
	L2ChallengerConfig *challengerconfig.Config
	DelaySeconds       uint64
	InteropFilter      *InteropFilter // nil if not using interop filter
}

func NewMultiSupervisorInteropRuntime

func NewMultiSupervisorInteropRuntime(t devtest.T) *MultiChainRuntime

func NewSimpleInteropRuntime

func NewSimpleInteropRuntime(t devtest.T) *MultiChainRuntime

func NewSimpleInteropRuntimeWithConfig

func NewSimpleInteropRuntimeWithConfig(t devtest.T, cfg PresetConfig) *MultiChainRuntime

func NewSimpleInteropSuperProofsRuntimeWithConfig

func NewSimpleInteropSuperProofsRuntimeWithConfig(t devtest.T, cfg PresetConfig) *MultiChainRuntime

func NewSingleChainInteropRuntime

func NewSingleChainInteropRuntime(t devtest.T) *MultiChainRuntime

func NewSingleChainInteropRuntimeWithConfig

func NewSingleChainInteropRuntimeWithConfig(t devtest.T, cfg PresetConfig) *MultiChainRuntime

func NewSingleChainSuperRootAtGenesisRuntimeWithConfig

func NewSingleChainSuperRootAtGenesisRuntimeWithConfig(t devtest.T, cfg PresetConfig) *MultiChainRuntime

NewSingleChainSuperRootAtGenesisRuntimeWithConfig builds a single-chain supernode runtime with SUPER_PERMISSIONED_CANNON installed in the permissioned slot at initial deploy.

func NewSingleChainSupernodeProofsRuntimeWithConfig

func NewSingleChainSupernodeProofsRuntimeWithConfig(t devtest.T, interopAtGenesis bool, cfg PresetConfig) *MultiChainRuntime

NewSingleChainSupernodeProofsRuntimeWithConfig deploys a single chain with SuperPermissionedCannon at genesis, then uses opcm.upgrade to add the permissionless super games and set the real starting anchor root.

func NewTwoL2SupernodeFollowL2RuntimeWithConfig

func NewTwoL2SupernodeFollowL2RuntimeWithConfig(t devtest.T, delaySeconds uint64, cfg PresetConfig) *MultiChainRuntime

func NewTwoL2SupernodeInteropRuntime

func NewTwoL2SupernodeInteropRuntime(t devtest.T, delaySeconds uint64) *MultiChainRuntime

func NewTwoL2SupernodeInteropRuntimeWithConfig

func NewTwoL2SupernodeInteropRuntimeWithConfig(t devtest.T, delaySeconds uint64, cfg PresetConfig) *MultiChainRuntime

func NewTwoL2SupernodeProofsRuntimeWithConfig

func NewTwoL2SupernodeProofsRuntimeWithConfig(t devtest.T, interopAtGenesis bool, cfg PresetConfig) *MultiChainRuntime

func NewTwoL2SupernodeRuntime

func NewTwoL2SupernodeRuntime(t devtest.T) *MultiChainRuntime

func NewTwoL2SupernodeRuntimeWithConfig

func NewTwoL2SupernodeRuntimeWithConfig(t devtest.T, cfg PresetConfig) *MultiChainRuntime

type OPRBuilderNode

type OPRBuilderNode struct {
	// contains filtered or unexported fields
}

func (*OPRBuilderNode) EngineRPC

func (b *OPRBuilderNode) EngineRPC() string

func (*OPRBuilderNode) FlashblocksWSURL

func (b *OPRBuilderNode) FlashblocksWSURL() string

func (*OPRBuilderNode) JWTPath

func (b *OPRBuilderNode) JWTPath() string

func (*OPRBuilderNode) Start

func (b *OPRBuilderNode) Start()

func (*OPRBuilderNode) Stop

func (b *OPRBuilderNode) Stop()

func (*OPRBuilderNode) UpdateRuleSet

func (b *OPRBuilderNode) UpdateRuleSet(rulesYaml string) error

func (*OPRBuilderNode) UserRPC

func (b *OPRBuilderNode) UserRPC() string

type OPRBuilderNodeConfig

type OPRBuilderNodeConfig struct {
	// Chain selector (defaults to "dev" to avoid mainnet imports during tests)
	Chain string

	// DataDir for op-OPRbuilderNode. If empty, a temp dir is created and cleaned up.
	DataDir string

	// Logging formats
	LogStdoutFormat string // e.g. "json"
	LogFileFormat   string // e.g. "json"

	// Flashblocks websocket bind address (host)
	FlashblocksAddr string
	// Flashblocks websocket port. 0 means auto-allocate an available local port.
	FlashblocksPort int
	// EnableFlashblocks enables the flashblocks feature.
	EnableFlashblocks bool

	// --http
	EnableRPC  bool
	RPCAPI     string
	RPCAddr    string
	RPCPort    int
	RPCJWTPath string

	AuthRPCJWTPath string
	AuthRPCAddr    string
	AuthRPCPort    int

	ChainBlockTime time.Duration

	// P2P
	P2PPort       int
	P2PAddr       string
	P2PNodeKeyHex string
	StaticPeers   []string
	TrustedPeers  []string

	// Misc process toggles
	WithUnusedPorts  bool // choose unused ports for subsystems
	DisableDiscovery bool // avoid discv5 UDP socket collisions

	Full bool

	RulesEnabled    bool
	RulesConfigPath string

	// ExtraArgs are appended to the generated CLI allowing callers to override defaults
	// if the binary respects "last flag wins".
	ExtraArgs []string
	// Env is passed to the subprocess environment.
	Env []string
}

OPRBuilderNodeConfig contains configuration used to generate the op-OPRbuilderNode CLI. Callers can modify the defaults via OPRbuilderNodeOption functions.

func DefaultOPRbuilderNodeConfig

func DefaultOPRbuilderNodeConfig() *OPRBuilderNodeConfig

func (*OPRBuilderNodeConfig) LaunchSpec

func (cfg *OPRBuilderNodeConfig) LaunchSpec(p devtest.CommonT) (args []string, env []string)

type OPRBuilderNodeOption

type OPRBuilderNodeOption interface {
	Apply(p devtest.CommonT, target ComponentTarget, cfg *OPRBuilderNodeConfig)
}

func OPRBuilderNodeWithEnv

func OPRBuilderNodeWithEnv(env ...string) OPRBuilderNodeOption

func OPRBuilderNodeWithExtraArgs

func OPRBuilderNodeWithExtraArgs(args ...string) OPRBuilderNodeOption

func OPRBuilderWithNodeIdentity

func OPRBuilderWithNodeIdentity(identity *ELNodeIdentity, addr string, staticPeers, trustedPeers []string) OPRBuilderNodeOption

OPRBuilderWithNodeIdentity applies an ELNodeIdentity directly to the builder EL.

func OPRBuilderWithP2PConfig

func OPRBuilderWithP2PConfig(addr string, port int, nodeKeyHex string, staticPeers, trustedPeers []string) OPRBuilderNodeOption

OPRBuilderWithP2PConfig sets deterministic P2P identity and static peers for the builder EL.

type OPRBuilderNodeOptionBundle

type OPRBuilderNodeOptionBundle []OPRBuilderNodeOption

OPRBuilderNodeOptionBundle applies multiple OPRBuilderNodeOptions in order.

func (OPRBuilderNodeOptionBundle) Apply

type OPRBuilderNodeOptionFn

type OPRBuilderNodeOptionFn func(p devtest.CommonT, target ComponentTarget, cfg *OPRBuilderNodeConfig)

func (OPRBuilderNodeOptionFn) Apply

type OpGeth

type OpGeth struct {
	// contains filtered or unexported fields
}

func (*OpGeth) EngineRPC

func (n *OpGeth) EngineRPC() string

func (*OpGeth) JWTPath

func (n *OpGeth) JWTPath() string

func (*OpGeth) Start

func (n *OpGeth) Start()

func (*OpGeth) Stop

func (n *OpGeth) Stop()

func (*OpGeth) UserRPC

func (n *OpGeth) UserRPC() string

type OpNode

type OpNode struct {
	// contains filtered or unexported fields
}

func (*OpNode) InteropRPC

func (n *OpNode) InteropRPC() (endpoint string, jwtSecret eth.Bytes32)

func (*OpNode) Start

func (n *OpNode) Start()

func (*OpNode) Stop

func (n *OpNode) Stop()

func (*OpNode) SyncMode

func (n *OpNode) SyncMode() nodeSync.Mode

SyncMode reports the sync mode the op-node was started with (VerifierSyncMode for verifiers, SequencerSyncMode for sequencers).

func (*OpNode) UserRPC

func (n *OpNode) UserRPC() string

type OpReth

type OpReth struct {
	// contains filtered or unexported fields
}

func (*OpReth) EngineRPC

func (n *OpReth) EngineRPC() string

func (*OpReth) JWTPath

func (n *OpReth) JWTPath() string

func (*OpReth) Start

func (n *OpReth) Start()

func (*OpReth) Stop

func (n *OpReth) Stop()

Stop stops the op-reth node. warning: no restarts supported yet, since the RPC port is not remembered.

func (*OpReth) UserRPC

func (n *OpReth) UserRPC() string

type OpRethConfig added in v1.18.0

type OpRethConfig struct {
	// ExtraArgs are appended to the generated CLI args.
	ExtraArgs []string
}

OpRethConfig holds the configurable knobs applied to an op-reth node before it is started.

func DefaultOpRethConfig added in v1.18.0

func DefaultOpRethConfig() *OpRethConfig

DefaultOpRethConfig returns a zero-valued OpRethConfig that callers can mutate via OpRethOptions.

type OpRethOption added in v1.18.0

type OpRethOption interface {
	Apply(p devtest.T, target ComponentTarget, cfg *OpRethConfig)
}

OpRethOption customises an OpRethConfig for a specific component target.

func OpRethWithExtraArgs added in v1.18.0

func OpRethWithExtraArgs(args ...string) OpRethOption

OpRethWithExtraArgs appends raw CLI arguments to the op-reth invocation.

func OpRethWithSDMEnabled added in v1.18.0

func OpRethWithSDMEnabled() OpRethOption

OpRethWithSDMEnabled enables Sequencer-Defined Metering on the op-reth node.

func OpRethWithSupervisorURL added in v1.18.0

func OpRethWithSupervisorURL(supervisorURL string) OpRethOption

OpRethWithSupervisorURL wires the op-reth node to the given supervisor HTTP endpoint. An empty supervisorURL is a no-op so callers can pass the value unconditionally.

type OpRethOptionBundle added in v1.18.0

type OpRethOptionBundle []OpRethOption

OpRethOptionBundle applies multiple OpRethOptions in order.

func (OpRethOptionBundle) Apply added in v1.18.0

func (b OpRethOptionBundle) Apply(p devtest.T, target ComponentTarget, cfg *OpRethConfig)

Apply runs each contained option against cfg, failing the test on a nil entry.

type OpRethOptionFn added in v1.18.0

type OpRethOptionFn func(p devtest.T, target ComponentTarget, cfg *OpRethConfig)

OpRethOptionFn adapts a plain function into an OpRethOption.

func (OpRethOptionFn) Apply added in v1.18.0

func (fn OpRethOptionFn) Apply(p devtest.T, target ComponentTarget, cfg *OpRethConfig)

Apply invokes the underlying function against the supplied config.

type OpSupervisor

type OpSupervisor struct {
	// contains filtered or unexported fields
}

func (*OpSupervisor) Start

func (s *OpSupervisor) Start()

func (*OpSupervisor) Stop

func (s *OpSupervisor) Stop()

func (*OpSupervisor) UserRPC

func (s *OpSupervisor) UserRPC() string

type PreGenesisSuperGameConfig

type PreGenesisSuperGameConfig struct {
	ClaimedOutputs []eth.Bytes32
}

type PresetConfig

type PresetConfig struct {
	LocalContractArtifactsPath string
	DeployerOptions            []DeployerOption
	BatcherOptions             []BatcherOption
	ProposerOptions            []ProposerOption
	OPRBuilderOptions          []OPRBuilderNodeOption
	GlobalL2CLOptions          []L2CLOption
	GlobalSyncTesterELOptions  []SyncTesterELOption
	L1ELKind                   string
	L1GethExecPath             string
	AddedGameTypes             []gameTypes.GameType
	RespectedGameTypes         []gameTypes.GameType
	EnableTimeTravel           bool
	MaxSequencingWindow        *uint64
	RequireInteropNotAtGen     bool
	MessageExpiryWindow        *uint64
	UseInteropFilter           bool
	// InteropLogBackfillDepth, if non-zero, configures the supernode to backfill
	// initiating-message logs backward from the tip by this duration at startup.
	InteropLogBackfillDepth time.Duration
	PreGenesisSuperGame     *PreGenesisSuperGameConfig
	// SkipHonestProposer skips starting op-proposer.
	SkipHonestProposer bool
}

PresetConfig captures preset constructor mutations. It is independent from orchestrator lifecycle hooks.

func NewPresetConfig

func NewPresetConfig() PresetConfig

type PrometheusMetricsTarget

type PrometheusMetricsTarget string

func NewPrometheusMetricsTarget

func NewPrometheusMetricsTarget(host string, port string, isRunningInDocker bool) PrometheusMetricsTarget

type Proposal

type Proposal struct {
	Root             common.Hash
	L2SequenceNumber *big.Int
}

Proposal matches the Solidity Proposal struct: (bytes32 root, uint256 l2SequenceNumber)

type ProposerOption

type ProposerOption func(target ComponentTarget, cfg *ps.CLIConfig)

type RollupBoostConfig

type RollupBoostConfig struct {
	// RPC endpoint for rollup-boost itself
	RPCHost string
	RPCPort uint16

	// Flashblocks proxy WebSocket exposure
	EnableFlashblocks bool
	FlashblocksHost   string
	FlashblocksPort   int

	// L2 engine connection details (HTTP(S))
	L2EngineURL string
	L2JWTPath   string

	// Builder engine connection details (HTTP(S))
	BuilderURL            string
	BuilderJWTPath        string
	FlashblocksBuilderURL string // upstream builder WS url (e.g. op-rbuilder ws)

	// Other settings
	ExecutionMode string // e.g. "enabled"
	LogFormat     string // e.g. "json"

	// Debug server
	DebugHost string
	DebugPort int

	// Optional WS headers to expose to clients through the proxy
	Headers http.Header

	// Env variables for the subprocess
	Env []string
	// ExtraArgs appended to the generated CLI (last-flag-wins semantics)
	ExtraArgs []string
}

RollupBoostConfig configures the rollup-boost process CLI and environment.

func DefaultRollupBoostConfig

func DefaultRollupBoostConfig() *RollupBoostConfig

func (*RollupBoostConfig) LaunchSpec

func (cfg *RollupBoostConfig) LaunchSpec(p devtest.CommonT) (args []string, env []string)

type RollupBoostNode

type RollupBoostNode struct {
	// contains filtered or unexported fields
}

RollupBoostNode is a lightweight sysgo-managed process wrapper around a rollup-boost WebSocket stream source. It exposes a stable proxied ws URL and hydrates the L2 network with a shared WSClient that points at it.

func (*RollupBoostNode) EngineRPC

func (r *RollupBoostNode) EngineRPC() string

func (*RollupBoostNode) FlashblocksWSURL

func (r *RollupBoostNode) FlashblocksWSURL() string

func (*RollupBoostNode) JWTPath

func (r *RollupBoostNode) JWTPath() string

func (*RollupBoostNode) Start

func (r *RollupBoostNode) Start()

func (*RollupBoostNode) Stop

func (r *RollupBoostNode) Stop()

func (*RollupBoostNode) UserRPC

func (r *RollupBoostNode) UserRPC() string

type RpcCaller

type RpcCaller interface {
	CallContext(ctx context.Context, result interface{}, method string, args ...interface{}) error
}

type RulesConfig

type RulesConfig struct {
	File []struct {
		Path string `yaml:"path"`
	} `yaml:"file"`
	RefreshInterval int `yaml:"refresh_interval"`
}

type SingleChainInteropSupport

type SingleChainInteropSupport struct {
	Migration     *interopMigrationState
	FullConfigSet depset.FullConfigSetMerged
	DependencySet depset.DependencySet
	Supervisor    Supervisor
}

type SingleChainNodeRuntime

type SingleChainNodeRuntime struct {
	Name        string
	IsSequencer bool
	EL          L2ELNode
	CL          L2CLNode
}

type SingleChainRuntime

type SingleChainRuntime struct {
	Keys devkeys.Keys

	L1Network *L1Network
	L2Network *L2Network

	L1EL *L1Geth
	L1CL *L1CLNode

	L2EL L2ELNode
	L2CL L2CLNode

	L2Batcher    *L2Batcher
	L2Proposer   *L2Proposer
	L2Challenger *L2Challenger

	FaucetService *faucet.Service
	TimeTravel    *clock.AdvancingClock
	TestSequencer *TestSequencerRuntime

	Nodes       map[string]*SingleChainNodeRuntime
	SyncTester  *SyncTesterRuntime
	Conductors  map[string]*Conductor
	Flashblocks *FlashblocksRuntimeSupport
	Interop     *SingleChainInteropSupport
	P2PEnabled  bool
}

func NewFlashblocksRuntime

func NewFlashblocksRuntime(t devtest.T) *SingleChainRuntime

func NewFlashblocksRuntimeWithConfig

func NewFlashblocksRuntimeWithConfig(t devtest.T, cfg PresetConfig) *SingleChainRuntime

func NewMinimalInteropNoSupervisorRuntime

func NewMinimalInteropNoSupervisorRuntime(t devtest.T) *SingleChainRuntime

NewMinimalInteropNoSupervisorRuntime constructs the single-chain interop world without supervisor wiring.

func NewMinimalRuntime

func NewMinimalRuntime(t devtest.T) *SingleChainRuntime

SingleChainRuntime is the shared DAG runtime for single-chain preset topologies. It is the root for minimal, flashblocks, follower-node, sync-tester, conductor, and no-supervisor interop variants.

func NewMinimalRuntimeWithConfig

func NewMinimalRuntimeWithConfig(t devtest.T, cfg PresetConfig) *SingleChainRuntime

func NewMinimalWithConductorsRuntime

func NewMinimalWithConductorsRuntime(t devtest.T) *SingleChainRuntime

func NewMinimalWithConductorsRuntimeWithConfig

func NewMinimalWithConductorsRuntimeWithConfig(t devtest.T, cfg PresetConfig) *SingleChainRuntime

func NewSimpleWithSyncTesterRuntime

func NewSimpleWithSyncTesterRuntime(t devtest.T) *SingleChainRuntime

func NewSimpleWithSyncTesterRuntimeWithConfig

func NewSimpleWithSyncTesterRuntimeWithConfig(t devtest.T, cfg PresetConfig) *SingleChainRuntime

func NewSingleChainMultiNodeRuntime

func NewSingleChainMultiNodeRuntime(t devtest.T, withP2P bool) *SingleChainRuntime

func NewSingleChainMultiNodeRuntimeWithConfig

func NewSingleChainMultiNodeRuntimeWithConfig(t devtest.T, withP2P bool, cfg PresetConfig) *SingleChainRuntime

func NewSingleChainTwoVerifiersRuntime

func NewSingleChainTwoVerifiersRuntime(t devtest.T) *SingleChainRuntime

func NewSingleChainTwoVerifiersRuntimeWithConfig

func NewSingleChainTwoVerifiersRuntimeWithConfig(t devtest.T, cfg PresetConfig) *SingleChainRuntime

func (*SingleChainRuntime) VMConfig added in v1.18.0

func (r *SingleChainRuntime) VMConfig(t devtest.T, dir string) *vm.Config

type SubProcess

type SubProcess struct {
	// contains filtered or unexported fields
}

SubProcess is a process that can be started and stopped.

func NewSubProcess

func NewSubProcess(p devtest.CommonT, stdOutCallback, stdErrCallback logpipe.LogCallback) *SubProcess

func (*SubProcess) Start

func (sp *SubProcess) Start(cmdPath string, args []string, env []string) error

func (*SubProcess) Stop

func (sp *SubProcess) Stop(interrupt bool) error

Stop waits for the process to stop, interrupting the process if it has not completed and interrupt is true.

type SuperNode

type SuperNode struct {
	// contains filtered or unexported fields
}

func (*SuperNode) InteropActivity

func (n *SuperNode) InteropActivity() *interop.Interop

InteropActivity returns the interop activity running inside the supernode, or nil if the supernode is stopped or has no interop activity. Callers must not cache the returned pointer across RestartInteropActivity, which swaps the activity for a fresh instance. For integration test control only.

func (*SuperNode) InteropRPC

func (n *SuperNode) InteropRPC() (endpoint string, jwtSecret eth.Bytes32)

func (*SuperNode) RestartInteropActivity

func (n *SuperNode) RestartInteropActivity(wipeLogsDBs bool) error

RestartInteropActivity stops the running interop activity, optionally wipes its on-disk logs DBs, and launches a fresh instance against the still-running supernode. For integration test control only.

func (*SuperNode) Start

func (n *SuperNode) Start()

func (*SuperNode) Stop

func (n *SuperNode) Stop()

func (*SuperNode) UserRPC

func (n *SuperNode) UserRPC() string

type SuperNodeProxy

type SuperNodeProxy struct {
	// contains filtered or unexported fields
}

SuperNodeProxy is a thin wrapper that points to a shared supernode instance.

func (*SuperNodeProxy) InteropRPC

func (n *SuperNodeProxy) InteropRPC() (endpoint string, jwtSecret eth.Bytes32)

func (*SuperNodeProxy) Start

func (n *SuperNodeProxy) Start()

func (*SuperNodeProxy) Stop

func (n *SuperNodeProxy) Stop()

func (*SuperNodeProxy) UserRPC

func (n *SuperNodeProxy) UserRPC() string

type SuperchainDeployment

type SuperchainDeployment struct {
	// contains filtered or unexported fields
}

func (*SuperchainDeployment) SuperchainConfigAddr

func (d *SuperchainDeployment) SuperchainConfigAddr() common.Address

type SupernodeConfig

type SupernodeConfig struct {
	// InteropActivationTimestamp enables the interop activity at the given timestamp.
	// Set to nil to disable interop (default). Non-nil (including 0) enables interop.
	InteropActivationTimestamp *uint64

	// UseGenesisInterop, when true, sets InteropActivationTimestamp to the genesis
	// timestamp of the first configured chain at deploy time. Takes effect inside
	// withSharedSupernodeCLsImpl after deployment, when the genesis time is known.
	UseGenesisInterop bool
}

SupernodeConfig holds configuration options for the shared supernode.

type SupernodeOption

type SupernodeOption func(*SupernodeConfig)

SupernodeOption is a functional option for configuring the supernode.

func WithSupernodeInterop

func WithSupernodeInterop(activationTimestamp uint64) SupernodeOption

WithSupernodeInterop enables the interop activity with the given activation timestamp.

func WithSupernodeInteropAtGenesis

func WithSupernodeInteropAtGenesis() SupernodeOption

WithSupernodeInteropAtGenesis enables interop at the genesis timestamp of the first configured chain. The timestamp is resolved after deployment, when genesis is known.

type Supervisor

type Supervisor interface {
	stack.Lifecycle
	UserRPC() string
}

type SyncTesterEL

type SyncTesterEL struct {
	// contains filtered or unexported fields
}

SyncTesterEL is an L2ELNode implementation that runs a sync tester service. It provides RPC endpoints that can be used by CL nodes for testing sync functionality.

func (*SyncTesterEL) EngineRPC

func (n *SyncTesterEL) EngineRPC() string

func (*SyncTesterEL) JWTPath

func (n *SyncTesterEL) JWTPath() string

func (*SyncTesterEL) Start

func (n *SyncTesterEL) Start()

func (*SyncTesterEL) Stop

func (n *SyncTesterEL) Stop()

func (*SyncTesterEL) UserRPC

func (n *SyncTesterEL) UserRPC() string

type SyncTesterELConfig

type SyncTesterELConfig struct {
	FCUState     eth.FCUState
	ELSyncActive bool
}

func DefaultSyncTesterELConfig

func DefaultSyncTesterELConfig() *SyncTesterELConfig

func (*SyncTesterELConfig) Path

func (cfg *SyncTesterELConfig) Path() string

type SyncTesterELOption

type SyncTesterELOption interface {
	Apply(p devtest.T, target ComponentTarget, cfg *SyncTesterELConfig)
}

type SyncTesterELOptionBundle

type SyncTesterELOptionBundle []SyncTesterELOption

SyncTesterELOptionBundle a list of multiple SyncTesterELOption, to all be applied in order.

func (SyncTesterELOptionBundle) Apply

type SyncTesterELOptionFn

type SyncTesterELOptionFn func(p devtest.T, target ComponentTarget, cfg *SyncTesterELConfig)

func (SyncTesterELOptionFn) Apply

type SyncTesterRuntime

type SyncTesterRuntime struct {
	Service *SyncTesterService
	Node    *SingleChainNodeRuntime
}

type SyncTesterService

type SyncTesterService struct {
	// contains filtered or unexported fields
}

Caveat: id is binded by a single EL(chainID), but service can support multiple ELs

func (*SyncTesterService) DefaultEndpoint

func (n *SyncTesterService) DefaultEndpoint(chainID eth.ChainID) (string, string, bool)

func (*SyncTesterService) RPC

func (n *SyncTesterService) RPC() string

func (*SyncTesterService) SyncTesterRPCPath

func (n *SyncTesterService) SyncTesterRPCPath(chainID eth.ChainID, withSessionID bool) string

type TestSequencerRuntime

type TestSequencerRuntime struct {
	Name       string
	AdminRPC   string
	JWTSecret  [32]byte
	ControlRPC map[eth.ChainID]string
	Service    *sequencer.Service
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL