proposer

package
v0.10.14 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: MIT Imports: 31 Imported by: 2

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 added in v0.10.11

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

	// NumConfirmations is the number of confirmations which we will wait after
	// appending new batches.
	NumConfirmations uint64

	// SafeAbortNonceTooLowCount is the number of ErrNonceTooLowObservations
	// required to give up on a tx at a particular nonce without receiving
	// confirmation.
	SafeAbortNonceTooLowCount uint64

	// ResubmissionTimeout is time we will wait before resubmitting a
	// transaction.
	ResubmissionTimeout time.Duration

	// Mnemonic is the HD seed used to derive the wallet private keys for both
	// the sequence and proposer. Must be used in conjunction with
	// SequencerHDPath and ProposerHDPath.
	Mnemonic string

	// L2OutputHDPath is the derivation path used to obtain the private key for
	// the l2output transactions.
	L2OutputHDPath string

	// PrivateKey is the private key used for l2output transactions.
	PrivateKey string

	RPCConfig oprpc.CLIConfig

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

	LogConfig oplog.CLIConfig

	MetricsConfig opmetrics.CLIConfig

	PprofConfig oppprof.CLIConfig

	// SignerConfig contains the client config for op-signer service
	SignerConfig opsigner.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 added in v0.10.11

func (c CLIConfig) Check() error

type Config

type Config struct {
	L2OutputOracleAddr common.Address
	PollInterval       time.Duration
	TxManagerConfig    txmgr.Config
	L1Client           *ethclient.Client
	RollupClient       *sources.RollupClient
	AllowNonFinalized  bool
	From               common.Address
	SignerFnFactory    opcrypto.SignerFactory
}

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

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) (*L2OutputSubmitter, error)

NewL2OutputSubmitter creates a new L2 Output Submitter

func NewL2OutputSubmitterFromCLIConfig added in v0.10.12

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

NewL2OutputSubmitterFromCLIConfig creates a new L2 Output Submitter given the CLI Config

func (*L2OutputSubmitter) CreateProposalTx added in v0.10.11

func (l *L2OutputSubmitter) CreateProposalTx(ctx context.Context, output *eth.OutputResponse) (*types.Transaction, error)

CreateProposalTx transforms an output response into a signed output transaction. It does not send the transaction to the transaction pool.

func (*L2OutputSubmitter) FetchNextOutputInfo added in v0.10.11

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) SendTransaction added in v0.10.11

func (l *L2OutputSubmitter) SendTransaction(ctx context.Context, tx *types.Transaction) error

SendTransaction injects a signed transaction into the pending pool for execution.

func (*L2OutputSubmitter) SendTransactionExt added in v0.10.11

func (l *L2OutputSubmitter) SendTransactionExt(ctx context.Context, tx *types.Transaction) error

SendTransactionExt sends a transaction through the transaction manager which handles automatic price bumping. It also hardcodes a timeout of 100s.

func (*L2OutputSubmitter) Start

func (l *L2OutputSubmitter) Start() error

func (*L2OutputSubmitter) Stop

func (l *L2OutputSubmitter) Stop()

func (*L2OutputSubmitter) UpdateGasPrice added in v0.10.11

func (l *L2OutputSubmitter) UpdateGasPrice(ctx context.Context, tx *types.Transaction) (*types.Transaction, error)

UpdateGasPrice signs an otherwise identical txn to the one provided but with updated gas prices sampled from the existing network conditions.

NOTE: This method SHOULD NOT publish the resulting transaction.

Jump to

Keyboard shortcuts

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