shim

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package shim contains implementations of internal types in terms of the external types

Package shim contains implementations of internal types in terms of the external types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LimitCheckOCR3ReportingPlugin

type LimitCheckOCR3ReportingPlugin[RI any] struct {
	Plugin ocr3types.ReportingPlugin[RI]
	Limits ocr3types.ReportingPluginLimits
}

LimitCheckOCR3ReportingPlugin wraps another plugin and checks that its outputs respect limits. We use it to surface violations to authors of plugins as early as possible.

It does not check inputs since those are checked by the SerializingEndpoint.

func (LimitCheckOCR3ReportingPlugin[RI]) Close

func (rp LimitCheckOCR3ReportingPlugin[RI]) Close() error

func (LimitCheckOCR3ReportingPlugin[RI]) Observation

func (LimitCheckOCR3ReportingPlugin[RI]) ObservationQuorum

func (rp LimitCheckOCR3ReportingPlugin[RI]) ObservationQuorum(ctx context.Context, outctx ocr3types.OutcomeContext, query types.Query, aos []types.AttributedObservation) (bool, error)

func (LimitCheckOCR3ReportingPlugin[RI]) Outcome

func (LimitCheckOCR3ReportingPlugin[RI]) Query

func (LimitCheckOCR3ReportingPlugin[RI]) Reports

func (rp LimitCheckOCR3ReportingPlugin[RI]) Reports(ctx context.Context, seqNr uint64, outcome ocr3types.Outcome) ([]ocr3types.ReportPlus[RI], error)

func (LimitCheckOCR3ReportingPlugin[RI]) ShouldAcceptAttestedReport

func (rp LimitCheckOCR3ReportingPlugin[RI]) ShouldAcceptAttestedReport(ctx context.Context, seqNr uint64, report ocr3types.ReportWithInfo[RI]) (bool, error)

func (LimitCheckOCR3ReportingPlugin[RI]) ShouldTransmitAcceptedReport

func (rp LimitCheckOCR3ReportingPlugin[RI]) ShouldTransmitAcceptedReport(ctx context.Context, seqNr uint64, report ocr3types.ReportWithInfo[RI]) (bool, error)

func (LimitCheckOCR3ReportingPlugin[RI]) ValidateObservation

type LimitCheckReportingPlugin

type LimitCheckReportingPlugin struct {
	Plugin types.ReportingPlugin
	Limits types.ReportingPluginLimits
}

LimitCheckReportingPlugin wraps another ReportingPlugin and checks that its outputs respect limits. We use it to surface violations to authors of ReportingPlugins as early as possible.

It does not check inputs since those are checked by the SerializingEndpoint.

func (LimitCheckReportingPlugin) Close

func (rp LimitCheckReportingPlugin) Close() error

func (LimitCheckReportingPlugin) Observation

func (LimitCheckReportingPlugin) Query

func (LimitCheckReportingPlugin) Report

func (LimitCheckReportingPlugin) ShouldAcceptFinalizedReport

func (rp LimitCheckReportingPlugin) ShouldAcceptFinalizedReport(ctx context.Context, ts types.ReportTimestamp, report types.Report) (bool, error)

func (LimitCheckReportingPlugin) ShouldTransmitAcceptedReport

func (rp LimitCheckReportingPlugin) ShouldTransmitAcceptedReport(ctx context.Context, ts types.ReportTimestamp, report types.Report) (bool, error)

type OCR2SerializingEndpoint

type OCR2SerializingEndpoint struct {
	// contains filtered or unexported fields
}

func NewOCR2SerializingEndpoint

func NewOCR2SerializingEndpoint(
	chTelemetry chan<- *serialization.TelemetryWrapper,
	configDigest types.ConfigDigest,
	endpoint commontypes.BinaryNetworkEndpoint,
	logger commontypes.Logger,
	metricsRegisterer prometheus.Registerer,
	reportingPluginLimits types.ReportingPluginLimits,
) *OCR2SerializingEndpoint

func (*OCR2SerializingEndpoint) Broadcast

func (n *OCR2SerializingEndpoint) Broadcast(msg protocol.Message)

func (*OCR2SerializingEndpoint) Close

func (n *OCR2SerializingEndpoint) Close() error

Close closes the SerializingEndpoint. It will also close the underlying endpoint.

func (*OCR2SerializingEndpoint) Receive

func (*OCR2SerializingEndpoint) SendTo

func (*OCR2SerializingEndpoint) Start

func (n *OCR2SerializingEndpoint) Start() error

Start starts the SerializingEndpoint. It will also start the underlying endpoint.

type OCR2TelemetrySender

type OCR2TelemetrySender struct {
	// contains filtered or unexported fields
}

func MakeOCR2TelemetrySender

func MakeOCR2TelemetrySender(chTelemetry chan<- *serialization.TelemetryWrapper, logger commontypes.Logger) OCR2TelemetrySender

func (OCR2TelemetrySender) RoundStarted

func (ts OCR2TelemetrySender) RoundStarted(
	configDigest types.ConfigDigest,
	epoch uint32,
	round uint8,
	leader commontypes.OracleID,
)

type OCR3SerializingEndpoint

type OCR3SerializingEndpoint[RI any] struct {
	// contains filtered or unexported fields
}

func NewOCR3SerializingEndpoint

func NewOCR3SerializingEndpoint[RI any](
	chTelemetry chan<- *serialization.TelemetryWrapper,
	configDigest types.ConfigDigest,
	endpoint commontypes.BinaryNetworkEndpoint,
	maxSigLen int,
	logger commontypes.Logger,
	metricsRegisterer prometheus.Registerer,
	pluginLimits ocr3types.ReportingPluginLimits,
	n, f int,
) *OCR3SerializingEndpoint[RI]

func (*OCR3SerializingEndpoint[RI]) Broadcast

func (n *OCR3SerializingEndpoint[RI]) Broadcast(msg protocol.Message[RI])

func (*OCR3SerializingEndpoint[RI]) Close

func (n *OCR3SerializingEndpoint[RI]) Close() error

Close closes the SerializingEndpoint. It will also close the underlying endpoint.

func (*OCR3SerializingEndpoint[RI]) Receive

func (n *OCR3SerializingEndpoint[RI]) Receive() <-chan protocol.MessageWithSender[RI]

func (*OCR3SerializingEndpoint[RI]) SendTo

func (n *OCR3SerializingEndpoint[RI]) SendTo(msg protocol.Message[RI], to commontypes.OracleID)

func (*OCR3SerializingEndpoint[RI]) Start

func (n *OCR3SerializingEndpoint[RI]) Start() error

Start starts the SerializingEndpoint. It will also start the underlying endpoint.

type OCR3TelemetrySender

type OCR3TelemetrySender struct {
	// contains filtered or unexported fields
}

func MakeOCR3TelemetrySender

func MakeOCR3TelemetrySender(chTelemetry chan<- *serialization.TelemetryWrapper, logger commontypes.Logger) OCR3TelemetrySender

func (OCR3TelemetrySender) RoundStarted

func (ts OCR3TelemetrySender) RoundStarted(
	configDigest types.ConfigDigest,
	epoch uint64,
	seqNr uint64,
	round uint64,
	leader commontypes.OracleID,
)

type SerializingOCR3Database

type SerializingOCR3Database struct {
	BinaryDb ocr3types.Database
}

func (*SerializingOCR3Database) ReadCert

func (*SerializingOCR3Database) ReadConfig

func (*SerializingOCR3Database) ReadPacemakerState

func (db *SerializingOCR3Database) ReadPacemakerState(ctx context.Context, configDigest types.ConfigDigest) (protocol.PacemakerState, error)

func (*SerializingOCR3Database) WriteCert

Writing with an empty value is the same as deleting.

func (*SerializingOCR3Database) WriteConfig

func (db *SerializingOCR3Database) WriteConfig(ctx context.Context, config types.ContractConfig) error

func (*SerializingOCR3Database) WritePacemakerState

func (db *SerializingOCR3Database) WritePacemakerState(ctx context.Context, configDigest types.ConfigDigest, state protocol.PacemakerState) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL