logprovider

package
v2.4.1-scale-20230817 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHeadNotAvailable   = fmt.Errorf("head not available")
	ErrBlockLimitExceeded = fmt.Errorf("block limit exceeded")
)
View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

func New

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

func NewLogEventsPacker

func NewLogEventsPacker(utilsABI abi.ABI) *logEventsPacker

func NewLogRecoverer added in v2.5.0

func NewLogRecoverer(lggr logger.Logger, poller logpoller.LogPoller, interval time.Duration) *logRecoverer

func NewUpkeepFilterStore added in v2.5.0

func NewUpkeepFilterStore() *upkeepFilterStore

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
	// GetLatestPayloads returns the logs in the given range.
	GetLatestPayloads(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
	CurrentPartitionIdx() uint64
}

type LogTriggerConfig

type LogTriggerConfig automation_utils_2_1.LogTriggerConfig

LogTriggerConfig is an alias for log trigger config.

type UpkeepFilterStore added in v2.5.0

type UpkeepFilterStore interface {
	GetIDs(selector func(upkeepFilter) bool) []*big.Int
	UpdateFilters(updater func(upkeepFilter, upkeepFilter) upkeepFilter, filters ...upkeepFilter)
	Has(id *big.Int) bool
	RangeFiltersByIDs(iterator func(int, upkeepFilter), ids ...*big.Int)
	GetFilters(selector func(upkeepFilter) bool) []upkeepFilter
	AddActiveUpkeeps(filters ...upkeepFilter)
	RemoveActiveUpkeeps(filters ...upkeepFilter)
	Size() int
}

Jump to

Keyboard shortcuts

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