evm

package
v2.2.0-clf-20230606 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UPKEEP_FAILURE_REASON_NONE = iota
	UPKEEP_FAILURE_REASON_UPKEEP_CANCELLED
	UPKEEP_FAILURE_REASON_UPKEEP_PAUSED
	UPKEEP_FAILURE_REASON_TARGET_CHECK_REVERTED
	UPKEEP_FAILURE_REASON_UPKEEP_NOT_NEEDED
	UPKEEP_FAILURE_REASON_PERFORM_DATA_EXCEEDS_LIMIT
	UPKEEP_FAILURE_REASON_INSUFFICIENT_BALANCE
)

enum UpkeepFailureReason https://github.com/smartcontractkit/chainlink/blob/d9dee8ea6af26bc82463510cb8786b951fa98585/contracts/src/v0.8/interfaces/AutomationRegistryInterface2_0.sol#L94

View Source
const (
	RetryDelay   = 500 * time.Millisecond
	TotalAttempt = 3
)
View Source
const (
	// DefaultUpkeepExpiration decides how long an upkeep info will be valid for. after it expires, a getUpkeepInfo
	// call will be made to the registry to obtain the most recent upkeep info and refresh this cache.
	DefaultUpkeepExpiration = 10 * time.Minute
	// DefaultCooldownExpiration decides how long a Mercury upkeep will be put in cool down for the first time. within
	// 10 minutes, subsequent failures will result in double amount of cool down period.
	DefaultCooldownExpiration = 5 * time.Second
	// DefaultApiErrExpiration decides a running sum of total errors of an upkeep in this 10 minutes window. it is used
	// to decide how long the cool down period will be.
	DefaultApiErrExpiration = 10 * time.Minute
	// CleanupInterval decides when the expired items in cache will be deleted.
	CleanupInterval = 15 * time.Minute
)

Variables

View Source
var (
	ErrLogReadFailure                = fmt.Errorf("failure reading logs")
	ErrHeadNotAvailable              = fmt.Errorf("head not available")
	ErrRegistryCallFailure           = fmt.Errorf("registry chain call failure")
	ErrBlockKeyNotParsable           = fmt.Errorf("block identifier not parsable")
	ErrUpkeepKeyNotParsable          = fmt.Errorf("upkeep key not parsable")
	ErrInitializationFailure         = fmt.Errorf("failed to initialize registry")
	ErrContextCancelled              = fmt.Errorf("context was cancelled")
	ErrABINotParsable                = fmt.Errorf("error parsing abi")
	ActiveUpkeepIDBatchSize    int64 = 1000
	FetchUpkeepConfigBatchSize       = 10
)

Functions

func NewEvmRegistryPackerV2_0

func NewEvmRegistryPackerV2_0(abi abi.ABI) *evmRegistryPackerV2_0

func UpkeepFilterName

func UpkeepFilterName(addr common.Address) string

Types

type EvmRegistry

type EvmRegistry struct {
	HeadProvider
	// contains filtered or unexported fields
}

func NewEVMRegistryServiceV2_0

func NewEVMRegistryServiceV2_0(addr common.Address, client evm.Chain, mc *models.MercuryCredentials, lggr logger.Logger) (*EvmRegistry, error)

func (*EvmRegistry) CheckUpkeep

func (r *EvmRegistry) CheckUpkeep(ctx context.Context, mercuryEnabled bool, keys ...types.UpkeepKey) (types.UpkeepResults, error)

func (*EvmRegistry) Close

func (r *EvmRegistry) Close() error

func (*EvmRegistry) GetActiveUpkeepIDs

func (r *EvmRegistry) GetActiveUpkeepIDs(context.Context) ([]types.UpkeepIdentifier, error)

GetActiveUpkeepKeys uses the latest head and map of all active upkeeps to build a slice of upkeep keys.

func (*EvmRegistry) HealthReport

func (r *EvmRegistry) HealthReport() map[string]error

func (*EvmRegistry) IdentifierFromKey

func (r *EvmRegistry) IdentifierFromKey(key types.UpkeepKey) (types.UpkeepIdentifier, error)

func (*EvmRegistry) Name

func (r *EvmRegistry) Name() string

func (*EvmRegistry) Ready

func (r *EvmRegistry) Ready() error

func (*EvmRegistry) Start

func (r *EvmRegistry) Start(ctx context.Context) error

type HeadProvider

type HeadProvider struct {
	// contains filtered or unexported fields
}

func (*HeadProvider) HeadTicker

func (hw *HeadProvider) HeadTicker() chan types.BlockKey

HeadTicker provides external access to the heads channel

func (*HeadProvider) LatestBlock

func (hw *HeadProvider) LatestBlock() int64

type HttpClient added in v2.2.0

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type LatestBlockGetter

type LatestBlockGetter interface {
	LatestBlock() int64
}

type MercuryBytes added in v2.2.0

type MercuryBytes struct {
	Index int
	Error error
	Bytes []byte
}

type MercuryConfig added in v2.2.0

type MercuryConfig struct {
	// contains filtered or unexported fields
}

type MercuryLookup added in v2.2.0

type MercuryLookup struct {
	// contains filtered or unexported fields
}

type MercuryResponse added in v2.2.0

type MercuryResponse struct {
	ChainlinkBlob string `json:"chainlinkBlob"`
}

type Registry added in v2.2.0

type Registry interface {
	GetUpkeep(opts *bind.CallOpts, id *big.Int) (keeper_registry_wrapper2_0.UpkeepInfo, error)
	GetState(opts *bind.CallOpts) (keeper_registry_wrapper2_0.GetState, error)
	GetActiveUpkeepIDs(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error)
	ParseLog(log coreTypes.Log) (generated.AbigenLog, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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