syncinterfaces

package
v0.5.0-RC3 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 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 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()
}

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