sequencing

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSequencerAlreadyStarted = errors.New("sequencer already running")
	ErrSequencerAlreadyStopped = errors.New("sequencer not running")
)
View Source
var ErrSequencerNotEnabled = errors.New("sequencer is not enabled")

Functions

This section is empty.

Types

type AsyncGossiper

type AsyncGossiper interface {
	Gossip(payload *eth.ExecutionPayloadEnvelope)
	Get() *eth.ExecutionPayloadEnvelope
	Clear()
	Stop()
	Start()
}

type BuildingState

type BuildingState struct {
	Onto eth.L2BlockRef
	Info eth.PayloadInfo

	Started time.Time

	// Set once known
	Ref eth.L2BlockRef
}

type DisabledSequencer

type DisabledSequencer struct{}

func (DisabledSequencer) Active

func (ds DisabledSequencer) Active() bool

func (DisabledSequencer) Close

func (ds DisabledSequencer) Close()

func (DisabledSequencer) Init

func (ds DisabledSequencer) Init(ctx context.Context, active bool) error

func (DisabledSequencer) NextAction

func (ds DisabledSequencer) NextAction() (t time.Time, ok bool)

func (DisabledSequencer) OnEvent

func (ds DisabledSequencer) OnEvent(ev event.Event) bool

func (DisabledSequencer) OverrideLeader

func (ds DisabledSequencer) OverrideLeader(ctx context.Context) error

func (DisabledSequencer) SetMaxSafeLag

func (ds DisabledSequencer) SetMaxSafeLag(ctx context.Context, v uint64) error

func (DisabledSequencer) Start

func (ds DisabledSequencer) Start(ctx context.Context, head common.Hash) error

func (DisabledSequencer) Stop

func (ds DisabledSequencer) Stop(ctx context.Context) (hash common.Hash, err error)

type L1OriginSelector

type L1OriginSelector struct {
	// contains filtered or unexported fields
}

func NewL1OriginSelector

func NewL1OriginSelector(log log.Logger, cfg *rollup.Config, l1 L1Blocks) *L1OriginSelector

func (*L1OriginSelector) FindL1Origin

func (los *L1OriginSelector) FindL1Origin(ctx context.Context, l2Head eth.L2BlockRef) (eth.L1BlockRef, error)

FindL1Origin determines what the next L1 Origin should be. The L1 Origin is either the L2 Head's Origin, or the following L1 block if the next L2 block's time is greater than or equal to the L2 Head's Origin.

type L1OriginSelectorIface

type L1OriginSelectorIface interface {
	FindL1Origin(ctx context.Context, l2Head eth.L2BlockRef) (eth.L1BlockRef, error)
}

type Metrics

type Metrics interface {
	RecordSequencerInconsistentL1Origin(from eth.BlockID, to eth.BlockID)
	RecordSequencerReset()
	RecordSequencingError()
}

type Sequencer

type Sequencer struct {
	// contains filtered or unexported fields
}

Sequencer implements the sequencing interface of the driver: it starts and completes block building jobs.

func NewSequencer

func NewSequencer(driverCtx context.Context, log log.Logger, rollupCfg *rollup.Config,
	attributesBuilder derive.AttributesBuilder,
	l1OriginSelector L1OriginSelectorIface,
	listener SequencerStateListener,
	conductor conductor.SequencerConductor,
	asyncGossip AsyncGossiper,
	metrics Metrics) *Sequencer

func (*Sequencer) Active

func (d *Sequencer) Active() bool

func (*Sequencer) AttachEmitter

func (d *Sequencer) AttachEmitter(em event.Emitter)

func (*Sequencer) Close

func (d *Sequencer) Close()

func (*Sequencer) Init

func (d *Sequencer) Init(ctx context.Context, active bool) error

func (*Sequencer) NextAction

func (d *Sequencer) NextAction() (t time.Time, ok bool)

func (*Sequencer) OnEvent

func (d *Sequencer) OnEvent(ev event.Event) bool

func (*Sequencer) OverrideLeader

func (d *Sequencer) OverrideLeader(ctx context.Context) error

func (*Sequencer) SetMaxSafeLag

func (d *Sequencer) SetMaxSafeLag(ctx context.Context, v uint64) error

func (*Sequencer) Start

func (d *Sequencer) Start(ctx context.Context, head common.Hash) error

func (*Sequencer) Stop

func (d *Sequencer) Stop(ctx context.Context) (common.Hash, error)

type SequencerActionEvent

type SequencerActionEvent struct {
}

SequencerActionEvent triggers the sequencer to start/seal a block, if active and ready to act. This event is used to prioritize sequencer work over derivation work, by emitting it before e.g. a derivation-pipeline step. A future sequencer in an async world may manage its own execution.

func (SequencerActionEvent) String

func (ev SequencerActionEvent) String() string

type SequencerIface

type SequencerIface interface {
	event.Deriver
	// NextAction returns when the sequencer needs to do the next change, and iff it should do so.
	NextAction() (t time.Time, ok bool)
	Active() bool
	Init(ctx context.Context, active bool) error
	Start(ctx context.Context, head common.Hash) error
	Stop(ctx context.Context) (hash common.Hash, err error)
	SetMaxSafeLag(ctx context.Context, v uint64) error
	OverrideLeader(ctx context.Context) error
	Close()
}

type SequencerStateListener

type SequencerStateListener interface {
	SequencerStarted() error
	SequencerStopped() error
}

Jump to

Keyboard shortcuts

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