tx_list_validator

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InvalidTxListReason

type InvalidTxListReason uint8

InvalidTxListReason represents a reason why a transactions list is invalid, must match the definitions in LibInvalidTxList.sol:

enum Reason {
	OK,
	BINARY_TOO_LARGE,
	BINARY_NOT_DECODABLE,
	BLOCK_TOO_MANY_TXS,
	BLOCK_GAS_LIMIT_TOO_LARGE,
	TX_INVALID_SIG,
	TX_GAS_LIMIT_TOO_SMALL
}
const (
	HintOK InvalidTxListReason = iota
	HintBinaryTooLarge
	HintBinaryNotDecodable
	HintBlockTooManyTxs
	HintBlockGasLimitTooLarge
	HintTxInvalidSig
	HintTxGasLimitTooSmall
)

All invalid transactions list reasons.

type TxListValidator

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

func NewTxListValidator

func NewTxListValidator(
	blockMaxGasLimit uint64,
	blockMaxTxs uint64,
	txListMaxBytes uint64,
	txMinGasLimit uint64,
	chainID *big.Int,
) *TxListValidator

NewTxListValidator creates a new TxListValidator instance based on giving configurations.

func (*TxListValidator) IsTxListValid

func (v *TxListValidator) IsTxListValid(blockID *big.Int, txListBytes []byte) (hint InvalidTxListReason, txIdx int)

IsTxListValid checks whether the transaction list is valid, must match the validation rule defined in LibInvalidTxList.sol. ref: https://github.com/taikoxyz/taiko-mono/blob/main/packages/bindings/contracts/libs/LibInvalidTxList.sol

func (*TxListValidator) ValidateTxList

func (v *TxListValidator) ValidateTxList(
	blockID *big.Int,
	proposeBlockTxInput []byte,
) (hint InvalidTxListReason, txIdx int, err error)

ValidateTxList checks whether the transactions list in the TaikoL1.proposeBlock transaction's input data is valid.

Jump to

Keyboard shortcuts

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