txbuilder

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrOversizedData when transaction input data is greater than a limit (DOS protection)
	ErrOversizedData       = errors.New("oversized data")
	MaxTxSizeForL1Disabled = uint64(0)
)
View Source
var MaxBatchesForL1Disabled = uint64(0)

Functions

func SequenceSanityCheck

func SequenceSanityCheck(seq *etherman.SequenceBanana) error

Types

type BananaBatch

type BananaBatch struct {
	etherman.Batch
}

func NewBananaBatch

func NewBananaBatch(batch *etherman.Batch) *BananaBatch

func (*BananaBatch) BatchNumber

func (b *BananaBatch) BatchNumber() uint64

func (BananaBatch) DeepCopy

func (b BananaBatch) DeepCopy() seqsendertypes.Batch

func (*BananaBatch) ForcedBatchTimestamp

func (b *BananaBatch) ForcedBatchTimestamp() uint64

func (*BananaBatch) ForcedBlockHashL1

func (b *BananaBatch) ForcedBlockHashL1() common.Hash

func (*BananaBatch) ForcedGlobalExitRoot

func (b *BananaBatch) ForcedGlobalExitRoot() common.Hash

func (*BananaBatch) GlobalExitRoot

func (b *BananaBatch) GlobalExitRoot() common.Hash

func (*BananaBatch) L1InfoTreeIndex

func (b *BananaBatch) L1InfoTreeIndex() uint32

func (*BananaBatch) L2Data

func (b *BananaBatch) L2Data() []byte

func (*BananaBatch) LastCoinbase

func (b *BananaBatch) LastCoinbase() common.Address

func (*BananaBatch) LastL2BLockTimestamp

func (b *BananaBatch) LastL2BLockTimestamp() uint64

func (*BananaBatch) SetL1InfoTreeIndex

func (b *BananaBatch) SetL1InfoTreeIndex(index uint32)

func (*BananaBatch) SetL2Data

func (b *BananaBatch) SetL2Data(data []byte)

func (*BananaBatch) SetLastCoinbase

func (b *BananaBatch) SetLastCoinbase(address common.Address)

func (*BananaBatch) SetLastL2BLockTimestamp

func (b *BananaBatch) SetLastL2BLockTimestamp(ts uint64)

func (*BananaBatch) String

func (b *BananaBatch) String() string

type BananaSequence

type BananaSequence struct {
	etherman.SequenceBanana
}

func NewBananaSequence

func NewBananaSequence(ult etherman.SequenceBanana) *BananaSequence

func (*BananaSequence) Batches

func (b *BananaSequence) Batches() []seqsendertypes.Batch

func (*BananaSequence) FirstBatch

func (b *BananaSequence) FirstBatch() seqsendertypes.Batch

func (*BananaSequence) IndexL1InfoRoot

func (b *BananaSequence) IndexL1InfoRoot() uint32

func (*BananaSequence) L1InfoRoot

func (b *BananaSequence) L1InfoRoot() common.Hash

func (*BananaSequence) L2Coinbase

func (b *BananaSequence) L2Coinbase() common.Address

func (*BananaSequence) LastBatch

func (b *BananaSequence) LastBatch() seqsendertypes.Batch

func (*BananaSequence) LastVirtualBatchNumber

func (b *BananaSequence) LastVirtualBatchNumber() uint64

func (*BananaSequence) Len

func (b *BananaSequence) Len() int

func (*BananaSequence) MaxSequenceTimestamp

func (b *BananaSequence) MaxSequenceTimestamp() uint64

func (*BananaSequence) SetLastVirtualBatchNumber

func (b *BananaSequence) SetLastVirtualBatchNumber(batchNumber uint64)

func (*BananaSequence) String

func (b *BananaSequence) String() string

type CondNewSequence

type CondNewSequence interface {
	// NewSequenceIfWorthToSend  Return nil, nil if the sequence is not worth sending
	NewSequenceIfWorthToSend(
		ctx context.Context, txBuilder TxBuilder, sequenceBatches []seqsendertypes.Batch, l2Coinbase common.Address,
	) (seqsendertypes.Sequence, error)
}

type ConditionalNewSequenceMaxSize

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

func NewConditionalNewSequenceMaxSize

func NewConditionalNewSequenceMaxSize(maxTxSizeForL1 uint64) *ConditionalNewSequenceMaxSize

func (*ConditionalNewSequenceMaxSize) NewSequenceIfWorthToSend

func (c *ConditionalNewSequenceMaxSize) NewSequenceIfWorthToSend(
	ctx context.Context, txBuilder TxBuilder, sequenceBatches []seqsendertypes.Batch, l2Coinbase common.Address,
) (seqsendertypes.Sequence, error)

type ConditionalNewSequenceNumBatches

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

func NewConditionalNewSequenceNumBatches

func NewConditionalNewSequenceNumBatches(maxBatchesForL1 uint64) *ConditionalNewSequenceNumBatches

func (*ConditionalNewSequenceNumBatches) NewSequenceIfWorthToSend

func (c *ConditionalNewSequenceNumBatches) NewSequenceIfWorthToSend(
	ctx context.Context, txBuilder TxBuilder, sequenceBatches []seqsendertypes.Batch, l2Coinbase common.Address,
) (seqsendertypes.Sequence, error)

type ElderberrySequence

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

func NewElderberrySequence

func NewElderberrySequence(batches []seqsendertypes.Batch, l2Coinbase common.Address) *ElderberrySequence

func (*ElderberrySequence) Batches

func (b *ElderberrySequence) Batches() []seqsendertypes.Batch

func (*ElderberrySequence) FirstBatch

func (b *ElderberrySequence) FirstBatch() seqsendertypes.Batch

func (*ElderberrySequence) IndexL1InfoRoot

func (b *ElderberrySequence) IndexL1InfoRoot() uint32

func (*ElderberrySequence) L1InfoRoot

func (b *ElderberrySequence) L1InfoRoot() common.Hash

func (*ElderberrySequence) L2Coinbase

func (b *ElderberrySequence) L2Coinbase() common.Address

func (*ElderberrySequence) LastBatch

func (b *ElderberrySequence) LastBatch() seqsendertypes.Batch

func (*ElderberrySequence) LastVirtualBatchNumber

func (b *ElderberrySequence) LastVirtualBatchNumber() uint64

func (*ElderberrySequence) Len

func (b *ElderberrySequence) Len() int

func (*ElderberrySequence) MaxSequenceTimestamp

func (b *ElderberrySequence) MaxSequenceTimestamp() uint64

func (*ElderberrySequence) SetLastVirtualBatchNumber

func (b *ElderberrySequence) SetLastVirtualBatchNumber(batchNumber uint64)

func (*ElderberrySequence) String

func (b *ElderberrySequence) String() string

type TxBuilder

type TxBuilder interface {
	// Stringer interface
	fmt.Stringer

	// BuildSequenceBatchesTx  Builds a sequence of batches transaction
	BuildSequenceBatchesTx(ctx context.Context, sequences seqsendertypes.Sequence) (*ethtypes.Transaction, error)
	// NewSequence  Creates a new sequence
	NewSequence(
		ctx context.Context, batches []seqsendertypes.Batch, coinbase common.Address,
	) (seqsendertypes.Sequence, error)
	// NewSequenceIfWorthToSend  Creates a new sequence if it is worth sending
	NewSequenceIfWorthToSend(
		ctx context.Context, sequenceBatches []seqsendertypes.Batch, l2Coinbase common.Address, batchNumber uint64,
	) (seqsendertypes.Sequence, error)
	// NewBatchFromL2Block  Creates a new batch from the L2 block from a datastream
	NewBatchFromL2Block(l2Block *datastream.L2Block) seqsendertypes.Batch
	// SetCondNewSeq  Allows to override the condition to send a new sequence, returns previous one
	SetCondNewSeq(cond CondNewSequence) CondNewSequence
}

type TxBuilderBananaBase

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

func NewTxBuilderBananaBase

func NewTxBuilderBananaBase(
	logger *log.Logger,
	rollupContract rollupBananaBaseContractor,
	gerContract globalExitRootBananaContractor,
	l1InfoTree l1InfoSyncer,
	ethClient l1Client,
	blockFinality *big.Int,
	opts bind.TransactOpts,
) *TxBuilderBananaBase

func (*TxBuilderBananaBase) CheckL1InfoTreeLeafCounterVsInitL1InfoMap added in v0.0.19

func (t *TxBuilderBananaBase) CheckL1InfoTreeLeafCounterVsInitL1InfoMap(ctx context.Context, leafCounter uint32) error

func (*TxBuilderBananaBase) GetCounterL1InfoRoot added in v0.0.19

func (t *TxBuilderBananaBase) GetCounterL1InfoRoot(ctx context.Context, highestL1IndexInBatch uint32) (uint32, error)

Returns CounterL1InfoRoot to use for this batch

func (*TxBuilderBananaBase) NewBatchFromL2Block

func (t *TxBuilderBananaBase) NewBatchFromL2Block(l2Block *datastream.L2Block) seqsendertypes.Batch

func (*TxBuilderBananaBase) NewSequence

func (t *TxBuilderBananaBase) NewSequence(
	ctx context.Context, batches []seqsendertypes.Batch, coinbase common.Address,
) (seqsendertypes.Sequence, error)

type TxBuilderBananaValidium

type TxBuilderBananaValidium struct {
	TxBuilderBananaBase
	// contains filtered or unexported fields
}

func NewTxBuilderBananaValidium

func NewTxBuilderBananaValidium(
	logger *log.Logger,
	rollupContract rollupBananaValidiumContractor,
	gerContract globalExitRootBananaContractor,
	da dataavailability.SequenceSenderBanana, opts bind.TransactOpts, maxBatchesForL1 uint64,
	l1InfoTree l1InfoSyncer,
	ethClient l1Client,
	blockFinality *big.Int,
) *TxBuilderBananaValidium

func (*TxBuilderBananaValidium) BuildSequenceBatchesTx

func (t *TxBuilderBananaValidium) BuildSequenceBatchesTx(
	ctx context.Context, sequences seqsendertypes.Sequence,
) (*types.Transaction, error)

func (*TxBuilderBananaValidium) NewSequenceIfWorthToSend

func (t *TxBuilderBananaValidium) NewSequenceIfWorthToSend(
	ctx context.Context, sequenceBatches []seqsendertypes.Batch, l2Coinbase common.Address, batchNumber uint64,
) (seqsendertypes.Sequence, error)

func (*TxBuilderBananaValidium) SetCondNewSeq

SetCondNewSeq allow to override the default conditional for new sequence

func (*TxBuilderBananaValidium) String

func (t *TxBuilderBananaValidium) String() string

type TxBuilderBananaZKEVM

type TxBuilderBananaZKEVM struct {
	TxBuilderBananaBase
	// contains filtered or unexported fields
}

func NewTxBuilderBananaZKEVM

func NewTxBuilderBananaZKEVM(
	logger *log.Logger,
	rollupContract rollupBananaZKEVMContractor,
	gerContract globalExitRootBananaZKEVMContractor,
	opts bind.TransactOpts,
	maxTxSizeForL1 uint64,
	l1InfoTree l1InfoSyncer,
	ethClient l1Client,
	blockFinality *big.Int,
) *TxBuilderBananaZKEVM

func (*TxBuilderBananaZKEVM) BuildSequenceBatchesTx

func (t *TxBuilderBananaZKEVM) BuildSequenceBatchesTx(
	ctx context.Context, sequences seqsendertypes.Sequence,
) (*types.Transaction, error)

func (*TxBuilderBananaZKEVM) NewSequenceIfWorthToSend

func (t *TxBuilderBananaZKEVM) NewSequenceIfWorthToSend(
	ctx context.Context, sequenceBatches []seqsendertypes.Batch, l2Coinbase common.Address, batchNumber uint64,
) (seqsendertypes.Sequence, error)

func (*TxBuilderBananaZKEVM) SetCondNewSeq

func (t *TxBuilderBananaZKEVM) SetCondNewSeq(cond CondNewSequence) CondNewSequence

SetCondNewSeq allow to override the default conditional for new sequence

func (*TxBuilderBananaZKEVM) String

func (t *TxBuilderBananaZKEVM) String() string

type TxBuilderElderberryBase

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

func NewTxBuilderElderberryBase

func NewTxBuilderElderberryBase(logger *log.Logger, opts bind.TransactOpts) *TxBuilderElderberryBase

func (*TxBuilderElderberryBase) NewBatchFromL2Block

func (t *TxBuilderElderberryBase) NewBatchFromL2Block(l2Block *datastream.L2Block) seqsendertypes.Batch

func (*TxBuilderElderberryBase) NewSequence

func (t *TxBuilderElderberryBase) NewSequence(
	ctx context.Context, batches []seqsendertypes.Batch, coinbase common.Address,
) (seqsendertypes.Sequence, error)

func (*TxBuilderElderberryBase) SetAuth

func (t *TxBuilderElderberryBase) SetAuth(auth *bind.TransactOpts)

SetAuth sets the auth for the tx builder

type TxBuilderElderberryValidium

type TxBuilderElderberryValidium struct {
	TxBuilderElderberryBase
	// contains filtered or unexported fields
}

func (*TxBuilderElderberryValidium) BuildSequenceBatchesTx

func (t *TxBuilderElderberryValidium) BuildSequenceBatchesTx(
	ctx context.Context, sequences seqsendertypes.Sequence,
) (*types.Transaction, error)

func (*TxBuilderElderberryValidium) NewSequenceIfWorthToSend

func (t *TxBuilderElderberryValidium) NewSequenceIfWorthToSend(
	ctx context.Context, sequenceBatches []seqsendertypes.Batch, l2Coinbase common.Address, batchNumber uint64,
) (seqsendertypes.Sequence, error)

func (*TxBuilderElderberryValidium) SetCondNewSeq

SetCondNewSeq allow to override the default conditional for new sequence

func (*TxBuilderElderberryValidium) String

func (t *TxBuilderElderberryValidium) String() string

type TxBuilderElderberryZKEVM

type TxBuilderElderberryZKEVM struct {
	TxBuilderElderberryBase
	// contains filtered or unexported fields
}

func NewTxBuilderElderberryZKEVM

func NewTxBuilderElderberryZKEVM(
	logger *log.Logger, zkevm rollupElderberryZKEVMContractor,
	opts bind.TransactOpts, maxTxSizeForL1 uint64,
) *TxBuilderElderberryZKEVM

func (*TxBuilderElderberryZKEVM) BuildSequenceBatchesTx

func (t *TxBuilderElderberryZKEVM) BuildSequenceBatchesTx(
	ctx context.Context, sequences seqsendertypes.Sequence,
) (*types.Transaction, error)

func (*TxBuilderElderberryZKEVM) NewSequenceIfWorthToSend

func (t *TxBuilderElderberryZKEVM) NewSequenceIfWorthToSend(
	ctx context.Context, sequenceBatches []seqsendertypes.Batch, l2Coinbase common.Address, batchNumber uint64,
) (seqsendertypes.Sequence, error)

func (*TxBuilderElderberryZKEVM) SetCondNewSeq

SetCondNewSeq allow to override the default conditional for new sequence

func (*TxBuilderElderberryZKEVM) String

func (t *TxBuilderElderberryZKEVM) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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