Documentation ¶
Index ¶
- Variables
- type Action
- type ActionStatus
- type BasicUser
- func (s *BasicUser[B]) ActCheckReceiptStatusOfLastTx(success bool) func(t Testing)
- func (s *BasicUser[B]) ActMakeTx(t Testing)
- func (s *BasicUser[B]) ActRandomTxData(t Testing)
- func (s *BasicUser[B]) ActRandomTxToAddr(t Testing)
- func (s *BasicUser[B]) ActRandomTxValue(t Testing)
- func (s *BasicUser[B]) ActResetTxOpts(t Testing)
- func (s *BasicUser[B]) ActSetTxCalldata(calldata []byte) Action
- func (s *BasicUser[B]) ActSetTxToAddr(to *common.Address) Action
- func (s *BasicUser[B]) ActSetTxValue(value *big.Int) Action
- func (s *BasicUser[B]) CheckReceipt(t Testing, success bool, txHash common.Hash) *types.Receipt
- func (s *BasicUser[B]) LastTxReceipt(t Testing) *types.Receipt
- func (s *BasicUser[B]) PendingNonce(t Testing) uint64
- func (s *BasicUser[B]) SetUserEnv(env *BasicUserEnv[B])
- func (s *BasicUser[B]) TxValue() *big.Int
- type BasicUserEnv
- type BatcherCfg
- type BlocksAPI
- type ChannelOutIface
- type CrossLayerUser
- func (s *CrossLayerUser) ActCheckDepositStatus(l1Success, l2Success bool) Action
- func (s *CrossLayerUser) ActCheckStartWithdrawal(success bool) Action
- func (s *CrossLayerUser) ActCompleteWithdrawal(t Testing)
- func (s *CrossLayerUser) ActDeposit(t Testing)
- func (s *CrossLayerUser) ActProveWithdrawal(t Testing)
- func (s *CrossLayerUser) ActResolve(t Testing)
- func (s *CrossLayerUser) ActResolveClaim(t Testing)
- func (s *CrossLayerUser) ActStartWithdrawal(t Testing)
- func (s *CrossLayerUser) Address() common.Address
- func (s *CrossLayerUser) CheckDepositTx(t Testing, l1TxHash common.Hash, index int, l1Success, l2Success bool)
- func (s *CrossLayerUser) CompleteWithdrawal(t Testing, l2TxHash common.Hash) common.Hash
- func (s *CrossLayerUser) ProveWithdrawal(t Testing, l2TxHash common.Hash) common.Hash
- func (s *CrossLayerUser) Resolve(t Testing, l2TxHash common.Hash) common.Hash
- func (s *CrossLayerUser) ResolveClaim(t Testing, l2TxHash common.Hash) common.Hash
- type EngineOption
- type GarbageChannelCfg
- type GarbageChannelOut
- func (co *GarbageChannelOut) AddBlock(rollupCfg *rollup.Config, block *types.Block) error
- func (co *GarbageChannelOut) Close() error
- func (co *GarbageChannelOut) Flush() error
- func (co *GarbageChannelOut) ID() derive.ChannelID
- func (co *GarbageChannelOut) OutputFrame(w *bytes.Buffer, maxSize uint64) (uint16, error)
- func (co *GarbageChannelOut) ReadyBytes() int
- func (co *GarbageChannelOut) Reset() error
- type GarbageKind
- type L1Bindings
- type L1CanonSrc
- type L1Miner
- func (s *L1Miner) ActEmptyBlock(t Testing)
- func (s *L1Miner) ActL1EndBlock(t Testing)
- func (s *L1Miner) ActL1IncludeTx(from common.Address) Action
- func (s *L1Miner) ActL1IncludeTxByHash(txHash common.Hash) Action
- func (s *L1Miner) ActL1SetFeeRecipient(coinbase common.Address)
- func (s *L1Miner) ActL1StartBlock(timeDelta uint64) Action
- func (s *L1Miner) BlobStore() derive.L1BlobsFetcher
- func (s *L1Miner) Close() error
- func (s *L1Miner) IncludeTx(t Testing, tx *types.Transaction)
- type L1Replica
- func (s *L1Replica) ActL1Finalize(t Testing, num uint64)
- func (s *L1Replica) ActL1FinalizeNext(t Testing)
- func (s *L1Replica) ActL1RPCFail(t Testing)
- func (s *L1Replica) ActL1RewindDepth(depth uint64) Action
- func (s *L1Replica) ActL1RewindToParent(t Testing)
- func (s *L1Replica) ActL1Safe(t Testing, num uint64)
- func (s *L1Replica) ActL1SafeNext(t Testing)
- func (s *L1Replica) ActL1Sync(canonL1 func(num uint64) *types.Block) Action
- func (s *L1Replica) CanonL1Chain() func(num uint64) *types.Block
- func (s *L1Replica) Close() error
- func (s *L1Replica) EthClient() *ethclient.Client
- func (s *L1Replica) FinalizedNum() uint64
- func (s *L1Replica) L1Client(t Testing, cfg *rollup.Config) *sources.L1Client
- func (s *L1Replica) MockL1RPCErrors(fn func() error)
- func (s *L1Replica) RPCClient() client.RPC
- func (s *L1Replica) SafeNum() uint64
- func (s *L1Replica) UnsafeNum() uint64
- type L1TxAPI
- type L1User
- type L2API
- type L2Batcher
- func (s *L2Batcher) ActBufferAll(t Testing)
- func (s *L2Batcher) ActL2BatchBuffer(t Testing)
- func (s *L2Batcher) ActL2BatchSubmit(t Testing, txOpts ...func(tx *types.DynamicFeeTx))
- func (s *L2Batcher) ActL2BatchSubmitGarbage(t Testing, kind GarbageKind)
- func (s *L2Batcher) ActL2BatchSubmitMultiBlob(t Testing, numBlobs int)
- func (s *L2Batcher) ActL2ChannelClose(t Testing)
- func (s *L2Batcher) ActSubmitAll(t Testing)
- func (s *L2Batcher) ActSubmitAllMultiBlobs(t Testing, numBlobs int)
- func (s *L2Batcher) Buffer(t Testing) error
- func (s *L2Batcher) SubmittingData() bool
- type L2Bindings
- type L2BlockRefs
- type L2Engine
- func (e *L2Engine) ActL2IncludeTx(from common.Address) Action
- func (e *L2Engine) ActL2RPCFail(t Testing, err error)
- func (s *L2Engine) AddPeers(peers ...*enode.Node)
- func (e *L2Engine) Close() error
- func (e *L2Engine) EngineClient(t Testing, cfg *rollup.Config) *sources.EngineClient
- func (s *L2Engine) Enode() *enode.Node
- func (s *L2Engine) EthClient() *ethclient.Client
- func (s *L2Engine) GethClient() *gethclient.Client
- func (s *L2Engine) PeerCount() int
- func (e *L2Engine) RPCClient() client.RPC
- type L2Proposer
- type L2Sequencer
- func (s *L2Sequencer) ActBuildL2ToEcotone(t Testing)
- func (s *L2Sequencer) ActBuildL2ToFjord(t Testing)
- func (s *L2Sequencer) ActBuildL2ToTime(t Testing, target uint64)
- func (s *L2Sequencer) ActBuildToL1Head(t Testing)
- func (s *L2Sequencer) ActBuildToL1HeadExcl(t Testing)
- func (s *L2Sequencer) ActBuildToL1HeadExclUnsafe(t Testing)
- func (s *L2Sequencer) ActBuildToL1HeadUnsafe(t Testing)
- func (s *L2Sequencer) ActL2EndBlock(t Testing)
- func (s *L2Sequencer) ActL2KeepL1Origin(t Testing)
- func (s *L2Sequencer) ActL2StartBlock(t Testing)
- func (s *L2Sequencer) ActL2StartBlockCheckErr(t Testing, checkErr error)
- type L2User
- type L2Verifier
- func (s *L2Verifier) ActL1FinalizedSignal(t Testing)
- func (s *L2Verifier) ActL1HeadSignal(t Testing)
- func (s *L2Verifier) ActL1SafeSignal(t Testing)
- func (s *L2Verifier) ActL2InsertUnsafePayload(payload *eth.ExecutionPayloadEnvelope) Action
- func (s *L2Verifier) ActL2PipelineFull(t Testing)
- func (s *L2Verifier) ActL2PipelineStep(t Testing)
- func (s *L2Verifier) ActL2UnsafeGossipReceive(payload *eth.ExecutionPayloadEnvelope) Action
- func (s *L2Verifier) ActRPCFail(t Testing)
- func (s *L2Verifier) L2BackupUnsafe() eth.L2BlockRef
- func (s *L2Verifier) L2Finalized() eth.L2BlockRef
- func (s *L2Verifier) L2PendingSafe() eth.L2BlockRef
- func (s *L2Verifier) L2Safe() eth.L2BlockRef
- func (s *L2Verifier) L2Unsafe() eth.L2BlockRef
- func (s *L2Verifier) RPCClient() client.RPC
- func (s *L2Verifier) RollupClient() *sources.RollupClient
- func (s *L2Verifier) SyncStatus() *eth.SyncStatus
- type MockL1OriginSelector
- type PlasmaInputSetter
- type ProposerCfg
- type StatefulTesting
- type SyncStatusAPI
- type Testing
- type Writer
Constants ¶
This section is empty.
Variables ¶
var GarbageKinds = []GarbageKind{ STRIP_VERSION, RANDOM, TRUNCATE_END, DIRTY_APPEND, INVALID_COMPRESSION, MALFORM_RLP, }
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action func(t Testing)
Action is a function that may change the state of one or more actors or check their state. Action definitions are meant to be very small building blocks, and then composed into larger patterns to write more elaborate tests.
type ActionStatus ¶
type ActionStatus uint
ActionStatus defines the state of an action, to make a basic distinction between InvalidAction() and other calls.
const ( // ActionOK indicates the action is valid to apply ActionOK ActionStatus = iota // ActionInvalid indicates the action is not applicable, and a different next action may taken. ActionInvalid )
type BasicUser ¶
type BasicUser[B any] struct { // contains filtered or unexported fields }
BasicUser is an actor on a single ethereum layer, with one account key. The user maintains a set of standard txOpts to build its transactions with, along with configurable txToAddr and txCallData. The user has an RNG source with actions to randomize its transaction building.
func NewBasicUser ¶
func (*BasicUser[B]) ActCheckReceiptStatusOfLastTx ¶
func (*BasicUser[B]) ActMakeTx ¶
ActMakeTx makes a tx with the predetermined contents (see randomization and other actions) and sends it to the tx pool
func (*BasicUser[B]) ActRandomTxData ¶
func (*BasicUser[B]) ActRandomTxToAddr ¶
func (*BasicUser[B]) ActRandomTxValue ¶
func (*BasicUser[B]) ActResetTxOpts ¶
ActResetTxOpts prepares the tx options to default values, based on the current pending block header.
func (*BasicUser[B]) ActSetTxCalldata ¶
func (*BasicUser[B]) ActSetTxToAddr ¶
func (*BasicUser[B]) CheckReceipt ¶
func (*BasicUser[B]) PendingNonce ¶
func (*BasicUser[B]) SetUserEnv ¶
func (s *BasicUser[B]) SetUserEnv(env *BasicUserEnv[B])
SetUserEnv changes the user environment. This way a user can be initialized before being embedded in a genesis allocation, and change between different endpoints that may be initialized after the user.
type BasicUserEnv ¶
type BasicUserEnv[B any] struct { EthCl *ethclient.Client Signer types.Signer AddressCorpora []common.Address Bindings B }
BasicUserEnv provides access to the eth RPC, signer, and contract bindings for a single ethereum layer. This environment can be shared between different BasicUser instances.
type BatcherCfg ¶
type BatcherCfg struct { // Limit the size of txs MinL1TxSize uint64 MaxL1TxSize uint64 BatcherKey *ecdsa.PrivateKey GarbageCfg *GarbageChannelCfg ForceSubmitSingularBatch bool ForceSubmitSpanBatch bool UsePlasma bool DataAvailabilityType batcherFlags.DataAvailabilityType PlasmaDA PlasmaInputSetter }
func DefaultBatcherCfg ¶
func DefaultBatcherCfg(dp *e2eutils.DeployParams) *BatcherCfg
func PlasmaBatcherCfg ¶
func PlasmaBatcherCfg(dp *e2eutils.DeployParams, plasmaDa PlasmaInputSetter) *BatcherCfg
type ChannelOutIface ¶
type ChannelOutIface interface { ID() derive.ChannelID Reset() error AddBlock(rollupCfg *rollup.Config, block *types.Block) error ReadyBytes() int Flush() error Close() error OutputFrame(w *bytes.Buffer, maxSize uint64) (uint16, error) }
ChannelOutIface is the interface implemented by ChannelOut & GarbageChannelOut
type CrossLayerUser ¶
CrossLayerUser represents the same user account on L1 and L2, and provides actions to make cross-layer transactions.
func NewCrossLayerUser ¶
func NewCrossLayerUser(log log.Logger, priv *ecdsa.PrivateKey, rng *rand.Rand) *CrossLayerUser
func (*CrossLayerUser) ActCheckDepositStatus ¶
func (s *CrossLayerUser) ActCheckDepositStatus(l1Success, l2Success bool) Action
func (*CrossLayerUser) ActCheckStartWithdrawal ¶
func (s *CrossLayerUser) ActCheckStartWithdrawal(success bool) Action
ActCheckStartWithdrawal checks that a previous witdrawal tx was either successful or failed.
func (*CrossLayerUser) ActCompleteWithdrawal ¶
func (s *CrossLayerUser) ActCompleteWithdrawal(t Testing)
ActCompleteWithdrawal creates a L1 withdrawal finalization tx for latest withdrawal. The tx hash is remembered as the last L1 tx, to check as L1 actor. The withdrawal functions like CompleteWithdrawal
func (*CrossLayerUser) ActDeposit ¶
func (s *CrossLayerUser) ActDeposit(t Testing)
func (*CrossLayerUser) ActProveWithdrawal ¶
func (s *CrossLayerUser) ActProveWithdrawal(t Testing)
ActCompleteWithdrawal creates a L1 proveWithdrawal tx for latest withdrawal. The tx hash is remembered as the last L1 tx, to check as L1 actor.
func (*CrossLayerUser) ActResolve ¶
func (s *CrossLayerUser) ActResolve(t Testing)
ActResolve creates a L1 resolve tx for the latest withdrawal. Resolve is different than resolving a claim, the root claim must be resolved first and then the game itself can be resolved.
func (*CrossLayerUser) ActResolveClaim ¶
func (s *CrossLayerUser) ActResolveClaim(t Testing)
ActResolveClaim creates a L1 resolveClaim tx for the latest withdrawal.
func (*CrossLayerUser) ActStartWithdrawal ¶
func (s *CrossLayerUser) ActStartWithdrawal(t Testing)
func (*CrossLayerUser) Address ¶
func (s *CrossLayerUser) Address() common.Address
func (*CrossLayerUser) CheckDepositTx ¶
func (*CrossLayerUser) CompleteWithdrawal ¶
CompleteWithdrawal creates a L1 withdrawal finalization tx for the given L2 withdrawal tx, returning the tx hash. It's an invalid action to attempt to complete a withdrawal that has not passed the L1 finalization period yet
func (*CrossLayerUser) ProveWithdrawal ¶
ProveWithdrawal creates a L1 proveWithdrawal tx for the given L2 withdrawal tx, returning the tx hash.
func (*CrossLayerUser) Resolve ¶
Resolve creates a L1 resolve tx for the given L2 withdrawal tx, returning the tx hash.
func (*CrossLayerUser) ResolveClaim ¶
ResolveClaim creates a L1 resolveClaim tx for the given L2 withdrawal tx, returning the tx hash.
type GarbageChannelCfg ¶
type GarbageChannelCfg struct {
// contains filtered or unexported fields
}
GarbageChannelCfg is the configuration for a `GarbageChannelOut`
type GarbageChannelOut ¶
type GarbageChannelOut struct {
// contains filtered or unexported fields
}
GarbageChannelOut is a modified `derive.ChannelOut` that can be configured to behave differently than the original
func NewGarbageChannelOut ¶
func NewGarbageChannelOut(cfg *GarbageChannelCfg) (*GarbageChannelOut, error)
NewGarbageChannelOut creates a new `GarbageChannelOut` with the given configuration.
func (*GarbageChannelOut) AddBlock ¶
AddBlock adds a block to the channel. It returns an error if there is a problem adding the block. The only sentinel error that it returns is ErrTooManyRLPBytes. If this error is returned, the channel should be closed and a new one should be made.
func (*GarbageChannelOut) Close ¶
func (co *GarbageChannelOut) Close() error
func (*GarbageChannelOut) Flush ¶
func (co *GarbageChannelOut) Flush() error
Flush flushes the internal compression stage to the ready buffer. It enables pulling a larger & more complete frame. It reduces the compression efficiency.
func (*GarbageChannelOut) ID ¶
func (co *GarbageChannelOut) ID() derive.ChannelID
func (*GarbageChannelOut) OutputFrame ¶
OutputFrame writes a frame to w with a given max size Use `ReadyBytes`, `Flush`, and `Close` to modify the ready buffer. Returns io.EOF when the channel is closed & there are no more frames Returns nil if there is still more buffered data. Returns and error if it ran into an error during processing.
func (*GarbageChannelOut) ReadyBytes ¶
func (co *GarbageChannelOut) ReadyBytes() int
ReadyBytes returns the number of bytes that the channel out can immediately output into a frame. Use `Flush` or `Close` to move data from the compression buffer into the ready buffer if more bytes are needed. Add blocks may add to the ready buffer, but it is not guaranteed due to the compression stage.
func (*GarbageChannelOut) Reset ¶
func (co *GarbageChannelOut) Reset() error
TODO: reuse ChannelOut for performance
type GarbageKind ¶
type GarbageKind int64
const ( STRIP_VERSION GarbageKind = iota RANDOM TRUNCATE_END DIRTY_APPEND INVALID_COMPRESSION MALFORM_RLP )
type L1Bindings ¶
type L1Bindings struct { // contract bindings OptimismPortal *bindings.OptimismPortal L2OutputOracle *bindings.L2OutputOracle OptimismPortal2 *bindingspreview.OptimismPortal2 DisputeGameFactory *bindings.DisputeGameFactory }
func NewL1Bindings ¶
func NewL1Bindings(t Testing, l1Cl *ethclient.Client) *L1Bindings
type L1CanonSrc ¶
L1CanonSrc is used to sync L1 from another node. The other node always has the canonical chain. May be nil if there is nothing to sync from
type L1Miner ¶
type L1Miner struct { L1Replica // contains filtered or unexported fields }
L1Miner wraps a L1Replica with instrumented block building ability.
func NewL1Miner ¶
NewL1Miner creates a new L1Replica that can also build blocks.
func (*L1Miner) ActEmptyBlock ¶
func (*L1Miner) ActL1EndBlock ¶
ActL1EndBlock finishes the new L1 block, and applies it to the chain as unsafe block
func (*L1Miner) ActL1IncludeTx ¶
ActL1IncludeTx includes the next tx from L1 tx pool from the given account
func (*L1Miner) ActL1IncludeTxByHash ¶
ActL1IncludeTxByHash tries to include a tx by tx-hash.
func (*L1Miner) ActL1SetFeeRecipient ¶
func (*L1Miner) ActL1StartBlock ¶
ActL1StartBlock returns an action to build a new L1 block on top of the head block, with timeDelta added to the head block time.
func (*L1Miner) BlobStore ¶
func (s *L1Miner) BlobStore() derive.L1BlobsFetcher
type L1Replica ¶
type L1Replica struct {
// contains filtered or unexported fields
}
L1Replica is an instrumented in-memory L1 geth node that: - can sync from the given canonical L1 blocks source - can rewind the chain back (for reorgs) - can provide an RPC with mock errors
func NewL1Replica ¶
NewL1Replica constructs a L1Replica starting at the given genesis.
func (*L1Replica) ActL1Finalize ¶
ActL1Finalize finalizes a later block, which must be marked as safe before doing so (see ActL1SafeNext).
func (*L1Replica) ActL1FinalizeNext ¶
ActL1FinalizeNext finalizes the next block, which must be marked as safe before doing so (see ActL1SafeNext).
func (*L1Replica) ActL1RPCFail ¶
ActL1RPCFail makes the next L1 RPC request to this node fail
func (*L1Replica) ActL1RewindDepth ¶
func (*L1Replica) ActL1RewindToParent ¶
ActL1RewindToParent rewinds the L1 chain to parent block of head
func (*L1Replica) ActL1SafeNext ¶
ActL1SafeNext marks the next unsafe block as safe.
func (*L1Replica) ActL1Sync ¶
ActL1Sync processes the next canonical L1 block, or rewinds one block if the canonical block cannot be applied to the head.
func (*L1Replica) FinalizedNum ¶
func (*L1Replica) MockL1RPCErrors ¶
type L1User ¶
type L1User struct { BasicUser[*L1Bindings] }
type L2API ¶
type L2API interface { derive.Engine L2BlockRefByNumber(ctx context.Context, num uint64) (eth.L2BlockRef, error) InfoByHash(ctx context.Context, hash common.Hash) (eth.BlockInfo, error) // GetProof returns a proof of the account, it may return a nil result without error if the address was not found. GetProof(ctx context.Context, address common.Address, storage []common.Hash, blockTag string) (*eth.AccountResult, error) OutputV0AtBlock(ctx context.Context, blockHash common.Hash) (*eth.OutputV0, error) }
type L2Batcher ¶
type L2Batcher struct { LastSubmitted *types.Transaction // contains filtered or unexported fields }
L2Batcher buffers and submits L2 batches to L1.
TODO: note the batcher shares little logic/state with actual op-batcher, tests should only use this actor to build batch contents for rollup node actors to consume, until the op-batcher is refactored and can be covered better.
func NewL2Batcher ¶
func NewL2Batcher(log log.Logger, rollupCfg *rollup.Config, batcherCfg *BatcherCfg, api SyncStatusAPI, l1 L1TxAPI, l2 BlocksAPI, engCl L2BlockRefs) *L2Batcher
func (*L2Batcher) ActBufferAll ¶
func (*L2Batcher) ActL2BatchBuffer ¶
ActL2BatchBuffer adds the next L2 block to the batch buffer. If the buffer is being submitted, the buffer is wiped.
func (*L2Batcher) ActL2BatchSubmit ¶
func (s *L2Batcher) ActL2BatchSubmit(t Testing, txOpts ...func(tx *types.DynamicFeeTx))
ActL2BatchSubmit constructs a batch tx from previous buffered L2 blocks, and submits it to L1
func (*L2Batcher) ActL2BatchSubmitGarbage ¶
func (s *L2Batcher) ActL2BatchSubmitGarbage(t Testing, kind GarbageKind)
ActL2BatchSubmitGarbage constructs a malformed channel frame and submits it to the batch inbox. This *should* cause the batch inbox to reject the blocks encoded within the frame, even if the blocks themselves are valid.
func (*L2Batcher) ActL2BatchSubmitMultiBlob ¶
func (*L2Batcher) ActL2ChannelClose ¶
func (*L2Batcher) ActSubmitAll ¶
func (*L2Batcher) ActSubmitAllMultiBlobs ¶
func (*L2Batcher) SubmittingData ¶
SubmittingData indicates if the actor is submitting buffer data. All data must be submitted before it can safely continue buffering more L2 blocks.
type L2Bindings ¶
type L2Bindings struct { L2ToL1MessagePasser *bindings.L2ToL1MessagePasser ProofClient withdrawals.ProofClient }
func NewL2Bindings ¶
func NewL2Bindings(t Testing, l2Cl *ethclient.Client, proofCl withdrawals.ProofClient) *L2Bindings
type L2BlockRefs ¶
type L2Engine ¶
type L2Engine struct {
// contains filtered or unexported fields
}
L2Engine is an in-memory implementation of the Engine API, without support for snap-sync, and no concurrency or background processes.
func NewL2Engine ¶
func (*L2Engine) ActL2IncludeTx ¶
ActL2IncludeTx includes the next transaction from the given address in the block that is being built
func (*L2Engine) ActL2RPCFail ¶
ActL2RPCFail makes the next L2 RPC request fail with given error
func (*L2Engine) EngineClient ¶
func (*L2Engine) GethClient ¶
func (s *L2Engine) GethClient() *gethclient.Client
type L2Proposer ¶
type L2Proposer struct {
// contains filtered or unexported fields
}
func NewL2Proposer ¶
func NewL2Proposer(t Testing, log log.Logger, cfg *ProposerCfg, l1 *ethclient.Client, rollupCl *sources.RollupClient) *L2Proposer
func (*L2Proposer) ActMakeProposalTx ¶
func (p *L2Proposer) ActMakeProposalTx(t Testing)
func (*L2Proposer) CanPropose ¶
func (p *L2Proposer) CanPropose(t Testing) bool
func (*L2Proposer) LastProposalTx ¶
func (p *L2Proposer) LastProposalTx() common.Hash
type L2Sequencer ¶
type L2Sequencer struct { L2Verifier // contains filtered or unexported fields }
L2Sequencer is an actor that functions like a rollup node, without the full P2P/API/Node stack, but just the derivation state, and simplified driver with sequencing ability.
func NewL2Sequencer ¶
func NewL2Sequencer(t Testing, log log.Logger, l1 derive.L1Fetcher, blobSrc derive.L1BlobsFetcher, plasmaSrc driver.PlasmaIface, eng L2API, cfg *rollup.Config, seqConfDepth uint64) *L2Sequencer
func (*L2Sequencer) ActBuildL2ToEcotone ¶
func (s *L2Sequencer) ActBuildL2ToEcotone(t Testing)
func (*L2Sequencer) ActBuildL2ToFjord ¶
func (s *L2Sequencer) ActBuildL2ToFjord(t Testing)
func (*L2Sequencer) ActBuildL2ToTime ¶
func (s *L2Sequencer) ActBuildL2ToTime(t Testing, target uint64)
func (*L2Sequencer) ActBuildToL1Head ¶
func (s *L2Sequencer) ActBuildToL1Head(t Testing)
ActBuildToL1Head builds empty blocks until (incl.) the L1 head becomes the L2 origin
func (*L2Sequencer) ActBuildToL1HeadExcl ¶
func (s *L2Sequencer) ActBuildToL1HeadExcl(t Testing)
ActBuildToL1HeadExcl builds empty blocks until (excl.) the L1 head becomes the L1 origin of the L2 head
func (*L2Sequencer) ActBuildToL1HeadExclUnsafe ¶
func (s *L2Sequencer) ActBuildToL1HeadExclUnsafe(t Testing)
ActBuildToL1HeadExclUnsafe builds empty blocks until (excl.) the L1 head becomes the L1 origin of the L2 head, without safe-head progression.
func (*L2Sequencer) ActBuildToL1HeadUnsafe ¶
func (s *L2Sequencer) ActBuildToL1HeadUnsafe(t Testing)
ActBuildToL1HeadUnsafe builds empty blocks until (incl.) the L1 head becomes the L1 origin of the L2 head
func (*L2Sequencer) ActL2EndBlock ¶
func (s *L2Sequencer) ActL2EndBlock(t Testing)
ActL2EndBlock completes a new L2 block and applies it to the L2 chain as new canonical unsafe head
func (*L2Sequencer) ActL2KeepL1Origin ¶
func (s *L2Sequencer) ActL2KeepL1Origin(t Testing)
ActL2KeepL1Origin makes the sequencer use the current L1 origin, even if the next origin is available.
func (*L2Sequencer) ActL2StartBlock ¶
func (s *L2Sequencer) ActL2StartBlock(t Testing)
ActL2StartBlock starts building of a new L2 block on top of the head
func (*L2Sequencer) ActL2StartBlockCheckErr ¶
func (s *L2Sequencer) ActL2StartBlockCheckErr(t Testing, checkErr error)
type L2User ¶
type L2User struct { BasicUser[*L2Bindings] }
type L2Verifier ¶
type L2Verifier struct {
// contains filtered or unexported fields
}
L2Verifier is an actor that functions like a rollup node, without the full P2P/API/Node stack, but just the derivation state, and simplified driver.
func NewL2Verifier ¶
func NewL2Verifier(t Testing, log log.Logger, l1 derive.L1Fetcher, blobsSrc derive.L1BlobsFetcher, plasmaSrc driver.PlasmaIface, eng L2API, cfg *rollup.Config, syncCfg *sync.Config, safeHeadListener safeDB) *L2Verifier
func (*L2Verifier) ActL1FinalizedSignal ¶
func (s *L2Verifier) ActL1FinalizedSignal(t Testing)
func (*L2Verifier) ActL1HeadSignal ¶
func (s *L2Verifier) ActL1HeadSignal(t Testing)
func (*L2Verifier) ActL1SafeSignal ¶
func (s *L2Verifier) ActL1SafeSignal(t Testing)
func (*L2Verifier) ActL2InsertUnsafePayload ¶
func (s *L2Verifier) ActL2InsertUnsafePayload(payload *eth.ExecutionPayloadEnvelope) Action
ActL2InsertUnsafePayload creates an action that can insert an unsafe execution payload
func (*L2Verifier) ActL2PipelineFull ¶
func (s *L2Verifier) ActL2PipelineFull(t Testing)
func (*L2Verifier) ActL2PipelineStep ¶
func (s *L2Verifier) ActL2PipelineStep(t Testing)
ActL2PipelineStep runs one iteration of the L2 derivation pipeline
func (*L2Verifier) ActL2UnsafeGossipReceive ¶
func (s *L2Verifier) ActL2UnsafeGossipReceive(payload *eth.ExecutionPayloadEnvelope) Action
ActL2UnsafeGossipReceive creates an action that can receive an unsafe execution payload, like gossipsub
func (*L2Verifier) ActRPCFail ¶
func (s *L2Verifier) ActRPCFail(t Testing)
ActRPCFail makes the next L2 RPC request fail
func (*L2Verifier) L2BackupUnsafe ¶
func (s *L2Verifier) L2BackupUnsafe() eth.L2BlockRef
func (*L2Verifier) L2Finalized ¶
func (s *L2Verifier) L2Finalized() eth.L2BlockRef
func (*L2Verifier) L2PendingSafe ¶
func (s *L2Verifier) L2PendingSafe() eth.L2BlockRef
func (*L2Verifier) L2Safe ¶
func (s *L2Verifier) L2Safe() eth.L2BlockRef
func (*L2Verifier) L2Unsafe ¶
func (s *L2Verifier) L2Unsafe() eth.L2BlockRef
func (*L2Verifier) RPCClient ¶
func (s *L2Verifier) RPCClient() client.RPC
func (*L2Verifier) RollupClient ¶
func (s *L2Verifier) RollupClient() *sources.RollupClient
func (*L2Verifier) SyncStatus ¶
func (s *L2Verifier) SyncStatus() *eth.SyncStatus
type MockL1OriginSelector ¶
type MockL1OriginSelector struct {
// contains filtered or unexported fields
}
MockL1OriginSelector is a shim to override the origin as sequencer, so we can force it to stay on an older origin.
func (*MockL1OriginSelector) FindL1Origin ¶
func (m *MockL1OriginSelector) FindL1Origin(ctx context.Context, l2Head eth.L2BlockRef) (eth.L1BlockRef, error)
type PlasmaInputSetter ¶
type ProposerCfg ¶
type StatefulTesting ¶
type StatefulTesting interface { Testing Reset(actionCtx context.Context) State() ActionStatus }
func NewDefaultTesting ¶
func NewDefaultTesting(tb e2eutils.TestingBase) StatefulTesting
NewDefaultTesting returns a new testing obj, and enables parallel test execution. Returns an interface, we're likely changing the behavior here as we build more action tests.
type SyncStatusAPI ¶
type SyncStatusAPI interface {
SyncStatus(ctx context.Context) (*eth.SyncStatus, error)
}
type Testing ¶
type Testing interface { e2eutils.TestingBase // Ctx shares a context to execute an action with, the test runner may interrupt the action without stopping the test. Ctx() context.Context // InvalidAction indicates the failure is due to action incompatibility, does not stop the test. InvalidAction(format string, args ...any) }
Testing is an interface to Go-like testing, extended with a context getter for the test runner to shut down individual actions without interrupting the test, and a signaling function for when an invalid action is hit. This helps custom test runners navigate slow or invalid actions, e.g. during fuzzing.