finality

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT, MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AltDABackend

type AltDABackend interface {
	// Finalize notifies the L1 finalized head so AltDA finality is always behind L1.
	Finalize(ref eth.L1BlockRef)
	// OnFinalizedHeadSignal sets the engine finalization signal callback.
	OnFinalizedHeadSignal(f altda.HeadSignalFn)
}

type AltDAFinalizer

type AltDAFinalizer struct {
	*Finalizer
	// contains filtered or unexported fields
}

AltDAFinalizer is a special type of Finalizer, wrapping a regular Finalizer, but overriding the finality signal handling: it proxies L1 finality signals to the AltDA backend, and relies on the backend to then signal when finality is really applicable.

func NewAltDAFinalizer

func NewAltDAFinalizer(ctx context.Context, log log.Logger, cfg *rollup.Config, finalizerCfg *Config, supervisorEnabled bool,
	l1Fetcher FinalizerL1Interface,
	backend AltDABackend, ec EngineController) *AltDAFinalizer

NewAltDAFinalizer creates a new AltDAFinalizer instance. The finalizerCfg parameter is optional and may be nil to use default finality behavior. When non-nil, any non-nil fields in finalizerCfg will override the defaults.

func (*AltDAFinalizer) OnEvent

func (fi *AltDAFinalizer) OnEvent(ctx context.Context, ev event.Event) bool

func (*AltDAFinalizer) OnL1Finalized

func (fi *AltDAFinalizer) OnL1Finalized(l1Origin eth.L1BlockRef)

type Config

type Config struct {
	// FinalityLookback specifies the number of L1 blocks to look back for finality verification.
	// When nil, uses the default finality lookback calculation (which considers both
	// the default lookback and alt-DA challenge/resolve windows if applicable).
	FinalityLookback *uint64

	// FinalityDelay specifies the number of L1 blocks to traverse before trying to finalize L2 blocks again.
	// When nil, defaults to 64 blocks.
	FinalityDelay *uint64
}

Config contains runtime configuration for the finalizer.

type EngineController

type EngineController interface {
	PromoteFinalized(context.Context, eth.L2BlockRef)
}

type FinalityData

type FinalityData struct {
	// The last L2 block that was fully derived and inserted into the L2 engine while processing this L1 block.
	L2Block eth.L2BlockRef
	// The L1 block this stage was at when inserting the L2 block.
	// When this L1 block is finalized, the L2 chain up to this block can be fully reproduced from finalized L1 data.
	L1Block eth.BlockID
}

type Finalizer

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

func NewFinalizer

func NewFinalizer(ctx context.Context, log log.Logger, cfg *rollup.Config, finalizerCfg *Config, supervisorEnabled bool, l1Fetcher FinalizerL1Interface, ec EngineController) *Finalizer

NewFinalizer creates a new Finalizer instance. The finalizerCfg parameter is optional and may be nil to use default finality behavior. When non-nil, any non-nil fields in finalizerCfg will override the defaults.

func (*Finalizer) AttachEmitter

func (fi *Finalizer) AttachEmitter(em event.Emitter)

func (*Finalizer) FinalizedL1

func (fi *Finalizer) FinalizedL1() (out eth.L1BlockRef)

FinalizedL1 identifies the L1 chain (incl.) that included and/or produced all the finalized L2 blocks. This may return a zeroed ID if no finalization signals have been seen yet.

func (*Finalizer) OnEvent

func (fi *Finalizer) OnEvent(ctx context.Context, ev event.Event) bool

func (*Finalizer) OnL1Finalized

func (fi *Finalizer) OnL1Finalized(l1Origin eth.L1BlockRef)

onL1Finalized applies a L1 finality signal

type FinalizerEngine

type FinalizerEngine interface {
	Finalized() eth.L2BlockRef
	SetFinalizedHead(eth.L2BlockRef)
}

type FinalizerL1Interface

type FinalizerL1Interface interface {
	L1BlockRefByNumber(context.Context, uint64) (eth.L1BlockRef, error)
}

type TryFinalizeEvent

type TryFinalizeEvent struct {
}

func (TryFinalizeEvent) String

func (ev TryFinalizeEvent) String() string

Jump to

Keyboard shortcuts

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