Documentation
¶
Index ¶
- Constants
- func Leader(epoch uint64, n int, key [16]byte) (leader commontypes.OracleID)
- func PrevRootVersion(seqNr uint64, config ocr3_1config.PublicConfig) uint64
- func RootVersion(seqNr uint64, config ocr3_1config.PublicConfig) uint64
- func RunBlobExchange[RI any](ctx context.Context, ...)
- func RunBlobReap(ctx context.Context, logger loghelper.LoggerWithContext, kvDb KeyValueDatabase)
- func RunOracle[RI any](ctx context.Context, blobEndpointWrapper *BlobEndpointWrapper, ...)
- func RunOutcomeGeneration[RI any](ctx context.Context, ...)
- func RunOutcomeGenerationReap(ctx context.Context, logger loghelper.LoggerWithContext, kvDb KeyValueDatabase)
- func RunPacemaker[RI any](ctx context.Context, chNetToPacemaker <-chan MessageToPacemakerWithSender[RI], ...)
- func RunReportAttestation[RI any](ctx context.Context, ...)
- func RunStateSync[RI any](ctx context.Context, chNetToStateSync <-chan MessageToStateSyncWithSender[RI], ...)
- func RunStateSyncBlockReplay(ctx context.Context, logger loghelper.LoggerWithContext, kvDb KeyValueDatabase, ...)
- func RunStateSyncDestroyIfNeeded(ctx context.Context, logger loghelper.LoggerWithContext, kvDb KeyValueDatabase, ...)
- func RunStateSyncReap(ctx context.Context, config ocr3_1config.SharedConfig, ...)
- func RunTransmission[RI any](ctx context.Context, ...)
- func VerifyGenesisStateTransitionBlockFromPrevInstance(cfg ocr3_1config.PublicConfig, gstb GenesisStateTransitionBlock) error
- type AttestedOrGenesisStateTransitionBlock
- type AttestedReportMany
- type AttestedStateTransitionBlock
- func (astb *AttestedStateTransitionBlock) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits) bool
- func (astb *AttestedStateTransitionBlock) ToCertifiedCommit(configDigest types.ConfigDigest) CertifiedCommit
- func (astb *AttestedStateTransitionBlock) Verify(config ocr3_1config.PublicConfig) error
- type AttributedBlobAvailabilitySignature
- type AttributedCommitSignature
- type AttributedPrepareSignature
- type AttributedSignedHighestCertifiedTimestamp
- type AttributedSignedObservation
- type BlobAvailabilitySignature
- type BlobChunkDigest
- type BlobChunkDigestsRoot
- type BlobDigest
- type BlobEndpoint
- type BlobEndpointWrapper
- type BlobMeta
- type BlobQuotaStats
- type BlobQuotaStatsType
- type CertifiedCommit
- func (hc *CertifiedCommit) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int) bool
- func (hc *CertifiedCommit) Epoch() uint64
- func (hc *CertifiedCommit) HistoryDigest(configDigest types.ConfigDigest) HistoryDigest
- func (hc *CertifiedCommit) SeqNr() uint64
- func (hc *CertifiedCommit) Timestamp() HighestCertifiedTimestamp
- func (hc *CertifiedCommit) Verify(config ocr3_1config.PublicConfig) error
- type CertifiedPrepare
- func (hc *CertifiedPrepare) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int) bool
- func (hc *CertifiedPrepare) Epoch() uint64
- func (hc *CertifiedPrepare) HistoryDigest(configDigest types.ConfigDigest) HistoryDigest
- func (hc *CertifiedPrepare) SeqNr() uint64
- func (hc *CertifiedPrepare) Timestamp() HighestCertifiedTimestamp
- func (hc *CertifiedPrepare) Verify(config ocr3_1config.PublicConfig) error
- type CertifiedPrepareOrCommit
- type CommitSignature
- type Database
- type EpochStartProof
- type EventAttestedReport
- type EventBlobBroadcastGraceTimeout
- type EventBlobBroadcastRequestDone
- type EventBlobBroadcastRequestRespond
- type EventBlobFetchRequestDone
- type EventBlobFetchRequestRespond
- type EventComputedCommitted
- type EventComputedObservation
- type EventComputedObservationQuorumSuccess
- type EventComputedProposalStateTransition
- type EventComputedQuery
- type EventComputedReports
- type EventComputedValidateVerifyObservation
- type EventMissingReportsPlusPrecursor
- type EventNewCertifiedCommit
- type EventNewEpochRequest
- type EventNewEpochStart
- type EventProgress
- type EventStateSyncRequest
- type EventToBlobExchange
- type EventToOutcomeGeneration
- type EventToPacemaker
- type EventToReportAttestation
- type EventToStateSync
- type EventToTransmission
- type GenesisFromPrevInstance
- func (gprev *GenesisFromPrevInstance) CheckSize(_ int, _ int, _ ocr3_1types.ReportingPluginLimits, _ int) bool
- func (gprev *GenesisFromPrevInstance) Epoch() uint64
- func (gprev *GenesisFromPrevInstance) HistoryDigest(configDigest types.ConfigDigest) HistoryDigest
- func (gprev *GenesisFromPrevInstance) SeqNr() uint64
- func (gprev *GenesisFromPrevInstance) Timestamp() HighestCertifiedTimestamp
- func (gprev *GenesisFromPrevInstance) Verify(config ocr3_1config.PublicConfig) error
- type GenesisFromScratch
- func (gscratch *GenesisFromScratch) CheckSize(_ int, _ int, _ ocr3_1types.ReportingPluginLimits, _ int) bool
- func (gscratch *GenesisFromScratch) Epoch() uint64
- func (gscratch *GenesisFromScratch) HistoryDigest(configDigest types.ConfigDigest) HistoryDigest
- func (gscratch *GenesisFromScratch) SeqNr() uint64
- func (gscratch *GenesisFromScratch) Timestamp() HighestCertifiedTimestamp
- func (gscratch *GenesisFromScratch) Verify(config ocr3_1config.PublicConfig) error
- type GenesisStateTransitionBlock
- type HighestCertifiedTimestamp
- type HistoryDigest
- type KeyDigestRange
- type KeyValueDatabase
- type KeyValueDatabaseFactory
- type KeyValueDatabaseReadTransaction
- type KeyValueDatabaseReadWriteTransaction
- type KeyValueDatabaseSemanticRead
- type KeyValueDatabaseSemanticWrite
- type KeyValuePair
- type KeyValuePairWithDeletions
- type LightCertifiedBlob
- type Message
- type MessageBlobChunkRequest
- type MessageBlobChunkResponse
- type MessageBlobOffer
- type MessageBlobOfferResponse
- type MessageBlockSyncRequest
- type MessageBlockSyncResponse
- type MessageBuffer
- type MessageCommit
- type MessageEpochStart
- type MessageEpochStartRequest
- type MessageNewEpochWish
- type MessageObservation
- type MessagePrepare
- type MessageProposal
- type MessageReportSignatures
- type MessageReportsPlusPrecursor
- type MessageReportsPlusPrecursorRequest
- type MessageRoundStart
- type MessageStateSyncSummary
- type MessageToBlobExchange
- type MessageToBlobExchangeWithSender
- type MessageToOutcomeGeneration
- type MessageToOutcomeGenerationWithSender
- type MessageToPacemaker
- type MessageToPacemakerWithSender
- type MessageToReportAttestation
- type MessageToReportAttestationWithSender
- type MessageToStateSync
- type MessageToStateSyncWithSender
- type MessageTreeSyncChunkRequest
- type MessageTreeSyncChunkResponse
- type MessageWithSender
- type NetworkEndpoint
- type NetworkSender
- type OutcomeGenerationID
- type PacemakerState
- type PendingKeyDigestRanges
- type PrepareSignature
- type ReportsPlusPrecursorDigest
- type RoundBlobBroadcastFetcher
- type RoundContext
- type SignedHighestCertifiedTimestamp
- type SignedObservation
- type SimpleNetwork
- type SimpleNetworkEndpoint
- func (end SimpleNetworkEndpoint[RI]) Broadcast(msg Message[RI])
- func (SimpleNetworkEndpoint[RI]) Close() error
- func (end SimpleNetworkEndpoint[RI]) Receive() <-chan MessageWithSender[RI]
- func (end SimpleNetworkEndpoint[RI]) SendTo(msg Message[RI], to commontypes.OracleID)
- func (SimpleNetworkEndpoint[RI]) Start() error
- type StaleBlob
- type StateRootDigest
- type StateTransitionBlock
- type StateTransitionInputsDigest
- type StateWriteSet
- type StateWriteSetDigest
- type TelemetrySender
- type TreeSyncPhase
- type TreeSyncStatus
- type VerifyAndWriteTreeSyncChunkResult
Constants ¶
const ContractTransmitterTimeoutWarningGracePeriod = 50 * time.Millisecond
const ( // DeltaStopExpiredBlobFetchOrBroadcast denotes the interval with which we // check for in-progress blob broadcasts and fetches for blobs that might // have expired, and mark them as expired and/or send reject // MessageBlobOfferResponse to the submitter if appropriate. DeltaStopExpiredBlobFetchOrBroadcast = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func Leader ¶
func Leader(epoch uint64, n int, key [16]byte) (leader commontypes.OracleID)
Leader will produce an oracle id for the given epoch.
func PrevRootVersion ¶
func PrevRootVersion(seqNr uint64, config ocr3_1config.PublicConfig) uint64
prevRootVersion returns the version number of the JMT root referring to the state as of seqNr - 1. This is used as the "old version" for writing the modifications of seqNr. We only maintain trees with versions that are multiples of SnapshotInterval.
func RootVersion ¶
func RootVersion(seqNr uint64, config ocr3_1config.PublicConfig) uint64
func RunBlobExchange ¶
func RunBlobExchange[RI any]( ctx context.Context, chNetToBlobExchange <-chan MessageToBlobExchangeWithSender[RI], chOutcomeGenerationToBlobExchange <-chan EventToBlobExchange[RI], chBlobBroadcastRequest <-chan blobBroadcastRequest, chBlobFetchRequest <-chan blobFetchRequest, config ocr3_1config.SharedConfig, kv KeyValueDatabase, id commontypes.OracleID, limits ocr3_1types.ReportingPluginLimits, localConfig types.LocalConfig, logger loghelper.LoggerWithContext, metricsRegisterer prometheus.Registerer, netSender NetworkSender[RI], offchainKeyring types.OffchainKeyring, telemetrySender TelemetrySender, )
func RunBlobReap ¶
func RunBlobReap( ctx context.Context, logger loghelper.LoggerWithContext, kvDb KeyValueDatabase, )
func RunOracle ¶
func RunOracle[RI any]( ctx context.Context, blobEndpointWrapper *BlobEndpointWrapper, config ocr3_1config.SharedConfig, contractTransmitter ocr3types.ContractTransmitter[RI], database Database, id commontypes.OracleID, kvDb KeyValueDatabase, limits ocr3_1types.ReportingPluginLimits, localConfig types.LocalConfig, logger loghelper.LoggerWithContext, metricsRegisterer prometheus.Registerer, netEndpoint NetworkEndpoint[RI], offchainKeyring types.OffchainKeyring, onchainKeyring ocr3types.OnchainKeyring[RI], reportingPlugin ocr3_1types.ReportingPlugin[RI], telemetrySender TelemetrySender, )
RunOracle runs one oracle instance of the offchain reporting protocol and manages the lifecycle of all underlying goroutines.
RunOracle runs forever until ctx is cancelled. It will only shut down after all its sub-goroutines have exited.
func RunOutcomeGeneration ¶
func RunOutcomeGeneration[RI any]( ctx context.Context, chNetToOutcomeGeneration <-chan MessageToOutcomeGenerationWithSender[RI], chPacemakerToOutcomeGeneration <-chan EventToOutcomeGeneration[RI], chOutcomeGenerationToPacemaker chan<- EventToPacemaker[RI], chOutcomeGenerationToReportAttestation chan<- EventToReportAttestation[RI], chOutcomeGenerationToStateSync chan<- EventToStateSync[RI], blobBroadcastFetcher ocr3_1types.BlobBroadcastFetcher, config ocr3_1config.SharedConfig, database Database, id commontypes.OracleID, kvDb KeyValueDatabase, localConfig types.LocalConfig, logger loghelper.LoggerWithContext, metricsRegisterer prometheus.Registerer, netSender NetworkSender[RI], offchainKeyring types.OffchainKeyring, reportingPlugin ocr3_1types.ReportingPlugin[RI], telemetrySender TelemetrySender, restoredCert CertifiedPrepareOrCommit, )
func RunOutcomeGenerationReap ¶
func RunOutcomeGenerationReap( ctx context.Context, logger loghelper.LoggerWithContext, kvDb KeyValueDatabase, )
func RunPacemaker ¶
func RunPacemaker[RI any]( ctx context.Context, chNetToPacemaker <-chan MessageToPacemakerWithSender[RI], chPacemakerToOutcomeGeneration chan<- EventToOutcomeGeneration[RI], chOutcomeGenerationToPacemaker <-chan EventToPacemaker[RI], config ocr3_1config.SharedConfig, database Database, id commontypes.OracleID, localConfig types.LocalConfig, logger loghelper.LoggerWithContext, metricsRegisterer prometheus.Registerer, netSender NetworkSender[RI], offchainKeyring types.OffchainKeyring, telemetrySender TelemetrySender, restoredState PacemakerState, )
func RunReportAttestation ¶
func RunReportAttestation[RI any]( ctx context.Context, chNetToReportAttestation <-chan MessageToReportAttestationWithSender[RI], chOutcomeGenerationToReportAttestation <-chan EventToReportAttestation[RI], chReportAttestationToStateSync chan<- EventToStateSync[RI], chReportAttestationToTransmission chan<- EventToTransmission[RI], config ocr3_1config.SharedConfig, contractTransmitter ocr3types.ContractTransmitter[RI], kvDb KeyValueDatabase, logger loghelper.LoggerWithContext, netSender NetworkSender[RI], onchainKeyring ocr3types.OnchainKeyring[RI], reportingPlugin ocr3_1types.ReportingPlugin[RI], )
func RunStateSync ¶
func RunStateSync[RI any]( ctx context.Context, chNetToStateSync <-chan MessageToStateSyncWithSender[RI], chOutcomeGenerationToStateSync <-chan EventToStateSync[RI], chReportAttestationToStateSync <-chan EventToStateSync[RI], config ocr3_1config.SharedConfig, database Database, id commontypes.OracleID, kvDb KeyValueDatabase, logger loghelper.LoggerWithContext, netSender NetworkSender[RI], reportingPlugin ocr3_1types.ReportingPlugin[RI], )
func RunStateSyncBlockReplay ¶
func RunStateSyncBlockReplay( ctx context.Context, logger loghelper.LoggerWithContext, kvDb KeyValueDatabase, chNotificationFromStateSync <-chan struct{}, )
func RunStateSyncDestroyIfNeeded ¶
func RunStateSyncDestroyIfNeeded( ctx context.Context, logger loghelper.LoggerWithContext, kvDb KeyValueDatabase, chNotificationFromStateSync <-chan struct{}, )
func RunStateSyncReap ¶
func RunStateSyncReap( ctx context.Context, config ocr3_1config.SharedConfig, logger loghelper.LoggerWithContext, database Database, kvDb KeyValueDatabase, )
func RunTransmission ¶
func RunTransmission[RI any]( ctx context.Context, chReportAttestationToTransmission <-chan EventToTransmission[RI], config ocr3_1config.SharedConfig, contractTransmitter ocr3types.ContractTransmitter[RI], id commontypes.OracleID, localConfig types.LocalConfig, logger loghelper.LoggerWithContext, reportingPlugin ocr3_1types.ReportingPlugin[RI], )
func VerifyGenesisStateTransitionBlockFromPrevInstance ¶
func VerifyGenesisStateTransitionBlockFromPrevInstance(cfg ocr3_1config.PublicConfig, gstb GenesisStateTransitionBlock) error
Types ¶
type AttestedOrGenesisStateTransitionBlock ¶
type AttestedOrGenesisStateTransitionBlock interface {
// contains filtered or unexported methods
}
type AttestedReportMany ¶
type AttestedReportMany[RI any] struct { ReportWithInfo ocr3types.ReportWithInfo[RI] AttributedSignatures []types.AttributedOnchainSignature }
type AttestedStateTransitionBlock ¶
type AttestedStateTransitionBlock struct {
StateTransitionBlock StateTransitionBlock
AttributedCommitSignatures []AttributedCommitSignature
}
func (*AttestedStateTransitionBlock) CheckSize ¶
func (astb *AttestedStateTransitionBlock) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits) bool
func (*AttestedStateTransitionBlock) ToCertifiedCommit ¶
func (astb *AttestedStateTransitionBlock) ToCertifiedCommit(configDigest types.ConfigDigest) CertifiedCommit
func (*AttestedStateTransitionBlock) Verify ¶
func (astb *AttestedStateTransitionBlock) Verify(config ocr3_1config.PublicConfig) error
type AttributedBlobAvailabilitySignature ¶
type AttributedBlobAvailabilitySignature = blobtypes.AttributedBlobAvailabilitySignature
type AttributedCommitSignature ¶
type AttributedCommitSignature struct {
Signature CommitSignature
Signer commontypes.OracleID
}
type AttributedPrepareSignature ¶
type AttributedPrepareSignature struct {
Signature PrepareSignature
Signer commontypes.OracleID
}
type AttributedSignedHighestCertifiedTimestamp ¶
type AttributedSignedHighestCertifiedTimestamp struct {
SignedHighestCertifiedTimestamp SignedHighestCertifiedTimestamp
Signer commontypes.OracleID
}
type AttributedSignedObservation ¶
type AttributedSignedObservation struct {
SignedObservation SignedObservation
Observer commontypes.OracleID
}
type BlobAvailabilitySignature ¶
type BlobAvailabilitySignature = blobtypes.BlobAvailabilitySignature
type BlobChunkDigest ¶
type BlobChunkDigest = blobtypes.BlobChunkDigest
type BlobChunkDigestsRoot ¶
type BlobChunkDigestsRoot = blobtypes.BlobChunkDigestsRoot
type BlobDigest ¶
type BlobDigest = blobtypes.BlobDigest
type BlobEndpoint ¶
type BlobEndpoint struct {
// contains filtered or unexported fields
}
func (*BlobEndpoint) BroadcastBlob ¶
func (be *BlobEndpoint) BroadcastBlob(ctx context.Context, payload []byte, expirationHint ocr3_1types.BlobExpirationHint) (ocr3_1types.BlobHandle, error)
func (*BlobEndpoint) FetchBlob ¶
func (be *BlobEndpoint) FetchBlob(ctx context.Context, handle ocr3_1types.BlobHandle) ([]byte, error)
type BlobEndpointWrapper ¶
type BlobEndpointWrapper struct {
// contains filtered or unexported fields
}
BlobEndpointWrapper enables deferred initialization of a BlobEndpoint. The plugin expects a BlobBroadcastFetcher instance as argument to NewReportingPlugin, which is called in managed_ocr3_1_oracle.go. The actual BlobEndpoint is only constructed later in RunOracle, where the blob exchange protocol is started. RunOracle then initializes the wrapper with the BlobEndpoint using setBlobEndpoint. All BlobBroadcastFetcher methods of BlobEndpointWrapper will error until proper initialization through setBlobEndpoint.
func (*BlobEndpointWrapper) BroadcastBlob ¶
func (bew *BlobEndpointWrapper) BroadcastBlob(ctx context.Context, payload []byte, expirationHint ocr3_1types.BlobExpirationHint) (ocr3_1types.BlobHandle, error)
func (*BlobEndpointWrapper) FetchBlob ¶
func (bew *BlobEndpointWrapper) FetchBlob(ctx context.Context, handle ocr3_1types.BlobHandle) ([]byte, error)
type BlobMeta ¶
type BlobMeta struct {
PayloadLength uint64
ChunkHaves []bool
ChunkDigests []BlobChunkDigest
ExpirySeqNr uint64
Submitter commontypes.OracleID
}
type BlobQuotaStats ¶
func (BlobQuotaStats) Add ¶
func (b BlobQuotaStats) Add(other BlobQuotaStats) (BlobQuotaStats, bool)
func (BlobQuotaStats) Sub ¶
func (b BlobQuotaStats) Sub(other BlobQuotaStats) (BlobQuotaStats, bool)
type BlobQuotaStatsType ¶
type BlobQuotaStatsType string
const ( BlobQuotaStatsTypeReaped BlobQuotaStatsType = "reaped" BlobQuotaStatsTypeAppended BlobQuotaStatsType = "appended" )
type CertifiedCommit ¶
type CertifiedCommit struct {
PrevHistoryDigest HistoryDigest
CommitEpoch uint64
CommitSeqNr uint64
StateTransitionInputsDigest StateTransitionInputsDigest
StateWriteSetDigest StateWriteSetDigest
StateRootDigest StateRootDigest
ReportsPlusPrecursorDigest ReportsPlusPrecursorDigest
CommitQuorumCertificate []AttributedCommitSignature
}
func (*CertifiedCommit) CheckSize ¶
func (hc *CertifiedCommit) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int) bool
func (*CertifiedCommit) Epoch ¶
func (hc *CertifiedCommit) Epoch() uint64
func (*CertifiedCommit) HistoryDigest ¶
func (hc *CertifiedCommit) HistoryDigest(configDigest types.ConfigDigest) HistoryDigest
func (*CertifiedCommit) SeqNr ¶
func (hc *CertifiedCommit) SeqNr() uint64
func (*CertifiedCommit) Timestamp ¶
func (hc *CertifiedCommit) Timestamp() HighestCertifiedTimestamp
func (*CertifiedCommit) Verify ¶
func (hc *CertifiedCommit) Verify(config ocr3_1config.PublicConfig) error
type CertifiedPrepare ¶
type CertifiedPrepare struct {
PrevHistoryDigest HistoryDigest
PrepareEpoch uint64
PrepareSeqNr uint64
StateTransitionInputsDigest StateTransitionInputsDigest
StateWriteSetDigest StateWriteSetDigest
StateRootDigest StateRootDigest
ReportsPlusPrecursorDigest ReportsPlusPrecursorDigest
PrepareQuorumCertificate []AttributedPrepareSignature
}
func (*CertifiedPrepare) CheckSize ¶
func (hc *CertifiedPrepare) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int) bool
func (*CertifiedPrepare) Epoch ¶
func (hc *CertifiedPrepare) Epoch() uint64
func (*CertifiedPrepare) HistoryDigest ¶
func (hc *CertifiedPrepare) HistoryDigest(configDigest types.ConfigDigest) HistoryDigest
func (*CertifiedPrepare) SeqNr ¶
func (hc *CertifiedPrepare) SeqNr() uint64
func (*CertifiedPrepare) Timestamp ¶
func (hc *CertifiedPrepare) Timestamp() HighestCertifiedTimestamp
func (*CertifiedPrepare) Verify ¶
func (hc *CertifiedPrepare) Verify(config ocr3_1config.PublicConfig) error
type CertifiedPrepareOrCommit ¶
type CertifiedPrepareOrCommit interface {
Epoch() uint64
SeqNr() uint64
Timestamp() HighestCertifiedTimestamp
HistoryDigest(_ types.ConfigDigest) HistoryDigest
Verify(_ ocr3_1config.PublicConfig) error
CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int) bool
// contains filtered or unexported methods
}
func GenesisCertifiedPrepareOrCommit ¶
func GenesisCertifiedPrepareOrCommit(cfg ocr3_1config.PublicConfig) CertifiedPrepareOrCommit
type CommitSignature ¶
type CommitSignature []byte
func MakeCommitSignature ¶
func MakeCommitSignature( ogid OutcomeGenerationID, prevHistoryDigest HistoryDigest, seqNr uint64, inputsDigest StateTransitionInputsDigest, writeSetDigest StateWriteSetDigest, rootDigest StateRootDigest, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, signer func(msg []byte) ([]byte, error), ) (CommitSignature, error)
func (CommitSignature) Verify ¶
func (sig CommitSignature) Verify( ogid OutcomeGenerationID, prevHistoryDigest HistoryDigest, seqNr uint64, inputsDigest StateTransitionInputsDigest, writeSetDigest StateWriteSetDigest, rootDigest StateRootDigest, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, publicKey types.OffchainPublicKey, ) error
type Database ¶
type Database interface {
types.ConfigDatabase
ReadPacemakerState(ctx context.Context, configDigest types.ConfigDigest) (PacemakerState, error)
WritePacemakerState(ctx context.Context, configDigest types.ConfigDigest, state PacemakerState) error
ReadCert(ctx context.Context, configDigest types.ConfigDigest) (CertifiedPrepareOrCommit, error)
WriteCert(ctx context.Context, configDigest types.ConfigDigest, cert CertifiedPrepareOrCommit) error
}
type EpochStartProof ¶
type EpochStartProof struct {
HighestCertified CertifiedPrepareOrCommit
HighestCertifiedProof []AttributedSignedHighestCertifiedTimestamp
}
func (*EpochStartProof) Verify ¶
func (qc *EpochStartProof) Verify( ogid OutcomeGenerationID, config ocr3_1config.PublicConfig, ) error
type EventAttestedReport ¶
type EventAttestedReport[RI any] struct { SeqNr uint64 Index int AttestedReport AttestedReportMany[RI] TransmissionScheduleOverride *ocr3types.TransmissionSchedule }
type EventBlobBroadcastGraceTimeout ¶
type EventBlobBroadcastGraceTimeout[RI any] struct { BlobDigest BlobDigest }
type EventBlobBroadcastRequestDone ¶
type EventBlobBroadcastRequestDone[RI any] struct { BlobDigest BlobDigest }
type EventBlobBroadcastRequestRespond ¶
type EventBlobBroadcastRequestRespond[RI any] struct { BlobDigest BlobDigest Request blobBroadcastRequest }
type EventBlobFetchRequestDone ¶
type EventBlobFetchRequestDone[RI any] struct { BlobDigest BlobDigest }
type EventBlobFetchRequestRespond ¶
type EventBlobFetchRequestRespond[RI any] struct { BlobDigest BlobDigest Request blobFetchRequest }
type EventComputedCommitted ¶
type EventComputedObservation ¶
type EventComputedObservation[RI any] struct { Epoch uint64 SeqNr uint64 RequestHandle types.RequestHandle AttributedQuery types.AttributedQuery Observation types.Observation }
type EventComputedProposalStateTransition ¶
type EventComputedProposalStateTransition[RI any] struct { Epoch uint64 SeqNr uint64 KeyValueDatabaseReadWriteTransaction KeyValueDatabaseReadWriteTransaction // contains filtered or unexported fields }
type EventComputedQuery ¶
type EventComputedReports ¶
type EventComputedReports[RI any] struct { SeqNr uint64 ReportsPlus []ocr3types.ReportPlus[RI] }
type EventComputedValidateVerifyObservation ¶
type EventComputedValidateVerifyObservation[RI any] struct { Epoch uint64 SeqNr uint64 Sender commontypes.OracleID }
type EventNewCertifiedCommit ¶
type EventNewCertifiedCommit[RI any] struct { SeqNr uint64 ReportsPlusPrecursorDigest ReportsPlusPrecursorDigest }
type EventNewEpochRequest ¶
type EventNewEpochRequest[RI any] struct{}
type EventNewEpochStart ¶
type EventProgress ¶
type EventProgress[RI any] struct{}
type EventStateSyncRequest ¶
type EventToBlobExchange ¶
type EventToBlobExchange[RI any] interface { // contains filtered or unexported methods }
type EventToOutcomeGeneration ¶
type EventToOutcomeGeneration[RI any] interface { // contains filtered or unexported methods }
type EventToPacemaker ¶
type EventToPacemaker[RI any] interface { // contains filtered or unexported methods }
type EventToReportAttestation ¶
type EventToReportAttestation[RI any] interface { // contains filtered or unexported methods }
type EventToStateSync ¶
type EventToStateSync[RI any] interface { // contains filtered or unexported methods }
type EventToTransmission ¶
type EventToTransmission[RI any] interface { // contains filtered or unexported methods }
type GenesisFromPrevInstance ¶
type GenesisFromPrevInstance struct {
PrevHistoryDigest HistoryDigest
PrevSeqNr uint64
}
func (*GenesisFromPrevInstance) CheckSize ¶
func (gprev *GenesisFromPrevInstance) CheckSize(_ int, _ int, _ ocr3_1types.ReportingPluginLimits, _ int) bool
func (*GenesisFromPrevInstance) Epoch ¶
func (gprev *GenesisFromPrevInstance) Epoch() uint64
func (*GenesisFromPrevInstance) HistoryDigest ¶
func (gprev *GenesisFromPrevInstance) HistoryDigest(configDigest types.ConfigDigest) HistoryDigest
func (*GenesisFromPrevInstance) SeqNr ¶
func (gprev *GenesisFromPrevInstance) SeqNr() uint64
func (*GenesisFromPrevInstance) Timestamp ¶
func (gprev *GenesisFromPrevInstance) Timestamp() HighestCertifiedTimestamp
func (*GenesisFromPrevInstance) Verify ¶
func (gprev *GenesisFromPrevInstance) Verify(config ocr3_1config.PublicConfig) error
type GenesisFromScratch ¶
type GenesisFromScratch struct{}
func (*GenesisFromScratch) CheckSize ¶
func (gscratch *GenesisFromScratch) CheckSize(_ int, _ int, _ ocr3_1types.ReportingPluginLimits, _ int) bool
func (*GenesisFromScratch) Epoch ¶
func (gscratch *GenesisFromScratch) Epoch() uint64
func (*GenesisFromScratch) HistoryDigest ¶
func (gscratch *GenesisFromScratch) HistoryDigest(configDigest types.ConfigDigest) HistoryDigest
func (*GenesisFromScratch) SeqNr ¶
func (gscratch *GenesisFromScratch) SeqNr() uint64
func (*GenesisFromScratch) Timestamp ¶
func (gscratch *GenesisFromScratch) Timestamp() HighestCertifiedTimestamp
func (*GenesisFromScratch) Verify ¶
func (gscratch *GenesisFromScratch) Verify(config ocr3_1config.PublicConfig) error
type GenesisStateTransitionBlock ¶
type GenesisStateTransitionBlock struct {
PrevHistoryDigest HistoryDigest
SeqNr uint64
StateTransitionInputsDigest StateTransitionInputsDigest
StateWriteSetDigest StateWriteSetDigest
StateRootDigest StateRootDigest
ReportsPlusPrecursorDigest ReportsPlusPrecursorDigest
}
func AttestedToGenesisStateTransitionBlock ¶
func AttestedToGenesisStateTransitionBlock(prevConfigDigest types.ConfigDigest, astb AttestedStateTransitionBlock) GenesisStateTransitionBlock
type HighestCertifiedTimestamp ¶
func (HighestCertifiedTimestamp) Less ¶
func (t HighestCertifiedTimestamp) Less(t2 HighestCertifiedTimestamp) bool
type HistoryDigest ¶
type HistoryDigest = types.HistoryDigest
func MakeHistoryDigest ¶
func MakeHistoryDigest( configDigest types.ConfigDigest, prevHistoryDigest HistoryDigest, seqNr uint64, inputsDigest StateTransitionInputsDigest, writeSetDigest StateWriteSetDigest, rootDigest StateRootDigest, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, ) HistoryDigest
type KeyDigestRange ¶
KeyDigestRange represents a contiguous range [StartIndex, EndInclIndex] in the key digest space that needs to be fetched during tree synchronization.
type KeyValueDatabase ¶
type KeyValueDatabase interface {
// Must error if the key value store is not ready to apply state transition
// for the given sequence number. Must update the highest committed sequence
// number magic key upon commit. Convenience method for synchronization
// between outcome generation & state sync.
NewSerializedReadWriteTransaction(postSeqNr uint64) (KeyValueDatabaseReadWriteTransaction, error)
// Must error if the key value store is not ready to apply state transition
// for the given sequence number. Convenience method for synchronization
// between outcome generation & state sync.
NewReadTransaction(postSeqNr uint64) (KeyValueDatabaseReadTransaction, error)
// Unchecked transactions are useful when you don't care that the
// transaction state represents the kv state as of some particular sequence
// number, mostly when writing auxiliary data to the kv store. Unchecked
// transactions do not update the highest committed sequence number magic
// key upon commit, as would checked transactions.
NewSerializedReadWriteTransactionUnchecked() (KeyValueDatabaseReadWriteTransaction, error)
// Unserialized transactions are guaranteed to commit.
// The protocol should make sure that there are no conflicts across potentially concurrent unserialized transactions,
// and if two unserialized transactions could actually have conflicts the protocol ensures that the are
// never opened concurrently.
NewUnserializedReadWriteTransactionUnchecked() (KeyValueDatabaseReadWriteTransaction, error)
// Unchecked transactions are useful when you don't care that the
// transaction state represents the kv state as of some particular sequence
// number, mostly when reading auxiliary data from the kv store.
NewReadTransactionUnchecked() (KeyValueDatabaseReadTransaction, error)
// Deprecated: Kept for convenience/small diff, consider using
// [KeyValueDatabaseSemanticRead.ReadHighestCommittedSeqNr] instead.
HighestCommittedSeqNr() (uint64, error)
Close() error
}
type KeyValueDatabaseFactory ¶
type KeyValueDatabaseFactory interface {
NewKeyValueDatabase(configDigest types.ConfigDigest) (KeyValueDatabase, error)
}
type KeyValueDatabaseReadTransaction ¶
type KeyValueDatabaseReadTransaction interface {
// The only read part of the interface that the plugin might see. The rest
// of the methods might only be called by protocol code.
ocr3_1types.KeyValueStateReader
KeyValueDatabaseSemanticRead
Discard()
}
type KeyValueDatabaseReadWriteTransaction ¶
type KeyValueDatabaseReadWriteTransaction interface {
KeyValueDatabaseReadTransaction
// The only write part of the interface that the plugin might see. The rest
// of the methods might only be called by protocol code.
ocr3_1types.KeyValueStateReadWriter
KeyValueDatabaseSemanticWrite
// Commit writes the new highest committed sequence number to the magic key
// (if the transaction is _not_ unchecked) and commits the transaction to
// the key value store, then discards the transaction.
Commit() error
}
type KeyValueDatabaseSemanticRead ¶
type KeyValueDatabaseSemanticRead interface {
// ReadHighestCommittedSeqNr returns the sequence number of which the state the transaction
// represents. Really read from the database here, no cached values allowed.
ReadHighestCommittedSeqNr() (uint64, error)
ReadLowestPersistedSeqNr() (uint64, error)
ReadAttestedStateTransitionBlock(seqNr uint64) (AttestedStateTransitionBlock, error)
ReadAttestedStateTransitionBlocks(minSeqNr uint64, maxItems int) (blocks []AttestedStateTransitionBlock, more bool, err error)
ExistsUnattestedStateTransitionBlock(seqNr uint64, stateTransitionInputsDigest StateTransitionInputsDigest) (bool, error)
ReadUnattestedStateTransitionBlock(seqNr uint64, stateTransitionInputsDigest StateTransitionInputsDigest) (*StateTransitionBlock, error)
ReadTreeSyncStatus() (TreeSyncStatus, error)
// ReadTreeSyncChunk retrieves a chunk of undigested key-value pairs in the
// range [startIndex, requestEndInclIndex] of the key digest space. It
// returns a maximally sized chunk that fully covers the range [startIndex,
// endInclIndex], where endInclIndex <= requestEndInclIndex, such that the
// chunk respects the protocol.MaxTreeSyncChunkKeys and
// protocol.MaxTreeSyncChunkKeysPlusValuesLength limits. It also includes in
// boundingLeaves the subrange proof, proving inclusion of key-values in the
// range [startIndex, endInclIndex] without omissions.
ReadTreeSyncChunk(
toSeqNr uint64,
startIndex jmt.Digest,
requestEndInclIndex jmt.Digest,
maxCumulativeKeysPlusValuesBytes int,
) (
endInclIndex jmt.Digest,
boundingLeaves []jmt.BoundingLeaf,
keyValues []KeyValuePair,
err error,
)
// ReadBlobPayload returns the payload of the blob if it exists in full and
// the blob has not expired. If the blob existed at some point but has since
// expired, it returns an error. If the blob never existed, it returns nil.
// If only some chunks are present, it returns an error.
ReadBlobPayload(BlobDigest) ([]byte, error)
ReadBlobMeta(BlobDigest) (*BlobMeta, error)
ReadBlobQuotaStats(blobQuotaStatsType BlobQuotaStatsType, submitter commontypes.OracleID) (BlobQuotaStats, error)
ReadBlobChunk(BlobDigest, uint64) ([]byte, error)
ReadStaleBlobIndex(maxStaleSinceSeqNr uint64, limit int) ([]StaleBlob, error)
ReadReportsPlusPrecursor(seqNr uint64, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest) (*ocr3_1types.ReportsPlusPrecursor, error)
jmt.RootReader
jmt.NodeReader
ReadPrevInstanceGenesisStateTransitionBlock() (*GenesisStateTransitionBlock, error)
}
type KeyValueDatabaseSemanticWrite ¶
type KeyValueDatabaseSemanticWrite interface {
// GetWriteSet returns a slice the KeyValuePair entries that
// have been written in this transaction. If the value of a key has been
// deleted, it the value is mapped to nil.
GetWriteSet() ([]KeyValuePairWithDeletions, error)
// CloseWriteSet returns the state root, writes it to the KV store
// and closes the transaction for writing: any future attempts for Writes or Deletes
// on this transaction will fail.
CloseWriteSet() (StateRootDigest, error)
// ApplyWriteSet applies the write set to the transaction and returns the
// state root digest. Useful for reproposals and state synchronization. Only
// works on checked transactions where the postSeqNr is specified at
// creation.
ApplyWriteSet(writeSet []KeyValuePairWithDeletions) (StateRootDigest, error)
WriteAttestedStateTransitionBlock(seqNr uint64, block AttestedStateTransitionBlock) error
DeleteAttestedStateTransitionBlocks(maxSeqNrToDelete uint64, maxItems int) (done bool, err error)
WriteUnattestedStateTransitionBlock(seqNr uint64, stateTransitionInputsDigest StateTransitionInputsDigest, stb StateTransitionBlock) error
DeleteUnattestedStateTransitionBlocks(maxSeqNrToDelete uint64, maxItems int) (done bool, err error)
// WriteHighestCommittedSeqNr writes the given sequence number to the magic
// key. It is called before Commit on checked transactions.
WriteHighestCommittedSeqNr(seqNr uint64) error
WriteLowestPersistedSeqNr(seqNr uint64) error
// VerifyAndWriteTreeSyncChunk first verifies that the keyValues are fully
// and without omissions included in the key digest range of [startIndex,
// endInclIndex]. It also verifies that endInclIndex is in the range of
// [startIndex, requestEndInclIndex], and that keyValues is non-empty unless
// requestEndInclIndex == endInclIndex. Only after doing all the above, it
// writes all keyValues into the tree and flat representation.
VerifyAndWriteTreeSyncChunk(
targetRootDigest StateRootDigest,
targetSeqNr uint64,
startIndex jmt.Digest,
requestEndInclIndex jmt.Digest,
endInclIndex jmt.Digest,
boundingLeaves []jmt.BoundingLeaf,
keyValues []KeyValuePair,
) (VerifyAndWriteTreeSyncChunkResult, error)
WriteTreeSyncStatus(state TreeSyncStatus) error
WriteBlobMeta(BlobDigest, BlobMeta) error
DeleteBlobMeta(BlobDigest) error
WriteBlobQuotaStats(blobQuotaStatsType BlobQuotaStatsType, submitter commontypes.OracleID, blobQuotaStats BlobQuotaStats) error
WriteBlobChunk(BlobDigest, uint64, []byte) error
DeleteBlobChunk(BlobDigest, uint64) error
WriteStaleBlobIndex(StaleBlob) error
DeleteStaleBlobIndex(StaleBlob) error
WriteReportsPlusPrecursor(seqNr uint64, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, reportsPlusPrecursor ocr3_1types.ReportsPlusPrecursor) error
DeleteReportsPlusPrecursors(minSeqNrToKeep uint64, maxItems int) (done bool, err error)
jmt.RootWriter
DeleteRoots(minVersionToKeep jmt.Version, maxItems int) (done bool, err error)
jmt.NodeWriter
jmt.StaleNodeWriter
DeleteStaleNodes(maxStaleSinceVersion jmt.Version, maxItems int) (done bool, err error)
DestructiveDestroyForTreeSync(n int) (done bool, err error)
WritePrevInstanceGenesisStateTransitionBlock(genesisStateTransitionBlock GenesisStateTransitionBlock) error
}
type KeyValuePair ¶
type LightCertifiedBlob ¶
type LightCertifiedBlob = blobtypes.LightCertifiedBlob
type Message ¶
type Message[RI any] interface { // CheckSize checks whether the given message conforms to the limits imposed by // reportingPluginLimits CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int, config ocr3_1config.PublicConfig) bool // contains filtered or unexported methods }
Message is the interface used to pass an inter-oracle message to the local oracle process.
type MessageBlobChunkRequest ¶
type MessageBlobChunkRequest[RI any] struct { RequestHandle types.RequestHandle // actual handle for inbound message, sentinel for outbound RequestInfo *types.RequestInfo BlobDigest BlobDigest ChunkIndex uint64 }
func (MessageBlobChunkRequest[RI]) CheckSize ¶
func (msg MessageBlobChunkRequest[RI]) CheckSize(n int, f int, _ ocr3_1types.ReportingPluginLimits, _ int, _ ocr3_1config.PublicConfig) bool
type MessageBlobChunkResponse ¶
type MessageBlobChunkResponse[RI any] struct { RequestHandle types.RequestHandle // actual handle for outbound message, sentinel for inbound BlobDigest BlobDigest ChunkIndex uint64 GoAway bool Chunk []byte Proof []mt.Digest }
func (MessageBlobChunkResponse[RI]) CheckSize ¶
func (msg MessageBlobChunkResponse[RI]) CheckSize(n int, f int, _ ocr3_1types.ReportingPluginLimits, _ int, config ocr3_1config.PublicConfig) bool
type MessageBlobOffer ¶
type MessageBlobOffer[RI any] struct { RequestHandle types.RequestHandle // actual handle for inbound message, sentinel for outbound RequestInfo *types.RequestInfo ChunkDigestsRoot mt.Digest PayloadLength uint64 ExpirySeqNr uint64 }
func (MessageBlobOffer[RI]) CheckSize ¶
func (msg MessageBlobOffer[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, _ int, config ocr3_1config.PublicConfig) bool
type MessageBlobOfferResponse ¶
type MessageBlobOfferResponse[RI any] struct { RequestHandle types.RequestHandle // actual handle for outbound message, sentinel for inbound BlobDigest BlobDigest RejectOffer bool Signature BlobAvailabilitySignature }
func (MessageBlobOfferResponse[RI]) CheckSize ¶
func (msg MessageBlobOfferResponse[RI]) CheckSize(n int, f int, _ ocr3_1types.ReportingPluginLimits, _ int, _ ocr3_1config.PublicConfig) bool
type MessageBlockSyncRequest ¶
type MessageBlockSyncRequest[RI any] struct { RequestHandle types.RequestHandle // actual handle for inbound message, sentinel for outbound RequestInfo *types.RequestInfo StartSeqNr uint64 // a successful response must contain at least the block with this sequence number EndExclSeqNr uint64 // the response may only contain sequence numbers less than this MaxCumulativeWriteSetBytes int }
func (MessageBlockSyncRequest[RI]) CheckSize ¶
func (msg MessageBlockSyncRequest[RI]) CheckSize(n int, f int, _ ocr3_1types.ReportingPluginLimits, _ int, _ ocr3_1config.PublicConfig) bool
type MessageBlockSyncResponse ¶
type MessageBlockSyncResponse[RI any] struct { RequestHandle types.RequestHandle // actual handle for outbound message, sentinel for inbound RequestStartSeqNr uint64 RequestEndExclSeqNr uint64 AttestedStateTransitionBlocks []AttestedStateTransitionBlock // must be contiguous and (if non-empty) starting at RequestStartSeqNr GenesisStateTransitionBlock *GenesisStateTransitionBlock // optional genesis block info when syncing from prev instance }
func (MessageBlockSyncResponse[RI]) CheckSize ¶
func (msg MessageBlockSyncResponse[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int, config ocr3_1config.PublicConfig) bool
type MessageBuffer ¶
type MessageBuffer[RI any] ringbuffer.RingBuffer[MessageToOutcomeGeneration[RI]]
We have this wrapper to deal with what appears to be a bug in the Go compiler that prevents us from using ringbuffer.RingBuffer in the outcome generation protocol: offchainreporting2plus/internal/ocr3/protocol/outcome_generation.go:241:21: internal compiler error: (*ringbuffer.RingBuffer[go.shape.interface { github.com/smartcontractkit/offchain-reporting/lib/offchainreporting2plus/internal/ocr3/protocol.epoch() uint64; github.com/smartcontractkit/offchain-reporting/lib/offchainreporting2plus/internal/ocr3/protocol.processOutcomeGeneration(*github.com/smartcontractkit/offchain-reporting/lib/offchainreporting2plus/internal/ocr3/protocol.outcomeGenerationState[go.shape.struct {}], github.com/smartcontractkit/offchain-reporting/lib/commontypes.OracleID) }]).Peek(buffer, (*[9]uintptr)(.dict[3])) (type go.shape.interface { github.com/smartcontractkit/offchain-reporting/lib/offchainreporting2plus/internal/ocr3/protocol.epoch() uint64; github.com/smartcontractkit/offchain-reporting/lib/offchainreporting2plus/internal/ocr3/protocol.processOutcomeGeneration(*github.com/smartcontractkit/offchain-reporting/lib/offchainreporting2plus/internal/ocr3/protocol.outcomeGenerationState[go.shape.struct {}], github.com/smartcontractkit/offchain-reporting/lib/commontypes.OracleID) }) is not shape-identical to MessageToOutcomeGeneration[go.shape.struct {}] Consider removing it in a future release.
func NewMessageBuffer ¶
func NewMessageBuffer[RI any](cap int) *MessageBuffer[RI]
func (*MessageBuffer[RI]) Length ¶
func (rb *MessageBuffer[RI]) Length() int
func (*MessageBuffer[RI]) Peek ¶
func (rb *MessageBuffer[RI]) Peek() MessageToOutcomeGeneration[RI]
func (*MessageBuffer[RI]) Pop ¶
func (rb *MessageBuffer[RI]) Pop() MessageToOutcomeGeneration[RI]
func (*MessageBuffer[RI]) Push ¶
func (rb *MessageBuffer[RI]) Push(msg MessageToOutcomeGeneration[RI])
type MessageCommit ¶
type MessageCommit[RI any] struct { Epoch uint64 SeqNr uint64 Signature CommitSignature }
func (MessageCommit[RI]) CheckSize ¶
func (msg MessageCommit[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int, _ ocr3_1config.PublicConfig) bool
type MessageEpochStart ¶
type MessageEpochStart[RI any] struct { Epoch uint64 EpochStartProof EpochStartProof Abdicate bool }
func (MessageEpochStart[RI]) CheckSize ¶
func (msg MessageEpochStart[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int, _ ocr3_1config.PublicConfig) bool
type MessageEpochStartRequest ¶
type MessageEpochStartRequest[RI any] struct { Epoch uint64 HighestCertified CertifiedPrepareOrCommit SignedHighestCertifiedTimestamp SignedHighestCertifiedTimestamp }
func (MessageEpochStartRequest[RI]) CheckSize ¶
func (msg MessageEpochStartRequest[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int, _ ocr3_1config.PublicConfig) bool
type MessageNewEpochWish ¶
func (MessageNewEpochWish[RI]) CheckSize ¶
func (msg MessageNewEpochWish[RI]) CheckSize(n int, f int, _ ocr3_1types.ReportingPluginLimits, _ int, _ ocr3_1config.PublicConfig) bool
type MessageObservation ¶
type MessageObservation[RI any] struct { RequestHandle types.RequestHandle // actual handle for outbound message, sentinel for inbound Epoch uint64 SeqNr uint64 SignedObservation SignedObservation }
func (MessageObservation[RI]) CheckSize ¶
func (msg MessageObservation[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int, _ ocr3_1config.PublicConfig) bool
type MessagePrepare ¶
type MessagePrepare[RI any] struct { Epoch uint64 SeqNr uint64 Signature PrepareSignature }
func (MessagePrepare[RI]) CheckSize ¶
func (msg MessagePrepare[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int, _ ocr3_1config.PublicConfig) bool
type MessageProposal ¶
type MessageProposal[RI any] struct { Epoch uint64 SeqNr uint64 AttributedSignedObservations []AttributedSignedObservation }
func (MessageProposal[RI]) CheckSize ¶
func (msg MessageProposal[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int, _ ocr3_1config.PublicConfig) bool
type MessageReportSignatures ¶
type MessageReportSignatures[RI any] struct { SeqNr uint64 ReportSignatures [][]byte ReportsPlusPrecursorDigest ReportsPlusPrecursorDigest }
func (MessageReportSignatures[RI]) CheckSize ¶
func (msg MessageReportSignatures[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int, _ ocr3_1config.PublicConfig) bool
type MessageReportsPlusPrecursor ¶
type MessageReportsPlusPrecursor[RI any] struct { RequestHandle types.RequestHandle // actual handle for outbound message, sentinel for inbound SeqNr uint64 ReportsPlusPrecursor ocr3_1types.ReportsPlusPrecursor }
func (MessageReportsPlusPrecursor[RI]) CheckSize ¶
func (msg MessageReportsPlusPrecursor[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int, _ ocr3_1config.PublicConfig) bool
type MessageReportsPlusPrecursorRequest ¶
type MessageReportsPlusPrecursorRequest[RI any] struct { RequestHandle types.RequestHandle // actual handle for inbound message, sentinel for outbound SeqNr uint64 }
func (MessageReportsPlusPrecursorRequest[RI]) CheckSize ¶
func (msg MessageReportsPlusPrecursorRequest[RI]) CheckSize(n int, f int, _ ocr3_1types.ReportingPluginLimits, maxReportSigLen int, _ ocr3_1config.PublicConfig) bool
type MessageRoundStart ¶
type MessageRoundStart[RI any] struct { RequestHandle types.RequestHandle // actual handle for inbound message, sentinel for outbound Epoch uint64 SeqNr uint64 Query types.Query }
func (MessageRoundStart[RI]) CheckSize ¶
func (msg MessageRoundStart[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int, _ ocr3_1config.PublicConfig) bool
type MessageStateSyncSummary ¶
type MessageStateSyncSummary[RI any] struct { LowestPersistedSeqNr uint64 HighestCommittedSeqNr uint64 }
func (MessageStateSyncSummary[RI]) CheckSize ¶
func (msg MessageStateSyncSummary[RI]) CheckSize(n int, f int, _ ocr3_1types.ReportingPluginLimits, _ int, _ ocr3_1config.PublicConfig) bool
type MessageToBlobExchange ¶
type MessageToBlobExchangeWithSender ¶
type MessageToBlobExchangeWithSender[RI any] struct { // contains filtered or unexported fields }
type MessageToOutcomeGenerationWithSender ¶
type MessageToOutcomeGenerationWithSender[RI any] struct { // contains filtered or unexported fields }
type MessageToPacemaker ¶
type MessageToPacemakerWithSender ¶
type MessageToPacemakerWithSender[RI any] struct { // contains filtered or unexported fields }
type MessageToReportAttestationWithSender ¶
type MessageToReportAttestationWithSender[RI any] struct { // contains filtered or unexported fields }
type MessageToStateSync ¶
type MessageToStateSyncWithSender ¶
type MessageToStateSyncWithSender[RI any] struct { // contains filtered or unexported fields }
type MessageTreeSyncChunkRequest ¶
type MessageTreeSyncChunkRequest[RI any] struct { RequestHandle types.RequestHandle // actual handle for inbound message, sentinel for outbound RequestInfo *types.RequestInfo ToSeqNr uint64 StartIndex jmt.Digest EndInclIndex jmt.Digest MaxCumulativeKeysPlusValuesBytes int }
func (MessageTreeSyncChunkRequest[RI]) CheckSize ¶
func (msg MessageTreeSyncChunkRequest[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int, _ ocr3_1config.PublicConfig) bool
type MessageTreeSyncChunkResponse ¶
type MessageTreeSyncChunkResponse[RI any] struct { RequestHandle types.RequestHandle // actual handle for outbound message, sentinel for inbound ToSeqNr uint64 StartIndex jmt.Digest RequestEndInclIndex jmt.Digest GoAway bool EndInclIndex jmt.Digest KeyValues []KeyValuePair BoundingLeaves []jmt.BoundingLeaf }
func (MessageTreeSyncChunkResponse[RI]) CheckSize ¶
func (msg MessageTreeSyncChunkResponse[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int, config ocr3_1config.PublicConfig) bool
type MessageWithSender ¶
type MessageWithSender[RI any] struct { Msg Message[RI] Sender commontypes.OracleID }
MessageWithSender records a msg with the index of the sender oracle
type NetworkEndpoint ¶
type NetworkEndpoint[RI any] interface { NetworkSender[RI] // Receive returns channel which carries all messages sent to this oracle Receive() <-chan MessageWithSender[RI] // Close must be called before receive. Close can be called multiple times. // Close can be called even on an unstarted NetworkEndpoint. Close() error }
NetworkEndpoint sends & receives messages to/from other oracles
type NetworkSender ¶
type NetworkSender[RI any] interface { // SendTo(msg, to) sends msg to "to" SendTo(msg Message[RI], to commontypes.OracleID) // Broadcast(msg) sends msg to all oracles Broadcast(msg Message[RI]) }
NetworkSender sends messages to other oracles
type OutcomeGenerationID ¶
type OutcomeGenerationID struct {
ConfigDigest types.ConfigDigest
Epoch uint64
}
Identifies an instance of the outcome generation protocol
type PacemakerState ¶
type PendingKeyDigestRanges ¶
type PendingKeyDigestRanges struct {
// contains filtered or unexported fields
}
PendingKeyDigestRanges tracks which key digest ranges still need to be fetched during tree synchronization. As chunks are received, the corresponding ranges are removed or updated.
func NewPendingKeyDigestRanges ¶
func NewPendingKeyDigestRanges(ranges []KeyDigestRange) PendingKeyDigestRanges
func (PendingKeyDigestRanges) All ¶
func (pkdr PendingKeyDigestRanges) All() []KeyDigestRange
All returns all pending key digest ranges that still need to be fetched.
func (PendingKeyDigestRanges) WithReceivedRange ¶
func (pkdr PendingKeyDigestRanges) WithReceivedRange(receivedRange KeyDigestRange) PendingKeyDigestRanges
WithReceivedRange returns a new PendingKeyDigestRanges with the given range marked as received. Does not mutate the receiver.
type PrepareSignature ¶
type PrepareSignature []byte
func MakePrepareSignature ¶
func MakePrepareSignature( ogid OutcomeGenerationID, prevHistoryDigest HistoryDigest, seqNr uint64, inputsDigest StateTransitionInputsDigest, writeSetDigest StateWriteSetDigest, rootDigest StateRootDigest, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, signer func(msg []byte) ([]byte, error), ) (PrepareSignature, error)
func (PrepareSignature) Verify ¶
func (sig PrepareSignature) Verify( ogid OutcomeGenerationID, prevHistoryDigest HistoryDigest, seqNr uint64, inputsDigest StateTransitionInputsDigest, writeSetDigest StateWriteSetDigest, rootDigest StateRootDigest, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, publicKey types.OffchainPublicKey, ) error
type ReportsPlusPrecursorDigest ¶
type ReportsPlusPrecursorDigest [32]byte
func MakeReportsPlusPrecursorDigest ¶
func MakeReportsPlusPrecursorDigest(configDigest types.ConfigDigest, seqNr uint64, precursor ocr3_1types.ReportsPlusPrecursor) ReportsPlusPrecursorDigest
type RoundBlobBroadcastFetcher ¶
type RoundBlobBroadcastFetcher struct {
// contains filtered or unexported fields
}
RoundBlobBroadcastFetcher is a thin wrapper around a blob broadcast fetcher which enforces that no expired blobs as of the current round at seqNr are fetched.
func NewRoundBlobBroadcastFetcher ¶
func NewRoundBlobBroadcastFetcher(seqNr uint64, blobBroadcastFetcher ocr3_1types.BlobBroadcastFetcher) *RoundBlobBroadcastFetcher
func (*RoundBlobBroadcastFetcher) BroadcastBlob ¶
func (r *RoundBlobBroadcastFetcher) BroadcastBlob(ctx context.Context, payload []byte, expirationHint ocr3_1types.BlobExpirationHint) (ocr3_1types.BlobHandle, error)
func (*RoundBlobBroadcastFetcher) FetchBlob ¶
func (r *RoundBlobBroadcastFetcher) FetchBlob(ctx context.Context, handle ocr3_1types.BlobHandle) ([]byte, error)
type RoundContext ¶
type SignedHighestCertifiedTimestamp ¶
type SignedHighestCertifiedTimestamp struct {
HighestCertifiedTimestamp HighestCertifiedTimestamp
Signature []byte
}
func MakeSignedHighestCertifiedTimestamp ¶
func MakeSignedHighestCertifiedTimestamp( ogid OutcomeGenerationID, highestCertifiedTimestamp HighestCertifiedTimestamp, signer func(msg []byte) ([]byte, error), ) (SignedHighestCertifiedTimestamp, error)
func (*SignedHighestCertifiedTimestamp) Verify ¶
func (shct *SignedHighestCertifiedTimestamp) Verify(ogid OutcomeGenerationID, publicKey types.OffchainPublicKey) error
type SignedObservation ¶
type SignedObservation struct {
Observation types.Observation
Signature []byte
}
func MakeSignedObservation ¶
func MakeSignedObservation( ogid OutcomeGenerationID, seqNr uint64, aq types.AttributedQuery, observation types.Observation, signer func(msg []byte) (sig []byte, err error), ) ( SignedObservation, error, )
func (SignedObservation) Verify ¶
func (so SignedObservation) Verify(ogid OutcomeGenerationID, seqNr uint64, aq types.AttributedQuery, publicKey types.OffchainPublicKey) error
type SimpleNetwork ¶
type SimpleNetwork[RI any] struct { // contains filtered or unexported fields }
SimpleNetwork is a strawman (in-memory) implementation of the Network interface. Network channels are buffered and can queue up to 100 messages before blocking.
func NewSimpleNetwork ¶
func NewSimpleNetwork[RI any](n int) *SimpleNetwork[RI]
NewSimpleNetwork returns a SimpleNetwork for n oracles
func (*SimpleNetwork[RI]) Endpoint ¶
func (net *SimpleNetwork[RI]) Endpoint(id commontypes.OracleID) (NetworkEndpoint[RI], error)
Endpoint returns the interface for oracle id's networking facilities
type SimpleNetworkEndpoint ¶
type SimpleNetworkEndpoint[RI any] struct { // contains filtered or unexported fields }
SimpleNetworkEndpoint is a strawman (in-memory) implementation of NetworkEndpoint, used by SimpleNetwork
func (SimpleNetworkEndpoint[RI]) Broadcast ¶
func (end SimpleNetworkEndpoint[RI]) Broadcast(msg Message[RI])
Broadcast sends msg to all participating oracles
func (SimpleNetworkEndpoint[RI]) Close ¶
func (SimpleNetworkEndpoint[RI]) Close() error
Close satisfies the interface
func (SimpleNetworkEndpoint[RI]) Receive ¶
func (end SimpleNetworkEndpoint[RI]) Receive() <-chan MessageWithSender[RI]
Receive returns a channel which carries all messages sent to the oracle
func (SimpleNetworkEndpoint[RI]) SendTo ¶
func (end SimpleNetworkEndpoint[RI]) SendTo(msg Message[RI], to commontypes.OracleID)
SendTo sends msg to oracle "to"
func (SimpleNetworkEndpoint[RI]) Start ¶
func (SimpleNetworkEndpoint[RI]) Start() error
Start satisfies the interface
type StaleBlob ¶
type StaleBlob struct {
StaleSinceSeqNr uint64
BlobDigest BlobDigest
}
type StateRootDigest ¶
type StateTransitionBlock ¶
type StateTransitionBlock struct {
PrevHistoryDigest HistoryDigest
Epoch uint64
BlockSeqNr uint64
StateTransitionInputsDigest StateTransitionInputsDigest
StateWriteSet StateWriteSet
StateRootDigest StateRootDigest
ReportsPlusPrecursorDigest ReportsPlusPrecursorDigest
}
func (*StateTransitionBlock) CheckSize ¶
func (stb *StateTransitionBlock) CheckSize(limits ocr3_1types.ReportingPluginLimits) bool
func (*StateTransitionBlock) SeqNr ¶
func (stb *StateTransitionBlock) SeqNr() uint64
type StateTransitionInputsDigest ¶
type StateTransitionInputsDigest [32]byte
func MakeStateTransitionInputsDigest ¶
func MakeStateTransitionInputsDigest( configDigest types.ConfigDigest, seqNr uint64, attributedQuery types.AttributedQuery, attributedObservations []types.AttributedObservation, ) StateTransitionInputsDigest
type StateWriteSet ¶
type StateWriteSet struct {
Entries []KeyValuePairWithDeletions
}
type StateWriteSetDigest ¶
type StateWriteSetDigest [32]byte
func MakeStateWriteSetDigest ¶
func MakeStateWriteSetDigest(configDigest types.ConfigDigest, seqNr uint64, writeSet []KeyValuePairWithDeletions) StateWriteSetDigest
type TelemetrySender ¶
type TelemetrySender interface {
RoundStarted(
configDigest types.ConfigDigest,
epoch uint64,
seqNr uint64,
round uint64,
leader commontypes.OracleID,
)
}
type TreeSyncPhase ¶
type TreeSyncPhase int
const ( // Tree sync was never started, or was completed. Regardless, it's not // happening right now. TreeSyncPhaseInactive TreeSyncPhase = iota // Tree sync is waiting for the necessary parts of the key-value store to be // cleaned up before it can start. TreeSyncPhaseWaiting // Tree sync is actively progressing now. TreeSyncPhaseActive )
func (TreeSyncPhase) String ¶
func (tsp TreeSyncPhase) String() string
type TreeSyncStatus ¶
type TreeSyncStatus struct {
Phase TreeSyncPhase
TargetSeqNr uint64
TargetStateRootDigest StateRootDigest
PendingKeyDigestRanges PendingKeyDigestRanges
}
type VerifyAndWriteTreeSyncChunkResult ¶
type VerifyAndWriteTreeSyncChunkResult int
const ( VerifyAndWriteTreeSyncChunkResultOkNeedMore VerifyAndWriteTreeSyncChunkResult VerifyAndWriteTreeSyncChunkResultOkComplete VerifyAndWriteTreeSyncChunkResultByzantine )
Source Files
¶
- blob_endpoint.go
- blob_exchange.go
- blob_reap.go
- db.go
- event.go
- kvdb.go
- message.go
- messagebuffer.go
- metrics.go
- network.go
- oracle.go
- outcome_generation.go
- outcome_generation_follower.go
- outcome_generation_leader.go
- outcome_generation_reap.go
- pacemaker.go
- prev_instance.go
- report_attestation.go
- round_context.go
- signed_data.go
- state_sync.go
- state_sync_block.go
- state_sync_block_replay.go
- state_sync_destroy_if_needed.go
- state_sync_reap.go
- state_sync_snapshot.go
- state_sync_tree.go
- state_sync_tree_ranges.go
- telemetry.go
- transmission.go
- types.go