Documentation ¶
Index ¶
- Variables
- func IsLaterThan(incoming gethTypes.Log, existing gethTypes.Log) bool
- func NewContractDB(sqldb *sql.DB, oracleSpecID int32, lggr logger.Logger) *contractDB
- type ContractTracker
- func (t *ContractTracker) Close() error
- func (t *ContractTracker) Connect(*evmtypes.Head) error
- func (t *ContractTracker) HandleLog(lb log.Broadcast)
- func (t *ContractTracker) IsV2Job() bool
- func (t *ContractTracker) JobID() int32
- func (t *ContractTracker) LatestBlockHeight(ctx context.Context) (blockheight uint64, err error)
- func (t *ContractTracker) LatestConfig(ctx context.Context, changedInBlock uint64) (ocrtypes.ContractConfig, error)
- func (t *ContractTracker) LatestConfigDetails(ctx context.Context) (changedInBlock uint64, configDigest ocrtypes.ConfigDigest, err error)
- func (t *ContractTracker) LatestRoundRequested(_ context.Context, lookback time.Duration) (configDigest ocrtypes.ConfigDigest, epoch uint32, round uint8, err error)
- func (t *ContractTracker) Notify() <-chan struct{}
- func (t *ContractTracker) OnNewLongestChain(_ context.Context, h *evmtypes.Head)
- func (t *ContractTracker) Start() error
- type ContractTransmitter
- func (oc *ContractTransmitter) FromAccount() ocrtypes.Account
- func (oc *ContractTransmitter) LatestConfigDigestAndEpoch(ctx context.Context) (ocrtypes.ConfigDigest, uint32, error)
- func (oc *ContractTransmitter) LatestRoundRequested(ctx context.Context, lookback time.Duration) (ocrtypes.ConfigDigest, uint32, uint8, error)
- func (oc *ContractTransmitter) LatestTransmissionDetails(ctx context.Context) (ocrtypes.ConfigDigest, uint32, uint8, *big.Int, time.Time, error)
- func (oc *ContractTransmitter) Transmit(ctx context.Context, reportCtx ocrtypes.ReportContext, report ocrtypes.Report, ...) error
- type OCR2Spec
- type OCRContractTrackerDB
- type RelayConfig
- type Relayer
- type Transmitter
Constants ¶
This section is empty.
Variables ¶
var (
OCRContractConfigSet = getEventTopic("ConfigSet")
)
Functions ¶
func IsLaterThan ¶
IsLaterThan returns true if the first log was emitted "after" the second log from the blockchain's point of view
Types ¶
type ContractTracker ¶
type ContractTracker struct { utils.StartStopOnce // contains filtered or unexported fields }
ContractTracker complies with ContractConfigTracker interface and handles log events related to the contract more generally
func NewOCRContractTracker ¶
func NewOCRContractTracker( contract *offchain_aggregator_wrapper.OffchainAggregator, contractFilterer *ocr2aggregator.OCR2AggregatorFilterer, contractCaller *ocr2aggregator.OCR2AggregatorCaller, ethClient evmclient.Client, logBroadcaster log.Broadcaster, jobID int32, logger logger.Logger, db *sqlx.DB, odb OCRContractTrackerDB, chain ocrcommon.Config, headBroadcaster httypes.HeadBroadcaster, ) (o *ContractTracker)
NewOCRContractTracker makes a new ContractTracker
func (*ContractTracker) Close ¶
func (t *ContractTracker) Close() error
Close should be called after teardown of the OCR job relying on this tracker
func (*ContractTracker) Connect ¶
func (t *ContractTracker) Connect(*evmtypes.Head) error
Connect conforms to HeadTrackable
func (*ContractTracker) HandleLog ¶
func (t *ContractTracker) HandleLog(lb log.Broadcast)
HandleLog complies with LogListener interface It is not thread safe
func (*ContractTracker) IsV2Job ¶
func (t *ContractTracker) IsV2Job() bool
IsV2Job complies with LogListener interface
func (*ContractTracker) JobID ¶
func (t *ContractTracker) JobID() int32
JobID complies with LogListener interface
func (*ContractTracker) LatestBlockHeight ¶
func (t *ContractTracker) LatestBlockHeight(ctx context.Context) (blockheight uint64, err error)
LatestBlockHeight queries the eth node for the most recent header
func (*ContractTracker) LatestConfig ¶
func (t *ContractTracker) LatestConfig(ctx context.Context, changedInBlock uint64) (ocrtypes.ContractConfig, error)
Return the latest configuration
func (*ContractTracker) LatestConfigDetails ¶
func (t *ContractTracker) LatestConfigDetails(ctx context.Context) (changedInBlock uint64, configDigest ocrtypes.ConfigDigest, err error)
LatestConfigDetails queries the eth node
func (*ContractTracker) LatestRoundRequested ¶
func (t *ContractTracker) 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 (*ContractTracker) Notify ¶
func (t *ContractTracker) Notify() <-chan struct{}
Notify returns a channel that can wake up the contract tracker to let it know when a new config is available
func (*ContractTracker) OnNewLongestChain ¶
func (t *ContractTracker) OnNewLongestChain(_ context.Context, h *evmtypes.Head)
OnNewLongestChain conformed to HeadTrackable and updates latestBlockHeight
func (*ContractTracker) Start ¶
func (t *ContractTracker) Start() error
Start must be called before logs can be delivered It ought to be called before starting OCR
type ContractTransmitter ¶
type ContractTransmitter struct {
// contains filtered or unexported fields
}
func NewOCRContractTransmitter ¶
func NewOCRContractTransmitter( address gethCommon.Address, contractCaller *ocr2aggregator.OCR2AggregatorCaller, contractABI abi.ABI, transmitter Transmitter, tracker *ContractTracker, lggr logger.Logger, ) *ContractTransmitter
func (*ContractTransmitter) FromAccount ¶
func (oc *ContractTransmitter) FromAccount() ocrtypes.Account
func (*ContractTransmitter) LatestConfigDigestAndEpoch ¶
func (oc *ContractTransmitter) LatestConfigDigestAndEpoch(ctx context.Context) (ocrtypes.ConfigDigest, uint32, error)
func (*ContractTransmitter) LatestRoundRequested ¶
func (oc *ContractTransmitter) LatestRoundRequested(ctx context.Context, lookback time.Duration) (ocrtypes.ConfigDigest, uint32, uint8, 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 (*ContractTransmitter) LatestTransmissionDetails ¶
func (*ContractTransmitter) Transmit ¶
func (oc *ContractTransmitter) Transmit(ctx context.Context, reportCtx ocrtypes.ReportContext, report ocrtypes.Report, signatures []ocrtypes.AttributedOnchainSignature) error
type OCRContractTrackerDB ¶
type OCRContractTrackerDB interface { SaveLatestRoundRequested(tx pg.Queryer, rr ocr2aggregator.OCR2AggregatorRoundRequested) error LoadLatestRoundRequested() (rr ocr2aggregator.OCR2AggregatorRoundRequested, err error) }
type RelayConfig ¶
type Relayer ¶
type Relayer struct {
// contains filtered or unexported fields
}
func (*Relayer) NewOCR2Provider ¶
type Transmitter ¶
type Transmitter interface { CreateEthTransaction(ctx context.Context, toAddress gethCommon.Address, payload []byte) error FromAddress() gethCommon.Address }