proposer

package
v0.0.0-...-1d04f91 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitFromConfig

func InitFromConfig(ctx context.Context, p *Proposer, cfg *Config) (err error)

InitFromConfig initializes the proposer instance based on the given configurations.

Types

type Config

type Config struct {
	L1Endpoint                 string
	L1HTTPEndpoint             string
	L2Endpoint                 string
	MxcL1Address               common.Address
	MxcL2Address               common.Address
	L1ProposerPrivKey          *ecdsa.PrivateKey
	L2SuggestedFeeRecipient    common.Address
	ProposeInterval            *time.Duration
	CommitSlot                 uint64
	LocalAddresses             []common.Address
	ProposeEmptyBlocksInterval *time.Duration
	MinBlockGasLimit           uint64
	MaxProposedTxListsPerEpoch uint64
	ProposeBlockTxGasLimit     *uint64
	BlockedAddresses           []common.Address
}

Config contains all configurations to initialize a Taiko proposer.

func NewConfigFromCliContext

func NewConfigFromCliContext(c *cli.Context) (*Config, error)

NewConfigFromCliContext initializes a Config instance from command line flags.

type Proposer

type Proposer struct {

	// Only for testing purposes
	CustomProposeOpHook func() error
	AfterCommitHook     func() error
	// contains filtered or unexported fields
}

Proposer keep proposing new transactions from L2 execution engine's tx pool at a fixed interval.

func (*Proposer) Close

func (p *Proposer) Close()

Close closes the proposer instance.

func (*Proposer) InitFromCli

func (p *Proposer) InitFromCli(ctx context.Context, c *cli.Context) error

New initializes the given proposer instance based on the command line flags.

func (*Proposer) L2SuggestedFeeRecipient

func (p *Proposer) L2SuggestedFeeRecipient() common.Address

L2SuggestedFeeRecipient returns the L2 suggested fee recipient of the current proposer.

func (*Proposer) Name

func (p *Proposer) Name() string

Name returns the application name.

func (*Proposer) ProposeEmptyBlockOp

func (p *Proposer) ProposeEmptyBlockOp(ctx context.Context) error

ProposeEmptyBlockOp performs a proposing one empty block operation.

func (*Proposer) ProposeOp

func (p *Proposer) ProposeOp(ctx context.Context) error

ProposeOp performs a proposing operation, fetching transactions from L2 execution engine's tx pool, splitting them by proposing constraints, and then proposing them to MxcL1 contract.

func (*Proposer) ProposeTxList

func (p *Proposer) ProposeTxList(
	ctx context.Context,
	meta *encoding.MxcL1BlockMetadataInput,
	txListBytes []byte,
	txNum uint,
	nonce *uint64,
) error

ProposeTxList proposes the given transactions list to MxcL1 smart contract.

func (*Proposer) Start

func (p *Proposer) Start() error

Start starts the proposer's main loop.

Jump to

Keyboard shortcuts

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