Documentation
¶
Index ¶
- type BlockProcessorFn
- type ChainMonitor
- type ChainProcessor
- type ChainsDBClientForLogProcessor
- type DatabaseRewinder
- type EventDecoder
- type HeadChangeCallback
- type HeadMonitor
- type HeadMonitorClient
- type HeadProcessor
- type HeadProcessorFn
- type LogProcessor
- type LogStorage
- type Metrics
- type Source
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockProcessorFn ¶
func (BlockProcessorFn) ProcessBlock ¶
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 Source, chain types.ChainID, processor LogProcessor, rewinder DatabaseRewinder) *ChainProcessor
func (*ChainProcessor) Close ¶ added in v1.9.4
func (s *ChainProcessor) Close()
type ChainsDBClientForLogProcessor ¶ added in v1.9.4
type DatabaseRewinder ¶
type EventDecoder ¶ added in v1.9.1
type EventDecoder interface {
DecodeExecutingMessageLog(log *ethTypes.Log) (types.ExecutingMessage, error)
}
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) error
}
type HeadProcessorFn ¶
type HeadProcessorFn func(ctx context.Context, head eth.L1BlockRef) error
func OnNewHead ¶ added in v1.9.4
func OnNewHead(id types.ChainID, apply func(id types.ChainID, v heads.HeadPointer) error) HeadProcessorFn
OnNewHead is a util function to turn a head-signal processor into head-pointer updater
func (HeadProcessorFn) OnNewHead ¶
func (f HeadProcessorFn) OnNewHead(ctx context.Context, head eth.L1BlockRef) error
type LogProcessor ¶ added in v1.9.4
type LogStorage ¶
type Storage ¶
type Storage interface {
ChainsDBClientForLogProcessor
DatabaseRewinder
LatestBlockNum(chainID types.ChainID) (num uint64, ok bool)
}