Documentation ¶
Index ¶
- Constants
- Variables
- func LogProviderFilterName(addr common.Address) string
- func NewEvmRegistryPackerV2_0(abi abi.ABI) *evmRegistryPackerV2_0
- func UpkeepFilterName(addr common.Address) string
- type BlockKeyHelper
- type EVMAutomationEncoder20
- func (enc EVMAutomationEncoder20) DecodeReport(report []byte) ([]ocr2keepers.UpkeepResult, error)
- func (enc EVMAutomationEncoder20) Detail(result ocr2keepers.UpkeepResult) (ocr2keepers.UpkeepKey, uint32, error)
- func (enc EVMAutomationEncoder20) Eligible(result ocr2keepers.UpkeepResult) (bool, error)
- func (enc EVMAutomationEncoder20) EncodeReport(toReport []ocr2keepers.UpkeepResult) ([]byte, error)
- func (enc EVMAutomationEncoder20) KeysFromReport(b []byte) ([]ocr2keepers.UpkeepKey, error)
- type EVMAutomationUpkeepResult20
- type EvmRegistry
- func (r *EvmRegistry) CheckUpkeep(ctx context.Context, mercuryEnabled bool, keys ...ocr2keepers.UpkeepKey) ([]ocr2keepers.UpkeepResult, error)
- func (r *EvmRegistry) Close() error
- func (r *EvmRegistry) GetActiveUpkeepIDs(context.Context) ([]ocr2keepers.UpkeepIdentifier, error)
- func (r *EvmRegistry) HealthReport() map[string]error
- func (r *EvmRegistry) Name() string
- func (r *EvmRegistry) Ready() error
- func (r *EvmRegistry) Start(ctx context.Context) error
- type HeadProvider
- type LatestBlockGetter
- type LogProvider
- func (c *LogProvider) Close() error
- func (c *LogProvider) HealthReport() map[string]error
- func (c *LogProvider) Name() string
- func (c *LogProvider) PerformLogs(ctx context.Context) ([]ocr2keepers.PerformLog, error)
- func (c *LogProvider) Ready() error
- func (c *LogProvider) StaleReportLogs(ctx context.Context) ([]ocr2keepers.StaleReportLog, error)
- func (c *LogProvider) Start(ctx context.Context) error
- type Registry
- type TransmitUnpacker
- type UpkeepKeyHelper
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 ( // 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 (
Uint256, _ = abi.NewType("uint256", "", nil)
Uint256Arr, _ = abi.NewType("uint256[]", "", nil)
PerformDataMarshalingArgs = []abi.ArgumentMarshaling{
{Name: "checkBlockNumber", Type: "uint32"},
{Name: "checkBlockhash", Type: "bytes32"},
{Name: "performData", Type: "bytes"},
}
PerformDataArr, _ = abi.NewType("tuple(uint32,bytes32,bytes)[]", "", PerformDataMarshalingArgs)
ErrUnexpectedResult = fmt.Errorf("unexpected result struct")
)
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 LogProviderFilterName ¶
func UpkeepFilterName ¶
Types ¶
type BlockKeyHelper ¶
func (BlockKeyHelper[T]) MakeBlockKey ¶
func (kh BlockKeyHelper[T]) MakeBlockKey(b T) ocr2keepers.BlockKey
type EVMAutomationEncoder20 ¶
type EVMAutomationEncoder20 struct {
encoding.BasicEncoder
}
func (EVMAutomationEncoder20) DecodeReport ¶
func (enc EVMAutomationEncoder20) DecodeReport(report []byte) ([]ocr2keepers.UpkeepResult, error)
func (EVMAutomationEncoder20) Detail ¶
func (enc EVMAutomationEncoder20) Detail(result ocr2keepers.UpkeepResult) (ocr2keepers.UpkeepKey, uint32, error)
func (EVMAutomationEncoder20) Eligible ¶
func (enc EVMAutomationEncoder20) Eligible(result ocr2keepers.UpkeepResult) (bool, error)
func (EVMAutomationEncoder20) EncodeReport ¶
func (enc EVMAutomationEncoder20) EncodeReport(toReport []ocr2keepers.UpkeepResult) ([]byte, error)
func (EVMAutomationEncoder20) KeysFromReport ¶
func (enc EVMAutomationEncoder20) KeysFromReport(b []byte) ([]ocr2keepers.UpkeepKey, error)
type EVMAutomationUpkeepResult20 ¶
type EVMAutomationUpkeepResult20 struct { // Block is the block number used to build an UpkeepKey for this result Block uint32 // ID is the unique identifier for the upkeep ID *big.Int Eligible bool FailureReason uint8 GasUsed *big.Int PerformData []byte FastGasWei *big.Int LinkNative *big.Int // CheckBlockNumber is the block number that the contract indicates the // upkeep was checked on CheckBlockNumber uint32 CheckBlockHash [32]byte ExecuteGas uint32 }
type EvmRegistry ¶
type EvmRegistry struct { HeadProvider // contains filtered or unexported fields }
func NewEVMRegistryService ¶
func (*EvmRegistry) CheckUpkeep ¶
func (r *EvmRegistry) CheckUpkeep(ctx context.Context, mercuryEnabled bool, keys ...ocr2keepers.UpkeepKey) ([]ocr2keepers.UpkeepResult, error)
func (*EvmRegistry) Close ¶
func (r *EvmRegistry) Close() error
func (*EvmRegistry) GetActiveUpkeepIDs ¶
func (r *EvmRegistry) GetActiveUpkeepIDs(context.Context) ([]ocr2keepers.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) Name ¶
func (r *EvmRegistry) Name() string
func (*EvmRegistry) Ready ¶
func (r *EvmRegistry) Ready() error
type HeadProvider ¶
type HeadProvider struct {
// contains filtered or unexported fields
}
func (*HeadProvider) HeadTicker ¶
func (hw *HeadProvider) HeadTicker() chan ocr2keepers.BlockKey
HeadTicker provides external access to the heads channel
func (*HeadProvider) LatestBlock ¶
func (hw *HeadProvider) LatestBlock() int64
type LatestBlockGetter ¶
type LatestBlockGetter interface {
LatestBlock() int64
}
type LogProvider ¶
type LogProvider struct {
// contains filtered or unexported fields
}
func NewLogProvider ¶
func (*LogProvider) Close ¶
func (c *LogProvider) Close() error
func (*LogProvider) HealthReport ¶
func (c *LogProvider) HealthReport() map[string]error
func (*LogProvider) Name ¶
func (c *LogProvider) Name() string
func (*LogProvider) PerformLogs ¶
func (c *LogProvider) PerformLogs(ctx context.Context) ([]ocr2keepers.PerformLog, error)
func (*LogProvider) Ready ¶
func (c *LogProvider) Ready() error
func (*LogProvider) StaleReportLogs ¶
func (c *LogProvider) StaleReportLogs(ctx context.Context) ([]ocr2keepers.StaleReportLog, error)
type Registry ¶
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) }
type TransmitUnpacker ¶
type TransmitUnpacker interface {
UnpackTransmitTxInput([]byte) ([]ocr2keepers.UpkeepResult, error)
}
type UpkeepKeyHelper ¶
func (UpkeepKeyHelper[T]) MakeUpkeepKey ¶
func (kh UpkeepKeyHelper[T]) MakeUpkeepKey(b T, id *big.Int) ocr2keepers.UpkeepKey
Click to show internal directories.
Click to hide internal directories.