presets

package
v1.16.9 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CombinedOption added in v1.16.9

type CombinedOption []Option

func Combine added in v1.16.9

func Combine(opts ...Option) CombinedOption

type Minimal added in v1.13.4

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 added in v1.13.4

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 added in v1.16.2

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

func (*Minimal) DisputeGameFactory added in v1.14.1

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

func (*Minimal) L2Networks added in v1.13.4

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

func (*Minimal) StandardBridge added in v1.13.5

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

type MinimalInteropNoSupervisor added in v1.16.7

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 added in v1.16.7

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

NewMinimalInteropNoSupervisor creates a fresh MinimalInteropNoSupervisor target for the current test.

type MinimalWithConductors added in v1.13.4

type MinimalWithConductors struct {
	*Minimal

	ConductorSets map[eth.ChainID]dsl.ConductorSet
}

func NewMinimalWithConductors added in v1.13.4

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 MixedSingleChainFrontends added in v1.16.9

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 added in v1.16.9

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

type MixedSingleChainNodeFrontends added in v1.16.9

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

type MultiSupervisorInterop added in v1.13.4

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 added in v1.13.4

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

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

type Option added in v1.16.9

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

func AfterBuild added in v1.16.9

func AfterBuild(fn func(target any)) Option

func RequireGameTypePresent added in v1.16.3

func RequireGameTypePresent(gameType gameTypes.GameType) Option

func RequireRespectedGameType added in v1.16.3

func RequireRespectedGameType(gameType gameTypes.GameType) Option

func WithBatcherOption added in v1.16.9

func WithBatcherOption(opt sysgo.BatcherOption) Option

func WithCannonKonaGameTypeAdded added in v1.16.9

func WithCannonKonaGameTypeAdded() Option

func WithChallengerCannonKonaEnabled added in v1.16.9

func WithChallengerCannonKonaEnabled() Option

func WithDeployerOptions added in v1.16.9

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

func WithDisputeGameFinalityDelaySeconds added in v1.13.4

func WithDisputeGameFinalityDelaySeconds(seconds uint64) Option

func WithFinalizationPeriodSeconds added in v1.13.4

func WithFinalizationPeriodSeconds(n uint64) Option

func WithGameTypeAdded added in v1.16.9

func WithGameTypeAdded(gameType gameTypes.GameType) Option

func WithGlobalL2CLOption added in v1.16.9

func WithGlobalL2CLOption(opt sysgo.L2CLOption) Option

func WithGlobalSyncTesterELOption added in v1.16.9

func WithGlobalSyncTesterELOption(opt sysgo.SyncTesterELOption) Option

func WithGuardianMatchL1PAO added in v1.13.4

func WithGuardianMatchL1PAO() Option

func WithHardforkSequentialActivation added in v1.13.6

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

func WithInteropNotAtGenesis

func WithInteropNotAtGenesis() Option

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

func WithLocalContractSourcesAt added in v1.16.9

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 added in v1.16.9

func WithMaxSequencingWindow(max uint64) Option

func WithOPRBuilderOption added in v1.16.9

func WithOPRBuilderOption(opt sysgo.OPRBuilderNodeOption) Option

func WithOPRBuilderRules added in v1.16.9

func WithOPRBuilderRules(ruleContent string, refreshInterval uint64) Option

func WithProofMaturityDelaySeconds added in v1.13.4

func WithProofMaturityDelaySeconds(seconds uint64) Option

func WithProposerGameType added in v1.13.4

func WithProposerGameType(gameType gameTypes.GameType) Option

func WithProposerOption added in v1.16.9

func WithProposerOption(opt sysgo.ProposerOption) Option

func WithRequireInteropNotAtGenesis added in v1.16.9

func WithRequireInteropNotAtGenesis() Option

func WithRespectedGameType added in v1.16.3

func WithRespectedGameType(gameType gameTypes.GameType) Option

func WithRespectedGameTypeOverride added in v1.16.9

func WithRespectedGameTypeOverride(gameType gameTypes.GameType) Option

func WithSequencingWindow added in v1.13.4

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 added in v1.13.4

func WithTimeTravel() Option

func WithTimeTravelEnabled added in v1.16.9

func WithTimeTravelEnabled() Option

type SameTimestampTestSetup added in v1.16.9

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 added in v1.16.9

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 added in v1.16.9

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 added in v1.16.9

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 added in v1.16.9

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 added in v1.16.9

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 added in v1.16.9

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 added in v1.13.6

type SimpleWithSyncTester struct {
	Minimal

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

func NewSimpleWithSyncTester added in v1.13.6

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 added in v1.13.4

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 added in v1.13.4

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 added in v1.16.9

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 NewSingleChainInteropSupernodeProofs added in v1.16.9

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 added in v1.13.4

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

func (*SingleChainInterop) DisputeGameFactory added in v1.16.9

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

func (*SingleChainInterop) L2Networks added in v1.13.4

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

func (*SingleChainInterop) StandardBridge added in v1.13.5

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

type SingleChainMultiNode added in v1.13.5

type SingleChainMultiNode struct {
	Minimal

	L2ELB *dsl.L2ELNode
	L2CLB *dsl.L2CLNode
}

func NewSingleChainMultiNode added in v1.13.5

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 added in v1.14.0

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 added in v1.16.9

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 added in v1.14.3

type SingleChainMultiNodeWithTestSeq struct {
	SingleChainMultiNode

	TestSequencer *dsl.TestSequencer
}

func NewSingleChainMultiNodeWithTestSeq added in v1.14.3

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 added in v1.16.3

type SingleChainTwoVerifiers struct {
	SingleChainMultiNode

	L2ELC *dsl.L2ELNode
	L2CLC *dsl.L2CLNode

	TestSequencer *dsl.TestSequencer
}

func NewSingleChainTwoVerifiersWithoutCheck added in v1.16.3

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 added in v1.16.3

type SingleChainWithFlashblocks struct {
	*Minimal

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

func NewSingleChainWithFlashblocks added in v1.16.3

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

func (*SingleChainWithFlashblocks) AdvanceTime added in v1.16.3

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

func (*SingleChainWithFlashblocks) DisputeGameFactory added in v1.16.3

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

func (*SingleChainWithFlashblocks) L2Networks added in v1.16.3

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

func (*SingleChainWithFlashblocks) StandardBridge added in v1.16.3

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

type TwoL2 added in v1.14.3

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 added in v1.16.9

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 added in v1.16.9

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 added in v1.16.9

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 added in v1.16.7

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
	// 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 added in v1.16.7

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

NewTwoL2SupernodeInterop creates a fresh TwoL2SupernodeInterop target for the current test.

func (*TwoL2SupernodeInterop) AdvanceTime added in v1.16.7

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

AdvanceTime advances the time-travel clock if enabled.

func (*TwoL2SupernodeInterop) ForSameTimestampTesting added in v1.16.9

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 added in v1.16.7

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