Documentation ¶
Index ¶
- Variables
- func AccountToAddress(accounts []types.Account) (addresses []common.Address, err error)
- func ConfigFromLog(logData []byte) (ocrtypes.ContractConfig, error)
- func IsLaterThan(incoming gethTypes.Log, existing gethTypes.Log) bool
- func NewOCR2DRProvider(chainSet evm.ChainSet, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs, ...) (relaytypes.Plugin, error)
- func NewOCRContractTransmitter(address gethcommon.Address, caller contractReader, contractABI abi.ABI, ...) (*contractTransmitter, error)
- func NewRoundRequestedDB(sqldb *sql.DB, oracleSpecID int32, lggr logger.Logger) *requestRoundDB
- func OnchainPublicKeyToAddress(publicKeys []types.OnchainPublicKey) (addresses []common.Address, err error)
- type ConfigPoller
- func (lp *ConfigPoller) LatestBlockHeight(ctx context.Context) (blockHeight uint64, err error)
- func (lp *ConfigPoller) LatestConfig(ctx context.Context, changedInBlock uint64) (ocrtypes.ContractConfig, error)
- func (lp *ConfigPoller) LatestConfigDetails(ctx context.Context) (changedInBlock uint64, configDigest ocrtypes.ConfigDigest, err error)
- func (lp *ConfigPoller) Notify() <-chan struct{}
- type ContractTransmitter
- type DKGProvider
- type OCR2AbstractConfigSet
- type OCR2KeeperProvider
- type OCR2KeeperProviderOpts
- type OCR2KeeperRelayer
- type OCR2VRFProvider
- type OCR2VRFRelayer
- type Relayer
- func (r *Relayer) Close() error
- func (r *Relayer) Healthy() error
- func (r *Relayer) NewConfigProvider(args relaytypes.RelayArgs) (relaytypes.ConfigProvider, error)
- func (r *Relayer) NewMedianProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MedianProvider, error)
- func (r *Relayer) NewMercuryMedianProvider(relayConfig types.RelayConfig) (contractTransmitter ContractTransmitter, reportCodec median.ReportCodec, ...)
- func (r *Relayer) Ready() error
- func (r *Relayer) Start(context.Context) error
- type RelayerConfig
- type RequestRoundDB
- type RequestRoundTracker
- func (t *RequestRoundTracker) Close() error
- func (t *RequestRoundTracker) HandleLog(lb log.Broadcast)
- func (t *RequestRoundTracker) IsV2Job() bool
- func (t *RequestRoundTracker) JobID() int32
- func (t *RequestRoundTracker) LatestRoundRequested(_ context.Context, lookback time.Duration) (configDigest ocrtypes.ConfigDigest, epoch uint32, round uint8, err error)
- func (t *RequestRoundTracker) Start() error
- type Transmitter
Constants ¶
This section is empty.
Variables ¶
var ConfigSet = common.HexToHash("0x1591690b8638f5fb2dbec82ac741805ac5da8b45dc5263f4875b0496fdce4e05")
Common to all OCR2 evm based contracts: https://github.com/smartcontractkit/libocr/blob/master/contract2/OCR2Abstract.sol#L23
Functions ¶
func AccountToAddress ¶ added in v1.5.0
func ConfigFromLog ¶ added in v1.5.0
func ConfigFromLog(logData []byte) (ocrtypes.ContractConfig, error)
func IsLaterThan ¶
IsLaterThan returns true if the first log was emitted "after" the second log from the blockchain's point of view
func NewOCR2DRProvider ¶ added in v1.11.0
func NewOCR2DRProvider(chainSet evm.ChainSet, rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs, lggr logger.Logger, ethKeystore keystore.Eth) (relaytypes.Plugin, error)
func NewOCRContractTransmitter ¶
func NewOCRContractTransmitter( address gethcommon.Address, caller contractReader, contractABI abi.ABI, transmitter Transmitter, lp logpoller.LogPoller, lggr logger.Logger, ) (*contractTransmitter, error)
func NewRoundRequestedDB ¶ added in v1.3.0
NewDB returns a new DB scoped to this oracleSpecID
func OnchainPublicKeyToAddress ¶ added in v1.5.0
func OnchainPublicKeyToAddress(publicKeys []types.OnchainPublicKey) (addresses []common.Address, err error)
Types ¶
type ConfigPoller ¶ added in v1.5.0
type ConfigPoller struct {
// contains filtered or unexported fields
}
func NewConfigPoller ¶ added in v1.5.0
func (*ConfigPoller) LatestBlockHeight ¶ added in v1.5.0
func (lp *ConfigPoller) LatestBlockHeight(ctx context.Context) (blockHeight uint64, err error)
func (*ConfigPoller) LatestConfig ¶ added in v1.5.0
func (lp *ConfigPoller) LatestConfig(ctx context.Context, changedInBlock uint64) (ocrtypes.ContractConfig, error)
func (*ConfigPoller) LatestConfigDetails ¶ added in v1.5.0
func (lp *ConfigPoller) LatestConfigDetails(ctx context.Context) (changedInBlock uint64, configDigest ocrtypes.ConfigDigest, err error)
func (*ConfigPoller) Notify ¶ added in v1.5.0
func (lp *ConfigPoller) Notify() <-chan struct{}
type ContractTransmitter ¶
type ContractTransmitter interface { services.ServiceCtx ocrtypes.ContractTransmitter }
type DKGProvider ¶ added in v1.6.0
type DKGProvider interface { relaytypes.Plugin }
DKGProvider provides all components needed for a DKG plugin.
type OCR2AbstractConfigSet ¶ added in v1.5.0
type OCR2KeeperProvider ¶ added in v1.10.0
type OCR2KeeperProvider interface { relaytypes.Plugin }
OCR2KeeperProvider provides all components needed for a OCR2Keeper plugin.
type OCR2KeeperProviderOpts ¶ added in v1.10.0
type OCR2KeeperProviderOpts struct { RArgs relaytypes.RelayArgs PArgs relaytypes.PluginArgs InstanceID int }
OCR2KeeperProviderOpts is the custom options to create a keeper provider
type OCR2KeeperRelayer ¶ added in v1.10.0
type OCR2KeeperRelayer interface {
NewOCR2KeeperProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (OCR2KeeperProvider, error)
}
OCR2KeeperRelayer contains the relayer and instantiating functions for OCR2Keeper providers.
type OCR2VRFProvider ¶ added in v1.6.0
type OCR2VRFProvider interface { relaytypes.Plugin }
OCR2VRFProvider provides all components needed for a OCR2VRF plugin.
type OCR2VRFRelayer ¶ added in v1.6.0
type OCR2VRFRelayer interface { NewDKGProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (DKGProvider, error) NewOCR2VRFProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (OCR2VRFProvider, error) }
OCR2VRFRelayer contains the relayer and instantiating functions for OCR2VRF providers.
type Relayer ¶
type Relayer struct {
// contains filtered or unexported fields
}
func NewRelayer ¶
func (*Relayer) NewConfigProvider ¶ added in v1.5.0
func (r *Relayer) NewConfigProvider(args relaytypes.RelayArgs) (relaytypes.ConfigProvider, error)
func (*Relayer) NewMedianProvider ¶ added in v1.5.0
func (r *Relayer) NewMedianProvider(rargs relaytypes.RelayArgs, pargs relaytypes.PluginArgs) (relaytypes.MedianProvider, error)
func (*Relayer) NewMercuryMedianProvider ¶ added in v1.11.0
func (r *Relayer) NewMercuryMedianProvider(relayConfig types.RelayConfig) (contractTransmitter ContractTransmitter, reportCodec median.ReportCodec, err error)
type RelayerConfig ¶ added in v1.11.0
type RequestRoundDB ¶ added in v1.3.0
type RequestRoundDB interface { SaveLatestRoundRequested(tx pg.Queryer, rr ocr2aggregator.OCR2AggregatorRoundRequested) error LoadLatestRoundRequested() (rr ocr2aggregator.OCR2AggregatorRoundRequested, err error) }
RequestRoundDB stores requested rounds for querying by the median plugin.
type RequestRoundTracker ¶ added in v1.3.0
type RequestRoundTracker struct { utils.StartStopOnce // contains filtered or unexported fields }
RequestRoundTracker subscribes to new request round logs.
func NewRequestRoundTracker ¶ added in v1.3.0
func NewRequestRoundTracker( contract *offchain_aggregator_wrapper.OffchainAggregator, contractFilterer *ocr2aggregator.OCR2AggregatorFilterer, ethClient evmclient.Client, logBroadcaster log.Broadcaster, jobID int32, lggr logger.Logger, db *sqlx.DB, odb RequestRoundDB, chain ocrcommon.Config, ) (o *RequestRoundTracker)
NewRequestRoundTracker makes a new RequestRoundTracker
func (*RequestRoundTracker) Close ¶ added in v1.3.0
func (t *RequestRoundTracker) Close() error
Close should be called after teardown of the OCR job relying on this tracker
func (*RequestRoundTracker) HandleLog ¶ added in v1.3.0
func (t *RequestRoundTracker) HandleLog(lb log.Broadcast)
HandleLog complies with LogListener interface It is not thread safe
func (*RequestRoundTracker) IsV2Job ¶ added in v1.3.0
func (t *RequestRoundTracker) IsV2Job() bool
IsV2Job complies with LogListener interface
func (*RequestRoundTracker) JobID ¶ added in v1.3.0
func (t *RequestRoundTracker) JobID() int32
JobID complies with LogListener interface
func (*RequestRoundTracker) LatestRoundRequested ¶ added in v1.3.0
func (t *RequestRoundTracker) LatestRoundRequested(_ context.Context, lookback time.Duration) (configDigest ocrtypes.ConfigDigest, epoch uint32, round uint8, err error)
LatestRoundRequested returns the configDigest, epoch, and round from the latest RoundRequested event emitted by the contract. LatestRoundRequested may or may not return a result if the latest such event was emitted in a block b such that b.timestamp < tip.timestamp - lookback.
If no event is found, LatestRoundRequested should return zero values, not an error. An error should only be returned if an actual error occurred during execution, e.g. because there was an error querying the blockchain or the database.
As an optimization, this function may also return zero values, if no RoundRequested event has been emitted after the latest NewTransmission event.
func (*RequestRoundTracker) Start ¶ added in v1.3.0
func (t *RequestRoundTracker) Start() error
Start must be called before logs can be delivered It ought to be called before starting OCR
type Transmitter ¶
type Transmitter interface { CreateEthTransaction(ctx context.Context, toAddress gethcommon.Address, payload []byte) error FromAddress() gethcommon.Address }