Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Main ¶
Main is the entrypoint into the L2 Output Submitter. This method returns a closure that executes the service and blocks until the service exits. The use of a closure allows the parameters bound to the top-level main package, e.g. GitVersion, to be captured and used once the function is executed.
Types ¶
type Config ¶
type Config struct { // L1EthRpc is the HTTP provider URL for L1. L1EthRpc string // L2EthRpc is the HTTP provider URL for L2. L2EthRpc 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 LogConfig oplog.CLIConfig MetricsConfig opmetrics.CLIConfig PprofConfig oppprof.CLIConfig }
type Driver ¶
type Driver interface { // Name is an identifier used to prefix logs for a particular service. Name() string // WalletAddr is the wallet address used to pay for transaction fees. WalletAddr() common.Address // GetBlockRange returns the start and end L2 block heights that need to be // processed. Note that the end value is *exclusive*, therefore if the // returned values are identical nothing needs to be processed. GetBlockRange(ctx context.Context) (*big.Int, *big.Int, error) // CraftTx transforms the L2 blocks between start and end into a transaction // using the given nonce. // // NOTE: This method SHOULD NOT publish the resulting transaction. CraftTx( ctx context.Context, start, end, nonce *big.Int, ) (*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: Thie method SHOULD NOT publish the resulting transaction. UpdateGasPrice( ctx context.Context, tx *types.Transaction, ) (*types.Transaction, error) // SendTransaction injects a signed transaction into the pending pool for // execution. SendTransaction(ctx context.Context, tx *types.Transaction) error }
Driver is an interface for creating and submitting transactions for a specific contract.
type L2OutputSubmitter ¶
type L2OutputSubmitter struct {
// contains filtered or unexported fields
}
L2OutputSubmitter encapsulates a service responsible for submitting L2Outputs to the L2OutputOracle contract.
func NewL2OutputSubmitter ¶
func NewL2OutputSubmitter( cfg Config, gitVersion string, l log.Logger, ) (*L2OutputSubmitter, error)
NewL2OutputSubmitter initializes the L2OutputSubmitter, gathering any resources that will be needed during operation.
func (*L2OutputSubmitter) Start ¶
func (l *L2OutputSubmitter) Start() error
func (*L2OutputSubmitter) Stop ¶
func (l *L2OutputSubmitter) Stop()
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(cfg ServiceConfig) *Service
Click to show internal directories.
Click to hide internal directories.