Documentation
¶
Index ¶
- Constants
- func Leader(epoch uint64, n int, key [16]byte) (leader commontypes.OracleID)
- func PrevRootVersion(seqNr uint64) uint64
- func RootVersion(seqNr uint64) 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 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 ocr3config.SharedConfig, ...)
- func RunTransmission[RI any](ctx context.Context, ...)
- type AttestedReportMany
- type AttestedStateTransitionBlock
- type AttributedBlobAvailabilitySignature
- type AttributedCommitSignature
- type AttributedPrepareSignature
- type AttributedSignedHighestCertifiedTimestamp
- type AttributedSignedObservation
- type BlobAvailabilitySignature
- type BlobChunkDigest
- type BlobDigest
- type BlobEndpoint
- type BlobEndpointWrapper
- type BlobMeta
- 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) IsGenesis() bool
- func (hc *CertifiedCommit) SeqNr() uint64
- func (hc *CertifiedCommit) Timestamp() HighestCertifiedTimestamp
- func (hc *CertifiedCommit) Verify(configDigest types.ConfigDigest, oracleIdentities []config.OracleIdentity, ...) error
- type CertifiedCommittedReports
- 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) IsGenesis() bool
- func (hc *CertifiedPrepare) SeqNr() uint64
- func (hc *CertifiedPrepare) Timestamp() HighestCertifiedTimestamp
- func (hc *CertifiedPrepare) Verify(configDigest types.ConfigDigest, oracleIdentities []config.OracleIdentity, ...) error
- type CertifiedPrepareOrCommit
- type CommitSignature
- type Database
- type EpochStartProof
- type EventAttestedReport
- type EventBlobBroadcastGraceTimeout
- type EventBlobBroadcastRequestDone
- type EventBlobBroadcastRequestRespond
- type EventBlobFetchRequestDone
- type EventBlobFetchRequestRespond
- type EventCertifiedCommit
- type EventComputedCommitted
- type EventComputedObservation
- type EventComputedObservationQuorumSuccess
- type EventComputedProposalStateTransition
- type EventComputedQuery
- type EventComputedReports
- type EventComputedValidateVerifyObservation
- type EventMissingOutcome
- type EventNewEpochRequest
- type EventNewEpochStart
- type EventProgress
- type EventStateSyncRequest
- type EventToBlobExchange
- type EventToOutcomeGeneration
- type EventToPacemaker
- type EventToReportAttestation
- type EventToStateSync
- type EventToTransmission
- type HighestCertifiedTimestamp
- 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 MessageBlobChunkRequestInfo
- type MessageBlobChunkResponse
- type MessageBlobOffer
- type MessageBlobOfferRequestInfo
- type MessageBlobOfferResponse
- type MessageBlockSyncRequest
- type MessageBlockSyncResponse
- type MessageBuffer
- type MessageCertifiedCommit
- type MessageCertifiedCommitRequest
- type MessageCommit
- type MessageEpochStart
- type MessageEpochStartRequest
- type MessageNewEpochWish
- type MessageObservation
- type MessagePrepare
- type MessageProposal
- type MessageReportSignatures
- 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 StateTransitionOutputDigest
- type StateTransitionOutputs
- type TelemetrySender
- type TreeSyncPhase
- type TreeSyncStatus
- type VerifyAndWriteTreeSyncChunkResult
Constants ¶
const ( // DeltaBlobChunkRequest denotes the minimum duration between sending two // MessageBlobChunkRequest messages to a particular oracle. DeltaBlobChunkRequest = 10 * time.Millisecond // DeltaBlobOfferBroadcast denotes the minimum duration between sending two // MessageBlobOffer messages to a particular oracle. DeltaBlobOfferBroadcast = 10 * time.Millisecond // DeltaBlobBroadcastGrace denotes the duration that we will wait after // receiving minSigners valid accepting MessageBlobOfferResponse messages, // to give a last chance to straggling oracles to send us a // MessageBlobOfferResponse. DeltaBlobBroadcastGrace = 100 * time.Millisecond // DeltaStopExpiredBlobFetches denotes the interval with which we check for // in-progress blob fetches for blobs that might have expired, and mark them // as expired and/or send reject MessageBlobOfferResponse to the submitter // if appropriate. DeltaStopExpiredBlobFetches = 5 * time.Second )
const ( MaxBlocksPerBlockSyncResponse int = 10 // Minimum delay between two consecutive BLOCK-SYNC-REQ requests DeltaMinBlockSyncRequest = 10 * time.Millisecond // Maximum delay between a BLOCK-SYNC-REQ and a BLOCK-SYNC response. We'll try // with another oracle if we don't get a response in this time. DeltaMaxBlockSyncRequest time.Duration = 1 * time.Second // We are looking to pipeline fetches of a range of at most // BlockSyncLookahead blocks at any given time BlockSyncLookahead = 10_000 )
const ( SnapshotInterval = 128 // MaxHistoricalSnapshotsRetained must be a non-zero value, denoting the // number of complete snapshots prior to the current (potentially // incomplete) one that will be retained to help other oracles with state // sync. All blocks starting from the highest block of the earliest retained // snapshot will be retained. MaxHistoricalSnapshotsRetained = 64 )
const ( // Maximum delay between a TREE-SYNC-REQ and TREE-SYNC-CHUNK response. We'll try // with another oracle if we don't get a response in this time. DeltaMaxTreeSyncRequest time.Duration = 1 * time.Second // Minimum delay between two consecutive BLOCK-SYNC-REQ requests DeltaMinTreeSyncRequest = 10 * time.Millisecond // The maximum number of key-value pairs that an oracle will send in a single tree-sync chunk MaxTreeSyncChunkKeys = 128 MaxTreeSyncChunkKeysPlusValuesLength = 2 * (ocr3_1types.MaxMaxKeyValueKeyLength + ocr3_1types.MaxMaxKeyValueValueLength) MaxMaxParallelTreeSyncChunkFetches = 8 )
const BlobChunkSize = 1 << 22 // 4MiB
const ContractTransmitterTimeoutWarningGracePeriod = 50 * time.Millisecond
const ( // An oracle sends a STATE-SYNC-SUMMARY message every DeltaStateSyncHeartbeat DeltaStateSyncHeartbeat time.Duration = 1 * 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 ¶
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 RunBlobExchange ¶
func RunBlobExchange[RI any]( ctx context.Context, chNetToBlobExchange <-chan MessageToBlobExchangeWithSender[RI], chOutcomeGenerationToBlobExchange <-chan EventToBlobExchange[RI], chBlobBroadcastRequest <-chan blobBroadcastRequest, chBlobFetchRequest <-chan blobFetchRequest, config ocr3config.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 ocr3config.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 ocr3config.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 RunPacemaker ¶
func RunPacemaker[RI any]( ctx context.Context, chNetToPacemaker <-chan MessageToPacemakerWithSender[RI], chPacemakerToOutcomeGeneration chan<- EventToOutcomeGeneration[RI], chOutcomeGenerationToPacemaker <-chan EventToPacemaker[RI], config ocr3config.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 ocr3config.SharedConfig, contractTransmitter ocr3types.ContractTransmitter[RI], 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 ocr3config.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 ocr3config.SharedConfig, logger loghelper.LoggerWithContext, database Database, kvDb KeyValueDatabase, )
func RunTransmission ¶
func RunTransmission[RI any]( ctx context.Context, chReportAttestationToTransmission <-chan EventToTransmission[RI], config ocr3config.SharedConfig, contractTransmitter ocr3types.ContractTransmitter[RI], id commontypes.OracleID, localConfig types.LocalConfig, logger loghelper.LoggerWithContext, reportingPlugin ocr3_1types.ReportingPlugin[RI], )
Types ¶
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) Verify ¶
func (astb *AttestedStateTransitionBlock) Verify( configDigest types.ConfigDigest, oracleIdentities []config.OracleIdentity, byzQuorumSize int, ) 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 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
}
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 CertifiedCommit ¶
type CertifiedCommit struct {
CommitEpoch uint64
CommitSeqNr uint64
StateTransitionInputsDigest StateTransitionInputsDigest
StateTransitionOutputs StateTransitionOutputs
StateRootDigest StateRootDigest
ReportsPlusPrecursor ocr3_1types.ReportsPlusPrecursor
CommitQuorumCertificate []AttributedCommitSignature
}
The empty CertifiedCommit{} is the genesis value
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) IsGenesis ¶
func (hc *CertifiedCommit) IsGenesis() bool
func (*CertifiedCommit) SeqNr ¶
func (hc *CertifiedCommit) SeqNr() uint64
func (*CertifiedCommit) Timestamp ¶
func (hc *CertifiedCommit) Timestamp() HighestCertifiedTimestamp
func (*CertifiedCommit) Verify ¶
func (hc *CertifiedCommit) Verify( configDigest types.ConfigDigest, oracleIdentities []config.OracleIdentity, byzQuorumSize int, ) error
type CertifiedCommittedReports ¶
type CertifiedCommittedReports[RI any] struct { CommitEpoch uint64 SeqNr uint64 StateTransitionInputsDigest StateTransitionInputsDigest StateTransitionOutputDigest StateTransitionOutputDigest StateRootDigest StateRootDigest ReportsPlusPrecursor ocr3_1types.ReportsPlusPrecursor CommitQuorumCertificate []AttributedCommitSignature }
func (*CertifiedCommittedReports[RI]) CheckSize ¶
func (ccrs *CertifiedCommittedReports[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int) bool
func (*CertifiedCommittedReports[RI]) Verify ¶
func (ccrs *CertifiedCommittedReports[RI]) Verify( configDigest types.ConfigDigest, oracleIdentities []config.OracleIdentity, byzQuorumSize int, ) error
type CertifiedPrepare ¶
type CertifiedPrepare struct {
PrepareEpoch uint64
PrepareSeqNr uint64
StateTransitionInputsDigest StateTransitionInputsDigest
StateTransitionOutputs StateTransitionOutputs
StateRootDigest StateRootDigest
ReportsPlusPrecursor ocr3_1types.ReportsPlusPrecursor
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) IsGenesis ¶
func (hc *CertifiedPrepare) IsGenesis() bool
func (*CertifiedPrepare) SeqNr ¶
func (hc *CertifiedPrepare) SeqNr() uint64
func (*CertifiedPrepare) Timestamp ¶
func (hc *CertifiedPrepare) Timestamp() HighestCertifiedTimestamp
func (*CertifiedPrepare) Verify ¶
func (hc *CertifiedPrepare) Verify( configDigest types.ConfigDigest, oracleIdentities []config.OracleIdentity, byzQuorumSize int, ) error
type CertifiedPrepareOrCommit ¶
type CertifiedPrepareOrCommit interface {
Epoch() uint64
SeqNr() uint64
Timestamp() HighestCertifiedTimestamp
IsGenesis() bool
Verify(
_ types.ConfigDigest,
_ []config.OracleIdentity,
byzQuorumSize int,
) error
CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int) bool
// contains filtered or unexported methods
}
type CommitSignature ¶
type CommitSignature []byte
func MakeCommitSignature ¶
func MakeCommitSignature( ogid OutcomeGenerationID, seqNr uint64, inputsDigest StateTransitionInputsDigest, outputDigest StateTransitionOutputDigest, rootDigest StateRootDigest, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, signer func(msg []byte) ([]byte, error), ) (CommitSignature, error)
func (CommitSignature) Verify ¶
func (sig CommitSignature) Verify( ogid OutcomeGenerationID, seqNr uint64, inputsDigest StateTransitionInputsDigest, outputDigest StateTransitionOutputDigest, 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, oracleIdentities []config.OracleIdentity, byzQuorumSize int, ) 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 EventCertifiedCommit ¶
type EventCertifiedCommit[RI any] struct { CertifiedCommittedReports CertifiedCommittedReports[RI] }
type EventComputedCommitted ¶
type EventComputedObservation ¶
type EventComputedObservation[RI any] struct { Epoch uint64 SeqNr uint64 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 EventMissingOutcome ¶
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 HighestCertifiedTimestamp ¶
func (HighestCertifiedTimestamp) Less ¶
func (t HighestCertifiedTimestamp) Less(t2 HighestCertifiedTimestamp) bool
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)
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,
) (
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)
ReadBlobChunk(BlobDigest, uint64) ([]byte, error)
ReadStaleBlobIndex(maxStaleSinceSeqNr uint64, limit int) ([]StaleBlob, error)
jmt.RootReader
jmt.NodeReader
}
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)
// 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]. Only after doing so, it writes all keyValues into the tree
// and flat representation.
VerifyAndWriteTreeSyncChunk(
targetRootDigest StateRootDigest,
targetSeqNr uint64,
startIndex jmt.Digest,
endInclIndex jmt.Digest,
boundingLeaves []jmt.BoundingLeaf,
keyValues []KeyValuePair,
) (VerifyAndWriteTreeSyncChunkResult, error)
WriteTreeSyncStatus(state TreeSyncStatus) error
WriteBlobMeta(BlobDigest, BlobMeta) error
DeleteBlobMeta(BlobDigest) error
WriteBlobChunk(BlobDigest, uint64, []byte) error
DeleteBlobChunk(BlobDigest, uint64) error
WriteStaleBlobIndex(StaleBlob) error
DeleteStaleBlobIndex(StaleBlob) 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)
}
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) 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 outbound message, sentinel for inbound RequestInfo *MessageBlobChunkRequestInfo BlobDigest BlobDigest ChunkIndex uint64 }
func (MessageBlobChunkRequest[RI]) CheckSize ¶
func (msg MessageBlobChunkRequest[RI]) CheckSize(n int, f int, _ ocr3_1types.ReportingPluginLimits, _ int) 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 }
func (MessageBlobChunkResponse[RI]) CheckSize ¶
func (msg MessageBlobChunkResponse[RI]) CheckSize(n int, f int, _ ocr3_1types.ReportingPluginLimits, _ int) bool
type MessageBlobOffer ¶
type MessageBlobOffer[RI any] struct { RequestHandle types.RequestHandle // actual handle for outbound message, sentinel for inbound RequestInfo *MessageBlobOfferRequestInfo ChunkDigests []BlobChunkDigest PayloadLength uint64 ExpirySeqNr uint64 }
func (MessageBlobOffer[RI]) CheckSize ¶
func (msg MessageBlobOffer[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, _ int) 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) bool
type MessageBlockSyncRequest ¶
type MessageBlockSyncRequest[RI any] struct { RequestHandle types.RequestHandle // actual handle for outbound message, sentinel for inbound 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 }
func (MessageBlockSyncRequest[RI]) CheckSize ¶
func (msg MessageBlockSyncRequest[RI]) CheckSize(n int, f int, _ ocr3_1types.ReportingPluginLimits, _ int) 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 }
func (MessageBlockSyncResponse[RI]) CheckSize ¶
func (msg MessageBlockSyncResponse[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int) 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 MessageCertifiedCommit ¶
type MessageCertifiedCommit[RI any] struct { CertifiedCommittedReports CertifiedCommittedReports[RI] }
func (MessageCertifiedCommit[RI]) CheckSize ¶
func (msg MessageCertifiedCommit[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int) bool
type MessageCertifiedCommitRequest ¶
func (MessageCertifiedCommitRequest[RI]) CheckSize ¶
func (msg MessageCertifiedCommitRequest[RI]) CheckSize(n int, f int, _ ocr3_1types.ReportingPluginLimits, maxReportSigLen int) bool
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) bool
type MessageEpochStart ¶
type MessageEpochStart[RI any] struct { Epoch uint64 EpochStartProof EpochStartProof }
func (MessageEpochStart[RI]) CheckSize ¶
func (msg MessageEpochStart[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int) 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) bool
type MessageNewEpochWish ¶
func (MessageNewEpochWish[RI]) CheckSize ¶
func (msg MessageNewEpochWish[RI]) CheckSize(n int, f int, _ ocr3_1types.ReportingPluginLimits, _ int) bool
type MessageObservation ¶
type MessageObservation[RI any] struct { 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) 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) 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) bool
type MessageReportSignatures ¶
func (MessageReportSignatures[RI]) CheckSize ¶
func (msg MessageReportSignatures[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int) bool
type MessageRoundStart ¶
func (MessageRoundStart[RI]) CheckSize ¶
func (msg MessageRoundStart[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int) 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) 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 outbound message, sentinel for inbound ToSeqNr uint64 StartIndex jmt.Digest EndInclIndex jmt.Digest }
func (MessageTreeSyncChunkRequest[RI]) CheckSize ¶
func (msg MessageTreeSyncChunkRequest[RI]) CheckSize(n int, f int, limits ocr3_1types.ReportingPluginLimits, maxReportSigLen int) 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) 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, seqNr uint64, inputsDigest StateTransitionInputsDigest, outputDigest StateTransitionOutputDigest, rootDigest StateRootDigest, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, signer func(msg []byte) ([]byte, error), ) (PrepareSignature, error)
func (PrepareSignature) Verify ¶
func (sig PrepareSignature) Verify( ogid OutcomeGenerationID, seqNr uint64, inputsDigest StateTransitionInputsDigest, outputDigest StateTransitionOutputDigest, rootDigest StateRootDigest, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, publicKey types.OffchainPublicKey, ) error
type ReportsPlusPrecursorDigest ¶
type ReportsPlusPrecursorDigest [32]byte
func MakeReportsPlusPrecursorDigest ¶
func MakeReportsPlusPrecursorDigest(ogid OutcomeGenerationID, 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 {
Epoch uint64
BlockSeqNr uint64
StateTransitionInputsDigest StateTransitionInputsDigest
StateTransitionOutputs StateTransitionOutputs
StateRootDigest StateRootDigest
ReportsPlusPrecursor ocr3_1types.ReportsPlusPrecursor
}
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( ogid OutcomeGenerationID, seqNr uint64, attributedQuery types.AttributedQuery, attributedObservations []types.AttributedObservation, ) StateTransitionInputsDigest
type StateTransitionOutputDigest ¶
type StateTransitionOutputDigest [32]byte
func MakeStateTransitionOutputDigest ¶
func MakeStateTransitionOutputDigest(ogid OutcomeGenerationID, seqNr uint64, output []KeyValuePairWithDeletions) StateTransitionOutputDigest
type StateTransitionOutputs ¶
type StateTransitionOutputs struct {
WriteSet []KeyValuePairWithDeletions
}
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 )
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
- pacemaker.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