Documentation ¶
Index ¶
- Variables
- func Main(version string) cliapp.LifecycleAction
- type CLIConfig
- type Client
- type DriverSetup
- type L1Client
- type L2Client
- type L2OutputSubmitter
- func (l *L2OutputSubmitter) IsRunning() bool
- func (l *L2OutputSubmitter) ProposeL2OutputTxData(proposal *Proposal) ([]byte, error)
- func (l *L2OutputSubmitter) StartL2OutputSubmitting() error
- func (l *L2OutputSubmitter) StopL2OutputSubmitting() error
- func (l *L2OutputSubmitter) StopL2OutputSubmittingIfRunning() error
- type OOContract
- type Proposal
- type ProposerConfig
- type ProposerService
- type Prover
- type RethExecutionWitness
- type RollupClient
Constants ¶
This section is empty.
Variables ¶
var ErrAlreadyStopped = errors.New("already stopped")
var (
ErrProposerNotRunning = errors.New("proposer is not running")
)
Functions ¶
func Main ¶
func Main(version string) cliapp.LifecycleAction
Main is the entrypoint into the L2OutputSubmitter. This method returns a cliapp.LifecycleAction, to create an op-service CLI-lifecycle-managed L2Output-submitter
Types ¶
type CLIConfig ¶
type DriverSetup ¶
type L1Client ¶
type L1Client interface { BlockNumber(ctx context.Context) (uint64, error) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) BlockReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) Close() }
type L2Client ¶
type L2Client interface { ChainConfig(ctx context.Context) (*params.ChainConfig, error) GetProof(ctx context.Context, address common.Address, hash common.Hash) (*eth.AccountResult, error) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error) ExecutionWitness(ctx context.Context, hash common.Hash) ([]byte, error) Close() }
type L2OutputSubmitter ¶
type L2OutputSubmitter struct { DriverSetup // contains filtered or unexported fields }
L2OutputSubmitter is responsible for proposing outputs
func NewL2OutputSubmitter ¶
func NewL2OutputSubmitter(setup DriverSetup) (_ *L2OutputSubmitter, err error)
NewL2OutputSubmitter creates a new L2 Output Submitter
func (*L2OutputSubmitter) IsRunning ¶
func (l *L2OutputSubmitter) IsRunning() bool
func (*L2OutputSubmitter) ProposeL2OutputTxData ¶
func (l *L2OutputSubmitter) ProposeL2OutputTxData(proposal *Proposal) ([]byte, error)
ProposeL2OutputTxData creates the transaction data for the ProposeL2Output function
func (*L2OutputSubmitter) StartL2OutputSubmitting ¶
func (l *L2OutputSubmitter) StartL2OutputSubmitting() error
func (*L2OutputSubmitter) StopL2OutputSubmitting ¶
func (l *L2OutputSubmitter) StopL2OutputSubmitting() error
func (*L2OutputSubmitter) StopL2OutputSubmittingIfRunning ¶
func (l *L2OutputSubmitter) StopL2OutputSubmittingIfRunning() error
type OOContract ¶
type Proposal ¶
type Proposal struct { Output *enclave.Proposal From eth.L2BlockRef To eth.L2BlockRef Withdrawals bool }
type ProposerConfig ¶
type ProposerConfig struct { // How frequently to poll L2 for new finalized outputs PollInterval time.Duration NetworkTimeout time.Duration // How frequently to post L2 outputs when the DisputeGameFactory is configured ProposalInterval time.Duration L2OutputOracleAddr *common.Address // AllowNonFinalized enables the proposal of safe, but non-finalized L2 blocks. // The L1 block-hash embedded in the proposal TX is checked and should ensure the proposal // is never valid on an alternative L1 chain that would produce different L2 data. // This option is not necessary when higher proposal latency is acceptable and L1 is healthy. AllowNonFinalized bool WaitNodeSync bool MinProposalInterval uint64 }
type ProposerService ¶
type ProposerService struct { Log log.Logger Metrics *metrics.Metrics ProposerConfig TxManager txmgr.TxManager L1Client *ethclient.Client L2Client *ethclient.Client L2Reth bool RollupClient *gethrpc.Client EnclaveClient *gethrpc.Client Version string // contains filtered or unexported fields }
func ProposerServiceFromCLIConfig ¶
func ProposerServiceFromCLIConfig(ctx context.Context, version string, cfg *CLIConfig, log log.Logger) (*ProposerService, error)
ProposerServiceFromCLIConfig creates a new ProposerService from a CLIConfig. The service components are fully started, except for the driver, which will not be submitting state (if it was configured to) until the Start part of the lifecycle.
func (*ProposerService) Driver ¶
func (ps *ProposerService) Driver() rpc.ProposerDriver
Driver returns the handler on the L2Output-submitter driver element, to start/stop/restart the L2Output-submission work, for use in testing.
func (*ProposerService) Kill ¶
func (ps *ProposerService) Kill() error
Kill is a convenience method to forcefully, non-gracefully, stop the ProposerService.
func (*ProposerService) Start ¶
func (ps *ProposerService) Start(_ context.Context) error
Start runs once upon start of the proposer lifecycle, and starts L2Output-submission work if the proposer is configured to start submit data on startup.
func (*ProposerService) Stop ¶
func (ps *ProposerService) Stop(ctx context.Context) error
Stop fully stops the L2Output-submitter and all its resources gracefully. After stopping, it cannot be restarted. See driver.StopL2OutputSubmitting to temporarily stop the L2Output submitter.
func (*ProposerService) Stopped ¶
func (ps *ProposerService) Stopped() bool
type Prover ¶
type Prover struct {
// contains filtered or unexported fields
}
type RethExecutionWitness ¶
type RethExecutionWitness struct { State map[common.Hash]hexutil.Bytes Codes map[common.Hash]hexutil.Bytes Keys map[common.Hash]hexutil.Bytes }
see https://github.com/alloy-rs/alloy/blob/main/crates/rpc-types-debug/src/debug.rs
type RollupClient ¶
type RollupClient interface { RollupConfig(ctx context.Context) (*rollup.Config, error) SyncStatus(ctx context.Context) (*eth.SyncStatus, error) }
func NewRollupClient ¶
func NewRollupClient(client *rpc.Client, metrics caching.Metrics) RollupClient