Documentation
¶
Index ¶
- func NewConfDepth(depth uint64, l1Head func() eth.L1BlockRef, fetcher derive.L1Fetcher) *confDepth
- func NewState(driverCfg *Config, log log.Logger, snapshotLog log.Logger, ...) *state
- type Config
- type DerivationPipeline
- type Downloader
- type Driver
- func (d *Driver) Close() error
- func (d *Driver) OnL1Finalized(ctx context.Context, finalized eth.L1BlockRef) error
- func (d *Driver) OnL1Head(ctx context.Context, head eth.L1BlockRef) error
- func (d *Driver) OnL1Safe(ctx context.Context, safe eth.L1BlockRef) error
- func (d *Driver) OnUnsafeL2Payload(ctx context.Context, payload *eth.ExecutionPayload) error
- func (d *Driver) ResetDerivationPipeline(ctx context.Context) error
- func (d *Driver) Start(ctx context.Context) error
- func (d *Driver) SyncStatus(ctx context.Context) (*eth.SyncStatus, error)
- type L1Chain
- type L2Chain
- type Metrics
- type Network
- type SyncStatusdeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConfDepth ¶
func NewConfDepth(depth uint64, l1Head func() eth.L1BlockRef, fetcher derive.L1Fetcher) *confDepth
func NewState ¶ added in v0.3.0
func NewState(driverCfg *Config, log log.Logger, snapshotLog log.Logger, config *rollup.Config, l1Chain L1Chain, l2Chain L2Chain, output outputInterface, derivationPipeline DerivationPipeline, network Network, metrics Metrics) *state
NewState creates a new driver state. State changes take effect though the given output, derivation pipeline and network interfaces.
Types ¶
type Config ¶
type Config struct {
// VerifierConfDepth is the distance to keep from the L1 head when reading L1 data for L2 derivation.
VerifierConfDepth uint64 `json:"verifier_conf_depth"`
// SequencerConfDepth is the distance to keep from the L1 head as origin when sequencing new L2 blocks.
// If this distance is too large, the sequencer may:
// - not adopt a L1 origin within the allowed time (rollup.Config.MaxSequencerDrift)
// - not adopt a L1 origin that can be included on L1 within the allowed range (rollup.Config.SeqWindowSize)
// and thus fail to produce a block with anything more than deposits.
SequencerConfDepth uint64 `json:"sequencer_conf_depth"`
// SequencerEnabled is true when the driver should sequence new blocks.
SequencerEnabled bool `json:"sequencer_enabled"`
}
type DerivationPipeline ¶
type DerivationPipeline interface {
Reset()
Step(ctx context.Context) error
SetUnsafeHead(head eth.L2BlockRef)
AddUnsafePayload(payload *eth.ExecutionPayload)
Finalize(ref eth.BlockID)
Finalized() eth.L2BlockRef
SafeL2Head() eth.L2BlockRef
UnsafeL2Head() eth.L2BlockRef
Progress() derive.Progress
}
type Downloader ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) OnL1Finalized ¶
func (*Driver) OnUnsafeL2Payload ¶
func (*Driver) ResetDerivationPipeline ¶
func (*Driver) SyncStatus ¶
type L1Chain ¶
type L1Chain interface {
derive.L1Fetcher
L1BlockRefByLabel(context.Context, eth.BlockLabel) (eth.L1BlockRef, error)
}
type Metrics ¶
type Metrics interface {
RecordPipelineReset()
RecordSequencingError()
RecordPublishingError()
RecordDerivationError()
RecordReceivedUnsafePayload(payload *eth.ExecutionPayload)
RecordL1Ref(name string, ref eth.L1BlockRef)
RecordL2Ref(name string, ref eth.L2BlockRef)
RecordUnsafePayloadsBuffer(length uint64, memSize uint64, next eth.BlockID)
SetDerivationIdle(idle bool)
RecordL1ReorgDepth(d uint64)
CountSequencedTxs(count int)
}
type Network ¶
type Network interface {
// PublishL2Payload is called by the driver whenever there is a new payload to publish, synchronously with the driver main loop.
PublishL2Payload(ctx context.Context, payload *eth.ExecutionPayload) error
}
type SyncStatus
deprecated
type SyncStatus = eth.SyncStatus
Deprecated: use eth.SyncStatus instead.
Click to show internal directories.
Click to hide internal directories.