Documentation
¶
Index ¶
- Constants
- Variables
- func LogProviderFilterName(addr common.Address) string
- func NewEvmRegistryPackerV2_1(abi abi.ABI) *evmRegistryPackerV2_1
- func UpkeepFilterName(addr common.Address) string
- type BlockKeyHelper
- type EVMAutomationEncoder21
- func (enc EVMAutomationEncoder21) DecodeReport(report []byte) ([]ocr2keepers.UpkeepResult, error)
- func (enc EVMAutomationEncoder21) Detail(result ocr2keepers.UpkeepResult) (ocr2keepers.UpkeepKey, uint32, error)
- func (enc EVMAutomationEncoder21) Eligible(result ocr2keepers.UpkeepResult) (bool, error)
- func (enc EVMAutomationEncoder21) EncodeReport(toReport []ocr2keepers.UpkeepResult) ([]byte, error)
- func (enc EVMAutomationEncoder21) KeysFromReport(b []byte) ([]ocr2keepers.UpkeepKey, error)
- type EVMAutomationUpkeepResult21
- 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(ctx context.Context) ([]ocr2keepers.UpkeepIdentifier, error)
- func (r *EvmRegistry) GetActiveUpkeepIDsByType(ctx context.Context, triggers ...uint8) ([]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 HttpClient
- 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 MercuryBytes
- type MercuryConfig
- type MercuryLookup
- type MercuryResponse
- 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 ( 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 ( Uint256 = mustNewType("uint256", "", nil) Uint256Arr = mustNewType("uint256[]", "", nil) BytesArr = mustNewType("bytes[]", "", nil) TriggerMarshalingArgs = []abi.ArgumentMarshaling{ {Name: "blockNumber", Type: "uint32"}, {Name: "blockHash", Type: "bytes32"}, } TriggerArr = mustNewType("tuple(uint32,bytes32)[]", "", TriggerMarshalingArgs) 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 EVMAutomationEncoder21 ¶
type EVMAutomationEncoder21 struct {
encoding.BasicEncoder
}
func (EVMAutomationEncoder21) DecodeReport ¶
func (enc EVMAutomationEncoder21) DecodeReport(report []byte) ([]ocr2keepers.UpkeepResult, error)
func (EVMAutomationEncoder21) Detail ¶
func (enc EVMAutomationEncoder21) Detail(result ocr2keepers.UpkeepResult) (ocr2keepers.UpkeepKey, uint32, error)
func (EVMAutomationEncoder21) Eligible ¶
func (enc EVMAutomationEncoder21) Eligible(result ocr2keepers.UpkeepResult) (bool, error)
func (EVMAutomationEncoder21) EncodeReport ¶
func (enc EVMAutomationEncoder21) EncodeReport(toReport []ocr2keepers.UpkeepResult) ([]byte, error)
func (EVMAutomationEncoder21) KeysFromReport ¶
func (enc EVMAutomationEncoder21) KeysFromReport(b []byte) ([]ocr2keepers.UpkeepKey, error)
type EVMAutomationUpkeepResult21 ¶
type EVMAutomationUpkeepResult21 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 NewEVMRegistryService(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 ...ocr2keepers.UpkeepKey) ([]ocr2keepers.UpkeepResult, error)
TODO: should be called with ocr2keepers.UpkeepPayload
func (*EvmRegistry) Close ¶
func (r *EvmRegistry) Close() error
func (*EvmRegistry) GetActiveUpkeepIDs ¶
func (r *EvmRegistry) GetActiveUpkeepIDs(ctx context.Context) ([]ocr2keepers.UpkeepIdentifier, error)
GetActiveUpkeepIDs uses the latest head and map of all active upkeeps to build a slice of upkeep keys.
func (*EvmRegistry) GetActiveUpkeepIDsByType ¶
func (r *EvmRegistry) GetActiveUpkeepIDsByType(ctx context.Context, triggers ...uint8) ([]ocr2keepers.UpkeepIdentifier, error)
GetActiveUpkeepIDsByType returns all active upkeeps of the given trigger types.
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 MercuryBytes ¶
type MercuryConfig ¶
type MercuryConfig struct {
// contains filtered or unexported fields
}
type MercuryLookup ¶
type MercuryLookup struct {
// contains filtered or unexported fields
}
type MercuryResponse ¶
type MercuryResponse struct {
ChainlinkBlob string `json:"chainlinkBlob"`
}
type Registry ¶
type Registry interface { GetUpkeep(opts *bind.CallOpts, id *big.Int) (iregistry21.UpkeepInfo, error) GetState(opts *bind.CallOpts) (iregistry21.GetState, error) GetActiveUpkeepIDs(opts *bind.CallOpts, startIndex *big.Int, maxCount *big.Int) ([]*big.Int, error) GetActiveUpkeepIDsByType(opts *bind.CallOpts, startIndex *big.Int, endIndex *big.Int, trigger uint8) ([]*big.Int, error) GetUpkeepAdminOffchainConfig(opts *bind.CallOpts, upkeepId *big.Int) ([]byte, error) GetUpkeepTriggerConfig(opts *bind.CallOpts, upkeepId *big.Int) ([]byte, error) MercuryCallback(opts *bind.TransactOpts, id *big.Int, values [][]byte, extraData []byte) (*coreTypes.Transaction, 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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.