syncinterfaces

package
v0.5.0-RC11 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingSyncFromL1 is returned when we are behind expected L1 sync, so must be done from L1
	ErrMissingSyncFromL1 = errors.New("must sync from L1")
	// ErrFatalDesyncFromL1 is returned when trusted node and permissionless node have different data
	ErrFatalDesyncFromL1 = errors.New("fatal situation: the TrustedNode have another data!. Halt or do something")
)

Functions

This section is empty.

Types

type CriticalErrorHandler

type CriticalErrorHandler interface {
	// CriticalError is called when a critical error occurs. The error is passed in as a parameter.
	// this function could be blocking or non-blocking, depending on the implementation.
	CriticalError(ctx context.Context, err error)
}

CriticalErrorHandler is an interface for handling critical errors. Before that class this was called Halt()

type EthermanGetLatestBatchNumber

type EthermanGetLatestBatchNumber interface {
	GetLatestBatchNumber() (uint64, error)
}

type EventLogInterface

type EventLogInterface interface {
	LogEvent(ctx context.Context, event *event.Event) error
}

EventLogInterface write an event to the event log database

type StateBeginTransactionInterface

type StateBeginTransactionInterface interface {
	BeginStateTransaction(ctx context.Context) (pgx.Tx, error)
}

StateInterface contains the methods required to interact with the state.

type StateGetBatchByNumberInterface

type StateGetBatchByNumberInterface interface {
	GetBatchByNumber(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.Batch, error)
}

type SyncTrustedStateExecutor

type SyncTrustedStateExecutor interface {
	// SyncTrustedState syncs the trusted state with the permissionless state
	// if returns error ErrMissingSyncFromL1 then must force a L1 sync
	SyncTrustedState(ctx context.Context, latestSyncedBatch uint64) error
	// CleanTrustedState clean cache of Batches and StateRoot
	CleanTrustedState()
}

SyncTrustedStateExecutor is the interface that class that synchronize permissionless with a trusted node

type SynchronizerFlushIDManager

type SynchronizerFlushIDManager interface {
	PendingFlushID(flushID uint64, proverID string)
	CheckFlushID(dbTx pgx.Tx) error
}

SynchronizerFlushIDManager is a interface with the methods to manage the flushID

type ZKEVMClientGlobalExitRootGetter

type ZKEVMClientGlobalExitRootGetter interface {
	ExitRootsByGER(ctx context.Context, globalExitRoot common.Hash) (*types.ExitRoots, error)
}

ZkEVMClientInterface contains the methods required to interact with zkEVM-RPC for obtain GlobalExitRoot information

type ZKEVMClientTrustedBatchesGetter

type ZKEVMClientTrustedBatchesGetter interface {
	BatchNumber(ctx context.Context) (uint64, error)
	BatchByNumber(ctx context.Context, number *big.Int) (*types.Batch, error)
}

ZkEVMClientInterface contains the methods required to interact with zkEVM-RPC

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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