Documentation ¶
Index ¶
- Constants
- Variables
- func CalcPositioningConstant(upkeepID *utils.Big, registryAddress ethkey.EIP55Address) (int32, error)
- func ValidatedKeeperSpec(tomlString string) (job.Job, error)
- type Config
- type Delegate
- type KeeperIndexMap
- type MailRoom
- type ORM
- func (korm ORM) AllUpkeepIDsForRegistry(regID int64) (upkeeps []utils.Big, err error)
- func (korm ORM) BatchDeleteUpkeepsForJob(jobID int32, upkeepIDs []utils.Big) (int64, error)
- func (korm ORM) EligibleUpkeepsForRegistry(registryAddress ethkey.EIP55Address, blockNumber, gracePeriod int64) (upkeeps []UpkeepRegistration, err error)
- func (korm ORM) NewEligibleUpkeepsForRegistry(registryAddress ethkey.EIP55Address, blockNumber int64, gracePeriod int64, ...) (upkeeps []UpkeepRegistration, err error)
- func (korm ORM) Q() pg.Q
- func (korm ORM) Registries() ([]Registry, error)
- func (korm ORM) RegistryByContractAddress(registryAddress ethkey.EIP55Address) (Registry, error)
- func (korm ORM) RegistryForJob(jobID int32) (Registry, error)
- func (korm ORM) SetLastRunInfoForUpkeepOnJob(jobID int32, upkeepID *utils.Big, height int64, ...) error
- func (korm ORM) UpdateUpkeepLastKeeperIndex(jobID int32, upkeepID *utils.Big, fromAddress ethkey.EIP55Address) error
- func (korm ORM) UpsertRegistry(registry *Registry) error
- func (korm ORM) UpsertUpkeep(registration *UpkeepRegistration) error
- type Registry
- type RegistryConfig
- type RegistrySynchronizer
- func (rs *RegistrySynchronizer) Close() error
- func (rs *RegistrySynchronizer) HandleLog(broadcast log.Broadcast)
- func (rs *RegistrySynchronizer) HandleUpkeepReceived(broadcast log.Broadcast, registry Registry)
- func (rs *RegistrySynchronizer) HandleUpkeepRegistered(broadcast log.Broadcast, registry Registry)
- func (rs *RegistrySynchronizer) JobID() int32
- func (rs *RegistrySynchronizer) Start(context.Context) error
- type RegistrySynchronizerOptions
- type RegistryVersion
- type RegistryWrapper
- func (rw *RegistryWrapper) AddFunds(opts *bind.TransactOpts, id *big.Int, amount *big.Int) (*types.Transaction, error)
- func (rw *RegistryWrapper) CancelUpkeep(opts *bind.TransactOpts, id *big.Int) (*types.Transaction, error)
- func (rw *RegistryWrapper) GetActiveUpkeepIDs(opts *bind.CallOpts) ([]*big.Int, error)
- func (rw *RegistryWrapper) GetCancelledUpkeepIDFromLog(broadcast log.Broadcast) (*big.Int, error)
- func (rw *RegistryWrapper) GetConfig(opts *bind.CallOpts) (*RegistryConfig, error)
- func (rw *RegistryWrapper) GetIDFromGasLimitSetLog(broadcast log.Broadcast) (*big.Int, error)
- func (rw *RegistryWrapper) GetLogListenerOpts(minIncomingConfirmations uint32, upkeepPerformedFilter [][]log.Topic) (*log.ListenerOpts, error)
- func (rw *RegistryWrapper) GetUpkeep(opts *bind.CallOpts, id *big.Int) (*UpkeepConfig, error)
- func (rw *RegistryWrapper) GetUpkeepIdFromMigratedLog(broadcast log.Broadcast) (*big.Int, error)
- func (rw *RegistryWrapper) GetUpkeepIdFromReceivedLog(broadcast log.Broadcast) (*big.Int, error)
- func (rw *RegistryWrapper) GetUpkeepIdFromRegistrationLog(broadcast log.Broadcast) (*big.Int, error)
- func (rw *RegistryWrapper) ParseUpkeepPerformedLog(broadcast log.Broadcast) (*UpkeepPerformedLog, error)
- func (rw *RegistryWrapper) PerformUpkeep(opts *bind.TransactOpts, id *big.Int, performData []byte) (*types.Transaction, error)
- func (rw *RegistryWrapper) RegisterUpkeep(opts *bind.TransactOpts, target common.Address, gasLimit uint32, ...) (*types.Transaction, error)
- func (rw *RegistryWrapper) SetKeepers(opts *bind.TransactOpts, keepers []common.Address, payees []common.Address) (*types.Transaction, error)
- type UpkeepConfig
- type UpkeepExecuter
- type UpkeepPerformedLog
- type UpkeepRegistration
Constants ¶
const ( // ExpectedObservationSource this is the expected observation source of the keeper job. ExpectedObservationSource = `` /* 2519-byte string literal not displayed */ )
Variables ¶
var Registry1_1ABI = evmtypes.MustGetABI(keeper_registry_wrapper1_1.KeeperRegistryABI)
var Registry1_2ABI = evmtypes.MustGetABI(keeper_registry_wrapper1_2.KeeperRegistryABI)
Functions ¶
func CalcPositioningConstant ¶ added in v0.10.5
func CalcPositioningConstant(upkeepID *utils.Big, registryAddress ethkey.EIP55Address) (int32, error)
CalcPositioningConstant calculates a positioning constant. The positioning constant is fixed because upkeepID and registryAddress are immutable
Types ¶
type Config ¶ added in v0.10.11
type Config interface { EvmEIP1559DynamicFees() bool KeySpecificMaxGasPriceWei(addr gethcommon.Address) *big.Int KeeperDefaultTransactionQueueDepth() uint32 KeeperGasPriceBufferPercent() uint32 KeeperGasTipCapBufferPercent() uint32 KeeperBaseFeeBufferPercent() uint32 KeeperMaximumGracePeriod() int64 KeeperRegistryCheckGasOverhead() uint64 KeeperRegistryPerformGasOverhead() uint64 KeeperRegistrySyncInterval() time.Duration KeeperRegistrySyncUpkeepQueueSize() uint32 KeeperCheckUpkeepGasPriceFeatureEnabled() bool KeeperTurnLookBack() int64 KeeperTurnFlagEnabled() bool LogSQL() bool }
type Delegate ¶
type Delegate struct {
// contains filtered or unexported fields
}
func NewDelegate ¶
func NewDelegate( db *sqlx.DB, jrm job.ORM, pr pipeline.Runner, logger logger.Logger, chainSet evm.ChainSet, ) *Delegate
NewDelegate is the constructor of Delegate
func (Delegate) AfterJobCreated ¶ added in v0.10.11
func (Delegate) BeforeJobDeleted ¶ added in v0.10.11
func (*Delegate) ServicesForSpec ¶
ServicesForSpec satisfies the job.Delegate interface.
type KeeperIndexMap ¶ added in v1.4.0
type KeeperIndexMap map[ethkey.EIP55Address]int32
func (*KeeperIndexMap) Scan ¶ added in v1.4.0
func (k *KeeperIndexMap) Scan(val interface{}) error
type MailRoom ¶ added in v0.10.4
type MailRoom struct {
// contains filtered or unexported fields
}
MailRoom holds the log mailboxes for all the log types that keeper cares about
type ORM ¶
type ORM struct {
// contains filtered or unexported fields
}
ORM implements ORM layer using PostgreSQL
func (ORM) AllUpkeepIDsForRegistry ¶ added in v1.5.0
func (ORM) BatchDeleteUpkeepsForJob ¶ added in v0.10.4
BatchDeleteUpkeepsForJob deletes all upkeeps by the given IDs for the job with the given ID
func (ORM) EligibleUpkeepsForRegistry ¶ added in v0.10.8
func (korm ORM) EligibleUpkeepsForRegistry(registryAddress ethkey.EIP55Address, blockNumber, gracePeriod int64) (upkeeps []UpkeepRegistration, err error)
func (ORM) NewEligibleUpkeepsForRegistry ¶ added in v1.4.0
func (korm ORM) NewEligibleUpkeepsForRegistry(registryAddress ethkey.EIP55Address, blockNumber int64, gracePeriod int64, binaryHash string) (upkeeps []UpkeepRegistration, err error)
NewEligibleUpkeepsForRegistry fetches eligible upkeeps for processing The query checks the following conditions - checks the registry address is correct and the registry has some keepers associated -- is it my turn AND my keeper was not the last perform for this upkeep OR my keeper was the last before BUT it is past the grace period -- OR is it my buddy's turn AND they were the last keeper to do the perform for this upkeep DEV: note we cast upkeep_id and binaryHash as 32 bits, even though both are 256 bit numbers when performing XOR. This is enough information to disribute the upkeeps over the keepers so long as num keepers < 4294967296
func (ORM) Registries ¶
Registries returns all registries
func (ORM) RegistryByContractAddress ¶ added in v1.4.0
func (korm ORM) RegistryByContractAddress(registryAddress ethkey.EIP55Address) (Registry, error)
RegistryByContractAddress returns a single registry based on provided address
func (ORM) RegistryForJob ¶ added in v0.10.4
RegistryForJob returns a specific registry for a job with the given ID
func (ORM) SetLastRunInfoForUpkeepOnJob ¶ added in v1.4.0
func (korm ORM) SetLastRunInfoForUpkeepOnJob(jobID int32, upkeepID *utils.Big, height int64, fromAddress ethkey.EIP55Address, qopts ...pg.QOpt) error
SetLastRunInfoForUpkeepOnJob sets the last run block height and the associated keeper index only if the new block height is greater than the previous.
func (ORM) UpdateUpkeepLastKeeperIndex ¶ added in v1.5.0
func (korm ORM) UpdateUpkeepLastKeeperIndex(jobID int32, upkeepID *utils.Big, fromAddress ethkey.EIP55Address) error
UpdateUpkeepLastKeeperIndex updates the last keeper index for an upkeep
func (ORM) UpsertRegistry ¶
UpsertRegistry upserts registry by the given input
func (ORM) UpsertUpkeep ¶
func (korm ORM) UpsertUpkeep(registration *UpkeepRegistration) error
UpsertUpkeep upserts upkeep by the given input
type Registry ¶
type Registry struct { ID int64 BlockCountPerTurn int32 CheckGas int32 ContractAddress ethkey.EIP55Address FromAddress ethkey.EIP55Address JobID int32 KeeperIndex int32 NumKeepers int32 KeeperIndexMap KeeperIndexMap }
type RegistryConfig ¶ added in v1.5.0
type RegistrySynchronizer ¶
type RegistrySynchronizer struct { utils.StartStopOnce // contains filtered or unexported fields }
func NewRegistrySynchronizer ¶
func NewRegistrySynchronizer(opts RegistrySynchronizerOptions) *RegistrySynchronizer
NewRegistrySynchronizer is the constructor of RegistrySynchronizer
func (*RegistrySynchronizer) Close ¶
func (rs *RegistrySynchronizer) Close() error
func (*RegistrySynchronizer) HandleLog ¶ added in v0.10.4
func (rs *RegistrySynchronizer) HandleLog(broadcast log.Broadcast)
func (*RegistrySynchronizer) HandleUpkeepReceived ¶ added in v1.5.0
func (rs *RegistrySynchronizer) HandleUpkeepReceived(broadcast log.Broadcast, registry Registry)
func (*RegistrySynchronizer) HandleUpkeepRegistered ¶ added in v0.10.11
func (rs *RegistrySynchronizer) HandleUpkeepRegistered(broadcast log.Broadcast, registry Registry)
func (*RegistrySynchronizer) JobID ¶ added in v0.10.4
func (rs *RegistrySynchronizer) JobID() int32
type RegistrySynchronizerOptions ¶ added in v1.1.0
type RegistryVersion ¶ added in v1.5.0
type RegistryVersion int32
const ( RegistryVersion_1_0 RegistryVersion = iota RegistryVersion_1_1 RegistryVersion_1_2 )
type RegistryWrapper ¶ added in v1.5.0
type RegistryWrapper struct { Address ethkey.EIP55Address Version RegistryVersion // contains filtered or unexported fields }
RegistryWrapper implements a layer on top of different versions of registry wrappers to provide a unified layer to rest of the codebase
func NewRegistryWrapper ¶ added in v1.5.0
func NewRegistryWrapper(address ethkey.EIP55Address, backend bind.ContractBackend) (*RegistryWrapper, error)
func (*RegistryWrapper) AddFunds ¶ added in v1.5.0
func (rw *RegistryWrapper) AddFunds(opts *bind.TransactOpts, id *big.Int, amount *big.Int) (*types.Transaction, error)
func (*RegistryWrapper) CancelUpkeep ¶ added in v1.5.0
func (rw *RegistryWrapper) CancelUpkeep(opts *bind.TransactOpts, id *big.Int) (*types.Transaction, error)
func (*RegistryWrapper) GetActiveUpkeepIDs ¶ added in v1.5.0
func (*RegistryWrapper) GetCancelledUpkeepIDFromLog ¶ added in v1.5.0
func (*RegistryWrapper) GetConfig ¶ added in v1.5.0
func (rw *RegistryWrapper) GetConfig(opts *bind.CallOpts) (*RegistryConfig, error)
func (*RegistryWrapper) GetIDFromGasLimitSetLog ¶ added in v1.5.0
func (*RegistryWrapper) GetLogListenerOpts ¶ added in v1.5.0
func (rw *RegistryWrapper) GetLogListenerOpts(minIncomingConfirmations uint32, upkeepPerformedFilter [][]log.Topic) (*log.ListenerOpts, error)
func (*RegistryWrapper) GetUpkeep ¶ added in v1.5.0
func (rw *RegistryWrapper) GetUpkeep(opts *bind.CallOpts, id *big.Int) (*UpkeepConfig, error)
func (*RegistryWrapper) GetUpkeepIdFromMigratedLog ¶ added in v1.5.0
func (*RegistryWrapper) GetUpkeepIdFromReceivedLog ¶ added in v1.5.0
func (*RegistryWrapper) GetUpkeepIdFromRegistrationLog ¶ added in v1.5.0
func (*RegistryWrapper) ParseUpkeepPerformedLog ¶ added in v1.5.0
func (rw *RegistryWrapper) ParseUpkeepPerformedLog(broadcast log.Broadcast) (*UpkeepPerformedLog, error)
func (*RegistryWrapper) PerformUpkeep ¶ added in v1.5.0
func (rw *RegistryWrapper) PerformUpkeep(opts *bind.TransactOpts, id *big.Int, performData []byte) (*types.Transaction, error)
func (*RegistryWrapper) RegisterUpkeep ¶ added in v1.5.0
func (rw *RegistryWrapper) RegisterUpkeep(opts *bind.TransactOpts, target common.Address, gasLimit uint32, admin common.Address, checkData []byte) (*types.Transaction, error)
func (*RegistryWrapper) SetKeepers ¶ added in v1.5.0
func (rw *RegistryWrapper) SetKeepers(opts *bind.TransactOpts, keepers []common.Address, payees []common.Address) (*types.Transaction, error)
type UpkeepConfig ¶ added in v1.5.0
type UpkeepExecuter ¶ added in v0.10.6
type UpkeepExecuter struct { utils.StartStopOnce // contains filtered or unexported fields }
UpkeepExecuter implements the logic to communicate with KeeperRegistry
func NewUpkeepExecuter ¶ added in v0.10.6
func NewUpkeepExecuter( job job.Job, orm ORM, pr pipeline.Runner, ethClient evmclient.Client, headBroadcaster httypes.HeadBroadcaster, gasEstimator gas.Estimator, logger logger.Logger, config Config, ) *UpkeepExecuter
NewUpkeepExecuter is the constructor of UpkeepExecuter
func (*UpkeepExecuter) Close ¶ added in v0.10.6
func (ex *UpkeepExecuter) Close() error
Close stops and closes upkeep executer
func (*UpkeepExecuter) OnNewLongestChain ¶ added in v0.10.6
func (ex *UpkeepExecuter) OnNewLongestChain(_ context.Context, head *evmtypes.Head)
OnNewLongestChain handles the given head of a new longest chain
type UpkeepPerformedLog ¶ added in v1.5.0
type UpkeepRegistration ¶
type UpkeepRegistration struct { ID int32 CheckData []byte ExecuteGas uint64 LastRunBlockHeight int64 RegistryID int64 Registry Registry UpkeepID *utils.Big LastKeeperIndex null.Int64 PositioningConstant int32 }
func (UpkeepRegistration) PrettyID ¶ added in v1.5.0
func (upkeep UpkeepRegistration) PrettyID() string