Documentation ¶
Index ¶
- type BlockByNumberSource
- type BlockProcessor
- type BlockProcessorFn
- type ChainMonitor
- type ChainProcessor
- type DatabaseRewinder
- type HeadChangeCallback
- type HeadMonitor
- type HeadMonitorClient
- type HeadProcessor
- type HeadProcessorFn
- type LogSource
- type LogStorage
- type Metrics
- type ReceiptProcessor
- type ReceiptProcessorFn
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockByNumberSource ¶
type BlockProcessor ¶
type BlockProcessor interface {
ProcessBlock(ctx context.Context, block eth.L1BlockRef) error
}
type BlockProcessorFn ¶
type BlockProcessorFn func(ctx context.Context, block eth.L1BlockRef) error
func (BlockProcessorFn) ProcessBlock ¶
func (fn BlockProcessorFn) ProcessBlock(ctx context.Context, block eth.L1BlockRef) error
type ChainMonitor ¶
type ChainMonitor struct {
// contains filtered or unexported fields
}
ChainMonitor monitors a source L2 chain, retrieving the data required to populate the database and perform interop consolidation. It detects and notifies when reorgs occur.
func NewChainMonitor ¶
func (*ChainMonitor) Start ¶
func (c *ChainMonitor) Start() error
func (*ChainMonitor) Stop ¶
func (c *ChainMonitor) Stop() error
type ChainProcessor ¶
type ChainProcessor struct {
// contains filtered or unexported fields
}
ChainProcessor is a HeadProcessor that fills in any skipped blocks between head update events. It ensures that, absent reorgs, every block in the chain is processed even if some head advancements are skipped.
func NewChainProcessor ¶
func NewChainProcessor(log log.Logger, client BlockByNumberSource, chain types.ChainID, startingHead eth.L1BlockRef, processor BlockProcessor, rewinder DatabaseRewinder) *ChainProcessor
func (*ChainProcessor) OnNewHead ¶
func (s *ChainProcessor) OnNewHead(ctx context.Context, head eth.L1BlockRef)
type DatabaseRewinder ¶
type HeadChangeCallback ¶
type HeadChangeCallback interface { OnNewUnsafeHead(ctx context.Context, block eth.L1BlockRef) OnNewSafeHead(ctx context.Context, block eth.L1BlockRef) OnNewFinalizedHead(ctx context.Context, block eth.L1BlockRef) }
type HeadMonitor ¶
type HeadMonitor struct {
// contains filtered or unexported fields
}
HeadMonitor monitors an L2 chain and sends notifications when the unsafe, safe or finalized head changes. Head updates may be coalesced, allowing the head block to skip forward multiple blocks. Reorgs are not identified.
func NewHeadMonitor ¶
func NewHeadMonitor(logger log.Logger, epochPollInterval time.Duration, rpc HeadMonitorClient, callback HeadChangeCallback) *HeadMonitor
func (*HeadMonitor) Start ¶
func (h *HeadMonitor) Start() error
func (*HeadMonitor) Stop ¶
func (h *HeadMonitor) Stop() error
type HeadMonitorClient ¶
type HeadMonitorClient interface { eth.NewHeadSource eth.L1BlockRefsSource }
type HeadProcessor ¶
type HeadProcessor interface {
OnNewHead(ctx context.Context, head eth.L1BlockRef)
}
type HeadProcessorFn ¶
type HeadProcessorFn func(ctx context.Context, head eth.L1BlockRef)
func (HeadProcessorFn) OnNewHead ¶
func (f HeadProcessorFn) OnNewHead(ctx context.Context, head eth.L1BlockRef)
type LogStorage ¶
type ReceiptProcessor ¶
type ReceiptProcessorFn ¶
func (ReceiptProcessorFn) ProcessLogs ¶
func (r ReceiptProcessorFn) ProcessLogs(ctx context.Context, block eth.L1BlockRef, rcpts types.Receipts) error
type Storage ¶
type Storage interface { LogStorage DatabaseRewinder LatestBlockNum(chainID types.ChainID) uint64 }
Click to show internal directories.
Click to hide internal directories.