types

package
v0.0.0-...-5cda5f8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TxBatchParseFailedError = errors.New("Failed to create TxBatch from decoded tx data")

Functions

This section is empty.

Types

type Assertion

type Assertion struct {
	ID           *big.Int
	VmHash       common.Hash
	InboxSize    *big.Int
	Parent       *big.Int
	Deadline     *big.Int
	ProposalTime *big.Int
}

Assertion represents disputable assertion for L1 rollup contract

func (*Assertion) Copy

func (a *Assertion) Copy() *Assertion

func (*Assertion) GetParentAssertion

func (a *Assertion) GetParentAssertion(assertionMap *bindings.AssertionMapCallerSession) (*Assertion, error)

type SequenceBlock

type SequenceBlock struct {
	SequenceContext
	Txs types.Transactions
}

SequenceBlock is a block sequenced to L1 sequencer inbox It is used by validators to reconstruct L2 chain from L1 activities

type SequenceContext

type SequenceContext struct {
	NumTxs      uint64
	BlockNumber uint64
	Timestamp   uint64
}

SequenceContext is the relavent context of each block sequenced to L1 sequncer inbox

type Staker

type Staker struct {
	IsStaked         bool
	AmountStaked     *big.Int
	AssertionID      *big.Int
	CurrentChallenge common.Address
}

Staker represents fraud-proof assertion stake status

type TxBatch

type TxBatch struct {
	Blocks   types.Blocks
	Contexts []SequenceContext
	Txs      types.Transactions
	GasUsed  *big.Int
}

TxBatch represents a transaction batch to be sequenced to L1 sequencer inbox It may contain multiple blocks

func NewTxBatch

func NewTxBatch(blocks []*types.Block, maxBatchSize uint64) *TxBatch

func TxBatchFromDecoded

func TxBatchFromDecoded(decoded []interface{}) (*TxBatch, error)

TxBatchFromDecoded decodes the input of SequencerInbox#appendTxBatch call It will only fill Contexts and Txs fields

func (*TxBatch) InboxSize

func (b *TxBatch) InboxSize() *big.Int

func (*TxBatch) LastBlockNumber

func (b *TxBatch) LastBlockNumber() uint64

func (*TxBatch) LastBlockRoot

func (b *TxBatch) LastBlockRoot() common.Hash

func (*TxBatch) SerializeToArgs

func (b *TxBatch) SerializeToArgs() ([]*big.Int, []*big.Int, []byte, error)

func (*TxBatch) ToAssertion

func (b *TxBatch) ToAssertion(parent *Assertion) *Assertion

Jump to

Keyboard shortcuts

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