processors

package
v1.13.7 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeExecutingMessageLog

func DecodeExecutingMessageLog(l *ethTypes.Log) (*types.ExecutingMessage, error)

func LogToLogHash added in v1.13.3

func LogToLogHash(l *ethTypes.Log) common.Hash

LogToLogHash transforms a log into a hash that represents the log. it is the concatenation of the log's address and the hash of the log's payload, which is then hashed again. This is the hash that is stored in the log storage. The address is hashed into the payload hash to save space in the log storage, and because they represent paired data.

func MessageFromLog added in v1.13.4

func MessageFromLog(l *ethTypes.Log) (*types.Message, error)

func NewEthClient

func NewEthClient(ctx context.Context, logger log.Logger, m caching.Metrics, rpc string, rpcClient client.RPC,
	pollRate time.Duration, trustRPC bool, kind sources.RPCProviderKind) (*sources.L1Client, error)

NewEthClient creates an Eth RPC client for event-log fetching.

Types

type BlockProcessorFn

type BlockProcessorFn func(ctx context.Context, block eth.BlockRef) error

func (BlockProcessorFn) ProcessBlock

func (fn BlockProcessorFn) ProcessBlock(ctx context.Context, block eth.BlockRef) 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(systemContext context.Context, log log.Logger, chain eth.ChainID, processor LogProcessor, rewinder DatabaseRewinder) *ChainProcessor

func (*ChainProcessor) AddSource added in v1.11.2

func (s *ChainProcessor) AddSource(cl Source)

func (*ChainProcessor) AttachEmitter added in v1.11.0

func (s *ChainProcessor) AttachEmitter(em event.Emitter)

func (*ChainProcessor) OnEvent added in v1.11.0

func (s *ChainProcessor) OnEvent(ctx context.Context, ev event.Event) bool

func (*ChainProcessor) ProcessChain added in v1.13.6

func (s *ChainProcessor) ProcessChain(target uint64)

func (*ChainProcessor) UpdateTarget added in v1.13.4

func (s *ChainProcessor) UpdateTarget(newTarget uint64)

type DatabaseRewinder

type DatabaseRewinder interface {
	Rewind(chain eth.ChainID, headBlock eth.BlockID) error
	LatestBlockNum(chain eth.ChainID) (num uint64, ok bool)
	AcceptedBlock(chainID eth.ChainID, id eth.BlockID) error
}

type EventDecoderFn

type EventDecoderFn func(*ethTypes.Log) (*types.ExecutingMessage, error)

type LogProcessor

type LogProcessor interface {
	ProcessLogs(ctx context.Context, block eth.BlockRef, receipts gethtypes.Receipts) error
}

func NewLogProcessor

func NewLogProcessor(chain eth.ChainID, logStore LogStorage) LogProcessor

type LogStorage

type LogStorage interface {
	SealBlock(chain eth.ChainID, block eth.BlockRef) error
	AddLog(chain eth.ChainID, logHash common.Hash, parentBlock eth.BlockID, logIdx uint32, execMsg *types.ExecutingMessage) error
}

type Source

type Source interface {
	L2BlockRefByNumber(ctx context.Context, number uint64) (eth.L2BlockRef, error)
	FetchReceipts(ctx context.Context, blockHash common.Hash) (gethtypes.Receipts, error)
}

Jump to

Keyboard shortcuts

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