Documentation ¶
Index ¶
- func Main(version string, cliCtx *cli.Context) error
- type CLIConfig
- type Config
- type L2OutputSubmitter
- func (l *L2OutputSubmitter) CreateProposalTx(ctx context.Context, output *eth.OutputResponse) (*types.Transaction, error)
- func (l *L2OutputSubmitter) FetchNextOutputInfo(ctx context.Context) (*eth.OutputResponse, bool, error)
- func (l *L2OutputSubmitter) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (l *L2OutputSubmitter) SendTransactionExt(ctx context.Context, tx *types.Transaction) error
- func (l *L2OutputSubmitter) Start() error
- func (l *L2OutputSubmitter) Stop()
- func (l *L2OutputSubmitter) UpdateGasPrice(ctx context.Context, tx *types.Transaction) (*types.Transaction, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.
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.