logprovider

package
v2.4.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockLimitExceeded = "block limit exceeded"
)

Variables

View Source
var (
	ErrHeadNotAvailable = fmt.Errorf("head not available")
)

Functions

func New

func New(lggr logger.Logger, poller logpoller.LogPoller, packer LogDataPacker, opts *LogEventProviderOptions) *logEventProvider

func NewLogEventsPacker

func NewLogEventsPacker(utilsABI abi.ABI) *logEventsPacker

Types

type LogDataPacker

type LogDataPacker interface {
	PackLogData(log logpoller.Log) ([]byte, error)
}

type LogEventProvider

type LogEventProvider interface {
	// Start starts the log event provider.
	Start(ctx context.Context) error
	// Close closes the log event provider.
	Close() error
	// RegisterFilter registers the filter (if valid) for the given upkeepID.
	RegisterFilter(upkeepID *big.Int, cfg LogTriggerConfig) error
	// UnregisterFilter removes the filter for the given upkeepID.
	UnregisterFilter(upkeepID *big.Int) error
	// GetLogs returns the logs in the given range.
	GetLogs(context.Context) ([]ocr2keepers.UpkeepPayload, error)
}

type LogEventProviderOptions

type LogEventProviderOptions struct {
	// LogRetention is the amount of time to retain logs for.
	LogRetention time.Duration
	// AllowedLogsPerBlock is the maximum number of logs allowed per block in the buffer.
	BufferMaxBlockSize int
	// LogBufferSize is the number of blocks in the buffer.
	LogBufferSize int
	// AllowedLogsPerBlock is the maximum number of logs allowed per block & upkeep in the buffer.
	AllowedLogsPerBlock int
	// LogBlocksLookback is the number of blocks to look back for logs.
	LogBlocksLookback int64
	// LookbackBuffer is the number of blocks to add as a buffer to the lookback.
	LookbackBuffer int64
	// BlockRateLimit is the rate limit for fetching logs per block.
	BlockRateLimit rate.Limit
	// BlockLimitBurst is the burst limit for fetching logs per block.
	BlockLimitBurst int
	// ReadInterval is the interval to fetch logs in the background.
	ReadInterval time.Duration
	// ReadMaxBatchSize is the max number of items in one read batch / partition.
	ReadMaxBatchSize int
	// Readers is the number of reader workers to spawn.
	Readers int
}

LogEventProviderOptions holds the options for the log event provider.

func (*LogEventProviderOptions) Defaults

func (o *LogEventProviderOptions) Defaults()

Defaults sets the default values for the options.

type LogEventProviderTest

type LogEventProviderTest interface {
	LogEventProvider
	ReadLogs(ctx context.Context, force bool, ids ...*big.Int) error
}

type LogTriggerConfig

type LogTriggerConfig automation_utils_2_1.LogTriggerConfig

LogTriggerConfig is an alias for log trigger config.

type LogTriggerExtension

type LogTriggerExtension struct {
	TxHash   string
	LogIndex int64
}

Jump to

Keyboard shortcuts

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