Versions in this module Expand all Collapse all v0 v0.1.0 Oct 9, 2024 Changes in this version + const LifeCycleStageProduction + const LifeCycleStageRetired + const LifeCycleStageStaging + const MaxObservationRemoveChannelIDsLength + const MaxObservationStreamValuesLength + const MaxObservationUpdateChannelDefinitionsLength + const MaxOutcomeChannelDefinitionsLength + var ErrNilStreamValue = errors.New("nil stream value") + var File_llo_offchain_config_proto protoreflect.FileDescriptor + var File_plugin_codecs_proto protoreflect.FileDescriptor + var LLOStreamValue_Type_name = map[int32]string + var LLOStreamValue_Type_value = map[string]int32 + func Decode(value StreamValue, data []byte) error + func VerifyChannelDefinitions(channelDefs llotypes.ChannelDefinitions) error + type AggregatorFunc func(values []StreamValue, f int) (StreamValue, error) + func GetAggregatorFunc(a llotypes.Aggregator) AggregatorFunc + type ChannelDefinitionCache interface + Definitions func() llotypes.ChannelDefinitions + type ChannelDefinitionWithID struct + ChannelID llotypes.ChannelID + type ChannelHash [32]byte + func MakeChannelHash(cd ChannelDefinitionWithID) ChannelHash + type Config struct + VerboseLogging bool + type DSOpts interface + ConfigDigest func() ocr2types.ConfigDigest + OutCtx func() ocr3types.OutcomeContext + SeqNr func() uint64 + VerboseLogging func() bool + type DataSource interface + Observe func(ctx context.Context, streamValues StreamValues, opts DSOpts) error + type Decimal decimal.Decimal + func ToDecimal(d decimal.Decimal) *Decimal + func (v *Decimal) Decimal() decimal.Decimal + func (v *Decimal) MarshalBinary() ([]byte, error) + func (v *Decimal) MarshalText() ([]byte, error) + func (v *Decimal) String() string + func (v *Decimal) Type() LLOStreamValue_Type + func (v *Decimal) UnmarshalBinary(data []byte) error + func (v *Decimal) UnmarshalText(data []byte) error + type ErrUnreportableChannel struct + ChannelID llotypes.ChannelID + Inner error + Reason string + func (e *ErrUnreportableChannel) Error() string + func (e *ErrUnreportableChannel) String() string + func (e *ErrUnreportableChannel) Unwrap() error + type JSONReportCodec struct + func (cdc JSONReportCodec) Decode(b []byte) (r Report, err error) + func (cdc JSONReportCodec) Encode(ctx context.Context, r Report, _ llotypes.ChannelDefinition) ([]byte, error) + type JSONStreamValue struct + Type LLOStreamValue_Type + Value string + type LLOChannelDefinitionProto struct + Opts []byte + ReportFormat uint32 + Streams []*LLOStreamDefinition + func (*LLOChannelDefinitionProto) Descriptor() ([]byte, []int) + func (*LLOChannelDefinitionProto) ProtoMessage() + func (x *LLOChannelDefinitionProto) GetOpts() []byte + func (x *LLOChannelDefinitionProto) GetReportFormat() uint32 + func (x *LLOChannelDefinitionProto) GetStreams() []*LLOStreamDefinition + func (x *LLOChannelDefinitionProto) ProtoReflect() protoreflect.Message + func (x *LLOChannelDefinitionProto) Reset() + func (x *LLOChannelDefinitionProto) String() string + type LLOChannelIDAndDefinitionProto struct + ChannelDefinition *LLOChannelDefinitionProto + ChannelID uint32 + func (*LLOChannelIDAndDefinitionProto) Descriptor() ([]byte, []int) + func (*LLOChannelIDAndDefinitionProto) ProtoMessage() + func (x *LLOChannelIDAndDefinitionProto) GetChannelDefinition() *LLOChannelDefinitionProto + func (x *LLOChannelIDAndDefinitionProto) GetChannelID() uint32 + func (x *LLOChannelIDAndDefinitionProto) ProtoReflect() protoreflect.Message + func (x *LLOChannelIDAndDefinitionProto) Reset() + func (x *LLOChannelIDAndDefinitionProto) String() string + type LLOChannelIDAndValidAfterSecondsProto struct + ChannelID uint32 + ValidAfterSeconds uint32 + func (*LLOChannelIDAndValidAfterSecondsProto) Descriptor() ([]byte, []int) + func (*LLOChannelIDAndValidAfterSecondsProto) ProtoMessage() + func (x *LLOChannelIDAndValidAfterSecondsProto) GetChannelID() uint32 + func (x *LLOChannelIDAndValidAfterSecondsProto) GetValidAfterSeconds() uint32 + func (x *LLOChannelIDAndValidAfterSecondsProto) ProtoReflect() protoreflect.Message + func (x *LLOChannelIDAndValidAfterSecondsProto) Reset() + func (x *LLOChannelIDAndValidAfterSecondsProto) String() string + type LLOObservationProto struct + AttestedPredecessorRetirement []byte + RemoveChannelIDs []uint32 + ShouldRetire bool + StreamValues map[uint32]*LLOStreamValue + UnixTimestampNanoseconds int64 + UpdateChannelDefinitions map[uint32]*LLOChannelDefinitionProto + func (*LLOObservationProto) Descriptor() ([]byte, []int) + func (*LLOObservationProto) ProtoMessage() + func (x *LLOObservationProto) GetAttestedPredecessorRetirement() []byte + func (x *LLOObservationProto) GetRemoveChannelIDs() []uint32 + func (x *LLOObservationProto) GetShouldRetire() bool + func (x *LLOObservationProto) GetStreamValues() map[uint32]*LLOStreamValue + func (x *LLOObservationProto) GetUnixTimestampNanoseconds() int64 + func (x *LLOObservationProto) GetUpdateChannelDefinitions() map[uint32]*LLOChannelDefinitionProto + func (x *LLOObservationProto) ProtoReflect() protoreflect.Message + func (x *LLOObservationProto) Reset() + func (x *LLOObservationProto) String() string + type LLOOffchainConfigProto struct + PredecessorConfigDigest []byte + func (*LLOOffchainConfigProto) Descriptor() ([]byte, []int) + func (*LLOOffchainConfigProto) ProtoMessage() + func (x *LLOOffchainConfigProto) GetPredecessorConfigDigest() []byte + func (x *LLOOffchainConfigProto) ProtoReflect() protoreflect.Message + func (x *LLOOffchainConfigProto) Reset() + func (x *LLOOffchainConfigProto) String() string + type LLOOutcomeProto struct + ChannelDefinitions []*LLOChannelIDAndDefinitionProto + LifeCycleStage string + ObservationsTimestampNanoseconds int64 + StreamAggregates []*LLOStreamAggregate + ValidAfterSeconds []*LLOChannelIDAndValidAfterSecondsProto + func (*LLOOutcomeProto) Descriptor() ([]byte, []int) + func (*LLOOutcomeProto) ProtoMessage() + func (x *LLOOutcomeProto) GetChannelDefinitions() []*LLOChannelIDAndDefinitionProto + func (x *LLOOutcomeProto) GetLifeCycleStage() string + func (x *LLOOutcomeProto) GetObservationsTimestampNanoseconds() int64 + func (x *LLOOutcomeProto) GetStreamAggregates() []*LLOStreamAggregate + func (x *LLOOutcomeProto) GetValidAfterSeconds() []*LLOChannelIDAndValidAfterSecondsProto + func (x *LLOOutcomeProto) ProtoReflect() protoreflect.Message + func (x *LLOOutcomeProto) Reset() + func (x *LLOOutcomeProto) String() string + type LLOStreamAggregate struct + Aggregator uint32 + StreamID uint32 + StreamValue *LLOStreamValue + func StreamAggregatesToProtoOutcome(in StreamAggregates) (out []*LLOStreamAggregate, err error) + func (*LLOStreamAggregate) Descriptor() ([]byte, []int) + func (*LLOStreamAggregate) ProtoMessage() + func (x *LLOStreamAggregate) GetAggregator() uint32 + func (x *LLOStreamAggregate) GetStreamID() uint32 + func (x *LLOStreamAggregate) GetStreamValue() *LLOStreamValue + func (x *LLOStreamAggregate) ProtoReflect() protoreflect.Message + func (x *LLOStreamAggregate) Reset() + func (x *LLOStreamAggregate) String() string + type LLOStreamDefinition struct + Aggregator uint32 + StreamID uint32 + func (*LLOStreamDefinition) Descriptor() ([]byte, []int) + func (*LLOStreamDefinition) ProtoMessage() + func (x *LLOStreamDefinition) GetAggregator() uint32 + func (x *LLOStreamDefinition) GetStreamID() uint32 + func (x *LLOStreamDefinition) ProtoReflect() protoreflect.Message + func (x *LLOStreamDefinition) Reset() + func (x *LLOStreamDefinition) String() string + type LLOStreamObservationProto struct + Valid bool + Value []byte + func (*LLOStreamObservationProto) Descriptor() ([]byte, []int) + func (*LLOStreamObservationProto) ProtoMessage() + func (x *LLOStreamObservationProto) GetValid() bool + func (x *LLOStreamObservationProto) GetValue() []byte + func (x *LLOStreamObservationProto) ProtoReflect() protoreflect.Message + func (x *LLOStreamObservationProto) Reset() + func (x *LLOStreamObservationProto) String() string + type LLOStreamValue struct + Type LLOStreamValue_Type + Value []byte + func (*LLOStreamValue) Descriptor() ([]byte, []int) + func (*LLOStreamValue) ProtoMessage() + func (x *LLOStreamValue) GetType() LLOStreamValue_Type + func (x *LLOStreamValue) GetValue() []byte + func (x *LLOStreamValue) ProtoReflect() protoreflect.Message + func (x *LLOStreamValue) Reset() + func (x *LLOStreamValue) String() string + type LLOStreamValueQuote struct + Ask []byte + Benchmark []byte + Bid []byte + func (*LLOStreamValueQuote) Descriptor() ([]byte, []int) + func (*LLOStreamValueQuote) ProtoMessage() + func (x *LLOStreamValueQuote) GetAsk() []byte + func (x *LLOStreamValueQuote) GetBenchmark() []byte + func (x *LLOStreamValueQuote) GetBid() []byte + func (x *LLOStreamValueQuote) ProtoReflect() protoreflect.Message + func (x *LLOStreamValueQuote) Reset() + func (x *LLOStreamValueQuote) String() string + type LLOStreamValue_Type int32 + const LLOStreamValue_Decimal + const LLOStreamValue_Quote + func (LLOStreamValue_Type) Descriptor() protoreflect.EnumDescriptor + func (LLOStreamValue_Type) EnumDescriptor() ([]byte, []int) + func (LLOStreamValue_Type) Type() protoreflect.EnumType + func (x LLOStreamValue_Type) Enum() *LLOStreamValue_Type + func (x LLOStreamValue_Type) Number() protoreflect.EnumNumber + func (x LLOStreamValue_Type) String() string + type Observation struct + AttestedPredecessorRetirement []byte + RemoveChannelIDs map[llotypes.ChannelID]struct{} + ShouldRetire bool + StreamValues StreamValues + UnixTimestampNanoseconds int64 + UpdateChannelDefinitions llotypes.ChannelDefinitions + type ObservationCodec interface + Decode func(encoded types.Observation) (obs Observation, err error) + Encode func(obs Observation) (types.Observation, error) + type OffchainConfig struct + PredecessorConfigDigest *types.ConfigDigest + func DecodeOffchainConfig(b []byte) (o OffchainConfig, err error) + func (c OffchainConfig) Encode() ([]byte, error) + type Outcome struct + ChannelDefinitions llotypes.ChannelDefinitions + LifeCycleStage llotypes.LifeCycleStage + ObservationsTimestampNanoseconds int64 + StreamAggregates StreamAggregates + ValidAfterSeconds map[llotypes.ChannelID]uint32 + func (out *Outcome) IsReportable(channelID llotypes.ChannelID) *ErrUnreportableChannel + func (out *Outcome) ObservationsTimestampSeconds() (uint32, error) + func (out *Outcome) ReportableChannels() (reportable []llotypes.ChannelID, unreportable []*ErrUnreportableChannel) + type OutcomeCodec interface + Decode func(encoded ocr3types.Outcome) (outcome Outcome, err error) + Encode func(outcome Outcome) (ocr3types.Outcome, error) + type Plugin struct + ChannelDefinitionCache ChannelDefinitionCache + Codecs map[llotypes.ReportFormat]ReportCodec + Config Config + ConfigDigest types.ConfigDigest + DataSource DataSource + F int + Logger logger.Logger + N int + ObservationCodec ObservationCodec + OutcomeCodec OutcomeCodec + PredecessorConfigDigest *types.ConfigDigest + PredecessorRetirementReportCache PredecessorRetirementReportCache + ShouldRetireCache ShouldRetireCache + func (p *Plugin) Close() error + func (p *Plugin) Observation(ctx context.Context, outctx ocr3types.OutcomeContext, query types.Query) (types.Observation, error) + func (p *Plugin) ObservationQuorum(ctx context.Context, outctx ocr3types.OutcomeContext, query types.Query, ...) (bool, error) + func (p *Plugin) Outcome(ctx context.Context, outctx ocr3types.OutcomeContext, query types.Query, ...) (ocr3types.Outcome, error) + func (p *Plugin) Query(ctx context.Context, outctx ocr3types.OutcomeContext) (types.Query, error) + func (p *Plugin) Reports(ctx context.Context, seqNr uint64, rawOutcome ocr3types.Outcome) ([]ocr3types.ReportPlus[llotypes.ReportInfo], error) + func (p *Plugin) ShouldAcceptAttestedReport(context.Context, uint64, ocr3types.ReportWithInfo[llotypes.ReportInfo]) (bool, error) + func (p *Plugin) ShouldTransmitAcceptedReport(context.Context, uint64, ocr3types.ReportWithInfo[llotypes.ReportInfo]) (bool, error) + func (p *Plugin) ValidateObservation(ctx context.Context, outctx ocr3types.OutcomeContext, query types.Query, ...) error + type PluginFactory struct + ChannelDefinitionCache ChannelDefinitionCache + Codecs map[llotypes.ReportFormat]ReportCodec + Config Config + DataSource DataSource + Logger logger.Logger + PredecessorRetirementReportCache PredecessorRetirementReportCache + ShouldRetireCache ShouldRetireCache + func NewPluginFactory(cfg Config, prrc PredecessorRetirementReportCache, src ShouldRetireCache, ...) *PluginFactory + func (f *PluginFactory) NewReportingPlugin(ctx context.Context, cfg ocr3types.ReportingPluginConfig) (ocr3types.ReportingPlugin[llotypes.ReportInfo], ocr3types.ReportingPluginInfo, ...) + type PredecessorRetirementReportCache interface + AttestedRetirementReport func(predecessorConfigDigest ocr2types.ConfigDigest) ([]byte, error) + CheckAttestedRetirementReport func(predecessorConfigDigest ocr2types.ConfigDigest, ...) (RetirementReport, error) + func NewPredecessorRetirementReportCache() PredecessorRetirementReportCache + type Quote struct + Ask decimal.Decimal + Benchmark decimal.Decimal + Bid decimal.Decimal + func (v *Quote) IsValid() bool + func (v *Quote) MarshalBinary() (b []byte, err error) + func (v *Quote) MarshalText() ([]byte, error) + func (v *Quote) Type() LLOStreamValue_Type + func (v *Quote) UnmarshalBinary(data []byte) error + func (v *Quote) UnmarshalText(data []byte) error + type Report struct + ChannelID llotypes.ChannelID + ConfigDigest types.ConfigDigest + ObservationTimestampSeconds uint32 + SeqNr uint64 + Specimen bool + ValidAfterSeconds uint32 + Values []StreamValue + type ReportCodec interface + Encode func(context.Context, Report, llotypes.ChannelDefinition) ([]byte, error) + type RetirementReport struct + ValidAfterSeconds map[llotypes.ChannelID]uint32 + type ShouldRetireCache interface + ShouldRetire func() (bool, error) + func NewShouldRetireCache() ShouldRetireCache + type StreamAggregates map[llotypes.StreamID]map[llotypes.Aggregator]StreamValue + type StreamValue interface + Type func() LLOStreamValue_Type + func MedianAggregator(values []StreamValue, f int) (StreamValue, error) + func ModeAggregator(values []StreamValue, f int) (StreamValue, error) + func QuoteAggregator(values []StreamValue, f int) (StreamValue, error) + func UnmarshalJSONStreamValue(enc *JSONStreamValue) (StreamValue, error) + func UnmarshalProtoStreamValue(enc *LLOStreamValue) (sv StreamValue, err error) + type StreamValues map[llotypes.StreamID]StreamValue + type Transmitter interface