proposer

package
v0.0.0-...-23d24bf Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(version string, cliCtx *cli.Context) error

Main is the entrypoint into the L2 Output Submitter. This method executes the service and blocks until the service exits.

Types

type CLIConfig

type CLIConfig struct {

	// L1EthRpc is the HTTP provider URL for L1.
	L1EthRpc string

	// RollupRpc is the HTTP provider URL for the rollup node.
	RollupRpc string

	// L2OOAddress is the L2OutputOracle contract address.
	L2OOAddress string

	// PollInterval is the delay between querying L2 for more transaction
	// and creating a new batch.
	PollInterval time.Duration

	// AllowNonFinalized can be set to true to propose outputs
	// for L2 blocks derived from non-finalized L1 data.
	AllowNonFinalized bool

	TxMgrConfig txmgr.CLIConfig

	RPCConfig ptrpc.CLIConfig

	LogConfig ptlog.CLIConfig

	MetricsConfig ptmetrics.CLIConfig

	PprofConfig ptpprof.CLIConfig
}

CLIConfig is a well typed config that is parsed from the CLI params. This also contains config options for auxiliary services. It is transformed into a `Config` before the L2 output submitter is started.

func NewConfig

func NewConfig(ctx *cli.Context) CLIConfig

NewConfig parses the Config from the provided flags or environment variables.

func (CLIConfig) Check

func (c CLIConfig) Check() error

type Config

type Config struct {
	L2OutputOracleAddr common.Address
	PollInterval       time.Duration
	NetworkTimeout     time.Duration
	TxManager          txmgr.TxManager
	L1Client           *ethclient.Client
	RollupClient       *sources.RollupClient
	AllowNonFinalized  bool
}

Config contains the well typed fields that are used to initialize the output submitter. It is intended for programmatic use.

func NewL2OutputSubmitterConfigFromCLIConfig

func NewL2OutputSubmitterConfigFromCLIConfig(cfg CLIConfig, l log.Logger, m metrics.Metricer) (*Config, error)

NewL2OutputSubmitterConfigFromCLIConfig creates the proposer config from the CLI config.

type L2OutputSubmitter

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

L2OutputSubmitter is responsible for proposing outputs

func NewL2OutputSubmitter

func NewL2OutputSubmitter(cfg Config, l log.Logger, m metrics.Metricer) (*L2OutputSubmitter, error)

NewL2OutputSubmitter creates a new L2 Output Submitter

func NewL2OutputSubmitterFromCLIConfig

func NewL2OutputSubmitterFromCLIConfig(cfg CLIConfig, l log.Logger, m metrics.Metricer) (*L2OutputSubmitter, error)

NewL2OutputSubmitterFromCLIConfig creates a new L2 Output Submitter given the CLI Config

func (*L2OutputSubmitter) FetchNextOutputInfo

func (l *L2OutputSubmitter) FetchNextOutputInfo(ctx context.Context) (*eth.OutputResponse, bool, error)

FetchNextOutputInfo gets the block number of the next proposal. It returns: the next block number, if the proposal should be made, error

func (*L2OutputSubmitter) ProposeL2OutputTxData

func (l *L2OutputSubmitter) ProposeL2OutputTxData(output *eth.OutputResponse) ([]byte, error)

ProposeL2OutputTxData creates the transaction data for the ProposeL2Output function

func (*L2OutputSubmitter) Start

func (l *L2OutputSubmitter) Start() error

func (*L2OutputSubmitter) Stop

func (l *L2OutputSubmitter) Stop()

Jump to

Keyboard shortcuts

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