Versions in this module Expand all Collapse all v1 v1.1.3 Jan 20, 2025 v1.1.2 Jan 20, 2025 Changes in this version + var ErrCantSyncFromL2 = errors.New("can't sync from L2") + var ErrFatalDesyncFromL1 = errors.New("fatal situation: the TrustedNode have another data!. Halt or do something") + var ErrMissingSyncFromL1 = errors.New("must sync from L1") + type AsyncL1BlockChecker interface + GetResult func() *IterationResult + Run func(ctx context.Context, onFinish func()) + RunSynchronous func(ctx context.Context) IterationResult + Stop func() + type CriticalErrorHandler interface + CriticalError func(ctx context.Context, err error) + type EthTxManager interface + Reorg func(ctx context.Context, fromBlockNumber uint64, dbTx pgx.Tx) error + type EthermanFullInterface interface + EthBlockByNumber func(ctx context.Context, blockNumber uint64) (*ethTypes.Block, error) + GetFinalizedBlockNumber func(ctx context.Context) (uint64, error) + GetLatestVerifiedBatchNum func() (uint64, error) + GetRollupInfoByBlockRange func(ctx context.Context, fromBlock uint64, toBlock *uint64) ([]etherman.Block, map[common.Hash][]etherman.Order, error) + GetTrustedSequencerURL func() (string, error) + HeaderByNumber func(ctx context.Context, number *big.Int) (*ethTypes.Header, error) + VerifyGenBlockNumber func(ctx context.Context, genBlockNumber uint64) (bool, error) + type EthermanGetLatestBatchNumber interface + GetLatestBatchNumber func() (uint64, error) + type EventLogInterface interface + LogEvent func(ctx context.Context, event *event.Event) error + type IterationResult struct + BlockNumber uint64 + Err error + ReorgDetected bool + ReorgMessage string + func (ir *IterationResult) String() string + type L1BlockCheckerIntegrator interface + CheckReorgWrapper func(ctx context.Context, reorgFirstBlockOk *state.Block, ...) (*state.Block, error) + OnResetState func(ctx context.Context) + OnStart func(ctx context.Context) error + type PoolInterface interface + DeleteReorgedTransactions func(ctx context.Context, txs []*ethTypes.Transaction) error + StoreTx func(ctx context.Context, tx ethTypes.Transaction, ip string, isWIP bool) error + type StateBeginTransactionInterface interface + BeginStateTransaction func(ctx context.Context) (pgx.Tx, error) + type StateFullInterface interface + AddAccumulatedInputHash func(ctx context.Context, batchNum uint64, accInputHash common.Hash, dbTx pgx.Tx) error + AddBlock func(ctx context.Context, block *state.Block, dbTx pgx.Tx) error + AddForcedBatch func(ctx context.Context, forcedBatch *state.ForcedBatch, dbTx pgx.Tx) error + AddForkIDInterval func(ctx context.Context, newForkID state.ForkIDInterval, dbTx pgx.Tx) error + AddGlobalExitRoot func(ctx context.Context, exitRoot *state.GlobalExitRoot, dbTx pgx.Tx) error + AddL1InfoTreeLeaf func(ctx context.Context, L1InfoTreeLeaf *state.L1InfoTreeLeaf, dbTx pgx.Tx) (*state.L1InfoTreeExitRootStorageEntry, error) + AddSequence func(ctx context.Context, sequence state.Sequence, dbTx pgx.Tx) error + AddTrustedReorg func(ctx context.Context, trustedReorg *state.TrustedReorg, dbTx pgx.Tx) error + AddVerifiedBatch func(ctx context.Context, verifiedBatch *state.VerifiedBatch, dbTx pgx.Tx) error + AddVirtualBatch func(ctx context.Context, virtualBatch *state.VirtualBatch, dbTx pgx.Tx) error + BeginStateTransaction func(ctx context.Context) (pgx.Tx, error) + CloseBatch func(ctx context.Context, receipt state.ProcessingReceipt, dbTx pgx.Tx) error + ExecuteBatch func(ctx context.Context, batch state.Batch, updateMerkleTree bool, dbTx pgx.Tx) (*executor.ProcessBatchResponse, error) + ExecuteBatchV2 func(ctx context.Context, batch state.Batch, L1InfoTreeRoot common.Hash, ...) (*executor.ProcessBatchResponseV2, error) + GetBatchByNumber func(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.Batch, error) + GetBlockByNumber func(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*state.Block, error) + GetExitRootByGlobalExitRoot func(ctx context.Context, ger common.Hash, dbTx pgx.Tx) (*state.GlobalExitRoot, error) + GetFirstUncheckedBlock func(ctx context.Context, fromBlockNumber uint64, dbTx pgx.Tx) (*state.Block, error) + GetForkIDByBatchNumber func(batchNumber uint64) uint64 + GetForkIDByBlockNumber func(blockNumber uint64) uint64 + GetForkIDInMemory func(forkId uint64) *state.ForkIDInterval + GetForkIDs func(ctx context.Context, dbTx pgx.Tx) ([]state.ForkIDInterval, error) + GetL1InfoRootLeafByL1InfoRoot func(ctx context.Context, l1InfoRoot common.Hash, dbTx pgx.Tx) (state.L1InfoTreeExitRootStorageEntry, error) + GetL1InfoTreeDataFromBatchL2Data func(ctx context.Context, batchL2Data []byte, dbTx pgx.Tx) (map[uint32]state.L1DataV2, common.Hash, common.Hash, error) + GetL2BlockByNumber func(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*state.L2Block, error) + GetLastBatchNumber func(ctx context.Context, dbTx pgx.Tx) (uint64, error) + GetLastBlock func(ctx context.Context, dbTx pgx.Tx) (*state.Block, error) + GetLastL2BlockByBatchNumber func(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.L2Block, error) + GetLastL2BlockNumber func(ctx context.Context, dbTx pgx.Tx) (uint64, error) + GetLastVerifiedBatch func(ctx context.Context, dbTx pgx.Tx) (*state.VerifiedBatch, error) + GetLastVirtualBatchNum func(ctx context.Context, dbTx pgx.Tx) (uint64, error) + GetNextForcedBatches func(ctx context.Context, nextForcedBatches int, dbTx pgx.Tx) ([]state.ForcedBatch, error) + GetPreviousBlock func(ctx context.Context, offset uint64, dbTx pgx.Tx) (*state.Block, error) + GetPreviousBlockToBlockNumber func(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) (*state.Block, error) + GetReorgedTransactions func(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) ([]*ethTypes.Transaction, error) + GetStateRootByBatchNumber func(ctx context.Context, batchNum uint64, dbTx pgx.Tx) (common.Hash, error) + GetStoredFlushID func(ctx context.Context) (uint64, string, error) + GetUncheckedBlocks func(ctx context.Context, fromBlockNumber uint64, toBlockNumber uint64, dbTx pgx.Tx) ([]*state.Block, error) + OpenBatch func(ctx context.Context, processingContext state.ProcessingContext, dbTx pgx.Tx) error + ProcessAndStoreClosedBatch func(ctx context.Context, processingCtx state.ProcessingContext, encodedTxs []byte, ...) (common.Hash, uint64, string, error) + ProcessAndStoreClosedBatchV2 func(ctx context.Context, processingCtx state.ProcessingContextV2, dbTx pgx.Tx, ...) (common.Hash, uint64, string, error) + ProcessBatch func(ctx context.Context, request state.ProcessRequest, updateMerkleTree bool) (*state.ProcessBatchResponse, error) + ProcessBatchV2 func(ctx context.Context, request state.ProcessRequest, updateMerkleTree bool) (*state.ProcessBatchResponse, error) + Reset func(ctx context.Context, blockNumber uint64, dbTx pgx.Tx) error + ResetForkID func(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) error + ResetTrustedState func(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) error + SetGenesis func(ctx context.Context, block state.Block, genesis state.Genesis, ...) (common.Hash, error) + SetInitSyncBatch func(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) error + SetLastBatchInfoSeenOnEthereum func(ctx context.Context, lastBatchNumberSeen, lastBatchNumberVerified uint64, ...) error + StoreL2Block func(ctx context.Context, batchNumber uint64, l2Block *state.ProcessBlockResponse, ...) error + StoreTransaction func(ctx context.Context, batchNumber uint64, ...) (*state.L2Header, error) + UpdateBatchL2Data func(ctx context.Context, batchNumber uint64, batchL2Data []byte, dbTx pgx.Tx) error + UpdateCheckedBlockByNumber func(ctx context.Context, blockNumber uint64, newCheckedStatus bool, dbTx pgx.Tx) error + UpdateForkIDBlockNumber func(ctx context.Context, forkdID uint64, newBlockNumber uint64, ...) error + UpdateWIPBatch func(ctx context.Context, receipt state.ProcessingReceipt, dbTx pgx.Tx) error + type StateGetBatchByNumberInterface interface + GetBatchByNumber func(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.Batch, error) + type SyncTrustedStateExecutor interface + CleanTrustedState func() + GetCachedBatch func(batchNumber uint64) *state.Batch + SyncTrustedState func(ctx context.Context, latestSyncedBatch uint64, ...) error + type SynchronizerCleanTrustedState interface + CleanTrustedState func() + type SynchronizerFlushIDManager interface + CheckFlushID func(dbTx pgx.Tx) error + PendingFlushID func(flushID uint64, proverID string) + type SynchronizerFullInterface interface + type SynchronizerIsTrustedSequencer interface + IsTrustedSequencer func() bool + type ZKEVMClientEthereumCompatibleInterface interface + type ZKEVMClientEthereumCompatibleL2BlockGetter interface + BlockByNumber func(ctx context.Context, number *big.Int) (*types.Block, error) + type ZKEVMClientGetL2BlockByNumber interface + BlockByNumber func(ctx context.Context, number *big.Int) (*types.Block, error) + type ZKEVMClientGlobalExitRootGetter interface + ExitRootsByGER func(ctx context.Context, globalExitRoot common.Hash) (*types.ExitRoots, error) + type ZKEVMClientInterface interface + type ZKEVMClientTrustedBatchesGetter interface + BatchByNumber func(ctx context.Context, number *big.Int) (*types.Batch, error) + BatchNumber func(ctx context.Context) (uint64, error)