presets

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: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CombinedOption

type CombinedOption []Option

func Combine

func Combine(opts ...Option) CombinedOption

type Minimal

type Minimal struct {
	Log log.Logger
	T   devtest.T

	L1Network *dsl.L1Network
	L1EL      *dsl.L1ELNode
	L1CL      *dsl.L1CLNode

	L2Chain   *dsl.L2Network
	L2Batcher *dsl.L2Batcher
	L2EL      *dsl.L2ELNode
	L2CL      *dsl.L2CLNode

	Wallet *dsl.HDWallet

	FaucetL1 *dsl.Faucet
	FaucetL2 *dsl.Faucet
	FunderL1 *dsl.Funder
	FunderL2 *dsl.Funder
	// contains filtered or unexported fields
}

func NewMinimal

func NewMinimal(t devtest.T, opts ...Option) *Minimal

NewMinimal creates a fresh Minimal target for the current test.

The target is created from the minimal runtime plus any additional preset options.

func (*Minimal) AdvanceTime

func (m *Minimal) AdvanceTime(amount time.Duration)

func (*Minimal) DisputeGameFactory

func (m *Minimal) DisputeGameFactory() *proofs.DisputeGameFactory

func (*Minimal) L2Networks

func (m *Minimal) L2Networks() []*dsl.L2Network

func (*Minimal) StandardBridge

func (m *Minimal) StandardBridge() *dsl.StandardBridge

type MinimalInteropNoSupervisor

type MinimalInteropNoSupervisor struct {
	Minimal
}

MinimalInteropNoSupervisor is like Minimal but with interop contracts deployed. No supervisor is running - this tests interop contract deployment with local finality.

func NewMinimalInteropNoSupervisor

func NewMinimalInteropNoSupervisor(t devtest.T, opts ...Option) *MinimalInteropNoSupervisor

NewMinimalInteropNoSupervisor creates a fresh MinimalInteropNoSupervisor target for the current test.

type MinimalWithConductors

type MinimalWithConductors struct {
	*Minimal

	ConductorSets map[eth.ChainID]dsl.ConductorSet
}

func NewMinimalWithConductors

func NewMinimalWithConductors(t devtest.T, opts ...Option) *MinimalWithConductors

NewMinimalWithConductors creates a fresh MinimalWithConductors target for the current test.

The target is created from the runtime plus any additional preset options.

type MinimalWithKona added in v1.18.0

type MinimalWithKona struct {
	*Minimal
	// contains filtered or unexported fields
}

MinimalWithKona embeds Minimal and bundles everything needed to run kona-host in --native mode against a live devstack.

func NewMinimalWithKona added in v1.18.0

func NewMinimalWithKona(t devtest.T, opts ...Option) *MinimalWithKona

NewMinimalWithKona creates a Minimal preset with the kona-host binary located and the chain configs needed to invoke kona natively.

func (*MinimalWithKona) RunKonaNative added in v1.18.1

func (m *MinimalWithKona) RunKonaNative(agreedBlock, claimBlock uint64) bool

type MixedSingleChainFrontends

type MixedSingleChainFrontends struct {
	L1Network     *dsl.L1Network
	L1EL          *dsl.L1ELNode
	L1CL          *dsl.L1CLNode
	L2Network     *dsl.L2Network
	L2Batcher     *dsl.L2Batcher
	FaucetL1      *dsl.Faucet
	FaucetL2      *dsl.Faucet
	TestSequencer *dsl.TestSequencer
	Nodes         []MixedSingleChainNodeFrontends
}

func NewMixedSingleChainFrontends

func NewMixedSingleChainFrontends(t devtest.T, runtime *sysgo.MixedSingleChainRuntime) *MixedSingleChainFrontends

type MixedSingleChainNodeFrontends

type MixedSingleChainNodeFrontends struct {
	Spec sysgo.MixedSingleChainNodeSpec
	EL   *dsl.L2ELNode
	CL   *dsl.L2CLNode
}

type MultiSupervisorInterop

type MultiSupervisorInterop struct {
	SimpleInterop

	// Supervisor does not support multinode so need a additional supervisor for verifier nodes
	SupervisorSecondary *dsl.Supervisor

	L2ELA2 *dsl.L2ELNode
	L2CLA2 *dsl.L2CLNode
	L2ELB2 *dsl.L2ELNode
	L2CLB2 *dsl.L2CLNode
}

func NewMultiSupervisorInterop

func NewMultiSupervisorInterop(t devtest.T, opts ...Option) *MultiSupervisorInterop

NewMultiSupervisorInterop initializes a fresh multi-supervisor interop target for the current test.

type Option

type Option interface {
	// contains filtered or unexported methods
}

func AfterBuild

func AfterBuild(fn func(target any)) Option

func RequireGameTypePresent

func RequireGameTypePresent(gameType gameTypes.GameType) Option

func RequireRespectedGameType

func RequireRespectedGameType(gameType gameTypes.GameType) Option

func WithBatcherOption

func WithBatcherOption(opt sysgo.BatcherOption) Option

func WithDeployerOptions

func WithDeployerOptions(opts ...sysgo.DeployerOption) Option

func WithDisputeGameFinalityDelaySeconds

func WithDisputeGameFinalityDelaySeconds(seconds uint64) Option

func WithFinalizationPeriodSeconds

func WithFinalizationPeriodSeconds(n uint64) Option

func WithGameTypeAdded

func WithGameTypeAdded(gameType gameTypes.GameType) Option

func WithGlobalL2CLOption

func WithGlobalL2CLOption(opt sysgo.L2CLOption) Option

func WithGlobalSyncTesterELOption

func WithGlobalSyncTesterELOption(opt sysgo.SyncTesterELOption) Option

func WithGuardianMatchL1PAO

func WithGuardianMatchL1PAO() Option

func WithHardforkSequentialActivation

func WithHardforkSequentialActivation(startFork, endFork forks.Name, delta uint64) Option

func WithInteropFilter

func WithInteropFilter() Option

WithInteropFilter enables the in-process op-interop-filter for EL transaction validation. Only supported on supernode interop presets.

func WithInteropLogBackfillDepth

func WithInteropLogBackfillDepth(d time.Duration) Option

WithInteropLogBackfillDepth configures the supernode to pre-ingest initiating-message logs backward from the tip by the given duration at startup. Zero disables backfill (the default).

func WithInteropNotAtGenesis

func WithInteropNotAtGenesis() Option

WithInteropNotAtGenesis adds a test-gate that checks if the interop hardfork is configured at a non-genesis time.

func WithKonaKarstAtGenesis added in v1.18.1

func WithKonaKarstAtGenesis() Option

WithKonaKarstAtGenesis configures kona-host to think Karst was active at genesis, regardless of what the live chain's rollup config says. Use to deliberately mismatch kona's view of the chain from the live devstack so kona disagrees on state transitions that depend on Karst.

func WithL1Geth

func WithL1Geth(execPath string) Option

func WithL2BlockTimes

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

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

func WithLocalContractSourcesAt

func WithLocalContractSourcesAt(path string) Option

WithLocalContractSourcesAt configures a preset to load local contracts-bedrock artifacts from the supplied directory instead of resolving them relative to the process working directory.

func WithMaxSequencingWindow

func WithMaxSequencingWindow(max uint64) Option

func WithMessageExpiryWindow

func WithMessageExpiryWindow(window uint64) Option

WithMessageExpiryWindow configures the message expiry window (in seconds) used by the dependency set. This controls how long cross-chain messages remain valid before they expire.

func WithOPRBuilderOption

func WithOPRBuilderOption(opt sysgo.OPRBuilderNodeOption) Option

func WithPreGenesisSuperGame

func WithPreGenesisSuperGame(claimedOutputs ...eth.Bytes32) Option

WithPreGenesisSuperGame seeds one invalid super dispute game before the rollup start block so tests can exercise supernode/challenger behaviour when a game's L1 head predates rollup genesis. The claimed outputs follow the preset chain order (`l2a`, `l2b` for two-chain presets).

func WithProofMaturityDelaySeconds

func WithProofMaturityDelaySeconds(seconds uint64) Option

func WithProposerGameType

func WithProposerGameType(gameType gameTypes.GameType) Option

func WithProposerOption

func WithProposerOption(opt sysgo.ProposerOption) Option

func WithRequireInteropNotAtGenesis

func WithRequireInteropNotAtGenesis() Option

func WithRespectedGameType

func WithRespectedGameType(gameType gameTypes.GameType) Option

func WithRespectedGameTypeOverride

func WithRespectedGameTypeOverride(gameType gameTypes.GameType) Option

func WithSequencingWindow

func WithSequencingWindow(suggestedSequencingWindow uint64, maxSequencingWindow uint64) Option

WithSequencingWindow suggests a sequencing window to use, and checks the maximum sequencing window. The sequencing windows are expressed in number of L1 execution-layer blocks till sequencing window expiry. This is applied to runtime deployment/config validation.

func WithSuggestedInteropActivationOffset

func WithSuggestedInteropActivationOffset(offset uint64) Option

WithSuggestedInteropActivationOffset suggests a hardfork time offset to use. This is applied e.g. to the deployment if running against sysgo.

func WithTimeTravel

func WithTimeTravel() Option

func WithTimeTravelEnabled

func WithTimeTravelEnabled() Option

func WithoutHonestProposer added in v1.18.1

func WithoutHonestProposer() Option

WithoutHonestProposer skips starting op-proposer.

type SameTimestampTestSetup

type SameTimestampTestSetup struct {
	*TwoL2SupernodeInterop

	// Alice is a funded EOA on chain A
	Alice *dsl.EOA
	// Bob is a funded EOA on chain B
	Bob *dsl.EOA

	// EventLoggerA is the EventLogger contract address on chain A
	EventLoggerA common.Address
	// EventLoggerB is the EventLogger contract address on chain B
	EventLoggerB common.Address

	// NextTimestamp is the timestamp that will be used for the next blocks
	NextTimestamp uint64
	// ExpectedBlockNumA is the expected block number on chain A
	ExpectedBlockNumA uint64
	// ExpectedBlockNumB is the expected block number on chain B
	ExpectedBlockNumB uint64
	// contains filtered or unexported fields
}

SameTimestampTestSetup provides a simplified setup for same-timestamp interop testing. It handles all the chain synchronization, sequencer control, and interop pausing needed to create blocks at the same timestamp on both chains.

func (*SameTimestampTestSetup) IncludeAndValidate

func (s *SameTimestampTestSetup) IncludeAndValidate(txsA, txsB []*txplan.PlannedTx, expectReplacedA, expectReplacedB bool)

IncludeAndValidate builds blocks with deterministic timestamps using the TestSequencer, then validates interop and checks for expected reorgs.

Unlike the regular sequencer which uses wall-clock time, the TestSequencer builds blocks at exactly parent.Time + blockTime, ensuring the blocks are at NextTimestamp.

func (*SameTimestampTestSetup) PrepareInitA

func (s *SameTimestampTestSetup) PrepareInitA(rng *rand.Rand, logIdx uint32) *dsl.SameTimestampPair

PrepareInitA creates a precomputed init message for chain A at the next timestamp.

func (*SameTimestampTestSetup) PrepareInitB

func (s *SameTimestampTestSetup) PrepareInitB(rng *rand.Rand, logIdx uint32) *dsl.SameTimestampPair

PrepareInitB creates a precomputed init message for chain B at the next timestamp.

type SimpleInterop

type SimpleInterop struct {
	SingleChainInterop

	L2ChainB   *dsl.L2Network
	L2BatcherB *dsl.L2Batcher
	L2ELB      *dsl.L2ELNode
	L2CLB      *dsl.L2CLNode

	FaucetB *dsl.Faucet
	FunderB *dsl.Funder
}

func NewSimpleInterop

func NewSimpleInterop(t devtest.T, opts ...Option) *SimpleInterop

NewSimpleInterop creates a fresh SimpleInterop target for the current test.

The target is created from the interop runtime plus any additional preset options.

func NewSimpleInteropIsthmusSuper

func NewSimpleInteropIsthmusSuper(t devtest.T, opts ...Option) *SimpleInterop

NewSimpleInteropIsthmusSuper creates a fresh SimpleInterop target for the current test using the Isthmus super-root system backed by op-supernode.

func NewSimpleInteropSuperProofs

func NewSimpleInteropSuperProofs(t devtest.T, opts ...Option) *SimpleInterop

NewSimpleInteropSuperProofs creates a fresh SimpleInterop target for the current test using the default super-root proofs system.

func NewSimpleInteropSupernodeProofs

func NewSimpleInteropSupernodeProofs(t devtest.T, opts ...Option) *SimpleInterop

NewSimpleInteropSupernodeProofs creates a fresh SimpleInterop target for the current test using the super-root proofs system backed by op-supernode.

func (*SimpleInterop) L2Networks

func (s *SimpleInterop) L2Networks() []*dsl.L2Network

type SimpleWithSyncTester

type SimpleWithSyncTester struct {
	Minimal

	SyncTester     *dsl.SyncTester
	SyncTesterL2EL *dsl.L2ELNode
	L2CL2          *dsl.L2CLNode
}

func NewSimpleWithSyncTester

func NewSimpleWithSyncTester(t devtest.T, opts ...Option) *SimpleWithSyncTester

NewSimpleWithSyncTester creates a fresh SimpleWithSyncTester target for the current test.

The target is created from the runtime plus any additional preset options.

type SingleChainInterop

type SingleChainInterop struct {
	Log log.Logger
	T   devtest.T

	Supervisor    *dsl.Supervisor
	SuperRoots    *dsl.Supernode
	TestSequencer *dsl.TestSequencer

	L1Network *dsl.L1Network
	L1EL      *dsl.L1ELNode
	L1CL      *dsl.L1CLNode

	L2ChainA   *dsl.L2Network
	L2BatcherA *dsl.L2Batcher
	L2ELA      *dsl.L2ELNode
	L2CLA      *dsl.L2CLNode

	Wallet *dsl.HDWallet

	FaucetA  *dsl.Faucet
	FaucetL1 *dsl.Faucet
	FunderL1 *dsl.Funder
	FunderA  *dsl.Funder
	// contains filtered or unexported fields
}

func NewSingleChainInterop

func NewSingleChainInterop(t devtest.T, opts ...Option) *SingleChainInterop

NewSingleChainInterop creates a fresh SingleChainInterop target for the current test.

The target is created from the single-chain interop runtime plus any additional preset options.

func NewSingleChainInteropIsthmusSuper

func NewSingleChainInteropIsthmusSuper(t devtest.T, opts ...Option) *SingleChainInterop

NewSingleChainInteropIsthmusSuper creates a fresh SingleChainInterop target for the current test using the single-chain Isthmus super-root system backed by op-supernode.

func NewSingleChainInteropSuperRootAtGenesis

func NewSingleChainInteropSuperRootAtGenesis(t devtest.T, opts ...Option) *SingleChainInterop

NewSingleChainInteropSuperRootAtGenesis creates a fresh SingleChainInterop target where SuperPermissionedDisputeGame is installed in the permissioned slot as part of the initial op-deployer apply - no post-deploy OPCMv2 migration runs. This exercises the initial-deploy path for super-root dispute games tracked by ethereum-optimism/optimism#18729.

func NewSingleChainInteropSupernodeProofs

func NewSingleChainInteropSupernodeProofs(t devtest.T, opts ...Option) *SingleChainInterop

NewSingleChainInteropSupernodeProofs creates a fresh SingleChainInterop target for the current test using the single-chain super-root proofs system backed by op-supernode.

func (*SingleChainInterop) AdvanceTime

func (s *SingleChainInterop) AdvanceTime(amount time.Duration)

func (*SingleChainInterop) DisputeGameFactory

func (s *SingleChainInterop) DisputeGameFactory() *proofs.DisputeGameFactory

func (*SingleChainInterop) L2Networks

func (s *SingleChainInterop) L2Networks() []*dsl.L2Network

func (*SingleChainInterop) StandardBridge

func (s *SingleChainInterop) StandardBridge(l2Chain *dsl.L2Network) *dsl.StandardBridge

type SingleChainMultiNode

type SingleChainMultiNode struct {
	Minimal

	L2ELB *dsl.L2ELNode
	L2CLB *dsl.L2CLNode
}

func NewSingleChainMultiNode

func NewSingleChainMultiNode(t devtest.T, opts ...Option) *SingleChainMultiNode

NewSingleChainMultiNode creates a fresh SingleChainMultiNode target for the current test.

The target is created from the runtime plus any additional preset options.

func NewSingleChainMultiNodeWithoutCheck

func NewSingleChainMultiNodeWithoutCheck(t devtest.T, opts ...Option) *SingleChainMultiNode

NewSingleChainMultiNodeWithoutCheck creates a fresh SingleChainMultiNode target for the current test, without running the initial verifier sync checks.

The target is created from the runtime plus any additional preset options.

func NewSingleChainMultiNodeWithoutP2PWithoutCheck

func NewSingleChainMultiNodeWithoutP2PWithoutCheck(t devtest.T, opts ...Option) *SingleChainMultiNode

NewSingleChainMultiNodeWithoutP2PWithoutCheck creates a fresh SingleChainMultiNode target without preconfigured sequencer/verifier P2P links and without running initial sync checks.

The target is created from the runtime plus any additional preset options.

type SingleChainMultiNodeWithTestSeq

type SingleChainMultiNodeWithTestSeq struct {
	SingleChainMultiNode

	TestSequencer *dsl.TestSequencer
}

func NewSingleChainMultiNodeWithTestSeq

func NewSingleChainMultiNodeWithTestSeq(t devtest.T, opts ...Option) *SingleChainMultiNodeWithTestSeq

NewSingleChainMultiNodeWithTestSeq creates a fresh SingleChainMultiNodeWithTestSeq target for the current test.

The target is created from the runtime plus any additional preset options.

type SingleChainTwoVerifiers

type SingleChainTwoVerifiers struct {
	SingleChainMultiNode

	L2ELC *dsl.L2ELNode
	L2CLC *dsl.L2CLNode

	TestSequencer *dsl.TestSequencer
}

func NewSingleChainTwoVerifiersWithoutCheck

func NewSingleChainTwoVerifiersWithoutCheck(t devtest.T, opts ...Option) *SingleChainTwoVerifiers

NewSingleChainTwoVerifiersWithoutCheck creates a fresh SingleChainTwoVerifiers target for the current test.

The target is created from the runtime plus any additional preset options.

type SingleChainWithFlashblocks

type SingleChainWithFlashblocks struct {
	*Minimal

	L2OPRBuilder  *dsl.OPRBuilderNode
	L2RollupBoost *dsl.RollupBoostNode
	TestSequencer *dsl.TestSequencer
}

func NewSingleChainWithFlashblocks

func NewSingleChainWithFlashblocks(t devtest.T, opts ...Option) *SingleChainWithFlashblocks

func (*SingleChainWithFlashblocks) AdvanceTime

func (m *SingleChainWithFlashblocks) AdvanceTime(amount time.Duration)

func (*SingleChainWithFlashblocks) DisputeGameFactory

func (m *SingleChainWithFlashblocks) DisputeGameFactory() *proofs.DisputeGameFactory

func (*SingleChainWithFlashblocks) L2Networks

func (m *SingleChainWithFlashblocks) L2Networks() []*dsl.L2Network

func (*SingleChainWithFlashblocks) StandardBridge

func (m *SingleChainWithFlashblocks) StandardBridge() *dsl.StandardBridge

type TwoL2

type TwoL2 struct {
	Log log.Logger
	T   devtest.T

	L1Network *dsl.L1Network
	L1EL      *dsl.L1ELNode
	L1CL      *dsl.L1CLNode

	L2A   *dsl.L2Network
	L2B   *dsl.L2Network
	L2ACL *dsl.L2CLNode
	L2BCL *dsl.L2CLNode
}

TwoL2 represents a two-L2 setup without interop considerations. It is useful for testing components which bridge multiple L2s without necessarily using interop.

func NewTwoL2Supernode

func NewTwoL2Supernode(t devtest.T, opts ...Option) *TwoL2

NewTwoL2Supernode creates a fresh TwoL2 target backed by a shared supernode for the current test.

type TwoL2SupernodeFollowL2

type TwoL2SupernodeFollowL2 struct {
	TwoL2SupernodeInterop

	L2AFollowEL *dsl.L2ELNode
	L2AFollowCL *dsl.L2CLNode
	L2BFollowEL *dsl.L2ELNode
	L2BFollowCL *dsl.L2CLNode
}

TwoL2SupernodeFollowL2 extends TwoL2SupernodeInterop with one follow-source follower per chain.

func NewTwoL2SupernodeFollowL2

func NewTwoL2SupernodeFollowL2(t devtest.T, delaySeconds uint64, opts ...Option) *TwoL2SupernodeFollowL2

NewTwoL2SupernodeFollowL2 creates a fresh follow-source variant of the two-L2 supernode interop preset for the current test.

type TwoL2SupernodeInterop

type TwoL2SupernodeInterop struct {
	TwoL2

	// Supernode provides access to the shared supernode for interop operations
	Supernode *dsl.Supernode

	// TestSequencer provides deterministic block building on both L2 chains.
	// Unlike the regular sequencer which uses wall-clock time, the TestSequencer
	// builds blocks at parent.Time + blockTime, making it ideal for same-timestamp tests.
	TestSequencer *dsl.TestSequencer

	// L2ELA and L2ELB provide access to the EL nodes for transaction submission
	L2ELA *dsl.L2ELNode
	L2ELB *dsl.L2ELNode

	// L2BatcherA and L2BatcherB provide access to the batchers for pausing/resuming
	L2BatcherA *dsl.L2Batcher
	L2BatcherB *dsl.L2Batcher

	// Faucets for funding test accounts
	FaucetA *dsl.Faucet
	FaucetB *dsl.Faucet

	// Wallet for test account management
	Wallet *dsl.HDWallet

	// Funders for creating funded EOAs
	FunderA *dsl.Funder
	FunderB *dsl.Funder

	// GenesisTime is the genesis timestamp of the L2 chains
	GenesisTime uint64

	// InteropActivationTime is the timestamp when interop becomes active
	InteropActivationTime uint64

	// DelaySeconds is the delay from genesis to interop activation
	DelaySeconds uint64

	// InteropFilter provides direct access to the in-process interop filter.
	// nil if not using interop filter (WithInteropFilter() not set).
	InteropFilter *sysgo.InteropFilter
	// contains filtered or unexported fields
}

TwoL2SupernodeInterop represents a two-L2 setup with a shared supernode that has interop enabled. This allows testing of cross-chain message verification at each timestamp. Use delaySeconds=0 for interop at genesis, or a positive value to test the transition.

func NewTwoL2SupernodeInterop

func NewTwoL2SupernodeInterop(t devtest.T, delaySeconds uint64, opts ...Option) *TwoL2SupernodeInterop

NewTwoL2SupernodeInterop creates a fresh TwoL2SupernodeInterop target for the current test.

func (*TwoL2SupernodeInterop) AdvanceTime

func (s *TwoL2SupernodeInterop) AdvanceTime(amount time.Duration)

AdvanceTime advances the time-travel clock if enabled.

func (*TwoL2SupernodeInterop) ForSameTimestampTesting

func (s *TwoL2SupernodeInterop) ForSameTimestampTesting(t devtest.T) *SameTimestampTestSetup

ForSameTimestampTesting sets up the system for same-timestamp interop testing. It syncs the chains, pauses interop, stops sequencers, and calculates expected positions. After calling this, you can use PrepareInitA/B to create same-timestamp message pairs.

func (*TwoL2SupernodeInterop) SuperNodeClient

func (s *TwoL2SupernodeInterop) SuperNodeClient() apis.SupernodeQueryAPI

SuperNodeClient returns an API for calling supernode-specific RPC methods like superroot_atTimestamp.

Jump to

Keyboard shortcuts

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