From 43ab92f5abe734e780bed06fee9a968855894529 Mon Sep 17 00:00:00 2001 From: Kostis Karantias Date: Thu, 30 Oct 2025 13:51:00 +0200 Subject: [PATCH] Improvements: - OCR3.1 polishing Based on 4cca1fb852fefbaa619fb7df6a6a5b45c2d1b375. Co-authored-by: kaleofduty <59616916+kaleofduty@users.noreply.github.com> Co-authored-by: stchrysa --- networking/ocr_endpoint_v3.go | 32 +- .../internal/managed/limits/ocr3_1_limits.go | 17 +- .../internal/managed/managed_ocr3_1_oracle.go | 32 +- .../max_max_serialization_limits.go | 2 +- .../internal/ocr3_1/protocol/blob_exchange.go | 4 +- .../internal/ocr3_1/protocol/blob_reap.go | 2 +- .../internal/ocr3_1/protocol/event.go | 1 + .../internal/ocr3_1/protocol/kvdb.go | 1 + .../internal/ocr3_1/protocol/message.go | 29 +- .../ocr3_1/protocol/outcome_generation.go | 49 +- .../protocol/outcome_generation_follower.go | 47 +- .../protocol/outcome_generation_leader.go | 1 + .../ocr3_1/protocol/report_attestation.go | 6 +- .../internal/ocr3_1/protocol/signed_data.go | 176 ++-- .../ocr3_1/protocol/state_sync_block.go | 91 ++- .../protocol/state_sync_block_replay.go | 2 +- .../ocr3_1/protocol/state_sync_tree.go | 21 +- .../internal/ocr3_1/protocol/types.go | 4 +- .../offchainreporting3_1_messages.pb.go | 754 ++++++++++-------- .../offchainreporting3_1_telemetry.pb.go | 223 +++--- .../ocr3_1/serialization/serialization.go | 60 +- .../internal/shim/metrics.go | 139 +++- .../ocr3_1_key_value_database_with_metrics.go | 104 +++ .../internal/shim/ocr3_1_key_value_store.go | 173 +++- .../shim/ocr3_1_serializing_endpoint.go | 212 +++-- offchainreporting2plus/ocr3_1types/plugin.go | 37 +- offchainreporting2plus/types/types.go | 4 +- 27 files changed, 1424 insertions(+), 799 deletions(-) create mode 100644 offchainreporting2plus/internal/shim/ocr3_1_key_value_database_with_metrics.go diff --git a/networking/ocr_endpoint_v3.go b/networking/ocr_endpoint_v3.go index a9cb10ca..a8b6f890 100644 --- a/networking/ocr_endpoint_v3.go +++ b/networking/ocr_endpoint_v3.go @@ -13,6 +13,7 @@ import ( "github.com/smartcontractkit/libocr/subprocesses" "github.com/smartcontractkit/libocr/internal/loghelper" + "github.com/smartcontractkit/libocr/internal/util" ) var ( @@ -22,8 +23,8 @@ var ( // ocrEndpointV3 represents a member of a particular feed oracle group type ocrEndpointV3 struct { // configuration and settings - defaultPriorityConfig ocr2types.BinaryNetworkEndpoint2Config - lowPriorityConfig ocr2types.BinaryNetworkEndpoint2Config + defaultPriorityConfig binaryNetworkEndpoint2ConfigNoNils + lowPriorityConfig binaryNetworkEndpoint2ConfigNoNils peerMapping map[commontypes.OracleID]ragetypes.PeerID host *ragep2pnew.Host configDigest ocr2types.ConfigDigest @@ -50,6 +51,21 @@ type priorityStreamGroup struct { Default ragep2pnew.Stream2 } +// copy of ocr2types.BinaryNetworkEndpoint2Config without nils +type binaryNetworkEndpoint2ConfigNoNils struct { + ocr2types.BinaryNetworkEndpointLimits + IncomingMessageBufferSize int + OutgoingMessageBufferSize int +} + +func binaryNetworkEndpoint2ConfigNilCoalesceWithPeerConfig(config ocr2types.BinaryNetworkEndpoint2Config, peer *concretePeerV2) binaryNetworkEndpoint2ConfigNoNils { + return binaryNetworkEndpoint2ConfigNoNils{ + config.BinaryNetworkEndpointLimits, + util.NilCoalesce(config.OverrideIncomingMessageBufferSize, peer.endpointConfig.IncomingMessageBufferSize), + util.NilCoalesce(config.OverrideOutgoingMessageBufferSize, peer.endpointConfig.OutgoingMessageBufferSize), + } +} + //nolint:unused func newOCREndpointV3( logger loghelper.LoggerWithContext, @@ -94,8 +110,8 @@ func newOCREndpointV3( } o := &ocrEndpointV3{ - defaultPriorityConfig, - lowPriorityConfig, + binaryNetworkEndpoint2ConfigNilCoalesceWithPeerConfig(defaultPriorityConfig, peer), + binaryNetworkEndpoint2ConfigNilCoalesceWithPeerConfig(lowPriorityConfig, peer), peerMapping, host, configDigest, @@ -141,8 +157,8 @@ func (o *ocrEndpointV3) start() error { pid, streamNameFromConfigDigestAndPriority(o.configDigest, ragep2pnew.StreamPriorityLow), ragep2pnew.StreamPriorityLow, - ragep2pnew.Stream2Limits{o.lowPriorityConfig.OverrideOutgoingMessageBufferSize, - o.lowPriorityConfig.OverrideIncomingMessageBufferSize, + ragep2pnew.Stream2Limits{o.lowPriorityConfig.OutgoingMessageBufferSize, + o.lowPriorityConfig.IncomingMessageBufferSize, o.lowPriorityConfig.MaxMessageLength, ragetypes.TokenBucketParams{ o.lowPriorityConfig.MessagesRatePerOracle, @@ -163,8 +179,8 @@ func (o *ocrEndpointV3) start() error { streamNameFromConfigDigestAndPriority(o.configDigest, ragep2pnew.StreamPriorityDefault), ragep2pnew.StreamPriorityDefault, ragep2pnew.Stream2Limits{ - o.defaultPriorityConfig.OverrideOutgoingMessageBufferSize, - o.defaultPriorityConfig.OverrideIncomingMessageBufferSize, + o.defaultPriorityConfig.OutgoingMessageBufferSize, + o.defaultPriorityConfig.IncomingMessageBufferSize, o.defaultPriorityConfig.MaxMessageLength, ragetypes.TokenBucketParams{ o.defaultPriorityConfig.MessagesRatePerOracle, diff --git a/offchainreporting2plus/internal/managed/limits/ocr3_1_limits.go b/offchainreporting2plus/internal/managed/limits/ocr3_1_limits.go index 28cddbe7..f16e754e 100644 --- a/offchainreporting2plus/internal/managed/limits/ocr3_1_limits.go +++ b/offchainreporting2plus/internal/managed/limits/ocr3_1_limits.go @@ -71,7 +71,7 @@ func OCR3_1Limits(cfg ocr3_1config.PublicConfig, pluginLimits ocr3_1types.Report const sigOverhead = 10 const overhead = 256 - maxLenStateTransitionOutputs := add( + maxLenStateWriteSet := add( pluginLimits.MaxKeyValueModifiedKeysPlusValuesBytes, mul( pluginLimits.MaxKeyValueModifiedKeys, @@ -79,7 +79,7 @@ func OCR3_1Limits(cfg ocr3_1config.PublicConfig, pluginLimits ocr3_1types.Report ), ) maxLenCertifiedPrepareOrCommit := add(mul(ed25519.SignatureSize+sigOverhead, cfg.ByzQuorumSize()), - sha256.Size*3, + sha256.Size*5, overhead) maxLenMsgNewEpoch := overhead maxLenMsgEpochStartRequest := add(maxLenCertifiedPrepareOrCommit, overhead) @@ -132,7 +132,7 @@ func OCR3_1Limits(cfg ocr3_1config.PublicConfig, pluginLimits ocr3_1types.Report // block sync messages maxLenMsgBlockSyncRequest := overhead - maxLenAttestedStateTransitionBlock := add(maxLenCertifiedPrepareOrCommit, maxLenStateTransitionOutputs) + maxLenAttestedStateTransitionBlock := add(maxLenCertifiedPrepareOrCommit, maxLenStateWriteSet) maxLenMsgBlockSyncResponse := add(mul(cfg.GetMaxBlocksPerBlockSyncResponse(), maxLenAttestedStateTransitionBlock), overhead) // blob exchange messages @@ -151,13 +151,11 @@ func OCR3_1Limits(cfg ocr3_1config.PublicConfig, pluginLimits ocr3_1types.Report maxLenMsgEpochStartRequest, maxLenMsgEpochStart, maxLenMsgRoundStart, - maxLenMsgObservation, maxLenMsgProposal, maxLenMsgPrepare, maxLenMsgCommit, maxLenMsgReportSignatures, maxLenMsgReportsPlusPrecursorRequest, - maxLenMsgReportsPlusPrecursor, maxLenMsgBlobOffer, maxLenMsgBlobChunkRequest, ) @@ -174,7 +172,7 @@ func OCR3_1Limits(cfg ocr3_1config.PublicConfig, pluginLimits ocr3_1types.Report defaultPriorityMessagesRate := (1.0*float64(time.Second)/float64(cfg.GetDeltaResend()) + 3.0*float64(time.Second)/minEpochInterval + - 8.0*float64(time.Second)/float64(minRoundInterval) + + 6.0*float64(time.Second)/float64(minRoundInterval) + 2.0*float64(time.Second)/float64(cfg.GetDeltaBlobOfferMinRequestToSameOracleInterval()) + 1.0*float64(time.Second)/float64(cfg.GetDeltaBlobChunkMinRequestToSameOracleInterval())) * 1.2 @@ -182,7 +180,7 @@ func OCR3_1Limits(cfg ocr3_1config.PublicConfig, pluginLimits ocr3_1types.Report 1.0*float64(time.Second)/float64(cfg.GetDeltaTreeSyncMinRequestToSameOracleInterval()) + 1.0*float64(time.Second)/float64(cfg.GetDeltaStateSyncSummaryInterval())) * 1.2 - defaultPriorityMessagesCapacity := mul(15, 3) + defaultPriorityMessagesCapacity := mul(13, 3) lowPriorityMessagesCapacity := mul(3, 3) // we don't multiply bytesRate by a safetyMargin since we already have a generous overhead on each message @@ -196,9 +194,7 @@ func OCR3_1Limits(cfg ocr3_1config.PublicConfig, pluginLimits ocr3_1types.Report float64(time.Second)/float64(minRoundInterval)*float64(maxLenMsgRoundStart) + float64(time.Second)/float64(minRoundInterval)*float64(maxLenMsgProposal) + float64(time.Second)/float64(minEpochInterval)*float64(maxLenMsgEpochStartRequest) + - float64(time.Second)/float64(minRoundInterval)*float64(maxLenMsgObservation) + float64(time.Second)/float64(minRoundInterval)*float64(maxLenMsgReportsPlusPrecursorRequest) + - float64(time.Second)/float64(minRoundInterval)*float64(maxLenMsgReportsPlusPrecursor) + float64(time.Second)/float64(cfg.GetDeltaBlobOfferMinRequestToSameOracleInterval())*float64(maxLenMsgBlobOffer) + // blob-related messages float64(time.Second)/float64(cfg.GetDeltaBlobChunkMinRequestToSameOracleInterval())*float64(maxLenMsgBlobChunkRequest) @@ -212,16 +208,13 @@ func OCR3_1Limits(cfg ocr3_1config.PublicConfig, pluginLimits ocr3_1types.Report maxLenMsgEpochStartRequest, maxLenMsgEpochStart, maxLenMsgRoundStart, - maxLenMsgObservation, maxLenMsgProposal, maxLenMsgPrepare, maxLenMsgCommit, maxLenMsgReportSignatures, maxLenMsgReportsPlusPrecursorRequest, - maxLenMsgReportsPlusPrecursor, maxLenMsgBlobOffer, maxLenMsgBlobChunkRequest, - maxLenMsgBlobOfferResponse, ), 3) lowPriorityBytesCapacity := mul(add( diff --git a/offchainreporting2plus/internal/managed/managed_ocr3_1_oracle.go b/offchainreporting2plus/internal/managed/managed_ocr3_1_oracle.go index 73e7ff7a..1c49a160 100644 --- a/offchainreporting2plus/internal/managed/managed_ocr3_1_oracle.go +++ b/offchainreporting2plus/internal/managed/managed_ocr3_1_oracle.go @@ -22,13 +22,6 @@ import ( "github.com/smartcontractkit/libocr/subprocesses" ) -const ( - defaultIncomingMessageBufferSize = 10 - defaultOutgoingMessageBufferSize = 10 - lowPriorityIncomingMessageBufferSize = 10 - lowPriorityOutgoingMessageBufferSize = 10 -) - // RunManagedOCR3_1Oracle runs a "managed" version of protocol.RunOracle. It handles // setting up telemetry, garbage collection, configuration updates, translating // from types.BinaryNetworkEndpoint2 to protocol.NetworkEndpoint, and @@ -175,15 +168,16 @@ func RunManagedOCR3_1Oracle[RI any]( }) return fmt.Errorf("ManagedOCR3_1Oracle: error during limits"), false } + defaultPriorityConfig := types.BinaryNetworkEndpoint2Config{ defaultLims, - defaultIncomingMessageBufferSize, - defaultOutgoingMessageBufferSize, + nil, + nil, } lowPriorityConfig := types.BinaryNetworkEndpoint2Config{ lowPriorityLimits, - lowPriorityIncomingMessageBufferSize, - lowPriorityOutgoingMessageBufferSize, + nil, + nil, } binNetEndpoint, err := messageNetEndpointFactory.NewEndpoint( @@ -237,7 +231,21 @@ func RunManagedOCR3_1Oracle[RI any]( logger, "ManagedOCR3_1Oracle: error during keyValueDatabase.Close()", ) - semanticOCR3_1KeyValueDatabase := shim.NewSemanticOCR3_1KeyValueDatabase(keyValueDatabase, reportingPluginInfo.Limits, sharedConfig.PublicConfig, logger, metricsRegisterer) + keyValueDatabaseWithMetrics := shim.NewKeyValueDatabaseWithMetrics(keyValueDatabase, metricsRegisterer, logger) + defer loghelper.CloseLogError( + keyValueDatabaseWithMetrics, + logger, + "ManagedOCR3_1Oracle: error during keyValueDatabaseWithMetrics.Close()", + ) + semanticOCR3_1KeyValueDatabase, err := shim.NewSemanticOCR3_1KeyValueDatabase(keyValueDatabaseWithMetrics, reportingPluginInfo.Limits, sharedConfig.PublicConfig, logger, metricsRegisterer) + if err != nil { + return fmt.Errorf("ManagedOCR3_1Oracle: error during NewSemanticOCR3_1KeyValueDatabase: %w", err), false + } + defer loghelper.CloseLogError( + semanticOCR3_1KeyValueDatabase, + logger, + "ManagedOCR3_1Oracle: error during semanticOCR3_1KeyValueDatabase.Close()", + ) protocol.RunOracle[RI]( ctx, diff --git a/offchainreporting2plus/internal/ocr3_1/maxmaxserializationlimits/max_max_serialization_limits.go b/offchainreporting2plus/internal/ocr3_1/maxmaxserializationlimits/max_max_serialization_limits.go index 6ddf7d3d..cc82744a 100644 --- a/offchainreporting2plus/internal/ocr3_1/maxmaxserializationlimits/max_max_serialization_limits.go +++ b/offchainreporting2plus/internal/ocr3_1/maxmaxserializationlimits/max_max_serialization_limits.go @@ -5,7 +5,7 @@ const ( MaxMaxEpochStartBytes = 4825 MaxMaxReportsPlusPrecursorRequestBytes = 18 MaxMaxReportsPlusPrecursorBytes = 6815772 - MaxMaxBlockSyncRequestBytes = 32 + MaxMaxBlockSyncRequestBytes = 40 MaxMaxBlockSyncResponseBytes = 27371305 MaxMaxTreeSyncChunkRequestBytes = 106 MaxMaxTreeSyncChunkResponseBytes = 65049225 diff --git a/offchainreporting2plus/internal/ocr3_1/protocol/blob_exchange.go b/offchainreporting2plus/internal/ocr3_1/protocol/blob_exchange.go index 98f599e1..4f444a0a 100644 --- a/offchainreporting2plus/internal/ocr3_1/protocol/blob_exchange.go +++ b/offchainreporting2plus/internal/ocr3_1/protocol/blob_exchange.go @@ -1815,9 +1815,9 @@ func (bex *blobExchangeState[RI]) verifyCert(cert *LightCertifiedBlob) error { } func staleBlob(expirySeqNr uint64, blobDigest BlobDigest) StaleBlob { - return StaleBlob{expirySeqNr + 1, blobDigest} + return StaleBlob{expirySeqNr, blobDigest} } func hasBlobExpired(expirySeqNr uint64, committedSeqNr uint64) bool { - return expirySeqNr < committedSeqNr + return expirySeqNr <= committedSeqNr } diff --git a/offchainreporting2plus/internal/ocr3_1/protocol/blob_reap.go b/offchainreporting2plus/internal/ocr3_1/protocol/blob_reap.go index 2f3e7e04..586fbf5b 100644 --- a/offchainreporting2plus/internal/ocr3_1/protocol/blob_reap.go +++ b/offchainreporting2plus/internal/ocr3_1/protocol/blob_reap.go @@ -10,7 +10,7 @@ import ( ) const ( - blobReapInterval = 10 * time.Second + blobReapInterval = 3 * time.Second maxBlobsToReapInSingleTransaction = 100 ) diff --git a/offchainreporting2plus/internal/ocr3_1/protocol/event.go b/offchainreporting2plus/internal/ocr3_1/protocol/event.go index 71e828ac..9a3a6854 100644 --- a/offchainreporting2plus/internal/ocr3_1/protocol/event.go +++ b/offchainreporting2plus/internal/ocr3_1/protocol/event.go @@ -78,6 +78,7 @@ func (ev EventComputedObservationQuorumSuccess[RI]) processOutcomeGeneration(out type EventComputedObservation[RI any] struct { Epoch uint64 SeqNr uint64 + RequestHandle types.RequestHandle AttributedQuery types.AttributedQuery Observation types.Observation } diff --git a/offchainreporting2plus/internal/ocr3_1/protocol/kvdb.go b/offchainreporting2plus/internal/ocr3_1/protocol/kvdb.go index b8f1fc2f..943d732f 100644 --- a/offchainreporting2plus/internal/ocr3_1/protocol/kvdb.go +++ b/offchainreporting2plus/internal/ocr3_1/protocol/kvdb.go @@ -40,6 +40,7 @@ type KeyValueDatabaseSemanticRead interface { toSeqNr uint64, startIndex jmt.Digest, requestEndInclIndex jmt.Digest, + maxCumulativeKeysPlusValuesBytes int, ) ( endInclIndex jmt.Digest, boundingLeaves []jmt.BoundingLeaf, diff --git a/offchainreporting2plus/internal/ocr3_1/protocol/message.go b/offchainreporting2plus/internal/ocr3_1/protocol/message.go index cce273f8..0026e5fa 100644 --- a/offchainreporting2plus/internal/ocr3_1/protocol/message.go +++ b/offchainreporting2plus/internal/ocr3_1/protocol/message.go @@ -179,9 +179,10 @@ func (msg MessageEpochStart[RI]) epoch() uint64 { } type MessageRoundStart[RI any] struct { - Epoch uint64 - SeqNr uint64 - Query types.Query + RequestHandle types.RequestHandle // actual handle for inbound message, sentinel for outbound + Epoch uint64 + SeqNr uint64 + Query types.Query } var _ MessageToOutcomeGeneration[struct{}] = (*MessageRoundStart[struct{}])(nil) @@ -206,6 +207,7 @@ func (msg MessageRoundStart[RI]) epoch() uint64 { } type MessageObservation[RI any] struct { + RequestHandle types.RequestHandle // actual handle for outbound message, sentinel for inbound Epoch uint64 SeqNr uint64 SignedObservation SignedObservation @@ -354,7 +356,8 @@ func (msg MessageReportSignatures[RI]) processReportAttestation(repatt *reportAt } type MessageReportsPlusPrecursorRequest[RI any] struct { - SeqNr uint64 + RequestHandle types.RequestHandle // actual handle for inbound message, sentinel for outbound + SeqNr uint64 } var _ MessageToReportAttestation[struct{}] = MessageReportsPlusPrecursorRequest[struct{}]{} @@ -372,6 +375,7 @@ func (msg MessageReportsPlusPrecursorRequest[RI]) processReportAttestation(repat } type MessageReportsPlusPrecursor[RI any] struct { + RequestHandle types.RequestHandle // actual handle for outbound message, sentinel for inbound SeqNr uint64 ReportsPlusPrecursor ocr3_1types.ReportsPlusPrecursor } @@ -394,10 +398,11 @@ func (msg MessageReportsPlusPrecursor[RI]) processReportAttestation(repatt *repo } type MessageBlockSyncRequest[RI any] struct { - RequestHandle types.RequestHandle // actual handle for outbound message, sentinel for inbound - 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 + 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 } var _ MessageToStateSync[struct{}] = MessageBlockSyncRequest[struct{}]{} @@ -463,11 +468,13 @@ func (msg MessageBlockSyncResponse[RI]) processStateSync(stasy *stateSyncState[R } type MessageTreeSyncChunkRequest[RI any] struct { - RequestHandle types.RequestHandle // actual handle for outbound message, sentinel for inbound + RequestHandle types.RequestHandle // actual handle for inbound message, sentinel for outbound RequestInfo *types.RequestInfo ToSeqNr uint64 StartIndex jmt.Digest EndInclIndex jmt.Digest + + MaxCumulativeKeysPlusValuesBytes int } var _ MessageToStateSync[struct{}] = MessageTreeSyncChunkRequest[struct{}]{} @@ -534,7 +541,7 @@ func (msg MessageTreeSyncChunkResponse[RI]) processStateSync(stasy *stateSyncSta } type MessageBlobOffer[RI any] struct { - RequestHandle types.RequestHandle // actual handle for outbound message, sentinel for inbound + RequestHandle types.RequestHandle // actual handle for inbound message, sentinel for outbound RequestInfo *types.RequestInfo ChunkDigestsRoot mt.Digest PayloadLength uint64 @@ -581,7 +588,7 @@ func (msg MessageBlobOfferResponse[RI]) processBlobExchange(bex *blobExchangeSta } type MessageBlobChunkRequest[RI any] struct { - RequestHandle types.RequestHandle // actual handle for outbound message, sentinel for inbound + RequestHandle types.RequestHandle // actual handle for inbound message, sentinel for outbound RequestInfo *types.RequestInfo BlobDigest BlobDigest ChunkIndex uint64 diff --git a/offchainreporting2plus/internal/ocr3_1/protocol/outcome_generation.go b/offchainreporting2plus/internal/ocr3_1/protocol/outcome_generation.go index 728e1984..b157b4db 100644 --- a/offchainreporting2plus/internal/ocr3_1/protocol/outcome_generation.go +++ b/offchainreporting2plus/internal/ocr3_1/protocol/outcome_generation.go @@ -159,8 +159,9 @@ type stateTransitionInfo interface { } type stateTransitionInfoDigests struct { + PrevHistoryDigest HistoryDigest InputsDigest StateTransitionInputsDigest - OutputDigest StateTransitionOutputDigest + WriteSetDigest StateWriteSetDigest StateRootDigest StateRootDigest ReportsPlusPrecursorDigest ReportsPlusPrecursorDigest } @@ -173,7 +174,7 @@ func (stid stateTransitionInfoDigests) digests() stateTransitionInfoDigests { type stateTransitionInfoDigestsAndPreimages struct { stateTransitionInfoDigests - Outputs StateTransitionOutputs + WriteSet StateWriteSet ReportsPlusPrecursor ocr3_1types.ReportsPlusPrecursor } @@ -191,19 +192,25 @@ type sharedState struct { seqNr uint64 observationQuorum *int - committedSeqNr uint64 + committedSeqNr uint64 + committedHistoryDigest HistoryDigest } func (outgen *outcomeGenerationState[RI]) run(restoredCert CertifiedPrepareOrCommit) { var restoredCommitedSeqNr uint64 - if restoredCert != nil { - if commitQC, ok := restoredCert.(*CertifiedCommit); ok { - restoredCommitedSeqNr = commitQC.SeqNr() - } else if prepareQc, ok := restoredCert.(*CertifiedPrepare); ok { - if prepareQc.SeqNr() > 1 { - restoredCommitedSeqNr = prepareQc.SeqNr() - 1 - } + var restoredCommitedHistoryDigest HistoryDigest + if restoredCert == nil { + restoredCert = &CertifiedCommit{} // genesis + } + if commitQC, ok := restoredCert.(*CertifiedCommit); ok { + restoredCommitedSeqNr = commitQC.SeqNr() + restoredCommitedHistoryDigest = commitQC.HistoryDigest(outgen.config.ConfigDigest) + } else if prepareQc, ok := restoredCert.(*CertifiedPrepare); ok { + if prepareQc.SeqNr() >= 1 { + restoredCommitedSeqNr = prepareQc.SeqNr() - 1 + restoredCommitedHistoryDigest = prepareQc.PrevHistoryDigest } + } outgen.logger.Info("OutcomeGeneration: running", commontypes.LogFields{ @@ -249,11 +256,17 @@ func (outgen *outcomeGenerationState[RI]) run(restoredCert CertifiedPrepareOrCom restoredCommitedSeqNr, nil, restoredCommitedSeqNr, + restoredCommitedHistoryDigest, } - outgen.subs.Go(func() { - RunOutcomeGenerationReap(outgen.ctx, outgen.logger, outgen.kvDb) - }) + { + ctx := outgen.ctx + logger := outgen.logger + kvDb := outgen.kvDb + outgen.subs.Go(func() { + RunOutcomeGenerationReap(ctx, logger, kvDb) + }) + } // Event Loop chDone := outgen.ctx.Done() @@ -578,7 +591,7 @@ func (outgen *outcomeGenerationState[RI]) tryToMoveCertAndKVStateToCommitQC(comm } // apply write set - stateRootDigest, err := tx.ApplyWriteSet(stb.StateTransitionOutputs.WriteSet) + stateRootDigest, err := tx.ApplyWriteSet(stb.StateWriteSet.Entries) if err != nil { outgen.logger.Error("error applying write set", commontypes.LogFields{ "commitQCSeqNr": commitQC.CommitSeqNr, @@ -634,14 +647,14 @@ func (outgen *outcomeGenerationState[RI]) persistUnattestedStateTransitionBlockA } func (outgen *outcomeGenerationState[RI]) isCompatibleUnattestedStateTransitionBlockSanityCheck(commitQC *CertifiedCommit, stb StateTransitionBlock) error { - stbStateTransitionOutputsDigest := MakeStateTransitionOutputDigest( + stbStateWriteSetDigest := MakeStateWriteSetDigest( outgen.config.ConfigDigest, stb.BlockSeqNr, - stb.StateTransitionOutputs.WriteSet, + stb.StateWriteSet.Entries, ) - if stbStateTransitionOutputsDigest != commitQC.StateTransitionOutputsDigest { - return fmt.Errorf("local state transition block outputs digest does not match commitQC: expected %s but got %s", commitQC.StateTransitionOutputsDigest, stbStateTransitionOutputsDigest) + if stbStateWriteSetDigest != commitQC.StateWriteSetDigest { + return fmt.Errorf("local state transition block write set digest does not match commitQC: expected %s but got %s", commitQC.StateWriteSetDigest, stbStateWriteSetDigest) } if stb.StateRootDigest != commitQC.StateRootDigest { return fmt.Errorf("local state transition block state root digest does not match commitQC: expected %s but got %s", commitQC.StateRootDigest, stb.StateRootDigest) diff --git a/offchainreporting2plus/internal/ocr3_1/protocol/outcome_generation_follower.go b/offchainreporting2plus/internal/ocr3_1/protocol/outcome_generation_follower.go index 3b1d26ca..c9707e7b 100644 --- a/offchainreporting2plus/internal/ocr3_1/protocol/outcome_generation_follower.go +++ b/offchainreporting2plus/internal/ocr3_1/protocol/outcome_generation_follower.go @@ -128,8 +128,9 @@ func (outgen *outcomeGenerationState[RI]) messageEpochStart(msg MessageEpochStar } outgen.followerState.stateTransitionInfo = stateTransitionInfoDigests{ + prepareQc.PrevHistoryDigest, prepareQc.StateTransitionInputsDigest, - prepareQc.StateTransitionOutputsDigest, + prepareQc.StateWriteSetDigest, prepareQc.StateRootDigest, prepareQc.ReportsPlusPrecursorDigest, } @@ -250,6 +251,7 @@ func (outgen *outcomeGenerationState[RI]) tryProcessRoundStartPool() { outgen.sharedState.l, } kvReadTxn, err := outgen.kvDb.NewReadTransaction(roundCtx.SeqNr) + requestHandle := msg.RequestHandle if err != nil { outgen.logger.Warn("failed to create new transaction, aborting tryProcessRoundStartPool", commontypes.LogFields{ @@ -259,7 +261,7 @@ func (outgen *outcomeGenerationState[RI]) tryProcessRoundStartPool() { return } outgen.subs.Go(func() { - outgen.backgroundObservation(ctx, logger, roundCtx, aq, kvReadTxn) + outgen.backgroundObservation(ctx, logger, roundCtx, aq, kvReadTxn, requestHandle) }) } } @@ -270,6 +272,7 @@ func (outgen *outcomeGenerationState[RI]) backgroundObservation( roundCtx RoundContext, aq types.AttributedQuery, kvReadTxn KeyValueDatabaseReadTransaction, + requestHandle types.RequestHandle, ) { observation, ok := callPluginFromOutcomeGenerationBackground[types.Observation]( ctx, @@ -298,6 +301,7 @@ func (outgen *outcomeGenerationState[RI]) backgroundObservation( case outgen.chLocalEvent <- EventComputedObservation[RI]{ roundCtx.Epoch, roundCtx.SeqNr, + requestHandle, aq, observation, }: @@ -346,6 +350,7 @@ func (outgen *outcomeGenerationState[RI]) eventComputedObservation(ev EventCompu "seqNr": outgen.sharedState.seqNr, }) outgen.netSender.SendTo(MessageObservation[RI]{ + ev.RequestHandle, outgen.sharedState.e, outgen.sharedState.seqNr, so, @@ -438,6 +443,7 @@ func (outgen *outcomeGenerationState[RI]) tryProcessProposalPool() { ctx := outgen.epochCtx logger := outgen.logger roundCtx := outgen.RoundCtx(outgen.sharedState.seqNr) + prevHistoryDigest := outgen.sharedState.committedHistoryDigest ogid := outgen.ID() aq := types.AttributedQuery{ *outgen.followerState.query, @@ -450,6 +456,7 @@ func (outgen *outcomeGenerationState[RI]) tryProcessProposalPool() { outgen.backgroundProposalStateTransition( ctx, logger, + prevHistoryDigest, ogid, roundCtx, aq, @@ -463,6 +470,7 @@ func (outgen *outcomeGenerationState[RI]) tryProcessProposalPool() { func (outgen *outcomeGenerationState[RI]) backgroundProposalStateTransition( ctx context.Context, logger loghelper.LoggerWithContext, + prevHistoryDigest HistoryDigest, ogid OutcomeGenerationID, roundCtx RoundContext, aq types.AttributedQuery, @@ -528,10 +536,10 @@ func (outgen *outcomeGenerationState[RI]) backgroundProposalStateTransition( return } - stateTransitionOutputDigest := MakeStateTransitionOutputDigest(outgen.config.ConfigDigest, roundCtx.SeqNr, writeSet) + stateWriteSetDigest := MakeStateWriteSetDigest(outgen.config.ConfigDigest, roundCtx.SeqNr, writeSet) reportsPlusPrecursorDigest := MakeReportsPlusPrecursorDigest(outgen.config.ConfigDigest, roundCtx.SeqNr, reportsPlusPrecursor) - stateTransitionOutputs := StateTransitionOutputs{writeSet} + stateWriteSet := StateWriteSet{writeSet} select { case outgen.chLocalEvent <- EventComputedProposalStateTransition[RI]{ @@ -540,12 +548,13 @@ func (outgen *outcomeGenerationState[RI]) backgroundProposalStateTransition( kvReadWriteTxn, stateTransitionInfoDigestsAndPreimages{ stateTransitionInfoDigests{ + prevHistoryDigest, stateTransitionInputsDigest, - stateTransitionOutputDigest, + stateWriteSetDigest, stateRootDigest, reportsPlusPrecursorDigest, }, - stateTransitionOutputs, + stateWriteSet, reportsPlusPrecursor, }, }: @@ -589,10 +598,11 @@ func (outgen *outcomeGenerationState[RI]) eventComputedProposalStateTransition(e err := outgen.persistUnattestedStateTransitionBlockAndReportsPlusPrecursor( StateTransitionBlock{ + stidap.PrevHistoryDigest, ev.Epoch, ev.SeqNr, stidap.InputsDigest, - stidap.Outputs, + stidap.WriteSet, stidap.StateRootDigest, stidap.ReportsPlusPrecursorDigest, }, @@ -618,9 +628,10 @@ func (outgen *outcomeGenerationState[RI]) broadcastMessagePrepare() { stid := outgen.followerState.stateTransitionInfo.digests() prepareSignature, err := MakePrepareSignature( ogid, + stid.PrevHistoryDigest, seqNr, stid.InputsDigest, - stid.OutputDigest, + stid.WriteSetDigest, stid.StateRootDigest, stid.ReportsPlusPrecursorDigest, outgen.offchainKeyring.OffchainSign, @@ -705,9 +716,10 @@ func (outgen *outcomeGenerationState[RI]) tryProcessPreparePool() { } err := preparePoolEntry.Item.Verify( outgen.ID(), + stid.PrevHistoryDigest, outgen.sharedState.seqNr, stid.InputsDigest, - stid.OutputDigest, + stid.WriteSetDigest, stid.StateRootDigest, stid.ReportsPlusPrecursorDigest, outgen.config.OracleIdentities[sender].OffchainPublicKey, @@ -742,9 +754,10 @@ func (outgen *outcomeGenerationState[RI]) tryProcessPreparePool() { commitSignature, err := MakeCommitSignature( outgen.ID(), + stid.PrevHistoryDigest, outgen.sharedState.seqNr, stid.InputsDigest, - stid.OutputDigest, + stid.WriteSetDigest, stid.StateRootDigest, stid.ReportsPlusPrecursorDigest, outgen.offchainKeyring.OffchainSign, @@ -758,10 +771,11 @@ func (outgen *outcomeGenerationState[RI]) tryProcessPreparePool() { } if !outgen.persistAndUpdateCertIfGreater(&CertifiedPrepare{ + stid.PrevHistoryDigest, outgen.sharedState.e, outgen.sharedState.seqNr, stid.InputsDigest, - stid.OutputDigest, + stid.WriteSetDigest, stid.StateRootDigest, stid.ReportsPlusPrecursorDigest, prepareQuorumCertificate, @@ -840,9 +854,10 @@ func (outgen *outcomeGenerationState[RI]) tryProcessCommitPool() { } err := commitPoolEntry.Item.Verify( outgen.ID(), + stid.PrevHistoryDigest, outgen.sharedState.seqNr, stid.InputsDigest, - stid.OutputDigest, + stid.WriteSetDigest, stid.StateRootDigest, stid.ReportsPlusPrecursorDigest, outgen.config.OracleIdentities[sender].OffchainPublicKey, @@ -880,10 +895,11 @@ func (outgen *outcomeGenerationState[RI]) tryProcessCommitPool() { } commitQC := &CertifiedCommit{ + stid.PrevHistoryDigest, outgen.sharedState.e, outgen.sharedState.seqNr, stid.InputsDigest, - stid.OutputDigest, + stid.WriteSetDigest, stid.StateRootDigest, stid.ReportsPlusPrecursorDigest, commitQuorumCertificate, @@ -914,10 +930,11 @@ func (outgen *outcomeGenerationState[RI]) tryProcessCommitPool() { // Write attested state transition block { stb := StateTransitionBlock{ + stid.PrevHistoryDigest, commitQC.CommitEpoch, commitQC.CommitSeqNr, sti.InputsDigest, - sti.Outputs, + sti.WriteSet, sti.StateRootDigest, sti.ReportsPlusPrecursorDigest, } @@ -1122,6 +1139,7 @@ func (outgen *outcomeGenerationState[RI]) commit(commit CertifiedCommit) bool { } outgen.sharedState.committedSeqNr = commit.SeqNr() + outgen.sharedState.committedHistoryDigest = commit.HistoryDigest(outgen.config.ConfigDigest) outgen.metrics.committedSeqNr.Set(float64(commit.SeqNr())) outgen.logger.Debug("✅ committed", commontypes.LogFields{ @@ -1238,7 +1256,6 @@ func (outgen *outcomeGenerationState[RI]) backgroundCheckAttributedSignedObserva asos []AttributedSignedObservation, kvReader ocr3_1types.KeyValueStateReader, // we don't discard the kvReader in this function because it is managed further up the call stack ) ([]types.AttributedObservation, bool) { - attributedObservations := make([]types.AttributedObservation, 0, len(asos)) subs, allValidMutex, allValid := subprocesses.Subprocesses{}, sync.Mutex{}, true diff --git a/offchainreporting2plus/internal/ocr3_1/protocol/outcome_generation_leader.go b/offchainreporting2plus/internal/ocr3_1/protocol/outcome_generation_leader.go index 91a310bf..05fcb501 100644 --- a/offchainreporting2plus/internal/ocr3_1/protocol/outcome_generation_leader.go +++ b/offchainreporting2plus/internal/ocr3_1/protocol/outcome_generation_leader.go @@ -393,6 +393,7 @@ func (outgen *outcomeGenerationState[RI]) eventComputedQuery(ev EventComputedQue "seqNr": outgen.sharedState.committedSeqNr + 1, }) outgen.netSender.Broadcast(MessageRoundStart[RI]{ + types.EmptyRequestHandleForOutboundRequest, outgen.sharedState.e, outgen.sharedState.committedSeqNr + 1, ev.Query, diff --git a/offchainreporting2plus/internal/ocr3_1/protocol/report_attestation.go b/offchainreporting2plus/internal/ocr3_1/protocol/report_attestation.go index 3df251ca..33add6c1 100644 --- a/offchainreporting2plus/internal/ocr3_1/protocol/report_attestation.go +++ b/offchainreporting2plus/internal/ocr3_1/protocol/report_attestation.go @@ -294,6 +294,7 @@ func (repatt *reportAttestationState[RI]) messageReportsPlusPrecursorRequest(msg "to": sender, }) repatt.netSender.SendTo(MessageReportsPlusPrecursor[RI]{ + msg.RequestHandle, msg.SeqNr, *repatt.rounds[msg.SeqNr].certifiedReportsPlusPrecursor, }, sender) @@ -392,7 +393,10 @@ func (repatt *reportAttestationState[RI]) tryRequestReportsPlusPrecursor(seqNr u "seqNr": seqNr, "to": randomCandidate, }) - repatt.netSender.SendTo(MessageReportsPlusPrecursorRequest[RI]{seqNr}, randomCandidate) + repatt.netSender.SendTo(MessageReportsPlusPrecursorRequest[RI]{ + types.EmptyRequestHandleForOutboundRequest, + seqNr, + }, randomCandidate) repatt.scheduler.ScheduleDelay(EventMissingReportsPlusPrecursor[RI]{seqNr}, repatt.config.GetDeltaReportsPlusPrecursorRequest()) } diff --git a/offchainreporting2plus/internal/ocr3_1/protocol/signed_data.go b/offchainreporting2plus/internal/ocr3_1/protocol/signed_data.go index 7b91dad1..a14f20f3 100644 --- a/offchainreporting2plus/internal/ocr3_1/protocol/signed_data.go +++ b/offchainreporting2plus/internal/ocr3_1/protocol/signed_data.go @@ -132,17 +132,17 @@ func MakeStateTransitionInputsDigest( return result } -type StateTransitionOutputDigest [32]byte +type StateWriteSetDigest [32]byte -func MakeStateTransitionOutputDigest(configDigest types.ConfigDigest, seqNr uint64, output []KeyValuePairWithDeletions) StateTransitionOutputDigest { +func MakeStateWriteSetDigest(configDigest types.ConfigDigest, seqNr uint64, writeSet []KeyValuePairWithDeletions) StateWriteSetDigest { h := sha256.New() _, _ = h.Write(configDigest[:]) _ = binary.Write(h, binary.BigEndian, seqNr) - _ = binary.Write(h, binary.BigEndian, uint64(len(output))) - for _, o := range output { + _ = binary.Write(h, binary.BigEndian, uint64(len(writeSet))) + for _, o := range writeSet { _ = binary.Write(h, binary.BigEndian, uint64(len(o.Key))) _, _ = h.Write(o.Key) @@ -151,7 +151,7 @@ func MakeStateTransitionOutputDigest(configDigest types.ConfigDigest, seqNr uint _, _ = h.Write(o.Value) } - var result StateTransitionOutputDigest + var result StateWriteSetDigest h.Sum(result[:0]) return result } @@ -179,21 +179,23 @@ type PrepareSignature []byte func MakePrepareSignature( ogid OutcomeGenerationID, + prevHistoryDigest HistoryDigest, seqNr uint64, inputsDigest StateTransitionInputsDigest, - outputDigest StateTransitionOutputDigest, + writeSetDigest StateWriteSetDigest, rootDigest StateRootDigest, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, signer func(msg []byte) ([]byte, error), ) (PrepareSignature, error) { - return signer(prepareSignatureMsg(ogid, seqNr, inputsDigest, outputDigest, rootDigest, reportsPlusPrecursorDigest)) + return signer(prepareSignatureMsg(ogid, prevHistoryDigest, seqNr, inputsDigest, writeSetDigest, rootDigest, reportsPlusPrecursorDigest)) } func (sig PrepareSignature) Verify( ogid OutcomeGenerationID, + prevHistoryDigest HistoryDigest, seqNr uint64, inputsDigest StateTransitionInputsDigest, - outputDigest StateTransitionOutputDigest, + writeSetDigest StateWriteSetDigest, rootDigest StateRootDigest, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, publicKey types.OffchainPublicKey, @@ -203,8 +205,8 @@ func (sig PrepareSignature) Verify( if len(pk) != ed25519.PublicKeySize { return fmt.Errorf("ed25519 public key size mismatch, expected %v but got %v", ed25519.PublicKeySize, len(pk)) } - msg := prepareSignatureMsg(ogid, seqNr, inputsDigest, outputDigest, rootDigest, reportsPlusPrecursorDigest) - ok := ed25519.Verify(pk, prepareSignatureMsg(ogid, seqNr, inputsDigest, outputDigest, rootDigest, reportsPlusPrecursorDigest), sig) + msg := prepareSignatureMsg(ogid, prevHistoryDigest, seqNr, inputsDigest, writeSetDigest, rootDigest, reportsPlusPrecursorDigest) + ok := ed25519.Verify(pk, msg, sig) if !ok { // Other less common causes include leader equivocation or actually invalid signatures. return fmt.Errorf("PrepareSignature failed to verify. This is commonly caused by non-determinism in the ReportingPlugin msg: %x, sig: %x", msg, sig) @@ -215,9 +217,10 @@ func (sig PrepareSignature) Verify( func prepareSignatureMsg( ogid OutcomeGenerationID, + prevHistoryDigest HistoryDigest, seqNr uint64, inputsDigest StateTransitionInputsDigest, - outputDigest StateTransitionOutputDigest, + writeSetDigest StateWriteSetDigest, rootDigest StateRootDigest, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, ) []byte { @@ -228,15 +231,16 @@ func prepareSignatureMsg( _, _ = h.Write(ogid.ConfigDigest[:]) _ = binary.Write(h, binary.BigEndian, ogid.Epoch) - _ = binary.Write(h, binary.BigEndian, seqNr) - - _, _ = h.Write(inputsDigest[:]) - - _, _ = h.Write(outputDigest[:]) - - _, _ = h.Write(rootDigest[:]) - - _, _ = h.Write(reportsPlusPrecursorDigest[:]) + historyDigest := MakeHistoryDigest( + ogid.ConfigDigest, + prevHistoryDigest, + seqNr, + inputsDigest, + writeSetDigest, + rootDigest, + reportsPlusPrecursorDigest, + ) + _, _ = h.Write(historyDigest[:]) return ocr3_1DomainSeparatedSum(h) } @@ -252,21 +256,23 @@ type CommitSignature []byte func MakeCommitSignature( ogid OutcomeGenerationID, + prevHistoryDigest HistoryDigest, seqNr uint64, inputsDigest StateTransitionInputsDigest, - outputDigest StateTransitionOutputDigest, + writeSetDigest StateWriteSetDigest, rootDigest StateRootDigest, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, signer func(msg []byte) ([]byte, error), ) (CommitSignature, error) { - return signer(commitSignatureMsg(ogid, seqNr, inputsDigest, outputDigest, rootDigest, reportsPlusPrecursorDigest)) + return signer(commitSignatureMsg(ogid, prevHistoryDigest, seqNr, inputsDigest, writeSetDigest, rootDigest, reportsPlusPrecursorDigest)) } func (sig CommitSignature) Verify( ogid OutcomeGenerationID, + prevHistoryDigest HistoryDigest, seqNr uint64, inputsDigest StateTransitionInputsDigest, - outputDigest StateTransitionOutputDigest, + writeSetDigest StateWriteSetDigest, rootDigest StateRootDigest, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, publicKey types.OffchainPublicKey, @@ -277,7 +283,7 @@ func (sig CommitSignature) Verify( return fmt.Errorf("ed25519 public key size mismatch, expected %v but got %v", ed25519.PublicKeySize, len(pk)) } - ok := ed25519.Verify(pk, commitSignatureMsg(ogid, seqNr, inputsDigest, outputDigest, rootDigest, reportsPlusPrecursorDigest), sig) + ok := ed25519.Verify(pk, commitSignatureMsg(ogid, prevHistoryDigest, seqNr, inputsDigest, writeSetDigest, rootDigest, reportsPlusPrecursorDigest), sig) if !ok { return fmt.Errorf("CommitSignature failed to verify") } @@ -285,31 +291,69 @@ func (sig CommitSignature) Verify( return nil } -func commitSignatureMsg( - ogid OutcomeGenerationID, +type HistoryDigest [32]byte + +const historyDigestDomainSeparator = "ocr3.1/HistoryDigest/" + +func MakeHistoryDigest( + configDigest types.ConfigDigest, + prevHistoryDigest HistoryDigest, seqNr uint64, inputsDigest StateTransitionInputsDigest, - outputDigest StateTransitionOutputDigest, + writeSetDigest StateWriteSetDigest, rootDigest StateRootDigest, reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, -) []byte { +) HistoryDigest { h := sha256.New() - _, _ = h.Write([]byte(commitSignatureDomainSeparator)) + _, _ = h.Write([]byte(historyDigestDomainSeparator)) - _, _ = h.Write(ogid.ConfigDigest[:]) - _ = binary.Write(h, binary.BigEndian, ogid.Epoch) + _, _ = h.Write(configDigest[:]) + + _, _ = h.Write(prevHistoryDigest[:]) _ = binary.Write(h, binary.BigEndian, seqNr) _, _ = h.Write(inputsDigest[:]) - _, _ = h.Write(outputDigest[:]) + _, _ = h.Write(writeSetDigest[:]) _, _ = h.Write(rootDigest[:]) _, _ = h.Write(reportsPlusPrecursorDigest[:]) + var result HistoryDigest + h.Sum(result[:0]) + return result +} + +func commitSignatureMsg( + ogid OutcomeGenerationID, + prevHistoryDigest HistoryDigest, + seqNr uint64, + inputsDigest StateTransitionInputsDigest, + writeSetDigest StateWriteSetDigest, + rootDigest StateRootDigest, + reportsPlusPrecursorDigest ReportsPlusPrecursorDigest, +) []byte { + h := sha256.New() + + _, _ = h.Write([]byte(commitSignatureDomainSeparator)) + + _, _ = h.Write(ogid.ConfigDigest[:]) + _ = binary.Write(h, binary.BigEndian, ogid.Epoch) + + historyDigest := MakeHistoryDigest( + ogid.ConfigDigest, + prevHistoryDigest, + seqNr, + inputsDigest, + writeSetDigest, + rootDigest, + reportsPlusPrecursorDigest, + ) + _, _ = h.Write(historyDigest[:]) + return ocr3_1DomainSeparatedSum(h) } @@ -463,13 +507,14 @@ type CertifiedPrepareOrCommit interface { var _ CertifiedPrepareOrCommit = &CertifiedPrepare{} type CertifiedPrepare struct { - PrepareEpoch uint64 - PrepareSeqNr uint64 - StateTransitionInputsDigest StateTransitionInputsDigest - StateTransitionOutputsDigest StateTransitionOutputDigest - StateRootDigest StateRootDigest - ReportsPlusPrecursorDigest ReportsPlusPrecursorDigest - PrepareQuorumCertificate []AttributedPrepareSignature + PrevHistoryDigest HistoryDigest + PrepareEpoch uint64 + PrepareSeqNr uint64 + StateTransitionInputsDigest StateTransitionInputsDigest + StateWriteSetDigest StateWriteSetDigest + StateRootDigest StateRootDigest + ReportsPlusPrecursorDigest ReportsPlusPrecursorDigest + PrepareQuorumCertificate []AttributedPrepareSignature } func (hc *CertifiedPrepare) isCertifiedPrepareOrCommit() {} @@ -518,7 +563,8 @@ func (hc *CertifiedPrepare) Verify( return fmt.Errorf("signer out of bounds: %v", aps.Signer) } if err := aps.Signature.Verify( - ogid, hc.SeqNr(), hc.StateTransitionInputsDigest, hc.StateTransitionOutputsDigest, hc.StateRootDigest, + ogid, hc.PrevHistoryDigest, + hc.SeqNr(), hc.StateTransitionInputsDigest, hc.StateWriteSetDigest, hc.StateRootDigest, hc.ReportsPlusPrecursorDigest, oracleIdentities[aps.Signer].OffchainPublicKey); err != nil { return fmt.Errorf("%v-th signature by %v-th oracle with pubkey %x does not verify: %w", i, aps.Signer, oracleIdentities[aps.Signer].OffchainPublicKey, err) } @@ -541,13 +587,14 @@ var _ CertifiedPrepareOrCommit = &CertifiedCommit{} // The empty CertifiedCommit{} is the genesis value type CertifiedCommit struct { - CommitEpoch uint64 - CommitSeqNr uint64 - StateTransitionInputsDigest StateTransitionInputsDigest - StateTransitionOutputsDigest StateTransitionOutputDigest - StateRootDigest StateRootDigest - ReportsPlusPrecursorDigest ReportsPlusPrecursorDigest - CommitQuorumCertificate []AttributedCommitSignature + PrevHistoryDigest HistoryDigest + CommitEpoch uint64 + CommitSeqNr uint64 + StateTransitionInputsDigest StateTransitionInputsDigest + StateWriteSetDigest StateWriteSetDigest + StateRootDigest StateRootDigest + ReportsPlusPrecursorDigest ReportsPlusPrecursorDigest + CommitQuorumCertificate []AttributedCommitSignature } func (hc *CertifiedCommit) isCertifiedPrepareOrCommit() {} @@ -571,10 +618,11 @@ func (hc *CertifiedCommit) Timestamp() HighestCertifiedTimestamp { func (hc *CertifiedCommit) IsGenesis() bool { // We intentionally don't just compare with CertifiedCommit{}, because after // protobuf deserialization, we might end up with hc.Outcome = []byte{} - return hc.CommitEpoch == uint64(0) && + return hc.PrevHistoryDigest == HistoryDigest{} && + hc.CommitEpoch == uint64(0) && hc.CommitSeqNr == uint64(0) && hc.StateTransitionInputsDigest == StateTransitionInputsDigest{} && - hc.StateTransitionOutputsDigest == StateTransitionOutputDigest{} && + hc.StateWriteSetDigest == StateWriteSetDigest{} && hc.StateRootDigest == StateRootDigest{} && hc.ReportsPlusPrecursorDigest == ReportsPlusPrecursorDigest{} && len(hc.CommitQuorumCertificate) == 0 @@ -607,10 +655,12 @@ func (hc *CertifiedCommit) Verify( if !(0 <= int(acs.Signer) && int(acs.Signer) < len(oracleIdentities)) { return fmt.Errorf("signer out of bounds: %v", acs.Signer) } - if err := acs.Signature.Verify(ogid, + if err := acs.Signature.Verify( + ogid, + hc.PrevHistoryDigest, hc.SeqNr(), hc.StateTransitionInputsDigest, - hc.StateTransitionOutputsDigest, + hc.StateWriteSetDigest, hc.StateRootDigest, hc.ReportsPlusPrecursorDigest, oracleIdentities[acs.Signer].OffchainPublicKey); err != nil { @@ -636,11 +686,24 @@ func (hc *CertifiedCommit) CheckSize(n int, f int, limits ocr3_1types.ReportingP return true } +func (hc *CertifiedCommit) HistoryDigest(configDigest types.ConfigDigest) HistoryDigest { + return MakeHistoryDigest( + configDigest, + hc.PrevHistoryDigest, + hc.SeqNr(), + hc.StateTransitionInputsDigest, + hc.StateWriteSetDigest, + hc.StateRootDigest, + hc.ReportsPlusPrecursorDigest, + ) +} + type StateTransitionBlock struct { + PrevHistoryDigest HistoryDigest Epoch uint64 BlockSeqNr uint64 StateTransitionInputsDigest StateTransitionInputsDigest - StateTransitionOutputs StateTransitionOutputs + StateWriteSet StateWriteSet StateRootDigest StateRootDigest ReportsPlusPrecursorDigest ReportsPlusPrecursorDigest } @@ -674,7 +737,7 @@ func checkWriteSetSize(writeSet []KeyValuePairWithDeletions, limits ocr3_1types. } func (stb *StateTransitionBlock) CheckSize(limits ocr3_1types.ReportingPluginLimits) bool { - if !checkWriteSetSize(stb.StateTransitionOutputs.WriteSet, limits) { + if !checkWriteSetSize(stb.StateWriteSet.Entries, limits) { return false } return true @@ -708,16 +771,17 @@ func (astb *AttestedStateTransitionBlock) Verify( func (astb *AttestedStateTransitionBlock) ToCertifiedCommit(configDigest types.ConfigDigest) CertifiedCommit { stb := astb.StateTransitionBlock - stateTransitionOutputsDigest := MakeStateTransitionOutputDigest( + stateWriteSetDigest := MakeStateWriteSetDigest( configDigest, stb.SeqNr(), - stb.StateTransitionOutputs.WriteSet, + stb.StateWriteSet.Entries, ) return CertifiedCommit{ + stb.PrevHistoryDigest, stb.Epoch, stb.SeqNr(), stb.StateTransitionInputsDigest, - stateTransitionOutputsDigest, + stateWriteSetDigest, stb.StateRootDigest, stb.ReportsPlusPrecursorDigest, astb.AttributedCommitSignatures, diff --git a/offchainreporting2plus/internal/ocr3_1/protocol/state_sync_block.go b/offchainreporting2plus/internal/ocr3_1/protocol/state_sync_block.go index d5fa0cd5..a20d552f 100644 --- a/offchainreporting2plus/internal/ocr3_1/protocol/state_sync_block.go +++ b/offchainreporting2plus/internal/ocr3_1/protocol/state_sync_block.go @@ -6,9 +6,15 @@ import ( "github.com/google/btree" "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/offchainreporting2plus/internal/ocr3_1/protocol/requestergadget" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3_1types" "github.com/smartcontractkit/libocr/offchainreporting2plus/types" ) +const ( + maxCumulativeWriteSetBytes = ocr3_1types.MaxMaxKeyValueModifiedKeysPlusValuesBytes + maxMaxCumulativeWriteSetBytes = 2 * maxCumulativeWriteSetBytes +) + // Half-open range, i.e. [StartSeqNr, EndExclSeqNr) type seqNrRange struct { StartSeqNr uint64 @@ -125,6 +131,7 @@ func (stasy *stateSyncState[RI]) sendBlockSyncRequest(seqNrRange seqNrRange, tar requestInfo, seqNrRange.StartSeqNr, seqNrRange.EndExclSeqNr, + maxCumulativeWriteSetBytes, } stasy.netSender.SendTo(msg, target) return requestInfo, true @@ -174,51 +181,49 @@ func (stasy *stateSyncState[RI]) messageBlockSyncRequest(msg MessageBlockSyncReq return } + maxCumulativeWriteSetBytes := min(msg.MaxCumulativeWriteSetBytes, maxMaxCumulativeWriteSetBytes) + + // trim suffix of astbs to fit in maxCumulativeWriteSetBytes and avoid seq nr gaps + cumulativeWriteSetBytes := 0 for i, astb := range astbs { + // check if block has the expected sequence number, if not break seqNr := astb.StateTransitionBlock.SeqNr() - var expectedSeqNr uint64 - if i == 0 { - expectedSeqNr = msg.StartSeqNr - } else { - expectedSeqNr = astbs[i-1].StateTransitionBlock.SeqNr() + 1 - } + expectedSeqNr := msg.StartSeqNr + uint64(i) if seqNr != expectedSeqNr { - astbs = nil - break // do not produce gap + // response shouldn't contain gaps + break } - } - if len(astbs) > 0 { - stasy.blockSyncState.logger.Debug("sending MessageBlockSyncResponse", commontypes.LogFields{ - "highestPersisted": stasy.highestPersistedStateTransitionBlockSeqNr, - "lowestPersisted": stasy.lowestPersistedStateTransitionBlockSeqNr, - "requestStartSeqNr": msg.StartSeqNr, - "requestEndExclSeqNr": msg.EndExclSeqNr, - "responseStartSeqNr": astbs[0].StateTransitionBlock.SeqNr(), - "responseEndExclSeqNr": astbs[len(astbs)-1].StateTransitionBlock.SeqNr() + 1, - "to": sender, - }) - stasy.netSender.SendTo(MessageBlockSyncResponse[RI]{ - msg.RequestHandle, - msg.StartSeqNr, - msg.EndExclSeqNr, - astbs, - }, sender) - } else { - stasy.blockSyncState.logger.Debug("no blocks to send, sending an empty MessageBlockSyncResponse to indicate go-away", commontypes.LogFields{ - "highestPersisted": stasy.highestPersistedStateTransitionBlockSeqNr, - "lowestPersisted": stasy.lowestPersistedStateTransitionBlockSeqNr, - "requestStartSeqNr": msg.StartSeqNr, - "requestEndExclSeqNr": msg.EndExclSeqNr, - "to": sender, - }) - stasy.netSender.SendTo(MessageBlockSyncResponse[RI]{ - msg.RequestHandle, - msg.StartSeqNr, - msg.EndExclSeqNr, - astbs, - }, sender) + // check if block's write set size would cause response to be too big + thisBlockWriteSetBytes := writeSetBytes(&astb) + if cumulativeWriteSetBytes+thisBlockWriteSetBytes < cumulativeWriteSetBytes { + // overflow, shouldn't happen but we are careful + break + } + if cumulativeWriteSetBytes+thisBlockWriteSetBytes > maxCumulativeWriteSetBytes { + // block would cause response to be too big + break + } + cumulativeWriteSetBytes += thisBlockWriteSetBytes } + + stasy.blockSyncState.logger.Debug("sending MessageBlockSyncResponse", commontypes.LogFields{ + "highestPersisted": stasy.highestPersistedStateTransitionBlockSeqNr, + "lowestPersisted": stasy.lowestPersistedStateTransitionBlockSeqNr, + "requestStartSeqNr": msg.StartSeqNr, + "requestEndExclSeqNr": msg.EndExclSeqNr, + "blocks": len(astbs), + "cumulativeWriteSetBytes": cumulativeWriteSetBytes, + "maxCumulativeWriteSetBytes": maxCumulativeWriteSetBytes, + "goAway": len(astbs) == 0, + "to": sender, + }) + stasy.netSender.SendTo(MessageBlockSyncResponse[RI]{ + msg.RequestHandle, + msg.StartSeqNr, + msg.EndExclSeqNr, + astbs, + }, sender) } func (stasy *stateSyncState[RI]) messageBlockSyncResponse(msg MessageBlockSyncResponse[RI], sender commontypes.OracleID) { @@ -376,3 +381,11 @@ func (stasy *stateSyncState[RI]) tryCompleteBlockSync() { stasy.highestPersistedStateTransitionBlockSeqNr = lastSeqNr stasy.pleaseTryToReplayBlock() } + +func writeSetBytes(astb *AttestedStateTransitionBlock) int { + runningCumulativeWriteSetBytes := 0 + for _, kvPair := range astb.StateTransitionBlock.StateWriteSet.Entries { + runningCumulativeWriteSetBytes += len(kvPair.Key) + len(kvPair.Value) + } + return runningCumulativeWriteSetBytes +} diff --git a/offchainreporting2plus/internal/ocr3_1/protocol/state_sync_block_replay.go b/offchainreporting2plus/internal/ocr3_1/protocol/state_sync_block_replay.go index fdec85bb..030e4d7b 100644 --- a/offchainreporting2plus/internal/ocr3_1/protocol/state_sync_block_replay.go +++ b/offchainreporting2plus/internal/ocr3_1/protocol/state_sync_block_replay.go @@ -96,7 +96,7 @@ func replayVerifiedBlock(logger loghelper.LoggerWithContext, kvReadWriteTxn KeyV logger.Trace("replaying state transition block", nil) - stateRootDigest, err := kvReadWriteTxn.ApplyWriteSet(stb.StateTransitionOutputs.WriteSet) + stateRootDigest, err := kvReadWriteTxn.ApplyWriteSet(stb.StateWriteSet.Entries) if err != nil { return fmt.Errorf("failed to apply write set for seq nr %d: %w", seqNr, err) } diff --git a/offchainreporting2plus/internal/ocr3_1/protocol/state_sync_tree.go b/offchainreporting2plus/internal/ocr3_1/protocol/state_sync_tree.go index c52f8dc7..90d9b8f4 100644 --- a/offchainreporting2plus/internal/ocr3_1/protocol/state_sync_tree.go +++ b/offchainreporting2plus/internal/ocr3_1/protocol/state_sync_tree.go @@ -64,6 +64,7 @@ func (stasy *stateSyncState[RI]) sendTreeSyncChunkRequest(item treeSyncChunkRequ item.targetSeqNr, item.keyDigestRange.StartIndex, item.keyDigestRange.EndInclIndex, + stasy.config.GetMaxTreeSyncChunkKeysPlusValuesBytes(), } stasy.netSender.SendTo(msg, target) return requestInfo, true @@ -306,7 +307,6 @@ func (stasy *stateSyncState[RI]) messageTreeSyncChunkRequest(msg MessageTreeSync } if treeSyncStatus.Phase != TreeSyncPhaseInactive || !(lowestPersistedSeqNr <= msg.ToSeqNr && msg.ToSeqNr <= highestCommittedSeqNr) { - kvReadTxn.Discard() stasy.treeSyncState.logger.Debug("sending MessageTreeSyncChunkResponse to go-away", commontypes.LogFields{ "sender": sender, "toSeqNr": msg.ToSeqNr, @@ -318,7 +318,7 @@ func (stasy *stateSyncState[RI]) messageTreeSyncChunkRequest(msg MessageTreeSync msg.RequestHandle, msg.ToSeqNr, msg.StartIndex, - jmt.Digest{}, + msg.EndInclIndex, true, jmt.Digest{}, nil, @@ -327,10 +327,13 @@ func (stasy *stateSyncState[RI]) messageTreeSyncChunkRequest(msg MessageTreeSync return } + maxCumulativeKeysPlusValuesBytes := min(msg.MaxCumulativeKeysPlusValuesBytes, stasy.config.GetMaxTreeSyncChunkKeysPlusValuesBytes()) + endInclIndex, boundingLeaves, keyValues, err := kvReadTxn.ReadTreeSyncChunk( msg.ToSeqNr, msg.StartIndex, msg.EndInclIndex, + maxCumulativeKeysPlusValuesBytes, ) if err != nil { stasy.treeSyncState.logger.Warn("failed to read chunk", commontypes.LogFields{ @@ -354,12 +357,14 @@ func (stasy *stateSyncState[RI]) messageTreeSyncChunkRequest(msg MessageTreeSync } stasy.treeSyncState.logger.Debug("sent MessageTreeSyncChunkResponse", commontypes.LogFields{ - "target": sender, - "toSeqNr": msg.ToSeqNr, - "startIndex": fmt.Sprintf("%x", msg.StartIndex), - "endInclIndex": fmt.Sprintf("%x", endInclIndex), - "proofLen": proofLen(boundingLeaves), - "keyValuesCount": len(keyValues), + "target": sender, + "toSeqNr": msg.ToSeqNr, + "requestStartIndex": fmt.Sprintf("%x", msg.StartIndex), + "requestEndInclIndex": fmt.Sprintf("%x", msg.EndInclIndex), + "endInclIndex": fmt.Sprintf("%x", endInclIndex), + "maxCumulativeKeysPlusValuesBytes": maxCumulativeKeysPlusValuesBytes, + "proofLen": proofLen(boundingLeaves), + "keyValuesCount": len(keyValues), }) stasy.netSender.SendTo(chunk, sender) diff --git a/offchainreporting2plus/internal/ocr3_1/protocol/types.go b/offchainreporting2plus/internal/ocr3_1/protocol/types.go index 938a1dc2..786a5ef7 100644 --- a/offchainreporting2plus/internal/ocr3_1/protocol/types.go +++ b/offchainreporting2plus/internal/ocr3_1/protocol/types.go @@ -21,8 +21,8 @@ type KeyValuePairWithDeletions struct { Deleted bool } -type StateTransitionOutputs struct { - WriteSet []KeyValuePairWithDeletions +type StateWriteSet struct { + Entries []KeyValuePairWithDeletions } type TreeSyncPhase int diff --git a/offchainreporting2plus/internal/ocr3_1/serialization/offchainreporting3_1_messages.pb.go b/offchainreporting2plus/internal/ocr3_1/serialization/offchainreporting3_1_messages.pb.go index 9dcaf042..88fa2500 100644 --- a/offchainreporting2plus/internal/ocr3_1/serialization/offchainreporting3_1_messages.pb.go +++ b/offchainreporting2plus/internal/ocr3_1/serialization/offchainreporting3_1_messages.pb.go @@ -1011,8 +1011,9 @@ type MessageBlockSyncRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - StartSeqNr uint64 `protobuf:"varint,1,opt,name=start_seq_nr,json=startSeqNr,proto3" json:"start_seq_nr,omitempty"` - EndExclSeqNr uint64 `protobuf:"varint,2,opt,name=end_excl_seq_nr,json=endExclSeqNr,proto3" json:"end_excl_seq_nr,omitempty"` + StartSeqNr uint64 `protobuf:"varint,1,opt,name=start_seq_nr,json=startSeqNr,proto3" json:"start_seq_nr,omitempty"` + EndExclSeqNr uint64 `protobuf:"varint,2,opt,name=end_excl_seq_nr,json=endExclSeqNr,proto3" json:"end_excl_seq_nr,omitempty"` + MaxCumulativeWriteSetBytes uint32 `protobuf:"varint,3,opt,name=max_cumulative_write_set_bytes,json=maxCumulativeWriteSetBytes,proto3" json:"max_cumulative_write_set_bytes,omitempty"` } func (x *MessageBlockSyncRequest) Reset() { @@ -1061,6 +1062,13 @@ func (x *MessageBlockSyncRequest) GetEndExclSeqNr() uint64 { return 0 } +func (x *MessageBlockSyncRequest) GetMaxCumulativeWriteSetBytes() uint32 { + if x != nil { + return x.MaxCumulativeWriteSetBytes + } + return 0 +} + type MessageBlockSyncResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1184,9 +1192,10 @@ type MessageTreeSyncChunkRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ToSeqNr uint64 `protobuf:"varint,1,opt,name=to_seq_nr,json=toSeqNr,proto3" json:"to_seq_nr,omitempty"` - StartIndex []byte `protobuf:"bytes,2,opt,name=start_index,json=startIndex,proto3" json:"start_index,omitempty"` - EndInclIndex []byte `protobuf:"bytes,3,opt,name=end_incl_index,json=endInclIndex,proto3" json:"end_incl_index,omitempty"` + ToSeqNr uint64 `protobuf:"varint,1,opt,name=to_seq_nr,json=toSeqNr,proto3" json:"to_seq_nr,omitempty"` + StartIndex []byte `protobuf:"bytes,2,opt,name=start_index,json=startIndex,proto3" json:"start_index,omitempty"` + EndInclIndex []byte `protobuf:"bytes,3,opt,name=end_incl_index,json=endInclIndex,proto3" json:"end_incl_index,omitempty"` + MaxCumulativeKeysPlusValuesBytes uint32 `protobuf:"varint,4,opt,name=max_cumulative_keys_plus_values_bytes,json=maxCumulativeKeysPlusValuesBytes,proto3" json:"max_cumulative_keys_plus_values_bytes,omitempty"` } func (x *MessageTreeSyncChunkRequest) Reset() { @@ -1242,6 +1251,13 @@ func (x *MessageTreeSyncChunkRequest) GetEndInclIndex() []byte { return nil } +func (x *MessageTreeSyncChunkRequest) GetMaxCumulativeKeysPlusValuesBytes() uint32 { + if x != nil { + return x.MaxCumulativeKeysPlusValuesBytes + } + return 0 +} + type KeyValuePair struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1643,13 +1659,14 @@ type CertifiedPrepare struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` - SeqNr uint64 `protobuf:"varint,2,opt,name=seq_nr,json=seqNr,proto3" json:"seq_nr,omitempty"` - StateTransitionInputsDigest []byte `protobuf:"bytes,3,opt,name=state_transition_inputs_digest,json=stateTransitionInputsDigest,proto3" json:"state_transition_inputs_digest,omitempty"` - StateTransitionOutputsDigest []byte `protobuf:"bytes,4,opt,name=state_transition_outputs_digest,json=stateTransitionOutputsDigest,proto3" json:"state_transition_outputs_digest,omitempty"` - StateRootDigest []byte `protobuf:"bytes,5,opt,name=state_root_digest,json=stateRootDigest,proto3" json:"state_root_digest,omitempty"` - ReportsPlusPrecursorDigest []byte `protobuf:"bytes,6,opt,name=reports_plus_precursor_digest,json=reportsPlusPrecursorDigest,proto3" json:"reports_plus_precursor_digest,omitempty"` - PrepareQuorumCertificate []*AttributedPrepareSignature `protobuf:"bytes,7,rep,name=prepare_quorum_certificate,json=prepareQuorumCertificate,proto3" json:"prepare_quorum_certificate,omitempty"` + PrevHistoryDigest []byte `protobuf:"bytes,8,opt,name=prev_history_digest,json=prevHistoryDigest,proto3" json:"prev_history_digest,omitempty"` + Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` + SeqNr uint64 `protobuf:"varint,2,opt,name=seq_nr,json=seqNr,proto3" json:"seq_nr,omitempty"` + StateTransitionInputsDigest []byte `protobuf:"bytes,3,opt,name=state_transition_inputs_digest,json=stateTransitionInputsDigest,proto3" json:"state_transition_inputs_digest,omitempty"` + StateWriteSetDigest []byte `protobuf:"bytes,4,opt,name=state_write_set_digest,json=stateWriteSetDigest,proto3" json:"state_write_set_digest,omitempty"` + StateRootDigest []byte `protobuf:"bytes,5,opt,name=state_root_digest,json=stateRootDigest,proto3" json:"state_root_digest,omitempty"` + ReportsPlusPrecursorDigest []byte `protobuf:"bytes,6,opt,name=reports_plus_precursor_digest,json=reportsPlusPrecursorDigest,proto3" json:"reports_plus_precursor_digest,omitempty"` + PrepareQuorumCertificate []*AttributedPrepareSignature `protobuf:"bytes,7,rep,name=prepare_quorum_certificate,json=prepareQuorumCertificate,proto3" json:"prepare_quorum_certificate,omitempty"` } func (x *CertifiedPrepare) Reset() { @@ -1684,6 +1701,13 @@ func (*CertifiedPrepare) Descriptor() ([]byte, []int) { return file_offchainreporting3_1_messages_proto_rawDescGZIP(), []int{22} } +func (x *CertifiedPrepare) GetPrevHistoryDigest() []byte { + if x != nil { + return x.PrevHistoryDigest + } + return nil +} + func (x *CertifiedPrepare) GetEpoch() uint64 { if x != nil { return x.Epoch @@ -1705,9 +1729,9 @@ func (x *CertifiedPrepare) GetStateTransitionInputsDigest() []byte { return nil } -func (x *CertifiedPrepare) GetStateTransitionOutputsDigest() []byte { +func (x *CertifiedPrepare) GetStateWriteSetDigest() []byte { if x != nil { - return x.StateTransitionOutputsDigest + return x.StateWriteSetDigest } return nil } @@ -1738,13 +1762,14 @@ type CertifiedCommit struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` - SeqNr uint64 `protobuf:"varint,2,opt,name=seq_nr,json=seqNr,proto3" json:"seq_nr,omitempty"` - StateTransitionInputsDigest []byte `protobuf:"bytes,3,opt,name=state_transition_inputs_digest,json=stateTransitionInputsDigest,proto3" json:"state_transition_inputs_digest,omitempty"` - StateTransitionOutputsDigest []byte `protobuf:"bytes,4,opt,name=state_transition_outputs_digest,json=stateTransitionOutputsDigest,proto3" json:"state_transition_outputs_digest,omitempty"` - StateRootDigest []byte `protobuf:"bytes,5,opt,name=state_root_digest,json=stateRootDigest,proto3" json:"state_root_digest,omitempty"` - ReportsPlusPrecursorDigest []byte `protobuf:"bytes,6,opt,name=reports_plus_precursor_digest,json=reportsPlusPrecursorDigest,proto3" json:"reports_plus_precursor_digest,omitempty"` - CommitQuorumCertificate []*AttributedCommitSignature `protobuf:"bytes,7,rep,name=commit_quorum_certificate,json=commitQuorumCertificate,proto3" json:"commit_quorum_certificate,omitempty"` + PrevHistoryDigest []byte `protobuf:"bytes,8,opt,name=prev_history_digest,json=prevHistoryDigest,proto3" json:"prev_history_digest,omitempty"` + Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` + SeqNr uint64 `protobuf:"varint,2,opt,name=seq_nr,json=seqNr,proto3" json:"seq_nr,omitempty"` + StateTransitionInputsDigest []byte `protobuf:"bytes,3,opt,name=state_transition_inputs_digest,json=stateTransitionInputsDigest,proto3" json:"state_transition_inputs_digest,omitempty"` + StateWriteSetDigest []byte `protobuf:"bytes,4,opt,name=state_write_set_digest,json=stateWriteSetDigest,proto3" json:"state_write_set_digest,omitempty"` + StateRootDigest []byte `protobuf:"bytes,5,opt,name=state_root_digest,json=stateRootDigest,proto3" json:"state_root_digest,omitempty"` + ReportsPlusPrecursorDigest []byte `protobuf:"bytes,6,opt,name=reports_plus_precursor_digest,json=reportsPlusPrecursorDigest,proto3" json:"reports_plus_precursor_digest,omitempty"` + CommitQuorumCertificate []*AttributedCommitSignature `protobuf:"bytes,7,rep,name=commit_quorum_certificate,json=commitQuorumCertificate,proto3" json:"commit_quorum_certificate,omitempty"` } func (x *CertifiedCommit) Reset() { @@ -1779,6 +1804,13 @@ func (*CertifiedCommit) Descriptor() ([]byte, []int) { return file_offchainreporting3_1_messages_proto_rawDescGZIP(), []int{23} } +func (x *CertifiedCommit) GetPrevHistoryDigest() []byte { + if x != nil { + return x.PrevHistoryDigest + } + return nil +} + func (x *CertifiedCommit) GetEpoch() uint64 { if x != nil { return x.Epoch @@ -1800,9 +1832,9 @@ func (x *CertifiedCommit) GetStateTransitionInputsDigest() []byte { return nil } -func (x *CertifiedCommit) GetStateTransitionOutputsDigest() []byte { +func (x *CertifiedCommit) GetStateWriteSetDigest() []byte { if x != nil { - return x.StateTransitionOutputsDigest + return x.StateWriteSetDigest } return nil } @@ -2336,12 +2368,13 @@ type StateTransitionBlock struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` - SeqNr uint64 `protobuf:"varint,2,opt,name=seq_nr,json=seqNr,proto3" json:"seq_nr,omitempty"` - StateTransitionInputsDigest []byte `protobuf:"bytes,3,opt,name=state_transition_inputs_digest,json=stateTransitionInputsDigest,proto3" json:"state_transition_inputs_digest,omitempty"` - StateTransitionOutputs *StateTransitionOutputs `protobuf:"bytes,4,opt,name=state_transition_outputs,json=stateTransitionOutputs,proto3" json:"state_transition_outputs,omitempty"` - StateRootDigest []byte `protobuf:"bytes,5,opt,name=state_root_digest,json=stateRootDigest,proto3" json:"state_root_digest,omitempty"` - ReportsPlusPrecursorDigest []byte `protobuf:"bytes,6,opt,name=reports_plus_precursor_digest,json=reportsPlusPrecursorDigest,proto3" json:"reports_plus_precursor_digest,omitempty"` + PrevHistoryDigest []byte `protobuf:"bytes,7,opt,name=prev_history_digest,json=prevHistoryDigest,proto3" json:"prev_history_digest,omitempty"` + Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"` + SeqNr uint64 `protobuf:"varint,2,opt,name=seq_nr,json=seqNr,proto3" json:"seq_nr,omitempty"` + StateTransitionInputsDigest []byte `protobuf:"bytes,3,opt,name=state_transition_inputs_digest,json=stateTransitionInputsDigest,proto3" json:"state_transition_inputs_digest,omitempty"` + StateWriteSet *StateWriteSet `protobuf:"bytes,4,opt,name=state_write_set,json=stateWriteSet,proto3" json:"state_write_set,omitempty"` + StateRootDigest []byte `protobuf:"bytes,5,opt,name=state_root_digest,json=stateRootDigest,proto3" json:"state_root_digest,omitempty"` + ReportsPlusPrecursorDigest []byte `protobuf:"bytes,6,opt,name=reports_plus_precursor_digest,json=reportsPlusPrecursorDigest,proto3" json:"reports_plus_precursor_digest,omitempty"` } func (x *StateTransitionBlock) Reset() { @@ -2376,6 +2409,13 @@ func (*StateTransitionBlock) Descriptor() ([]byte, []int) { return file_offchainreporting3_1_messages_proto_rawDescGZIP(), []int{33} } +func (x *StateTransitionBlock) GetPrevHistoryDigest() []byte { + if x != nil { + return x.PrevHistoryDigest + } + return nil +} + func (x *StateTransitionBlock) GetEpoch() uint64 { if x != nil { return x.Epoch @@ -2397,9 +2437,9 @@ func (x *StateTransitionBlock) GetStateTransitionInputsDigest() []byte { return nil } -func (x *StateTransitionBlock) GetStateTransitionOutputs() *StateTransitionOutputs { +func (x *StateTransitionBlock) GetStateWriteSet() *StateWriteSet { if x != nil { - return x.StateTransitionOutputs + return x.StateWriteSet } return nil } @@ -2418,16 +2458,16 @@ func (x *StateTransitionBlock) GetReportsPlusPrecursorDigest() []byte { return nil } -type StateTransitionOutputs struct { +type StateWriteSet struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - WriteSet []*KeyValueModification `protobuf:"bytes,1,rep,name=write_set,json=writeSet,proto3" json:"write_set,omitempty"` + Entries []*KeyValueModification `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` } -func (x *StateTransitionOutputs) Reset() { - *x = StateTransitionOutputs{} +func (x *StateWriteSet) Reset() { + *x = StateWriteSet{} if protoimpl.UnsafeEnabled { mi := &file_offchainreporting3_1_messages_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2435,13 +2475,13 @@ func (x *StateTransitionOutputs) Reset() { } } -func (x *StateTransitionOutputs) String() string { +func (x *StateWriteSet) String() string { return protoimpl.X.MessageStringOf(x) } -func (*StateTransitionOutputs) ProtoMessage() {} +func (*StateWriteSet) ProtoMessage() {} -func (x *StateTransitionOutputs) ProtoReflect() protoreflect.Message { +func (x *StateWriteSet) ProtoReflect() protoreflect.Message { mi := &file_offchainreporting3_1_messages_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -2453,14 +2493,14 @@ func (x *StateTransitionOutputs) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use StateTransitionOutputs.ProtoReflect.Descriptor instead. -func (*StateTransitionOutputs) Descriptor() ([]byte, []int) { +// Deprecated: Use StateWriteSet.ProtoReflect.Descriptor instead. +func (*StateWriteSet) Descriptor() ([]byte, []int) { return file_offchainreporting3_1_messages_proto_rawDescGZIP(), []int{34} } -func (x *StateTransitionOutputs) GetWriteSet() []*KeyValueModification { +func (x *StateWriteSet) GetEntries() []*KeyValueModification { if x != nil { - return x.WriteSet + return x.Entries } return nil } @@ -3097,111 +3137,152 @@ var file_offchainreporting3_1_messages_proto_rawDesc = []byte{ 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x70, 0x6c, 0x75, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x14, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x50, 0x6c, 0x75, 0x73, 0x50, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, - 0x22, 0x62, 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x73, - 0x74, 0x61, 0x72, 0x74, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x25, 0x0a, - 0x0f, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x78, 0x63, 0x6c, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x45, 0x78, 0x63, 0x6c, 0x53, - 0x65, 0x71, 0x4e, 0x72, 0x22, 0xfe, 0x01, 0x0a, 0x18, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x2f, 0x0a, 0x14, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x71, - 0x4e, 0x72, 0x12, 0x34, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x6e, - 0x64, 0x5f, 0x65, 0x78, 0x63, 0x6c, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x13, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x45, 0x6e, 0x64, 0x45, - 0x78, 0x63, 0x6c, 0x53, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x7b, 0x0a, 0x20, 0x61, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, - 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, - 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x1d, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, - 0x79, 0x12, 0x35, 0x0a, 0x17, 0x6c, 0x6f, 0x77, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x73, - 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x14, 0x6c, 0x6f, 0x77, 0x65, 0x73, 0x74, 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, - 0x74, 0x65, 0x64, 0x53, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x37, 0x0a, 0x18, 0x68, 0x69, 0x67, 0x68, - 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x65, - 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, 0x68, 0x69, 0x67, 0x68, - 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x53, 0x65, 0x71, 0x4e, - 0x72, 0x22, 0x80, 0x01, 0x0a, 0x1b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x72, 0x65, - 0x65, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1a, 0x0a, 0x09, 0x74, 0x6f, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x74, 0x6f, 0x53, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x1f, 0x0a, - 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x24, - 0x0a, 0x0e, 0x65, 0x6e, 0x64, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x63, 0x6c, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x22, 0x36, 0x0a, 0x0c, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, - 0x50, 0x61, 0x69, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x5a, 0x0a, 0x16, - 0x4c, 0x65, 0x61, 0x66, 0x4b, 0x65, 0x79, 0x41, 0x6e, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, - 0x69, 0x67, 0x65, 0x73, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6b, 0x65, 0x79, 0x5f, 0x64, 0x69, - 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x44, - 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x64, - 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x6c, 0x0a, 0x0c, 0x42, 0x6f, 0x75, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x61, 0x66, 0x12, 0x40, 0x0a, 0x04, 0x6c, 0x65, 0x61, 0x66, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x4c, 0x65, - 0x61, 0x66, 0x4b, 0x65, 0x79, 0x41, 0x6e, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x69, 0x67, - 0x65, 0x73, 0x74, 0x73, 0x52, 0x04, 0x6c, 0x65, 0x61, 0x66, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x69, - 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x08, 0x73, 0x69, - 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x22, 0xdf, 0x02, 0x0a, 0x1c, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x22, 0xa6, 0x01, 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0c, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x53, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x25, + 0x0a, 0x0f, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x78, 0x63, 0x6c, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x6e, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x45, 0x78, 0x63, 0x6c, + 0x53, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x42, 0x0a, 0x1e, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x75, 0x6d, + 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x73, 0x65, + 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x1a, 0x6d, + 0x61, 0x78, 0x43, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x53, 0x65, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xfe, 0x01, 0x0a, 0x18, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x53, 0x79, 0x6e, 0x63, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x14, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x53, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x34, 0x0a, 0x17, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x65, 0x78, 0x63, 0x6c, 0x5f, 0x73, 0x65, 0x71, 0x5f, + 0x6e, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x45, 0x6e, 0x64, 0x45, 0x78, 0x63, 0x6c, 0x53, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x7b, 0x0a, + 0x20, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x41, + 0x74, 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x1d, 0x61, 0x74, 0x74, + 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x17, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x53, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x35, 0x0a, 0x17, 0x6c, 0x6f, 0x77, 0x65, 0x73, 0x74, + 0x5f, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x6e, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x6c, 0x6f, 0x77, 0x65, 0x73, 0x74, 0x50, + 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x37, 0x0a, + 0x18, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x64, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x15, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, + 0x64, 0x53, 0x65, 0x71, 0x4e, 0x72, 0x22, 0xd1, 0x01, 0x0a, 0x1b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x72, 0x65, 0x65, 0x53, 0x79, 0x6e, 0x63, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x09, 0x74, 0x6f, 0x5f, 0x73, 0x65, - 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x74, 0x6f, 0x53, 0x65, - 0x71, 0x4e, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0x33, 0x0a, 0x16, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, - 0x65, 0x6e, 0x64, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x45, 0x6e, 0x64, - 0x49, 0x6e, 0x63, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x6f, 0x5f, - 0x61, 0x77, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x67, 0x6f, 0x41, 0x77, - 0x61, 0x79, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x6e, 0x64, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x5f, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x49, - 0x6e, 0x63, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x41, 0x0a, 0x0a, 0x6b, 0x65, 0x79, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x09, 0x74, 0x6f, 0x5f, 0x73, 0x65, 0x71, + 0x5f, 0x6e, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x74, 0x6f, 0x53, 0x65, 0x71, + 0x4e, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x6e, 0x64, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x5f, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x65, 0x6e, 0x64, + 0x49, 0x6e, 0x63, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x4f, 0x0a, 0x25, 0x6d, 0x61, 0x78, + 0x5f, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x73, + 0x5f, 0x70, 0x6c, 0x75, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x5f, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x20, 0x6d, 0x61, 0x78, 0x43, 0x75, 0x6d, + 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x4b, 0x65, 0x79, 0x73, 0x50, 0x6c, 0x75, 0x73, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x73, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0x36, 0x0a, 0x0c, 0x4b, 0x65, + 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x50, 0x61, 0x69, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x22, 0x5a, 0x0a, 0x16, 0x4c, 0x65, 0x61, 0x66, 0x4b, 0x65, 0x79, 0x41, 0x6e, 0x64, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x6b, 0x65, 0x79, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x09, 0x6b, 0x65, 0x79, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x6c, + 0x0a, 0x0c, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x61, 0x66, 0x12, 0x40, + 0x0a, 0x04, 0x6c, 0x65, 0x61, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, - 0x33, 0x5f, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x50, 0x61, 0x69, 0x72, - 0x52, 0x09, 0x6b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x4b, 0x0a, 0x0f, 0x62, - 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x18, 0x07, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x42, 0x6f, 0x75, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x0e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x22, 0xe7, 0x01, 0x0a, 0x0f, 0x45, 0x70, 0x6f, - 0x63, 0x68, 0x53, 0x74, 0x61, 0x72, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x5b, 0x0a, 0x11, - 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x43, - 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x4f, - 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x10, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, - 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x77, 0x0a, 0x17, 0x68, 0x69, 0x67, - 0x68, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x6f, 0x66, 0x66, + 0x33, 0x5f, 0x31, 0x2e, 0x4c, 0x65, 0x61, 0x66, 0x4b, 0x65, 0x79, 0x41, 0x6e, 0x64, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x73, 0x52, 0x04, 0x6c, 0x65, 0x61, 0x66, + 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0c, 0x52, 0x08, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x22, 0xdf, 0x02, 0x0a, + 0x1c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x72, 0x65, 0x65, 0x53, 0x79, 0x6e, 0x63, + 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, + 0x09, 0x74, 0x6f, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x07, 0x74, 0x6f, 0x53, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x33, 0x0a, 0x16, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x6e, 0x64, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x5f, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x45, 0x6e, 0x64, 0x49, 0x6e, 0x63, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, + 0x17, 0x0a, 0x07, 0x67, 0x6f, 0x5f, 0x61, 0x77, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x06, 0x67, 0x6f, 0x41, 0x77, 0x61, 0x79, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x6e, 0x64, 0x5f, + 0x69, 0x6e, 0x63, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0c, 0x65, 0x6e, 0x64, 0x49, 0x6e, 0x63, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x41, + 0x0a, 0x0a, 0x6b, 0x65, 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x50, 0x61, 0x69, 0x72, 0x52, 0x09, 0x6b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x73, 0x12, 0x4b, 0x0a, 0x0f, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, + 0x61, 0x76, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, - 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, - 0x65, 0x64, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x15, 0x68, 0x69, 0x67, - 0x68, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x50, 0x72, 0x6f, - 0x6f, 0x66, 0x22, 0xb4, 0x01, 0x0a, 0x18, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, - 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x4f, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, - 0x42, 0x0a, 0x07, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, - 0x64, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x65, 0x70, - 0x61, 0x72, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, - 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, 0x00, 0x52, 0x06, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x13, 0x0a, 0x11, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x5f, - 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, 0xaa, 0x03, 0x0a, 0x10, 0x43, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x14, + 0x31, 0x2e, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x0e, + 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x22, 0xe7, + 0x01, 0x0a, 0x0f, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x74, 0x61, 0x72, 0x74, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x12, 0x5b, 0x0a, 0x11, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, + 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, + 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x50, 0x72, + 0x65, 0x70, 0x61, 0x72, 0x65, 0x4f, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x10, 0x68, + 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, + 0x77, 0x0a, 0x17, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x64, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x3f, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, + 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x15, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0xb4, 0x01, 0x0a, 0x18, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x4f, 0x72, 0x43, + 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x42, 0x0a, 0x07, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x48, 0x00, + 0x52, 0x07, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6f, 0x66, 0x66, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, + 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x48, 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x13, 0x0a, 0x11, 0x70, 0x72, + 0x65, 0x70, 0x61, 0x72, 0x65, 0x5f, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, + 0xc8, 0x03, 0x0a, 0x10, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x50, 0x72, 0x65, + 0x70, 0x61, 0x72, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x68, 0x69, 0x73, + 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x11, 0x70, 0x72, 0x65, 0x76, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x69, + 0x67, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x65, + 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x73, 0x65, 0x71, 0x4e, + 0x72, 0x12, 0x43, 0x0a, 0x1e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x5f, 0x64, 0x69, 0x67, + 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1b, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, + 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x73, 0x74, 0x61, 0x74, 0x65, 0x57, 0x72, 0x69, + 0x74, 0x65, 0x53, 0x65, 0x74, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, + 0x74, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x1d, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x73, 0x5f, 0x70, 0x6c, 0x75, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x6f, + 0x72, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1a, + 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x50, 0x6c, 0x75, 0x73, 0x50, 0x72, 0x65, 0x63, 0x75, + 0x72, 0x73, 0x6f, 0x72, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x6e, 0x0a, 0x1a, 0x70, 0x72, + 0x65, 0x70, 0x61, 0x72, 0x65, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x63, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, + 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, + 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, + 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x52, 0x18, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0xc4, 0x03, 0x0a, 0x0f, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x2e, + 0x0a, 0x13, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x64, + 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x70, 0x72, 0x65, + 0x76, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x73, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x43, 0x0a, 0x1e, 0x73, @@ -3209,210 +3290,183 @@ var file_offchainreporting3_1_messages_proto_rawDesc = []byte{ 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x12, 0x45, 0x0a, 0x1f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x5f, 0x64, 0x69, 0x67, - 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1c, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x73, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x44, 0x69, 0x67, - 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x1d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x70, - 0x6c, 0x75, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x5f, 0x64, 0x69, - 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1a, 0x72, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x73, 0x50, 0x6c, 0x75, 0x73, 0x50, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, - 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x6e, 0x0a, 0x1a, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, - 0x65, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x6f, 0x66, 0x66, - 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, - 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x50, 0x72, 0x65, 0x70, - 0x61, 0x72, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x18, 0x70, 0x72, - 0x65, 0x70, 0x61, 0x72, 0x65, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x43, 0x65, 0x72, 0x74, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, 0xa6, 0x03, 0x0a, 0x0f, 0x43, 0x65, 0x72, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, - 0x12, 0x15, 0x0a, 0x06, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x05, 0x73, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x43, 0x0a, 0x1e, 0x73, 0x74, 0x61, 0x74, 0x65, - 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x70, 0x75, - 0x74, 0x73, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x1b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x1f, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x44, 0x69, 0x67, - 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, - 0x41, 0x0a, 0x1d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x70, 0x6c, 0x75, 0x73, 0x5f, - 0x70, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1a, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x50, - 0x6c, 0x75, 0x73, 0x50, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x44, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x12, 0x6b, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x71, 0x75, 0x6f, - 0x72, 0x75, 0x6d, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x41, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x17, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x51, 0x75, - 0x6f, 0x72, 0x75, 0x6d, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x22, - 0x80, 0x01, 0x0a, 0x19, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, - 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x15, 0x0a, - 0x06, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x73, - 0x65, 0x71, 0x4e, 0x72, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, - 0x64, 0x5f, 0x65, 0x6c, 0x73, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, - 0x45, 0x6c, 0x73, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x22, 0xc8, 0x01, 0x0a, 0x29, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x43, 0x65, - 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x82, 0x01, 0x0a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x68, 0x69, 0x67, 0x68, - 0x65, 0x73, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, - 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, - 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x48, 0x69, 0x67, 0x68, 0x65, - 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x1f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x48, 0x69, 0x67, 0x68, - 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0xb0, 0x01, - 0x0a, 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x43, - 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x6f, 0x0a, 0x1b, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x65, 0x72, - 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x48, 0x69, - 0x67, 0x68, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x19, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, + 0x12, 0x33, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, + 0x73, 0x65, 0x74, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x13, 0x73, 0x74, 0x61, 0x74, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x44, + 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, + 0x6f, 0x6f, 0x74, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x44, 0x69, 0x67, 0x65, 0x73, + 0x74, 0x12, 0x41, 0x0a, 0x1d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x70, 0x6c, 0x75, + 0x73, 0x5f, 0x70, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x5f, 0x64, 0x69, 0x67, 0x65, + 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1a, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x73, 0x50, 0x6c, 0x75, 0x73, 0x50, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x44, 0x69, + 0x67, 0x65, 0x73, 0x74, 0x12, 0x6b, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x71, + 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x41, + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x17, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x22, 0x80, 0x01, 0x0a, 0x19, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x15, 0x0a, 0x06, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x05, 0x73, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x36, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x74, 0x65, 0x64, 0x5f, 0x65, 0x6c, 0x73, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, + 0x65, 0x64, 0x45, 0x6c, 0x73, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x22, 0xc8, 0x01, 0x0a, 0x29, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x22, 0x55, 0x0a, 0x15, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x4f, 0x62, - 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x62, 0x73, - 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, - 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6f, - 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x6f, - 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x91, 0x01, 0x0a, 0x1b, 0x41, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, - 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x56, 0x0a, 0x12, 0x73, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x5f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, - 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x64, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x73, 0x69, - 0x67, 0x6e, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x1a, 0x0a, 0x08, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x08, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x53, 0x0a, 0x11, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, - 0x22, 0x52, 0x0a, 0x1a, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x50, 0x72, - 0x65, 0x70, 0x61, 0x72, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1c, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x69, - 0x67, 0x6e, 0x65, 0x72, 0x22, 0x51, 0x0a, 0x19, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0xe6, 0x01, 0x0a, 0x1c, 0x41, 0x74, 0x74, 0x65, - 0x73, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x60, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, + 0x6d, 0x70, 0x12, 0x82, 0x01, 0x0a, 0x22, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x68, 0x69, + 0x67, 0x68, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x35, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x48, 0x69, 0x67, + 0x68, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x1f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x48, 0x69, + 0x67, 0x68, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, + 0xb0, 0x01, 0x0a, 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, + 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x6f, 0x0a, 0x1b, 0x68, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x5f, 0x63, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x14, 0x73, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x64, 0x0a, 0x15, 0x61, 0x74, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6f, 0x66, 0x66, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, - 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x14, 0x61, 0x74, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, - 0x22, 0xdf, 0x02, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, - 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, - 0x15, 0x0a, 0x06, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x05, 0x73, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x43, 0x0a, 0x1e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, - 0x73, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1b, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x6e, 0x70, 0x75, 0x74, 0x73, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x66, 0x0a, 0x18, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, - 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, - 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x52, 0x16, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, - 0x41, 0x0a, 0x1d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x70, 0x6c, 0x75, 0x73, 0x5f, - 0x70, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1a, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x50, - 0x6c, 0x75, 0x73, 0x50, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x44, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x22, 0x61, 0x0a, 0x16, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x12, 0x47, 0x0a, 0x09, - 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2a, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, - 0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x77, 0x72, 0x69, - 0x74, 0x65, 0x53, 0x65, 0x74, 0x22, 0x58, 0x0a, 0x14, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, - 0xd6, 0x01, 0x0a, 0x15, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x65, 0x71, - 0x5f, 0x6e, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x73, 0x65, 0x71, 0x4e, 0x72, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x12, 0x64, 0x0a, 0x17, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, - 0x5f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, - 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x16, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, - 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x8b, 0x01, 0x0a, 0x10, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x12, 0x2c, 0x0a, - 0x12, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x63, 0x68, 0x75, 0x6e, 0x6b, - 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x4c, 0x65, 0x6e, 0x67, - 0x74, 0x68, 0x12, 0x22, 0x0a, 0x0d, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x5f, 0x73, 0x65, 0x71, - 0x5f, 0x6e, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, - 0x79, 0x53, 0x65, 0x71, 0x4e, 0x72, 0x22, 0x5b, 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x44, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x22, 0xa1, 0x01, 0x0a, 0x18, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, - 0x6c, 0x6f, 0x62, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x44, 0x69, 0x67, 0x65, 0x73, - 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x17, 0x0a, 0x07, 0x67, 0x6f, 0x5f, 0x61, 0x77, 0x61, 0x79, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x06, 0x67, 0x6f, 0x41, 0x77, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x63, - 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, - 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, - 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x22, 0x7c, 0x0a, 0x18, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x64, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x44, 0x69, - 0x67, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6f, - 0x66, 0x66, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x72, 0x65, 0x6a, 0x65, - 0x63, 0x74, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0x11, 0x5a, 0x0f, 0x2e, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x61, - 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x48, 0x69, 0x67, 0x68, 0x65, 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x19, 0x68, 0x69, 0x67, 0x68, 0x65, + 0x73, 0x74, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x22, 0x55, 0x0a, 0x15, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, + 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x6f, + 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0b, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, + 0x08, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x08, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x91, 0x01, 0x0a, 0x1b, 0x41, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4f, 0x62, + 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x56, 0x0a, 0x12, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x5f, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, + 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x08, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x53, 0x0a, + 0x11, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x22, 0x52, 0x0a, 0x1a, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, + 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, + 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x51, 0x0a, 0x19, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, + 0x75, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0xe6, 0x01, 0x0a, 0x1c, 0x41, 0x74, + 0x74, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x60, 0x0a, 0x16, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6f, 0x66, 0x66, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, + 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x14, 0x73, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x64, 0x0a, 0x15, + 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6f, 0x66, + 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, + 0x5f, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x14, 0x61, 0x74, + 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x22, 0xf4, 0x02, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x2e, 0x0a, 0x13, 0x70, + 0x72, 0x65, 0x76, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x64, 0x69, 0x67, 0x65, + 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x11, 0x70, 0x72, 0x65, 0x76, 0x48, 0x69, + 0x73, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x05, 0x73, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x43, 0x0a, 0x1e, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x70, + 0x75, 0x74, 0x73, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x1b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x4b, 0x0a, + 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x73, 0x65, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, + 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x52, 0x0d, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x74, + 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, + 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x1d, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x73, 0x5f, 0x70, 0x6c, 0x75, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, + 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1a, 0x72, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x50, 0x6c, 0x75, 0x73, 0x50, 0x72, 0x65, 0x63, 0x75, 0x72, + 0x73, 0x6f, 0x72, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x55, 0x0a, 0x0d, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x65, 0x74, 0x12, 0x44, 0x0a, 0x07, 0x65, 0x6e, + 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6f, 0x66, + 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, + 0x5f, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, + 0x22, 0x58, 0x0a, 0x14, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x6f, 0x64, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0xd6, 0x01, 0x0a, 0x15, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, + 0x70, 0x75, 0x74, 0x73, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x73, 0x65, 0x71, 0x4e, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x64, 0x0a, + 0x17, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x62, 0x73, 0x65, + 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, + 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, + 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, + 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x16, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x22, 0x8b, 0x01, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, + 0x6c, 0x6f, 0x62, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x68, 0x75, 0x6e, + 0x6b, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x44, 0x69, 0x67, 0x65, 0x73, + 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, + 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, + 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x22, 0x0a, + 0x0d, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x5f, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x53, 0x65, 0x71, 0x4e, + 0x72, 0x22, 0x5b, 0x0a, 0x17, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x62, + 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, + 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, + 0x0b, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0a, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xa1, + 0x01, 0x0a, 0x18, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x62, 0x43, 0x68, + 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x62, + 0x6c, 0x6f, 0x62, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, + 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0a, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x17, 0x0a, + 0x07, 0x67, 0x6f, 0x5f, 0x61, 0x77, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x67, 0x6f, 0x41, 0x77, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, + 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, 0x70, 0x72, 0x6f, + 0x6f, 0x66, 0x22, 0x7c, 0x0a, 0x18, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, + 0x62, 0x4f, 0x66, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, + 0x0a, 0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, + 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x4f, 0x66, 0x66, + 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x42, 0x11, 0x5a, 0x0f, 0x2e, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3463,7 +3517,7 @@ var file_offchainreporting3_1_messages_proto_goTypes = []interface{}{ (*AttributedCommitSignature)(nil), // 31: offchainreporting3_1.AttributedCommitSignature (*AttestedStateTransitionBlock)(nil), // 32: offchainreporting3_1.AttestedStateTransitionBlock (*StateTransitionBlock)(nil), // 33: offchainreporting3_1.StateTransitionBlock - (*StateTransitionOutputs)(nil), // 34: offchainreporting3_1.StateTransitionOutputs + (*StateWriteSet)(nil), // 34: offchainreporting3_1.StateWriteSet (*KeyValueModification)(nil), // 35: offchainreporting3_1.KeyValueModification (*StateTransitionInputs)(nil), // 36: offchainreporting3_1.StateTransitionInputs (*MessageBlobOffer)(nil), // 37: offchainreporting3_1.MessageBlobOffer @@ -3512,8 +3566,8 @@ var file_offchainreporting3_1_messages_proto_depIdxs = []int32{ 29, // 37: offchainreporting3_1.AttributedSignedObservation.signed_observation:type_name -> offchainreporting3_1.SignedObservation 33, // 38: offchainreporting3_1.AttestedStateTransitionBlock.state_transition_block:type_name -> offchainreporting3_1.StateTransitionBlock 31, // 39: offchainreporting3_1.AttestedStateTransitionBlock.attributed_signatures:type_name -> offchainreporting3_1.AttributedCommitSignature - 34, // 40: offchainreporting3_1.StateTransitionBlock.state_transition_outputs:type_name -> offchainreporting3_1.StateTransitionOutputs - 35, // 41: offchainreporting3_1.StateTransitionOutputs.write_set:type_name -> offchainreporting3_1.KeyValueModification + 34, // 40: offchainreporting3_1.StateTransitionBlock.state_write_set:type_name -> offchainreporting3_1.StateWriteSet + 35, // 41: offchainreporting3_1.StateWriteSet.entries:type_name -> offchainreporting3_1.KeyValueModification 27, // 42: offchainreporting3_1.StateTransitionInputs.attributed_observations:type_name -> offchainreporting3_1.AttributedObservation 43, // [43:43] is the sub-list for method output_type 43, // [43:43] is the sub-list for method input_type @@ -3937,7 +3991,7 @@ func file_offchainreporting3_1_messages_proto_init() { } } file_offchainreporting3_1_messages_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StateTransitionOutputs); i { + switch v := v.(*StateWriteSet); i { case 0: return &v.state case 1: diff --git a/offchainreporting2plus/internal/ocr3_1/serialization/offchainreporting3_1_telemetry.pb.go b/offchainreporting2plus/internal/ocr3_1/serialization/offchainreporting3_1_telemetry.pb.go index 3d648d1d..f75a802b 100644 --- a/offchainreporting2plus/internal/ocr3_1/serialization/offchainreporting3_1_telemetry.pb.go +++ b/offchainreporting2plus/internal/ocr3_1/serialization/offchainreporting3_1_telemetry.pb.go @@ -33,7 +33,7 @@ type TelemetryWrapper struct { // *TelemetryWrapper_AssertionViolation // *TelemetryWrapper_RoundStarted Wrapped isTelemetryWrapper_Wrapped `protobuf_oneof:"wrapped"` - UnixTimeNanoseconds int64 `protobuf:"varint,6,opt,name=unix_time_nanoseconds,json=unixTimeNanoseconds,proto3" json:"unix_time_nanoseconds,omitempty"` + UnixTimeNanoseconds int64 `protobuf:"varint,26,opt,name=unix_time_nanoseconds,json=unixTimeNanoseconds,proto3" json:"unix_time_nanoseconds,omitempty"` } func (x *TelemetryWrapper) Reset() { @@ -122,23 +122,23 @@ type isTelemetryWrapper_Wrapped interface { } type TelemetryWrapper_MessageReceived struct { - MessageReceived *TelemetryMessageReceived `protobuf:"bytes,1,opt,name=message_received,json=messageReceived,proto3,oneof"` + MessageReceived *TelemetryMessageReceived `protobuf:"bytes,21,opt,name=message_received,json=messageReceived,proto3,oneof"` } type TelemetryWrapper_MessageBroadcast struct { - MessageBroadcast *TelemetryMessageBroadcast `protobuf:"bytes,2,opt,name=message_broadcast,json=messageBroadcast,proto3,oneof"` + MessageBroadcast *TelemetryMessageBroadcast `protobuf:"bytes,22,opt,name=message_broadcast,json=messageBroadcast,proto3,oneof"` } type TelemetryWrapper_MessageSent struct { - MessageSent *TelemetryMessageSent `protobuf:"bytes,3,opt,name=message_sent,json=messageSent,proto3,oneof"` + MessageSent *TelemetryMessageSent `protobuf:"bytes,23,opt,name=message_sent,json=messageSent,proto3,oneof"` } type TelemetryWrapper_AssertionViolation struct { - AssertionViolation *TelemetryAssertionViolation `protobuf:"bytes,4,opt,name=assertion_violation,json=assertionViolation,proto3,oneof"` + AssertionViolation *TelemetryAssertionViolation `protobuf:"bytes,24,opt,name=assertion_violation,json=assertionViolation,proto3,oneof"` } type TelemetryWrapper_RoundStarted struct { - RoundStarted *TelemetryRoundStarted `protobuf:"bytes,5,opt,name=round_started,json=roundStarted,proto3,oneof"` + RoundStarted *TelemetryRoundStarted `protobuf:"bytes,25,opt,name=round_started,json=roundStarted,proto3,oneof"` } func (*TelemetryWrapper_MessageReceived) isTelemetryWrapper_Wrapped() {} @@ -159,6 +159,7 @@ type TelemetryMessageReceived struct { ConfigDigest []byte `protobuf:"bytes,1,opt,name=config_digest,json=configDigest,proto3" json:"config_digest,omitempty"` Msg *MessageWrapper `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Sender uint32 `protobuf:"varint,3,opt,name=sender,proto3" json:"sender,omitempty"` + Priority uint32 `protobuf:"varint,4,opt,name=priority,proto3" json:"priority,omitempty"` } func (x *TelemetryMessageReceived) Reset() { @@ -214,14 +215,21 @@ func (x *TelemetryMessageReceived) GetSender() uint32 { return 0 } +func (x *TelemetryMessageReceived) GetPriority() uint32 { + if x != nil { + return x.Priority + } + return 0 +} + type TelemetryMessageBroadcast struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ConfigDigest []byte `protobuf:"bytes,1,opt,name=config_digest,json=configDigest,proto3" json:"config_digest,omitempty"` - Msg *MessageWrapper `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` - SerializedMsg []byte `protobuf:"bytes,3,opt,name=serialized_msg,json=serializedMsg,proto3" json:"serialized_msg,omitempty"` + ConfigDigest []byte `protobuf:"bytes,1,opt,name=config_digest,json=configDigest,proto3" json:"config_digest,omitempty"` + Msg *MessageWrapper `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + Priority uint32 `protobuf:"varint,3,opt,name=priority,proto3" json:"priority,omitempty"` } func (x *TelemetryMessageBroadcast) Reset() { @@ -270,11 +278,11 @@ func (x *TelemetryMessageBroadcast) GetMsg() *MessageWrapper { return nil } -func (x *TelemetryMessageBroadcast) GetSerializedMsg() []byte { +func (x *TelemetryMessageBroadcast) GetPriority() uint32 { if x != nil { - return x.SerializedMsg + return x.Priority } - return nil + return 0 } type TelemetryMessageSent struct { @@ -282,10 +290,10 @@ type TelemetryMessageSent struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ConfigDigest []byte `protobuf:"bytes,1,opt,name=config_digest,json=configDigest,proto3" json:"config_digest,omitempty"` - Msg *MessageWrapper `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` - SerializedMsg []byte `protobuf:"bytes,3,opt,name=serialized_msg,json=serializedMsg,proto3" json:"serialized_msg,omitempty"` - Receiver uint32 `protobuf:"varint,4,opt,name=receiver,proto3" json:"receiver,omitempty"` + ConfigDigest []byte `protobuf:"bytes,1,opt,name=config_digest,json=configDigest,proto3" json:"config_digest,omitempty"` + Msg *MessageWrapper `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + Receiver uint32 `protobuf:"varint,3,opt,name=receiver,proto3" json:"receiver,omitempty"` + Priority uint32 `protobuf:"varint,4,opt,name=priority,proto3" json:"priority,omitempty"` } func (x *TelemetryMessageSent) Reset() { @@ -334,16 +342,16 @@ func (x *TelemetryMessageSent) GetMsg() *MessageWrapper { return nil } -func (x *TelemetryMessageSent) GetSerializedMsg() []byte { +func (x *TelemetryMessageSent) GetReceiver() uint32 { if x != nil { - return x.SerializedMsg + return x.Receiver } - return nil + return 0 } -func (x *TelemetryMessageSent) GetReceiver() uint32 { +func (x *TelemetryMessageSent) GetPriority() uint32 { if x != nil { - return x.Receiver + return x.Priority } return 0 } @@ -420,9 +428,11 @@ type TelemetryAssertionViolationInvalidSerialization struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - ConfigDigest []byte `protobuf:"bytes,1,opt,name=config_digest,json=configDigest,proto3" json:"config_digest,omitempty"` - SerializedMsg []byte `protobuf:"bytes,2,opt,name=serialized_msg,json=serializedMsg,proto3" json:"serialized_msg,omitempty"` - Sender uint32 `protobuf:"varint,3,opt,name=sender,proto3" json:"sender,omitempty"` + ConfigDigest []byte `protobuf:"bytes,1,opt,name=config_digest,json=configDigest,proto3" json:"config_digest,omitempty"` + SerializedMsgPrefix []byte `protobuf:"bytes,2,opt,name=serialized_msg_prefix,json=serializedMsgPrefix,proto3" json:"serialized_msg_prefix,omitempty"` + SerializedMsgLength uint32 `protobuf:"varint,3,opt,name=serialized_msg_length,json=serializedMsgLength,proto3" json:"serialized_msg_length,omitempty"` + Sender uint32 `protobuf:"varint,4,opt,name=sender,proto3" json:"sender,omitempty"` + Priority uint32 `protobuf:"varint,5,opt,name=priority,proto3" json:"priority,omitempty"` } func (x *TelemetryAssertionViolationInvalidSerialization) Reset() { @@ -464,13 +474,20 @@ func (x *TelemetryAssertionViolationInvalidSerialization) GetConfigDigest() []by return nil } -func (x *TelemetryAssertionViolationInvalidSerialization) GetSerializedMsg() []byte { +func (x *TelemetryAssertionViolationInvalidSerialization) GetSerializedMsgPrefix() []byte { if x != nil { - return x.SerializedMsg + return x.SerializedMsgPrefix } return nil } +func (x *TelemetryAssertionViolationInvalidSerialization) GetSerializedMsgLength() uint32 { + if x != nil { + return x.SerializedMsgLength + } + return 0 +} + func (x *TelemetryAssertionViolationInvalidSerialization) GetSender() uint32 { if x != nil { return x.Sender @@ -478,6 +495,13 @@ func (x *TelemetryAssertionViolationInvalidSerialization) GetSender() uint32 { return 0 } +func (x *TelemetryAssertionViolationInvalidSerialization) GetPriority() uint32 { + if x != nil { + return x.Priority + } + return 0 +} + type TelemetryRoundStarted struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -574,104 +598,111 @@ var file_offchainreporting3_1_telemetry_proto_rawDesc = []byte{ 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x1a, 0x23, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x99, 0x04, 0x0a, 0x10, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x57, + 0x6f, 0x22, 0x9f, 0x04, 0x0a, 0x10, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x12, 0x5b, 0x0a, 0x10, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x65, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x48, 0x00, 0x52, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x12, 0x5e, 0x0a, 0x11, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x62, - 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, + 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x48, 0x00, 0x52, 0x10, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, - 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6f, 0x66, 0x66, 0x63, + 0x65, 0x6e, 0x74, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6e, 0x74, 0x12, 0x64, 0x0a, 0x13, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x6e, 0x5f, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x12, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x0d, 0x72, 0x6f, - 0x75, 0x6e, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x75, 0x6e, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, - 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x75, + 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, - 0x64, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x22, 0x8f, 0x01, - 0x0a, 0x18, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, - 0x36, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, - 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, - 0x33, 0x5f, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x72, 0x61, 0x70, 0x70, - 0x65, 0x72, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, - 0x9f, 0x01, 0x0a, 0x19, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x12, 0x23, 0x0a, - 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x12, 0x36, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x72, - 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, - 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x4d, 0x73, - 0x67, 0x22, 0xb6, 0x01, 0x0a, 0x14, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, - 0x36, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, - 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, - 0x33, 0x5f, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x72, 0x61, 0x70, 0x70, - 0x65, 0x72, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x69, 0x61, - 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x0d, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x1a, - 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x22, 0xae, 0x01, 0x0a, 0x1b, 0x54, - 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, - 0x6e, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x7c, 0x0a, 0x15, 0x69, 0x6e, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x6f, 0x66, 0x66, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, - 0x2e, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, - 0x69, 0x6f, 0x6e, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x48, 0x00, 0x52, 0x14, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x65, 0x72, 0x69, 0x61, - 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0x0a, 0x09, 0x76, 0x69, 0x6f, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0x95, 0x01, 0x0a, 0x2f, - 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, - 0x6f, 0x6e, 0x56, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x76, 0x61, 0x6c, - 0x69, 0x64, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x64, 0x73, 0x42, 0x09, 0x0a, 0x07, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x4a, 0x04, 0x08, + 0x01, 0x10, 0x15, 0x22, 0xab, 0x01, 0x0a, 0x18, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, + 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, + 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, + 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, + 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x22, 0x94, 0x01, 0x0a, 0x19, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, - 0x67, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, - 0x65, 0x64, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x73, 0x65, - 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x65, 0x6e, - 0x64, 0x65, 0x72, 0x22, 0xab, 0x01, 0x0a, 0x15, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, - 0x79, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x23, 0x0a, - 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, - 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x65, - 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x73, 0x65, 0x71, 0x4e, - 0x72, 0x42, 0x11, 0x5a, 0x0f, 0x2e, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x67, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x1a, 0x0a, 0x08, + 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, + 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0xab, 0x01, 0x0a, 0x14, 0x54, 0x65, 0x6c, + 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x6e, + 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x67, 0x65, + 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x72, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x1a, + 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, + 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x72, + 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0xae, 0x01, 0x0a, 0x1b, 0x54, 0x65, 0x6c, 0x65, 0x6d, + 0x65, 0x74, 0x72, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x69, 0x6f, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x7c, 0x0a, 0x15, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x45, 0x2e, 0x6f, 0x66, 0x66, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x33, 0x5f, 0x31, 0x2e, 0x54, 0x65, 0x6c, + 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x56, + 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x53, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x14, + 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0b, 0x0a, 0x09, 0x76, 0x69, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0xf2, 0x01, 0x0a, 0x2f, 0x54, 0x65, 0x6c, 0x65, + 0x6d, 0x65, 0x74, 0x72, 0x79, 0x41, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x69, + 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, + 0x12, 0x32, 0x0a, 0x15, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x6d, + 0x73, 0x67, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x13, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x4d, 0x73, 0x67, 0x50, 0x72, + 0x65, 0x66, 0x69, 0x78, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x64, 0x5f, 0x6d, 0x73, 0x67, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x13, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x4d, + 0x73, 0x67, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0xab, 0x01, 0x0a, + 0x15, 0x54, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x65, 0x70, 0x6f, 0x63, + 0x68, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x74, + 0x69, 0x6d, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x73, 0x65, 0x71, 0x5f, 0x6e, 0x72, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x05, 0x73, 0x65, 0x71, 0x4e, 0x72, 0x42, 0x11, 0x5a, 0x0f, 0x2e, 0x3b, + 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/offchainreporting2plus/internal/ocr3_1/serialization/serialization.go b/offchainreporting2plus/internal/ocr3_1/serialization/serialization.go index fe2bf39f..8a03be8e 100644 --- a/offchainreporting2plus/internal/ocr3_1/serialization/serialization.go +++ b/offchainreporting2plus/internal/ocr3_1/serialization/serialization.go @@ -377,6 +377,7 @@ func (tpm *toProtoMessage[RI]) messageWrapper(m protocol.Message[RI]) (*MessageW // fields v.StartSeqNr, v.EndExclSeqNr, + uint32(v.MaxCumulativeWriteSetBytes), } msgWrapper.Msg = &MessageWrapper_MessageBlockSyncRequest{pm} case protocol.MessageBlockSyncResponse[RI]: @@ -416,6 +417,7 @@ func (tpm *toProtoMessage[RI]) messageWrapper(m protocol.Message[RI]) (*MessageW v.ToSeqNr, v.StartIndex[:], v.EndInclIndex[:], + uint32(v.MaxCumulativeKeysPlusValuesBytes), } msgWrapper.Msg = &MessageWrapper_MessageTreeSyncChunkRequest{pm} case protocol.MessageTreeSyncChunkResponse[RI]: @@ -529,10 +531,11 @@ func (tpm *toProtoMessage[RI]) certifiedPrepareOrCommit(cpoc protocol.CertifiedP 0, nil, // fields + v.PrevHistoryDigest[:], v.Epoch(), v.SeqNr(), v.StateTransitionInputsDigest[:], - v.StateTransitionOutputsDigest[:], + v.StateWriteSetDigest[:], v.StateRootDigest[:], v.ReportsPlusPrecursorDigest[:], prepareQuorumCertificate, @@ -573,10 +576,11 @@ func (tpm *toProtoMessage[RI]) CertifiedCommit(cpocc protocol.CertifiedCommit) * 0, nil, // fields + cpocc.PrevHistoryDigest[:], cpocc.Epoch(), cpocc.SeqNr(), cpocc.StateTransitionInputsDigest[:], - cpocc.StateTransitionOutputsDigest[:], + cpocc.StateWriteSetDigest[:], cpocc.StateRootDigest[:], cpocc.ReportsPlusPrecursorDigest[:], commitQuorumCertificate, @@ -691,18 +695,19 @@ func (tpm *toProtoMessage[RI]) stateTransitionBlock(stb protocol.StateTransition 0, nil, // fields + stb.PrevHistoryDigest[:], stb.Epoch, stb.SeqNr(), stb.StateTransitionInputsDigest[:], - tpm.stateTransitionOutputs(stb.StateTransitionOutputs), + tpm.stateWriteSet(stb.StateWriteSet), stb.StateRootDigest[:], stb.ReportsPlusPrecursorDigest[:], } } -func (tpm *toProtoMessage[RI]) stateTransitionOutputs(sto protocol.StateTransitionOutputs) *StateTransitionOutputs { - pbWriteSet := make([]*KeyValueModification, 0, len(sto.WriteSet)) - for _, kvmod := range sto.WriteSet { +func (tpm *toProtoMessage[RI]) stateWriteSet(sto protocol.StateWriteSet) *StateWriteSet { + pbWriteSet := make([]*KeyValueModification, 0, len(sto.Entries)) + for _, kvmod := range sto.Entries { pbWriteSet = append(pbWriteSet, &KeyValueModification{ // zero-initialize protobuf built-ins protoimpl.MessageState{}, @@ -714,7 +719,7 @@ func (tpm *toProtoMessage[RI]) stateTransitionOutputs(sto protocol.StateTransiti kvmod.Deleted, }) } - return &StateTransitionOutputs{ + return &StateWriteSet{ // zero-initialize protobuf built-ins protoimpl.MessageState{}, 0, @@ -956,10 +961,12 @@ func (fpm *fromProtoMessage[RI]) certifiedPrepare(m *CertifiedPrepare) (protocol if m == nil { return protocol.CertifiedPrepare{}, fmt.Errorf("unable to extract a CertifiedPrepare value") } + var prevHistoryDigest protocol.HistoryDigest + copy(prevHistoryDigest[:], m.PrevHistoryDigest) var inputsDigest protocol.StateTransitionInputsDigest copy(inputsDigest[:], m.StateTransitionInputsDigest) - var outputsDigest protocol.StateTransitionOutputDigest - copy(outputsDigest[:], m.StateTransitionOutputsDigest) + var writeSetDigest protocol.StateWriteSetDigest + copy(writeSetDigest[:], m.StateWriteSetDigest) var stateRootDigest protocol.StateRootDigest copy(stateRootDigest[:], m.StateRootDigest) var reportsPlusPrecursorDigest protocol.ReportsPlusPrecursorDigest @@ -977,10 +984,11 @@ func (fpm *fromProtoMessage[RI]) certifiedPrepare(m *CertifiedPrepare) (protocol }) } return protocol.CertifiedPrepare{ + prevHistoryDigest, m.Epoch, m.SeqNr, inputsDigest, - outputsDigest, + writeSetDigest, stateRootDigest, reportsPlusPrecursorDigest, prepareQuorumCertificate, @@ -992,10 +1000,12 @@ func (fpm *fromProtoMessage[RI]) certifiedCommit(m *CertifiedCommit) (protocol.C if m == nil { return protocol.CertifiedCommit{}, fmt.Errorf("unable to extract a CertifiedCommit value") } + var prevHistoryDigest protocol.HistoryDigest + copy(prevHistoryDigest[:], m.PrevHistoryDigest) var inputsDigest protocol.StateTransitionInputsDigest copy(inputsDigest[:], m.StateTransitionInputsDigest) - var outputsDigest protocol.StateTransitionOutputDigest - copy(outputsDigest[:], m.StateTransitionOutputsDigest) + var writeSetDigest protocol.StateWriteSetDigest + copy(writeSetDigest[:], m.StateWriteSetDigest) var stateRootDigest protocol.StateRootDigest copy(stateRootDigest[:], m.StateRootDigest) var reportsPlusPrecursorDigest protocol.ReportsPlusPrecursorDigest @@ -1013,10 +1023,11 @@ func (fpm *fromProtoMessage[RI]) certifiedCommit(m *CertifiedCommit) (protocol.C }) } return protocol.CertifiedCommit{ + prevHistoryDigest, m.Epoch, m.SeqNr, inputsDigest, - outputsDigest, + writeSetDigest, stateRootDigest, reportsPlusPrecursorDigest, commitQuorumCertificate, @@ -1086,6 +1097,7 @@ func (fpm *fromProtoMessage[RI]) messageRoundStart(m *MessageRoundStart) (protoc return protocol.MessageRoundStart[RI]{}, fmt.Errorf("unable to extract a MessageRoundStart value") } return protocol.MessageRoundStart[RI]{ + fpm.requestHandle, m.Epoch, m.SeqNr, m.Query, @@ -1101,6 +1113,7 @@ func (fpm *fromProtoMessage[RI]) messageObservation(m *MessageObservation) (prot return protocol.MessageObservation[RI]{}, err } return protocol.MessageObservation[RI]{ + types.EmptyRequestHandleForInboundResponse, m.Epoch, m.SeqNr, so, @@ -1127,6 +1140,7 @@ func (fpm *fromProtoMessage[RI]) messageReportsPlusPrecursorRequest(m *MessageRe return protocol.MessageReportsPlusPrecursorRequest[RI]{}, fmt.Errorf("unable to extract a MessageReportsPlusPrecursorRequest value") } return protocol.MessageReportsPlusPrecursorRequest[RI]{ + fpm.requestHandle, m.SeqNr, }, nil } @@ -1136,6 +1150,7 @@ func (fpm *fromProtoMessage[RI]) messageReportsPlusPrecursor(m *MessageReportsPl return protocol.MessageReportsPlusPrecursor[RI]{}, fmt.Errorf("unable to extract a MessageReportsPlusPrecursor value") } return protocol.MessageReportsPlusPrecursor[RI]{ + fpm.requestHandle, m.SeqNr, m.ReportsPlusPrecursor, }, nil @@ -1202,6 +1217,7 @@ func (fpm *fromProtoMessage[RI]) messageBlockSyncRequest(m *MessageBlockSyncRequ types.EmptyRequestInfoForInboundRequest, m.StartSeqNr, m.EndExclSeqNr, + int(m.MaxCumulativeWriteSetBytes), }, nil } @@ -1264,21 +1280,24 @@ func (fpm *fromProtoMessage[RI]) stateTransitionBlock(m *StateTransitionBlock) ( if m == nil { return protocol.StateTransitionBlock{}, fmt.Errorf("unable to extract a StateTransitionBlock value") } + var prevHistoryDigest protocol.HistoryDigest + copy(prevHistoryDigest[:], m.PrevHistoryDigest) var inputsDigest protocol.StateTransitionInputsDigest copy(inputsDigest[:], m.StateTransitionInputsDigest) var stateRootDigest protocol.StateRootDigest copy(stateRootDigest[:], m.StateRootDigest) - outputs, err := fpm.stateTransitionOutputs(m.StateTransitionOutputs) + writeSet, err := fpm.stateWriteSet(m.StateWriteSet) if err != nil { return protocol.StateTransitionBlock{}, err } var reportsPlusPrecursorDigest protocol.ReportsPlusPrecursorDigest copy(reportsPlusPrecursorDigest[:], m.ReportsPlusPrecursorDigest) return protocol.StateTransitionBlock{ + prevHistoryDigest, m.Epoch, m.SeqNr, inputsDigest, - outputs, + writeSet, stateRootDigest, reportsPlusPrecursorDigest, }, nil @@ -1310,13 +1329,13 @@ func (fpm *fromProtoMessage[RI]) attributedCommitSignature(m *AttributedCommitSi }, nil } -func (fpm *fromProtoMessage[RI]) stateTransitionOutputs(m *StateTransitionOutputs) (protocol.StateTransitionOutputs, error) { +func (fpm *fromProtoMessage[RI]) stateWriteSet(m *StateWriteSet) (protocol.StateWriteSet, error) { if m == nil { - return protocol.StateTransitionOutputs{}, fmt.Errorf("unable to extract an StateTransitionOutputs value") + return protocol.StateWriteSet{}, fmt.Errorf("unable to extract an StateWriteSet value") } - writeSet := make([]protocol.KeyValuePairWithDeletions, 0, len(m.WriteSet)) - for _, pbkvmod := range m.WriteSet { + writeSet := make([]protocol.KeyValuePairWithDeletions, 0, len(m.Entries)) + for _, pbkvmod := range m.Entries { writeSet = append(writeSet, protocol.KeyValuePairWithDeletions{ pbkvmod.Key, pbkvmod.Value, @@ -1324,7 +1343,7 @@ func (fpm *fromProtoMessage[RI]) stateTransitionOutputs(m *StateTransitionOutput }) } - return protocol.StateTransitionOutputs{writeSet}, nil + return protocol.StateWriteSet{writeSet}, nil } func (fpm *fromProtoMessage[RI]) messageBlobOffer(m *MessageBlobOffer) (protocol.MessageBlobOffer[RI], error) { @@ -1428,6 +1447,7 @@ func (fpm *fromProtoMessage[RI]) messageTreeSyncChunkRequest(m *MessageTreeSyncC m.ToSeqNr, startIndex, endInclIndex, + int(m.MaxCumulativeKeysPlusValuesBytes), }, nil } diff --git a/offchainreporting2plus/internal/shim/metrics.go b/offchainreporting2plus/internal/shim/metrics.go index 0c7a4b1d..3dc12ce4 100644 --- a/offchainreporting2plus/internal/shim/metrics.go +++ b/offchainreporting2plus/internal/shim/metrics.go @@ -1,6 +1,8 @@ package shim import ( + "time" + "github.com/prometheus/client_golang/prometheus" "github.com/smartcontractkit/libocr/commontypes" "github.com/smartcontractkit/libocr/internal/metricshelper" @@ -40,53 +42,120 @@ func (m *serializingEndpointMetrics) Close() { m.registerer.Unregister(m.droppedMessagesTotal) } -type keyValueMetrics struct { - registerer prometheus.Registerer - closeWriteSetDurationNanoseconds prometheus.Histogram - txWriteDurationNanoseconds prometheus.Histogram - txCommitDurationNanoseconds prometheus.Histogram +type semanticKeyValueDatabaseMetrics struct { + registerer prometheus.Registerer + closeWriteSetDurationSeconds prometheus.Histogram + txWriteDurationSeconds prometheus.Histogram + txCommitDurationSeconds prometheus.Histogram } -const ( - hist_bucket_start = 2 - hist_bucket_factor = 2 - hist_bucket_count = 35 -) +func newSemanticKeyValueDatabaseMetrics( + registerer prometheus.Registerer, + logger commontypes.Logger, +) *semanticKeyValueDatabaseMetrics { + closeWriteSetDurationSeconds := prometheus.NewHistogram(prometheus.HistogramOpts{ + Name: "ocr3_1_experimental_semantic_kvdb_close_write_set_duration_seconds", + Help: "How long it takes to close the write set.", + Buckets: prometheus.ExponentialBucketsRange( + (50 * time.Microsecond).Seconds(), + (10 * time.Second).Seconds(), + 20, + ), + }) + metricshelper.RegisterOrLogError(logger, registerer, closeWriteSetDurationSeconds, "ocr3_1_experimental_semantic_kvdb_close_write_set_duration_seconds") -func newKeyValueMetrics( + txWriteDurationSeconds := prometheus.NewHistogram(prometheus.HistogramOpts{ + Name: "ocr3_1_experimental_semantic_kvdb_tx_write_duration_seconds", + Help: "How long it takes to write to the transaction.", + Buckets: prometheus.ExponentialBucketsRange( + (1 * time.Microsecond).Seconds(), + (10 * time.Millisecond).Seconds(), + 10, + ), + }) + metricshelper.RegisterOrLogError(logger, registerer, txWriteDurationSeconds, "ocr3_1_experimental_semantic_kvdb_tx_write_duration_seconds") + + txCommitDurationSeconds := prometheus.NewHistogram(prometheus.HistogramOpts{ + Name: "ocr3_1_experimental_semantic_kvdb_tx_commit_duration_seconds", + Help: "How long it takes to commit a transaction.", + Buckets: prometheus.ExponentialBucketsRange( + (500 * time.Microsecond).Seconds(), + (10 * time.Second).Seconds(), + 20, + ), + }) + metricshelper.RegisterOrLogError(logger, registerer, txCommitDurationSeconds, "ocr3_1_experimental_semantic_kvdb_tx_commit_duration_seconds") + return &semanticKeyValueDatabaseMetrics{ + registerer, + closeWriteSetDurationSeconds, + txWriteDurationSeconds, + txCommitDurationSeconds, + } +} + +func (m *semanticKeyValueDatabaseMetrics) Close() { + m.registerer.Unregister(m.closeWriteSetDurationSeconds) + m.registerer.Unregister(m.txWriteDurationSeconds) + m.registerer.Unregister(m.txCommitDurationSeconds) +} + +type keyValueDatabaseMetrics struct { + registerer prometheus.Registerer + openedReadTransactionsTotal prometheus.Counter + discardedReadTransactionsTotal prometheus.Counter + openedReadWriteTransactionsTotal prometheus.Counter + committedReadWriteTransactionsTotal prometheus.Counter + discardedReadWriteTransactionsTotal prometheus.Counter +} + +func newKeyValueDatabaseMetrics( registerer prometheus.Registerer, logger commontypes.Logger, -) *keyValueMetrics { - closeWriteSetDurationNanoseconds := prometheus.NewHistogram(prometheus.HistogramOpts{ - Name: "ocr3_1_experimental_key_value_close_write_set_duration_ns", - Help: "How long it takes to close the write set.", - Buckets: prometheus.ExponentialBuckets(hist_bucket_start, hist_bucket_factor, hist_bucket_count), +) *keyValueDatabaseMetrics { + openedReadTransactionsTotal := prometheus.NewCounter(prometheus.CounterOpts{ + Name: "ocr3_1_experimental_kvdb_opened_read_transactions_total", + Help: "The number of opened read transactions.", }) - metricshelper.RegisterOrLogError(logger, registerer, closeWriteSetDurationNanoseconds, "ocr3_1_experimental_key_value_close_write_set_duration_ns") + metricshelper.RegisterOrLogError(logger, registerer, openedReadTransactionsTotal, "ocr3_1_experimental_kvdb_opened_read_transactions_total") - txWriteDurationNanoseconds := prometheus.NewHistogram(prometheus.HistogramOpts{ - Name: "ocr3_1_experimental_key_value_tx_write_duration_ns", - Help: "How long it takes to write to the transaction.", - Buckets: prometheus.ExponentialBuckets(hist_bucket_start, hist_bucket_factor, hist_bucket_count), + discardedReadTransactionsTotal := prometheus.NewCounter(prometheus.CounterOpts{ + Name: "ocr3_1_experimental_kvdb_discarded_read_transactions_total", + Help: "The number of discarded read transactions.", }) - metricshelper.RegisterOrLogError(logger, registerer, txWriteDurationNanoseconds, "ocr3_1_experimental_key_value_tx_write_duration_ns") + metricshelper.RegisterOrLogError(logger, registerer, discardedReadTransactionsTotal, "ocr3_1_experimental_kvdb_discarded_read_transactions_total") - txCommitDurationNanoseconds := prometheus.NewHistogram(prometheus.HistogramOpts{ - Name: "ocr3_1_experimental_key_value_tx_commit_duration_nanoseconds", - Help: "How long it takes to commit a transaction.", - Buckets: prometheus.ExponentialBuckets(hist_bucket_start, hist_bucket_factor, hist_bucket_count), + openedReadWriteTransactionsTotal := prometheus.NewCounter(prometheus.CounterOpts{ + Name: "ocr3_1_experimental_kvdb_opened_read_write_transactions_total", + Help: "The number of opened read-write transactions.", }) - metricshelper.RegisterOrLogError(logger, registerer, txCommitDurationNanoseconds, "ocr3_1_experimental_key_value_tx_commit_duration_ns") - return &keyValueMetrics{ + metricshelper.RegisterOrLogError(logger, registerer, openedReadWriteTransactionsTotal, "ocr3_1_experimental_kvdb_opened_read_write_transactions_total") + + committedReadWriteTransactionsTotal := prometheus.NewCounter(prometheus.CounterOpts{ + Name: "ocr3_1_experimental_kvdb_committed_read_write_transactions_total", + Help: "The number of committed read-write transactions.", + }) + metricshelper.RegisterOrLogError(logger, registerer, committedReadWriteTransactionsTotal, "ocr3_1_experimental_kvdb_committed_read_write_transactions_total") + + discardedReadWriteTransactionsTotal := prometheus.NewCounter(prometheus.CounterOpts{ + Name: "ocr3_1_experimental_kvdb_discarded_read_write_transactions_total", + Help: "The number of discarded read-write transactions.", + }) + metricshelper.RegisterOrLogError(logger, registerer, discardedReadWriteTransactionsTotal, "ocr3_1_experimental_kvdb_discarded_read_write_transactions_total") + + return &keyValueDatabaseMetrics{ registerer, - closeWriteSetDurationNanoseconds, - txWriteDurationNanoseconds, - txCommitDurationNanoseconds, + openedReadTransactionsTotal, + discardedReadTransactionsTotal, + openedReadWriteTransactionsTotal, + committedReadWriteTransactionsTotal, + discardedReadWriteTransactionsTotal, } } -func (m *keyValueMetrics) Close() { - m.registerer.Unregister(m.closeWriteSetDurationNanoseconds) - m.registerer.Unregister(m.txWriteDurationNanoseconds) - m.registerer.Unregister(m.txCommitDurationNanoseconds) +func (m *keyValueDatabaseMetrics) Close() { + m.registerer.Unregister(m.openedReadTransactionsTotal) + m.registerer.Unregister(m.discardedReadTransactionsTotal) + m.registerer.Unregister(m.openedReadWriteTransactionsTotal) + m.registerer.Unregister(m.committedReadWriteTransactionsTotal) + m.registerer.Unregister(m.discardedReadWriteTransactionsTotal) } diff --git a/offchainreporting2plus/internal/shim/ocr3_1_key_value_database_with_metrics.go b/offchainreporting2plus/internal/shim/ocr3_1_key_value_database_with_metrics.go new file mode 100644 index 00000000..48a0cff8 --- /dev/null +++ b/offchainreporting2plus/internal/shim/ocr3_1_key_value_database_with_metrics.go @@ -0,0 +1,104 @@ +package shim + +import ( + "sync" + + "github.com/prometheus/client_golang/prometheus" + "github.com/smartcontractkit/libocr/commontypes" + "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3_1types" +) + +type keyValueDatabaseWithMetrics struct { + ocr3_1types.KeyValueDatabase + metrics *keyValueDatabaseMetrics +} + +type keyValueDatabaseReadTransactionWithMetrics struct { + ocr3_1types.KeyValueDatabaseReadTransaction + metrics *keyValueDatabaseMetrics + once sync.Once +} + +// Discard implements ocr3_1types.KeyValueDatabaseReadTransaction. +func (k *keyValueDatabaseReadTransactionWithMetrics) Discard() { + k.once.Do(func() { + k.metrics.discardedReadTransactionsTotal.Inc() + }) + k.KeyValueDatabaseReadTransaction.Discard() +} + +type keyValueDatabaseReadWriteTransactionWithMetrics struct { + ocr3_1types.KeyValueDatabaseReadWriteTransaction + metrics *keyValueDatabaseMetrics + once sync.Once +} + +// Discard implements ocr3_1types.KeyValueDatabaseReadWriteTransaction. +func (k *keyValueDatabaseReadWriteTransactionWithMetrics) Discard() { + k.once.Do(func() { + k.metrics.discardedReadWriteTransactionsTotal.Inc() + }) + k.KeyValueDatabaseReadWriteTransaction.Discard() +} + +// Commit implements ocr3_1types.KeyValueDatabaseReadWriteTransaction. +func (k *keyValueDatabaseReadWriteTransactionWithMetrics) Commit() error { + err := k.KeyValueDatabaseReadWriteTransaction.Commit() + k.once.Do(func() { + if err == nil { + k.metrics.committedReadWriteTransactionsTotal.Inc() + } else { + + k.metrics.discardedReadWriteTransactionsTotal.Inc() + } + }) + return err +} + +// Close implements ocr3_1types.KeyValueDatabase. It does not manage the lifetime of the underlying database, +// and is expected to be closed first, before the underlying database is closed. +func (k *keyValueDatabaseWithMetrics) Close() error { + k.metrics.Close() + return nil +} + +// NewReadTransaction implements ocr3_1types.KeyValueDatabase. +func (k *keyValueDatabaseWithMetrics) NewReadTransaction() (ocr3_1types.KeyValueDatabaseReadTransaction, error) { + tx, err := k.KeyValueDatabase.NewReadTransaction() + if err != nil { + return nil, err + } + k.metrics.openedReadTransactionsTotal.Inc() + return &keyValueDatabaseReadTransactionWithMetrics{ + tx, + k.metrics, + sync.Once{}, + }, nil +} + +// NewReadWriteTransaction implements ocr3_1types.KeyValueDatabase. +func (k *keyValueDatabaseWithMetrics) NewReadWriteTransaction() (ocr3_1types.KeyValueDatabaseReadWriteTransaction, error) { + tx, err := k.KeyValueDatabase.NewReadWriteTransaction() + if err != nil { + return nil, err + } + k.metrics.openedReadWriteTransactionsTotal.Inc() + return &keyValueDatabaseReadWriteTransactionWithMetrics{ + tx, + k.metrics, + sync.Once{}, + }, nil +} + +func NewKeyValueDatabaseWithMetrics( + kvDb ocr3_1types.KeyValueDatabase, + metricsRegisterer prometheus.Registerer, + logger commontypes.Logger, +) ocr3_1types.KeyValueDatabase { + return &keyValueDatabaseWithMetrics{ + kvDb, + newKeyValueDatabaseMetrics(metricsRegisterer, logger), + } +} + +var _ ocr3_1types.KeyValueDatabase = &keyValueDatabaseWithMetrics{} diff --git a/offchainreporting2plus/internal/shim/ocr3_1_key_value_store.go b/offchainreporting2plus/internal/shim/ocr3_1_key_value_store.go index bdc9086e..efa4341b 100644 --- a/offchainreporting2plus/internal/shim/ocr3_1_key_value_store.go +++ b/offchainreporting2plus/internal/shim/ocr3_1_key_value_store.go @@ -28,7 +28,7 @@ type SemanticOCR3_1KeyValueDatabase struct { Limits ocr3_1types.ReportingPluginLimits config ocr3_1config.PublicConfig logger commontypes.Logger - metrics *keyValueMetrics + metrics *semanticKeyValueDatabaseMetrics } var _ protocol.KeyValueDatabase = &SemanticOCR3_1KeyValueDatabase{} @@ -39,15 +39,18 @@ func NewSemanticOCR3_1KeyValueDatabase( config ocr3_1config.PublicConfig, logger commontypes.Logger, metricsRegisterer prometheus.Registerer, -) *SemanticOCR3_1KeyValueDatabase { +) (*SemanticOCR3_1KeyValueDatabase, error) { + if err := initializeSchema(keyValueDatabase); err != nil { + return nil, fmt.Errorf("failed to initialize schema: %w", err) + } return &SemanticOCR3_1KeyValueDatabase{ singlewriter.NewConflictTracker(), keyValueDatabase, limits, config, logger, - newKeyValueMetrics(metricsRegisterer, logger), - } + newSemanticKeyValueDatabaseMetrics(metricsRegisterer, logger), + }, nil } func (s *SemanticOCR3_1KeyValueDatabase) newReadWriteTransaction(tx ocr3_1types.KeyValueDatabaseReadWriteTransaction, nilOrSeqNr *uint64) *SemanticOCR3_1KeyValueDatabaseReadWriteTransaction { @@ -65,10 +68,11 @@ func (s *SemanticOCR3_1KeyValueDatabase) newReadWriteTransaction(tx ocr3_1types. } } +// SemanticOCR3_1KeyValueDatabase does not manage the lifetime of the underlying +// database, and is expected to be closed first, before the database is closed. func (s *SemanticOCR3_1KeyValueDatabase) Close() error { - err := s.KeyValueDatabase.Close() s.metrics.Close() - return err + return nil } func (s *SemanticOCR3_1KeyValueDatabase) HighestCommittedSeqNr() (uint64, error) { @@ -169,7 +173,7 @@ func (s *SemanticOCR3_1KeyValueDatabase) NewReadTransactionUnchecked() (protocol type SemanticOCR3_1KeyValueDatabaseReadWriteTransaction struct { SemanticOCR3_1KeyValueDatabaseReadTransaction // inherit all read implementations rawTransaction ocr3_1types.KeyValueDatabaseReadWriteTransaction - metrics *keyValueMetrics + metrics *semanticKeyValueDatabaseMetrics mu sync.Mutex nilOrWriteSet *limitCheckWriteSet nilOrSeqNr *uint64 @@ -195,7 +199,7 @@ func (s *SemanticOCR3_1KeyValueDatabaseReadWriteTransactionWithPreCommitHook) Co func (s *SemanticOCR3_1KeyValueDatabaseReadWriteTransaction) Commit() error { start := time.Now() defer func() { - s.metrics.txCommitDurationNanoseconds.Observe(float64(time.Since(start).Nanoseconds())) + s.metrics.txCommitDurationSeconds.Observe(float64(time.Since(start).Seconds())) }() err := s.rawTransaction.Commit() @@ -229,50 +233,66 @@ func (s *SemanticOCR3_1KeyValueDatabaseReadWriteTransaction) Delete(key []byte) return s.rawTransaction.Delete(pluginPrefixedUnhashedKey(key)) } -func (s *SemanticOCR3_1KeyValueDatabaseReadWriteTransaction) deletePrefixedKeys(prefix []byte, except [][]byte, n int) (done bool, err error) { +func (s *SemanticOCR3_1KeyValueDatabaseReadWriteTransaction) deletePrefixedKeys(prefix []byte, n int) (done bool, numDeleted int, err error) { // We cannot delete the keys while iterating them, if we want to be agnostic // to kvdb implementation semantics. var keysToDelete [][]byte it := s.rawTransaction.Range(prefix, nil) for it.Next() && len(keysToDelete) < n+1 { - if !bytes.HasPrefix(it.Key(), prefix) { + key := it.Key() + if !bytes.HasPrefix(key, prefix) { break } - matchAnyException := false - for _, e := range except { - if bytes.Equal(it.Key(), e) { - matchAnyException = true - break - } - } - if matchAnyException { - continue - } - keysToDelete = append(keysToDelete, it.Key()) + keysToDelete = append(keysToDelete, key) } if err := it.Err(); err != nil { it.Close() - return false, fmt.Errorf("failed to range: %w", err) + return false, 0, fmt.Errorf("failed to range: %w", err) } it.Close() for _, key := range keysToDelete { + if !(numDeleted+1 <= n) { + break + } if err := s.rawTransaction.Delete(key); err != nil { - return false, fmt.Errorf("failed to delete key %s: %w", key, err) + return false, numDeleted, fmt.Errorf("failed to delete key %s: %w", key, err) } + numDeleted++ } - return len(keysToDelete) <= n, nil + return len(keysToDelete) <= n, numDeleted, nil } // Caller must ensure to make committed state inaccessible to other transactions // until completed. Must be reinvoked until done=true. func (s *SemanticOCR3_1KeyValueDatabaseReadWriteTransaction) DestructiveDestroyForTreeSync(n int) (done bool, err error) { - return s.deletePrefixedKeys([]byte{}, [][]byte{ - []byte(highestCommittedSeqNrKey), - []byte(treeSyncStatusKey), - }, n) + prefixesToDelete := destructiveDestroyForTreeSyncPrefixesToDelete + + prefixesDone := make([]bool, len(prefixesToDelete)) + budget := n + for i, prefix := range prefixesToDelete { + done, numDeleted, err := s.deletePrefixedKeys(prefix, budget) + if err != nil { + return false, fmt.Errorf("failed to delete prefixed keys for prefix %q: %w", prefix, err) + } + budget -= numDeleted + if done { + prefixesDone[i] = true + } else if budget == 0 { + break + } + } + + allPrefixesDone := true + for _, done := range prefixesDone { + if !done { + allPrefixesDone = false + break + } + } + return allPrefixesDone, nil } // Helper for reaping methods that require large ranges over multiple transactions @@ -341,7 +361,7 @@ func (s *SemanticOCR3_1KeyValueDatabaseReadWriteTransaction) GetWriteSet() ([]pr func (s *SemanticOCR3_1KeyValueDatabaseReadWriteTransaction) CloseWriteSet() (protocol.StateRootDigest, error) { start := time.Now() defer func() { - s.metrics.closeWriteSetDurationNanoseconds.Observe(float64(time.Since(start).Nanoseconds())) + s.metrics.closeWriteSetDurationSeconds.Observe(float64(time.Since(start).Seconds())) }() s.mu.Lock() @@ -416,7 +436,7 @@ func (s *SemanticOCR3_1KeyValueDatabaseReadWriteTransaction) ApplyWriteSet(write func (s *SemanticOCR3_1KeyValueDatabaseReadWriteTransaction) Write(key []byte, value []byte) error { start := time.Now() defer func() { - s.metrics.txWriteDurationNanoseconds.Observe(float64(time.Since(start).Nanoseconds())) + s.metrics.txWriteDurationSeconds.Observe(float64(time.Since(start).Seconds())) }() if !(len(key) <= ocr3_1types.MaxMaxKeyValueKeyBytes) { @@ -565,6 +585,7 @@ func (s *SemanticOCR3_1KeyValueDatabaseReadTransaction) ReadTreeSyncChunk( toSeqNr uint64, startIndex jmt.Digest, requestEndInclIndex jmt.Digest, + maxCumulativeKeysPlusValuesBytes int, ) ( endInclIndex jmt.Digest, boundingLeaves []jmt.BoundingLeaf, @@ -595,7 +616,7 @@ func (s *SemanticOCR3_1KeyValueDatabaseReadTransaction) ReadTreeSyncChunk( protocol.RootVersion(toSeqNr, s.config), startIndex, requestEndInclIndex, - s.config.GetMaxTreeSyncChunkKeysPlusValuesBytes(), + maxCumulativeKeysPlusValuesBytes, s.config.GetMaxTreeSyncChunkKeys(), ) if err != nil { @@ -724,7 +745,6 @@ func (s *SemanticOCR3_1KeyValueDatabaseReadWriteTransaction) VerifyAndWriteTreeS } // write flat representation - for _, kv := range keyValues { err := s.rawTransaction.Write(pluginPrefixedUnhashedKey(kv.Key), kv.Value) if err != nil { @@ -963,6 +983,10 @@ func (s *SemanticOCR3_1KeyValueDatabaseReadWriteTransaction) WriteBlobQuotaStats } func (s *SemanticOCR3_1KeyValueDatabaseReadTransaction) ReadStaleBlobIndex(maxStaleSinceSeqNr uint64, limit int) ([]protocol.StaleBlob, error) { + if maxStaleSinceSeqNr+1 < maxStaleSinceSeqNr { + return nil, fmt.Errorf("maxStaleSinceSeqNr overflow") + } + it := s.rawTransaction.Range(staleBlobIndexPrefixKey(protocol.StaleBlob{0, blobtypes.BlobDigest{}}), staleBlobIndexPrefixKey(protocol.StaleBlob{maxStaleSinceSeqNr + 1, blobtypes.BlobDigest{}})) defer it.Close() @@ -1070,7 +1094,18 @@ func (s *SemanticOCR3_1KeyValueDatabaseReadWriteTransaction) DeleteUnattestedSta return !more, err } +var destructiveDestroyForTreeSyncPrefixesToDelete = [][]byte{ + []byte(pluginPrefix), + []byte(treeNodePrefix), + []byte(treeRootPrefix), + []byte(treeStaleNodePrefix), + []byte(lowestPersistedSeqNrKey), +} + const ( + schemaVersionKey = "OCR3_1_SCHEMA_VERSION" + supportedSchemaVersion = "1" + blockPrefix = "B|" pluginPrefix = "P|" blobChunkPrefix = "BC|" @@ -1088,6 +1123,68 @@ const ( lowestPersistedSeqNrKey = "LPS" ) +func initializeSchema(keyValueDatabase ocr3_1types.KeyValueDatabase) error { + rawTx, err := keyValueDatabase.NewReadWriteTransaction() + if err != nil { + return fmt.Errorf("failed to create read write transaction: %w", err) + } + defer rawTx.Discard() + + schemaVersion, err := readSchemaVersion(rawTx) + if err != nil { + return fmt.Errorf("failed to read schema version: %w", err) + } + if schemaVersion != nil { + if *schemaVersion != supportedSchemaVersion { + return fmt.Errorf("unsupported schema version: %q, we support: %q", *schemaVersion, supportedSchemaVersion) + } + // already initialized + return nil + } + + // ensure database is empty + err = func() error { + it := rawTx.Range(nil, nil) + defer it.Close() + for it.Next() { + return fmt.Errorf("database is not empty") + } + if err := it.Err(); err != nil { + return fmt.Errorf("failed to ensure database is not empty, iteration error: %w", err) + } + return nil + }() + + if err != nil { + return err + } + + if err := writeSchemaVersion(rawTx); err != nil { + return fmt.Errorf("failed to write schema version: %w", err) + } + + if err := rawTx.Commit(); err != nil { + return fmt.Errorf("failed to commit transaction: %w", err) + } + + return nil +} + +func writeSchemaVersion(rawTx ocr3_1types.KeyValueDatabaseReadWriteTransaction) error { + return rawTx.Write([]byte(schemaVersionKey), []byte(supportedSchemaVersion)) +} + +func readSchemaVersion(rawTx ocr3_1types.KeyValueDatabaseReadTransaction) (*string, error) { + schemaVersion, err := rawTx.Read([]byte(schemaVersionKey)) + if err != nil { + return nil, fmt.Errorf("error reading schema version: %w", err) + } + if schemaVersion == nil { + return nil, nil + } + return util.PointerTo(string(schemaVersion)), nil +} + func encodeBigEndianUint64(n uint64) []byte { b := make([]byte, 8) binary.BigEndian.PutUint64(b, n) @@ -1098,13 +1195,8 @@ func hashPluginKey(key []byte) jmt.Digest { return jmt.DigestKey(key) } -func pluginPrefixedUnhashedKey(key []byte) []byte { - pluginKey := hashPluginKey(key) - return pluginPrefixedHashedKey(pluginKey[:]) -} - -func pluginPrefixedHashedKey(hashedKey []byte) []byte { - return append([]byte(pluginPrefix), hashedKey[:]...) +func pluginPrefixedUnhashedKey(unhashedKey []byte) []byte { + return append([]byte(pluginPrefix), unhashedKey[:]...) } // ────────────────────────── blocks ─────────────────────────── @@ -1118,6 +1210,9 @@ func deserializeBlockKey(enc []byte) (uint64, error) { return 0, fmt.Errorf("encoding too short") } enc = enc[len(blockPrefix):] + if len(enc) < 8 { + return 0, fmt.Errorf("encoding too short to contain seqnr") + } return binary.BigEndian.Uint64(enc), nil } diff --git a/offchainreporting2plus/internal/shim/ocr3_1_serializing_endpoint.go b/offchainreporting2plus/internal/shim/ocr3_1_serializing_endpoint.go index 0d0f686c..e5faacac 100644 --- a/offchainreporting2plus/internal/shim/ocr3_1_serializing_endpoint.go +++ b/offchainreporting2plus/internal/shim/ocr3_1_serializing_endpoint.go @@ -93,14 +93,14 @@ func (n *OCR3_1SerializingEndpoint[RI]) sendTelemetry(t *serialization.Telemetry } } -func (n *OCR3_1SerializingEndpoint[RI]) toOutboundBinaryMessage(msg protocol.Message[RI]) (types.OutboundBinaryMessage, *serialization.MessageWrapper) { +func (n *OCR3_1SerializingEndpoint[RI]) toOutboundBinaryMessage(msg protocol.Message[RI]) (outboundBinaryMessage types.OutboundBinaryMessage, pbMessageForTelemetry *serialization.MessageWrapper) { if !msg.CheckSize(n.publicConfig.N(), n.publicConfig.F, n.pluginLimits, n.maxSigLen, n.publicConfig) { n.logger.Error("OCR3_1SerializingEndpoint: Dropping outgoing message because it fails size check", commontypes.LogFields{ "limits": n.pluginLimits, }) return nil, nil } - payload, pbm, err := serialization.Serialize(msg) + payload, pbMessageForTelemetry, err := serialization.Serialize(msg) if err != nil { n.logger.Error("OCR3_1SerializingEndpoint: Failed to serialize", commontypes.LogFields{ "message": msg, @@ -113,29 +113,43 @@ func (n *OCR3_1SerializingEndpoint[RI]) toOutboundBinaryMessage(msg protocol.Mes // OutboundBinaryMessage type and priority. switch msg := msg.(type) { case protocol.MessageNewEpochWish[RI]: - return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbm + return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbMessageForTelemetry case protocol.MessageEpochStartRequest[RI]: - return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbm + return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbMessageForTelemetry case protocol.MessageEpochStart[RI]: - return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbm + return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbMessageForTelemetry case protocol.MessageRoundStart[RI]: - return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbm + return types.OutboundBinaryMessageRequest{ + types.SingleUseSizedLimitedResponsePolicy{ + n.serializedLengthLimits.MaxLenMsgObservation, + time.Now().Add(n.publicConfig.DeltaProgress), + }, + payload, + types.BinaryMessagePriorityDefault, + }, pbMessageForTelemetry case protocol.MessageObservation[RI]: - return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbm + return msg.RequestHandle.MakeResponse(payload), pbMessageForTelemetry case protocol.MessageProposal[RI]: - return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbm + return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbMessageForTelemetry case protocol.MessagePrepare[RI]: - return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbm + return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbMessageForTelemetry case protocol.MessageCommit[RI]: - return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbm + return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbMessageForTelemetry case protocol.MessageReportSignatures[RI]: - return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbm + return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbMessageForTelemetry case protocol.MessageReportsPlusPrecursorRequest[RI]: - return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbm + return types.OutboundBinaryMessageRequest{ + types.SingleUseSizedLimitedResponsePolicy{ + n.serializedLengthLimits.MaxLenMsgReportsPlusPrecursor, + time.Now().Add(3 * n.publicConfig.GetDeltaReportsPlusPrecursorRequest()), + }, + payload, + types.BinaryMessagePriorityDefault, + }, pbMessageForTelemetry case protocol.MessageReportsPlusPrecursor[RI]: - return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityDefault}, pbm + return msg.RequestHandle.MakeResponse(payload), pbMessageForTelemetry case protocol.MessageStateSyncSummary[RI]: - return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityLow}, pbm + return types.OutboundBinaryMessagePlain{payload, types.BinaryMessagePriorityLow}, pbMessageForTelemetry case protocol.MessageBlockSyncRequest[RI]: return types.OutboundBinaryMessageRequest{ types.SingleUseSizedLimitedResponsePolicy{ @@ -144,9 +158,9 @@ func (n *OCR3_1SerializingEndpoint[RI]) toOutboundBinaryMessage(msg protocol.Mes }, payload, types.BinaryMessagePriorityLow, - }, pbm + }, pbMessageForTelemetry case protocol.MessageBlockSyncResponse[RI]: - return msg.RequestHandle.MakeResponse(payload), pbm + return msg.RequestHandle.MakeResponse(payload), pbMessageForTelemetry case protocol.MessageTreeSyncChunkRequest[RI]: return types.OutboundBinaryMessageRequest{ types.SingleUseSizedLimitedResponsePolicy{ @@ -155,9 +169,9 @@ func (n *OCR3_1SerializingEndpoint[RI]) toOutboundBinaryMessage(msg protocol.Mes }, payload, types.BinaryMessagePriorityLow, - }, pbm + }, pbMessageForTelemetry case protocol.MessageTreeSyncChunkResponse[RI]: - return msg.RequestHandle.MakeResponse(payload), pbm + return msg.RequestHandle.MakeResponse(payload), pbMessageForTelemetry case protocol.MessageBlobOffer[RI]: return types.OutboundBinaryMessageRequest{ types.SingleUseSizedLimitedResponsePolicy{ @@ -166,7 +180,7 @@ func (n *OCR3_1SerializingEndpoint[RI]) toOutboundBinaryMessage(msg protocol.Mes }, payload, types.BinaryMessagePriorityDefault, - }, pbm + }, pbMessageForTelemetry case protocol.MessageBlobChunkRequest[RI]: return types.OutboundBinaryMessageRequest{ types.SingleUseSizedLimitedResponsePolicy{ @@ -175,17 +189,17 @@ func (n *OCR3_1SerializingEndpoint[RI]) toOutboundBinaryMessage(msg protocol.Mes }, payload, types.BinaryMessagePriorityDefault, - }, pbm + }, pbMessageForTelemetry case protocol.MessageBlobChunkResponse[RI]: - return msg.RequestHandle.MakeResponse(payload), pbm + return msg.RequestHandle.MakeResponse(payload), pbMessageForTelemetry case protocol.MessageBlobOfferResponse[RI]: - return msg.RequestHandle.MakeResponse(payload), pbm + return msg.RequestHandle.MakeResponse(payload), pbMessageForTelemetry } panic("unreachable") } -func (n *OCR3_1SerializingEndpoint[RI]) fromInboundBinaryMessage(inboundBinaryMessage types.InboundBinaryMessage) (protocol.Message[RI], *serialization.MessageWrapper, error) { +func (n *OCR3_1SerializingEndpoint[RI]) fromInboundBinaryMessage(inboundBinaryMessage types.InboundBinaryMessage) (message protocol.Message[RI], pbMessageForTelemetry *serialization.MessageWrapper, err error) { var payload []byte var requestHandle types.RequestHandle switch m := inboundBinaryMessage.(type) { @@ -198,7 +212,7 @@ func (n *OCR3_1SerializingEndpoint[RI]) fromInboundBinaryMessage(inboundBinaryMe payload = m.Payload } - m, pbm, err := serialization.Deserialize[RI](n.publicConfig.N(), payload, requestHandle) + message, pbMessageForTelemetry, err = serialization.Deserialize[RI](n.publicConfig.N(), payload, requestHandle) if err != nil { return nil, nil, err } @@ -206,94 +220,94 @@ func (n *OCR3_1SerializingEndpoint[RI]) fromInboundBinaryMessage(inboundBinaryMe // Check InboundBinaryMessage type and priority. We can do this here because // for every protocol message type we know the corresponding // InboundBinaryMessage type and priority. - switch m.(type) { + switch message.(type) { case protocol.MessageNewEpochWish[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessagePlain); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessageNewEpochWish[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageNewEpochWish") + return protocol.MessageNewEpochWish[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageNewEpochWish") } case protocol.MessageEpochStartRequest[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessagePlain); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessageEpochStartRequest[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageEpochStartRequest") + return protocol.MessageEpochStartRequest[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageEpochStartRequest") } case protocol.MessageEpochStart[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessagePlain); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessageEpochStart[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageEpochStart") + return protocol.MessageEpochStart[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageEpochStart") } case protocol.MessageRoundStart[RI]: - if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessagePlain); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessageRoundStart[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageRoundStart") + if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessageRequest); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { + return protocol.MessageRoundStart[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageRoundStart") } case protocol.MessageObservation[RI]: - if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessagePlain); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessageObservation[RI]{}, pbm, fmt.Errorf("wrong type or request ID for MessageObservation") + if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessageResponse); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { + return protocol.MessageObservation[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageObservation") } case protocol.MessageProposal[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessagePlain); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessageProposal[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageProposal") + return protocol.MessageProposal[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageProposal") } case protocol.MessagePrepare[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessagePlain); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessagePrepare[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessagePrepare") + return protocol.MessagePrepare[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessagePrepare") } case protocol.MessageCommit[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessagePlain); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessageCommit[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageCommit") + return protocol.MessageCommit[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageCommit") } case protocol.MessageReportSignatures[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessagePlain); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessageReportSignatures[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageReportSignatures") + return protocol.MessageReportSignatures[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageReportSignatures") } case protocol.MessageReportsPlusPrecursorRequest[RI]: - if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessagePlain); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessageReportsPlusPrecursorRequest[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageReportsPlusPrecursorRequest") + if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessageRequest); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { + return protocol.MessageReportsPlusPrecursorRequest[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageReportsPlusPrecursorRequest") } case protocol.MessageReportsPlusPrecursor[RI]: - if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessagePlain); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessageReportsPlusPrecursor[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageReportsPlusPrecursor") + if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessageResponse); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { + return protocol.MessageReportsPlusPrecursor[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageReportsPlusPrecursor") } case protocol.MessageBlockSyncRequest[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessageRequest); !ok || ibm.Priority != types.BinaryMessagePriorityLow { - return protocol.MessageBlockSyncRequest[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageBlockSyncRequest") + return protocol.MessageBlockSyncRequest[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageBlockSyncRequest") } case protocol.MessageBlockSyncResponse[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessageResponse); !ok || ibm.Priority != types.BinaryMessagePriorityLow { - return protocol.MessageBlockSyncResponse[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageBlockSync") + return protocol.MessageBlockSyncResponse[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageBlockSync") } case protocol.MessageStateSyncSummary[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessagePlain); !ok || ibm.Priority != types.BinaryMessagePriorityLow { - return protocol.MessageStateSyncSummary[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageStateSyncSummary") + return protocol.MessageStateSyncSummary[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageStateSyncSummary") } case protocol.MessageTreeSyncChunkRequest[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessageRequest); !ok || ibm.Priority != types.BinaryMessagePriorityLow { - return protocol.MessageTreeSyncChunkRequest[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageTreeSyncRequest") + return protocol.MessageTreeSyncChunkRequest[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageTreeSyncRequest") } case protocol.MessageTreeSyncChunkResponse[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessageResponse); !ok || ibm.Priority != types.BinaryMessagePriorityLow { - return protocol.MessageTreeSyncChunkResponse[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageTreeSyncChunk") + return protocol.MessageTreeSyncChunkResponse[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageTreeSyncChunk") } case protocol.MessageBlobOffer[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessageRequest); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessageBlobOffer[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageBlobOffer") + return protocol.MessageBlobOffer[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageBlobOffer") } case protocol.MessageBlobOfferResponse[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessageResponse); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessageBlobOfferResponse[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageBlobOfferResponse") + return protocol.MessageBlobOfferResponse[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageBlobOfferResponse") } case protocol.MessageBlobChunkRequest[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessageRequest); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessageBlobChunkRequest[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageBlobChunkRequest") + return protocol.MessageBlobChunkRequest[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageBlobChunkRequest") } case protocol.MessageBlobChunkResponse[RI]: if ibm, ok := inboundBinaryMessage.(types.InboundBinaryMessageResponse); !ok || ibm.Priority != types.BinaryMessagePriorityDefault { - return protocol.MessageBlobChunkResponse[RI]{}, pbm, fmt.Errorf("wrong type or priority for MessageBlobChunkResponse") + return protocol.MessageBlobChunkResponse[RI]{}, pbMessageForTelemetry, fmt.Errorf("wrong type or priority for MessageBlobChunkResponse") } } - if !m.CheckSize(n.publicConfig.N(), n.publicConfig.F, n.pluginLimits, n.maxSigLen, n.publicConfig) { + if !message.CheckSize(n.publicConfig.N(), n.publicConfig.F, n.pluginLimits, n.maxSigLen, n.publicConfig) { return nil, nil, fmt.Errorf("message failed size check") } - return m, pbm, nil + return message, pbMessageForTelemetry, nil } // Start starts the SerializingEndpoint. It will also start the underlying endpoint. @@ -324,7 +338,9 @@ func (n *OCR3_1SerializingEndpoint[RI]) Start() error { return } - m, pbm, err := n.fromInboundBinaryMessage(raw.InboundBinaryMessage) + priority := getBinaryMessageOutboundPriorityFromInboundBinaryMessage(raw.InboundBinaryMessage) + + message, pbMessageForTelemetry, err := n.fromInboundBinaryMessage(raw.InboundBinaryMessage) if err != nil { n.logger.Error("OCR3_1SerializingEndpoint: Failed to deserialize", commontypes.LogFields{ "error": err, @@ -334,9 +350,11 @@ func (n *OCR3_1SerializingEndpoint[RI]) Start() error { n.sendTelemetry(&serialization.TelemetryWrapper{ Wrapped: &serialization.TelemetryWrapper_AssertionViolation{&serialization.TelemetryAssertionViolation{ Violation: &serialization.TelemetryAssertionViolation_InvalidSerialization{&serialization.TelemetryAssertionViolationInvalidSerialization{ - ConfigDigest: n.configDigest[:], - SerializedMsg: raw.InboundBinaryMessage.GetPayload(), - Sender: uint32(raw.Sender), + ConfigDigest: n.configDigest[:], + SerializedMsgPrefix: truncateByteSlice(raw.InboundBinaryMessage.GetPayload(), 100), + SerializedMsgLength: uint32(len(raw.InboundBinaryMessage.GetPayload())), + Sender: uint32(raw.Sender), + Priority: uint32(priority), }}, }}, UnixTimeNanoseconds: time.Now().UnixNano(), @@ -344,17 +362,19 @@ func (n *OCR3_1SerializingEndpoint[RI]) Start() error { break } + redactPbMessageForTelemetryToSaveBandwidth(pbMessageForTelemetry) n.sendTelemetry(&serialization.TelemetryWrapper{ Wrapped: &serialization.TelemetryWrapper_MessageReceived{&serialization.TelemetryMessageReceived{ ConfigDigest: n.configDigest[:], - Msg: pbm, + Msg: pbMessageForTelemetry, Sender: uint32(raw.Sender), + Priority: uint32(priority), }}, UnixTimeNanoseconds: time.Now().UnixNano(), }) select { - case n.chOut <- protocol.MessageWithSender[RI]{m, raw.Sender}: + case n.chOut <- protocol.MessageWithSender[RI]{message, raw.Sender}: case <-n.chCancel: return } @@ -392,16 +412,16 @@ func (n *OCR3_1SerializingEndpoint[RI]) Close() error { } func (n *OCR3_1SerializingEndpoint[RI]) SendTo(msg protocol.Message[RI], to commontypes.OracleID) { - oMsg, pbm := n.toOutboundBinaryMessage(msg) + oMsg, pbMessageForTelemetry := n.toOutboundBinaryMessage(msg) if oMsg != nil { n.endpoint.SendTo(oMsg, to) + redactPbMessageForTelemetryToSaveBandwidth(pbMessageForTelemetry) n.sendTelemetry(&serialization.TelemetryWrapper{ Wrapped: &serialization.TelemetryWrapper_MessageSent{&serialization.TelemetryMessageSent{ - ConfigDigest: n.configDigest[:], - Msg: pbm, - SerializedMsg: oMsg.GetPayload(), - // TODO: What about priority or message type? - Receiver: uint32(to), + ConfigDigest: n.configDigest[:], + Msg: pbMessageForTelemetry, + Receiver: uint32(to), + Priority: uint32(getBinaryMessageOutboundPriorityFromOutboundBinaryMessage(oMsg)), }}, UnixTimeNanoseconds: time.Now().UnixNano(), }) @@ -409,15 +429,15 @@ func (n *OCR3_1SerializingEndpoint[RI]) SendTo(msg protocol.Message[RI], to comm } func (n *OCR3_1SerializingEndpoint[RI]) Broadcast(msg protocol.Message[RI]) { - oMsg, pbm := n.toOutboundBinaryMessage(msg) + oMsg, pbMessageForTelemetry := n.toOutboundBinaryMessage(msg) if oMsg != nil { n.endpoint.Broadcast(oMsg) + redactPbMessageForTelemetryToSaveBandwidth(pbMessageForTelemetry) n.sendTelemetry(&serialization.TelemetryWrapper{ Wrapped: &serialization.TelemetryWrapper_MessageBroadcast{&serialization.TelemetryMessageBroadcast{ ConfigDigest: n.configDigest[:], - Msg: pbm, - // TODO: What about priority or message type? - SerializedMsg: oMsg.GetPayload(), + Msg: pbMessageForTelemetry, + Priority: uint32(getBinaryMessageOutboundPriorityFromOutboundBinaryMessage(oMsg)), }}, UnixTimeNanoseconds: time.Now().UnixNano(), }) @@ -427,3 +447,61 @@ func (n *OCR3_1SerializingEndpoint[RI]) Broadcast(msg protocol.Message[RI]) { func (n *OCR3_1SerializingEndpoint[RI]) Receive() <-chan protocol.MessageWithSender[RI] { return n.chOut } + +func redactPbMessageForTelemetryToSaveBandwidth(pbMessageForTelemetry *serialization.MessageWrapper) { + switch pbMessageForTelemetry.Msg.(type) { + case *serialization.MessageWrapper_MessageReportsPlusPrecursor: + mrpc := pbMessageForTelemetry.GetMessageReportsPlusPrecursor() + if mrpc != nil { + mrpc.ReportsPlusPrecursor = nil + } + case *serialization.MessageWrapper_MessageBlockSyncResponse: + mbsr := pbMessageForTelemetry.GetMessageBlockSyncResponse() + if mbsr != nil { + mbsr.AttestedStateTransitionBlocks = nil + } + case *serialization.MessageWrapper_MessageTreeSyncChunkResponse: + mtscr := pbMessageForTelemetry.GetMessageTreeSyncChunkResponse() + if mtscr != nil { + mtscr.KeyValues = nil + mtscr.BoundingLeaves = nil + } + case *serialization.MessageWrapper_MessageBlobChunkResponse: + mbcr := pbMessageForTelemetry.GetMessageBlobChunkResponse() + if mbcr != nil { + mbcr.Chunk = nil + mbcr.Proof = nil + } + } +} + +func getBinaryMessageOutboundPriorityFromInboundBinaryMessage(inboundBinaryMessage types.InboundBinaryMessage) types.BinaryMessageOutboundPriority { + switch inboundBinaryMessage := inboundBinaryMessage.(type) { + case types.InboundBinaryMessagePlain: + return inboundBinaryMessage.Priority + case types.InboundBinaryMessageRequest: + return inboundBinaryMessage.Priority + case types.InboundBinaryMessageResponse: + return inboundBinaryMessage.Priority + } + panic("getBinaryMessageOutboundPriorityFromInboundBinaryMessage: unreachable") +} + +func getBinaryMessageOutboundPriorityFromOutboundBinaryMessage(outboundBinaryMessage types.OutboundBinaryMessage) types.BinaryMessageOutboundPriority { + switch outboundBinaryMessage := outboundBinaryMessage.(type) { + case types.OutboundBinaryMessagePlain: + return outboundBinaryMessage.Priority + case types.OutboundBinaryMessageRequest: + return outboundBinaryMessage.Priority + case types.OutboundBinaryMessageResponse: + return outboundBinaryMessage.Priority + } + panic("getBinaryMessageOutboundPriorityFromOutboundBinaryMessage: unreachable") +} + +func truncateByteSlice(b []byte, maxLength int) []byte { + if len(b) > maxLength { + return b[:maxLength] + } + return b +} diff --git a/offchainreporting2plus/ocr3_1types/plugin.go b/offchainreporting2plus/ocr3_1types/plugin.go index 4dbaf008..b4ceda56 100644 --- a/offchainreporting2plus/ocr3_1types/plugin.go +++ b/offchainreporting2plus/ocr3_1types/plugin.go @@ -382,12 +382,43 @@ type ReportingPluginLimits struct { // A modification that resets the value of a key to its original value at // the start of StateTransition will still count towards the limit. - MaxKeyValueModifiedKeys int + // MaxKeyValueModifiedKeys upper bounds the number of modified keys inside + // the StateTransition method. A key might be modified multiple times within + // a single StateTransition, but will only count once towards the limit. A + // modification that resets the value of a key to its original value at the + // start of StateTransition will still count towards the limit. + MaxKeyValueModifiedKeys int + // MaxKeyValueModifiedKeysPlusValuesBytes upper bounds the cumulative bytes + // for all modifications to key-values inside the StateTransition method. + // For a write modification, both the key and the value count towards the + // limit. For a delete modification, only the key counts towards the limit. + // For each key, only its last modification counts towards the limit. A + // modification that resets the value of a key to its original value at the + // start of StateTransition will still count towards the limit. MaxKeyValueModifiedKeysPlusValuesBytes int - MaxBlobPayloadBytes int + // MaxBlobPayloadBytes upper bounds the payload bytes for a single blob. A + // broadcast with a larger payload will be rejected. + MaxBlobPayloadBytes int + // MaxPerOracleUnexpiredBlobCumulativePayloadBytes upper bounds the + // cumulative payload length for all unreaped blobs from a single oracle. + // Inbound broadcasts that would violate this upper bound will be rejected. + // Due to the asynchronous nature of blob reaping, an expired blob might not + // be reaped yet, and thus might still be counted towards this upper bound. + // The number of unreaped blobs eventually approximates the number of + // unexpired blobs. Consequently, you must set this value loosely, + // multiplying by a factor that accounts for a blob reaping interval in the + // tens of seconds. MaxPerOracleUnexpiredBlobCumulativePayloadBytes int - MaxPerOracleUnexpiredBlobCount int + // MaxPerOracleUnexpiredBlobCount is upper bounds the number of unreaped + // blobs from a single oracle. Inbound broadcasts that would violate this + // upper bound will be rejected. Due to the asynchronous nature of blob + // reaping, an expired blob might not be reaped yet, and thus might still be + // counted towards this upper bound. The number of unreaped blobs eventually + // approximates the number of unexpired blobs. Consequently, you must set + // this value loosely, multiplying by a factor that accounts for a blob + // reaping interval in the tens of seconds. + MaxPerOracleUnexpiredBlobCount int } //go-sumtype:decl ReportingPluginInfo diff --git a/offchainreporting2plus/types/types.go b/offchainreporting2plus/types/types.go index 4f787186..859c8785 100644 --- a/offchainreporting2plus/types/types.go +++ b/offchainreporting2plus/types/types.go @@ -24,8 +24,8 @@ type BinaryNetworkEndpoint2Config struct { BinaryNetworkEndpointLimits // Buffer sizes specified below override the values set in PeerConfig. - OverrideIncomingMessageBufferSize int - OverrideOutgoingMessageBufferSize int + OverrideIncomingMessageBufferSize *int + OverrideOutgoingMessageBufferSize *int } // BinaryNetworkEndpointFactory creates permissioned BinaryNetworkEndpoint instances.