diff --git a/go.mod b/go.mod index 0e5f7e050b0..8b9e188c923 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( code.cloudfoundry.org/clock v1.0.0 github.com/IBM/idemix v0.0.0-20220112103229-701e7610d405 github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible - github.com/SmartBFT-Go/consensus v0.0.0-20230212211744-e5a79afcea81 + github.com/SmartBFT-Go/consensus v0.0.0-20230430133422-4dca5ba006ee github.com/VictoriaMetrics/fastcache v1.9.0 github.com/bits-and-blooms/bitset v1.2.1 github.com/cheggaaa/pb v1.0.29 diff --git a/go.sum b/go.sum index fd412b50c4c..b835c867286 100644 --- a/go.sum +++ b/go.sum @@ -57,8 +57,8 @@ github.com/Microsoft/hcsshim v0.8.25/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01 github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/SmartBFT-Go/consensus v0.0.0-20230212211744-e5a79afcea81 h1:yiyJRAf/rsEu3Sl0ATWu1zREfyaj01i9VsPbGiXzZZw= -github.com/SmartBFT-Go/consensus v0.0.0-20230212211744-e5a79afcea81/go.mod h1:ZOD/ZiAdH9HpqdsJLlUTlbzYBr/qYEzyYx7wClbrH+w= +github.com/SmartBFT-Go/consensus v0.0.0-20230430133422-4dca5ba006ee h1:1/b3uHIk7nZRRJK5bkPBs/8URxSkD7xgsMZpwK3yk1A= +github.com/SmartBFT-Go/consensus v0.0.0-20230430133422-4dca5ba006ee/go.mod h1:KsqqnNjG+MiuEdm/9ufh5C0oKJqd1rkpQ5S2mYPvVcA= github.com/VictoriaMetrics/fastcache v1.9.0 h1:oMwsS6c8abz98B7ytAewQ7M1ZN/Im/iwKoE1euaFvhs= github.com/VictoriaMetrics/fastcache v1.9.0/go.mod h1:otoTS3xu+6IzF/qByjqzjp3rTuzM3Qf0ScU1UTj97iU= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= diff --git a/orderer/consensus/smartbft/chain.go b/orderer/consensus/smartbft/chain.go index 21fe5ae0f6b..54a31568d11 100644 --- a/orderer/consensus/smartbft/chain.go +++ b/orderer/consensus/smartbft/chain.go @@ -14,7 +14,9 @@ import ( "sync/atomic" "time" + "github.com/SmartBFT-Go/consensus/pkg/api" smartbft "github.com/SmartBFT-Go/consensus/pkg/consensus" + "github.com/SmartBFT-Go/consensus/pkg/metrics/disabled" "github.com/SmartBFT-Go/consensus/pkg/types" "github.com/SmartBFT-Go/consensus/pkg/wal" "github.com/SmartBFT-Go/consensus/smartbftprotos" @@ -231,7 +233,8 @@ func bftSmartConsensusBuild( return c.RuntimeConfig.Load().(RuntimeConfig).LastConfigBlock.Header.Number }, }, - Metadata: smartbftprotos.ViewMetadata{ + MetricsProvider: api.NewCustomerProvider(&disabled.Provider{}), + Metadata: &smartbftprotos.ViewMetadata{ ViewId: latestMetadata.ViewId, LatestSequence: latestMetadata.LatestSequence, DecisionsInView: latestMetadata.DecisionsInView, diff --git a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/batcher.go b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/batcher.go index 50c0011ced8..d6b97f3b6ca 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/batcher.go +++ b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/batcher.go @@ -43,7 +43,7 @@ func (b *BatchBuilder) NextBatch() [][]byte { return currBatch } - timeout := time.After(b.batchTimeout) //TODO use task-scheduler based on logical time + timeout := time.After(b.batchTimeout) // TODO use task-scheduler based on logical time for { select { @@ -70,7 +70,6 @@ func (b *BatchBuilder) Close() { case <-b.closeChan: return default: - } close(b.closeChan) } diff --git a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/controller.go b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/controller.go index 76be0e5158b..9e1405cfddb 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/controller.go +++ b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/controller.go @@ -9,6 +9,7 @@ import ( "errors" "sync" "sync/atomic" + "time" "github.com/SmartBFT-Go/consensus/pkg/api" "github.com/SmartBFT-Go/consensus/pkg/types" @@ -17,18 +18,21 @@ import ( ) // Decider delivers the proposal with signatures to the application +// //go:generate mockery -dir . -name Decider -case underscore -output ./mocks/ type Decider interface { Decide(proposal types.Proposal, signatures []types.Signature, requests []types.RequestInfo) } // FailureDetector initiates a view change when there is a complaint +// //go:generate mockery -dir . -name FailureDetector -case underscore -output ./mocks/ type FailureDetector interface { Complain(viewNum uint64, stopView bool) } // Batcher batches requests to eventually become a new proposal +// //go:generate mockery -dir . -name Batcher -case underscore -output ./mocks/ type Batcher interface { NextBatch() [][]byte @@ -38,6 +42,7 @@ type Batcher interface { } // RequestPool is a pool of client's requests +// //go:generate mockery -dir . -name RequestPool -case underscore -output ./mocks/ type RequestPool interface { Prune(predicate func([]byte) error) @@ -51,6 +56,7 @@ type RequestPool interface { } // LeaderMonitor monitors the heartbeat from the current leader +// //go:generate mockery -dir . -name LeaderMonitor -case underscore -output ./mocks/ type LeaderMonitor interface { ChangeRole(role Role, view uint64, leaderID uint64) @@ -73,6 +79,7 @@ type Proposer interface { } // ProposerBuilder builds a new Proposer +// //go:generate mockery -dir . -name ProposerBuilder -case underscore -output ./mocks/ type ProposerBuilder interface { NewProposer(leader, proposalSequence, viewNum, decisionsInView uint64, quorumSize int) Proposer @@ -105,6 +112,7 @@ type Controller struct { Collector *StateCollector State State InFlight *InFlightData + MetricsView *MetricsView quorum int currView Proposer @@ -465,9 +473,7 @@ func (c *Controller) getNextBatch() [][]byte { if c.stopped() || c.Batcher.Closed() { return nil } - for _, req := range requests { - validRequests = append(validRequests, req) - } + validRequests = append(validRequests, requests...) } return validRequests } @@ -522,7 +528,9 @@ func (c *Controller) run() { } func (c *Controller) decide(d decision) { + begin := time.Now() reconfig := c.Application.Deliver(d.proposal, d.signatures) + c.MetricsView.LatencyBatchSave.Observe(time.Since(begin).Seconds()) if reconfig.InLatestDecision { c.close() } @@ -588,7 +596,7 @@ func (c *Controller) sync() (viewNum uint64, seq uint64, decisions uint64) { if len(syncResponse.RequestDel) != 0 { c.RequestPool.Prune(func(bytes []byte) error { - return errors.New("Need all delete") + return errors.New("need all delete") }) for i := range syncResponse.RequestDel { @@ -637,7 +645,7 @@ func (c *Controller) sync() (viewNum uint64, seq uint64, decisions uint64) { c.Logger.Infof("Replicated decisions from view %d and seq %d up to view %d and sequence %d with verification sequence %d", c.currViewNumber, latestSequence, md.ViewId, md.LatestSequence, decision.Proposal.VerificationSequence) - c.maybePruneInFlight(*md) + c.maybePruneInFlight(md) view := md.ViewId newView := false @@ -674,7 +682,7 @@ func (c *Controller) sync() (viewNum uint64, seq uint64, decisions uint64) { return view, md.LatestSequence + 1, md.DecisionsInView + 1 } -func (c *Controller) maybePruneInFlight(syncResultViewMD protos.ViewMetadata) { +func (c *Controller) maybePruneInFlight(syncResultViewMD *protos.ViewMetadata) { inFlight := c.InFlight.InFlightProposal() if inFlight == nil { c.Logger.Debugf("No in-flight proposal to prune") @@ -752,7 +760,6 @@ func (c *Controller) relinquishLeaderToken() { select { case <-c.leaderToken: default: - } } @@ -842,7 +849,7 @@ func (c *Controller) Stop() { c.controllerDone.Wait() } -// Stop the controller but only stop the requests pool timers +// StopWithPoolPause the controller but only stop the requests pool timers func (c *Controller) StopWithPoolPause() { c.close() c.Batcher.Close() @@ -886,7 +893,6 @@ func (c *Controller) Decide(proposal types.Proposal, signatures []types.Signatur case <-c.deliverChan: // wait for the delivery of the decision to the application case <-c.stopChan: // If we stopped the controller, abort delivery } - } func (c *Controller) removeDeliveredFromPool(d decision) { diff --git a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/metrics.go b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/metrics.go new file mode 100644 index 00000000000..baab9b31bdc --- /dev/null +++ b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/metrics.go @@ -0,0 +1,386 @@ +package bft + +import metrics "github.com/SmartBFT-Go/consensus/pkg/api" + +const ( + nameBlackListNodeID = "blackid" + nameReasonFailAdd = "reason" + + reasonRequestMaxBytes = "MAX_BYTES" + reasonSemaphoreAcquireFail = "SEMAPHORE_ACQUIRE_FAIL" +) + +var countOfRequestPoolOpts = metrics.GaugeOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "pool_count_of_elements", + Help: "Number of elements in the consensus request pool.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var countOfFailAddRequestToPoolOpts = metrics.CounterOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "pool_count_of_fail_add_request", + Help: "Number of requests pool insertion failure.", + LabelNames: []string{nameReasonFailAdd}, + StatsdFormat: "%{#fqname}.%{" + nameReasonFailAdd + "}", +} + +// ForwardTimeout +var countOfLeaderForwardRequestOpts = metrics.CounterOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "pool_count_leader_forward_request", + Help: "Number of requests forwarded to the leader.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var countTimeoutTwoStepOpts = metrics.CounterOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "pool_count_timeout_two_step", + Help: "Number of times requests reached second timeout.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var countOfDeleteRequestPoolOpts = metrics.CounterOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "pool_count_of_delete_request", + Help: "Number of elements removed from the request pool.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var countOfRequestPoolAllOpts = metrics.CounterOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "pool_count_of_elements_all", + Help: "Total amount of elements in the request pool.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var latencyOfRequestPoolOpts = metrics.HistogramOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "pool_latency_of_elements", + Help: "The average request processing time, time request resides in the pool.", + Buckets: []float64{0.005, 0.01, 0.015, 0.05, 0.1, 1, 10}, + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +// MetricsRequestPool encapsulates request pool metrics +type MetricsRequestPool struct { + CountOfRequestPool metrics.Gauge + CountOfFailAddRequestToPool metrics.Counter + CountOfLeaderForwardRequest metrics.Counter + CountTimeoutTwoStep metrics.Counter + CountOfDeleteRequestPool metrics.Counter + CountOfRequestPoolAll metrics.Counter + LatencyOfRequestPool metrics.Histogram + + labels []string +} + +// NewMetricsRequestPool create new request pool metrics +func NewMetricsRequestPool(p *metrics.CustomerProvider) *MetricsRequestPool { + countOfRequestPoolOptsTmp := p.NewGaugeOpts(countOfRequestPoolOpts) + countOfFailAddRequestToPoolOptsTmp := p.NewCounterOpts(countOfFailAddRequestToPoolOpts) + countOfLeaderForwardRequestOptsTmp := p.NewCounterOpts(countOfLeaderForwardRequestOpts) + countTimeoutTwoStepOptsTmp := p.NewCounterOpts(countTimeoutTwoStepOpts) + countOfDeleteRequestPoolOptsTmp := p.NewCounterOpts(countOfDeleteRequestPoolOpts) + countOfRequestPoolAllOptsTmp := p.NewCounterOpts(countOfRequestPoolAllOpts) + latencyOfRequestPoolOptsTmp := p.NewHistogramOpts(latencyOfRequestPoolOpts) + return &MetricsRequestPool{ + CountOfRequestPool: p.NewGauge(countOfRequestPoolOptsTmp).With(p.LabelsForWith()...), + CountOfFailAddRequestToPool: p.NewCounter(countOfFailAddRequestToPoolOptsTmp), + CountOfLeaderForwardRequest: p.NewCounter(countOfLeaderForwardRequestOptsTmp).With(p.LabelsForWith()...), + CountTimeoutTwoStep: p.NewCounter(countTimeoutTwoStepOptsTmp).With(p.LabelsForWith()...), + CountOfDeleteRequestPool: p.NewCounter(countOfDeleteRequestPoolOptsTmp).With(p.LabelsForWith()...), + CountOfRequestPoolAll: p.NewCounter(countOfRequestPoolAllOptsTmp).With(p.LabelsForWith()...), + LatencyOfRequestPool: p.NewHistogram(latencyOfRequestPoolOptsTmp).With(p.LabelsForWith()...), + labels: p.LabelsForWith(), + } +} + +func (m *MetricsRequestPool) LabelsForWith(labelValues ...string) []string { + result := make([]string, 0, len(m.labels)+len(labelValues)) + result = append(result, labelValues...) + result = append(result, m.labels...) + return result +} + +var countBlackListOpts = metrics.GaugeOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "blacklist_count", + Help: "Count of nodes in blacklist on this channel.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var nodesInBlackListOpts = metrics.GaugeOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "node_id_in_blacklist", + Help: "Node ID in blacklist on this channel.", + LabelNames: []string{nameBlackListNodeID}, + StatsdFormat: "%{#fqname}.%{" + nameBlackListNodeID + "}", +} + +// MetricsBlacklist encapsulates blacklist metrics +type MetricsBlacklist struct { + CountBlackList metrics.Gauge + NodesInBlackList metrics.Gauge + + labels []string +} + +// NewMetricsBlacklist create new blacklist metrics +func NewMetricsBlacklist(p *metrics.CustomerProvider) *MetricsBlacklist { + countBlackListOptsTmp := p.NewGaugeOpts(countBlackListOpts) + nodesInBlackListOptsTmp := p.NewGaugeOpts(nodesInBlackListOpts) + return &MetricsBlacklist{ + CountBlackList: p.NewGauge(countBlackListOptsTmp).With(p.LabelsForWith()...), + NodesInBlackList: p.NewGauge(nodesInBlackListOptsTmp), + labels: p.LabelsForWith(), + } +} + +func (m *MetricsBlacklist) LabelsForWith(labelValues ...string) []string { + result := make([]string, 0, len(m.labels)+len(labelValues)) + result = append(result, labelValues...) + result = append(result, m.labels...) + return result +} + +var consensusReconfigOpts = metrics.CounterOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "consensus_reconfig", + Help: "Number of reconfiguration requests.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var latencySyncOpts = metrics.HistogramOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "consensus_latency_sync", + Help: "An average time it takes to sync node.", + Buckets: []float64{0.005, 0.01, 0.015, 0.05, 0.1, 1, 10}, + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +// MetricsConsensus encapsulates consensus metrics +type MetricsConsensus struct { + CountConsensusReconfig metrics.Counter + LatencySync metrics.Histogram +} + +// NewMetricsConsensus create new consensus metrics +func NewMetricsConsensus(p *metrics.CustomerProvider) *MetricsConsensus { + consensusReconfigOptsTmp := p.NewCounterOpts(consensusReconfigOpts) + latencySyncOptsTmp := p.NewHistogramOpts(latencySyncOpts) + return &MetricsConsensus{ + CountConsensusReconfig: p.NewCounter(consensusReconfigOptsTmp).With(p.LabelsForWith()...), + LatencySync: p.NewHistogram(latencySyncOptsTmp).With(p.LabelsForWith()...), + } +} + +var viewNumberOpts = metrics.GaugeOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "view_number", + Help: "The View number value.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var leaderIDOpts = metrics.GaugeOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "view_leader_id", + Help: "The leader id.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var proposalSequenceOpts = metrics.GaugeOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "view_proposal_sequence", + Help: "The sequence number within current view.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var decisionsInViewOpts = metrics.GaugeOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "view_decisions", + Help: "The number of decisions in the current view.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var phaseOpts = metrics.GaugeOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "view_phase", + Help: "Current consensus phase.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var countTxsInBatchOpts = metrics.GaugeOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "view_count_txs_in_batch", + Help: "The number of transactions per batch.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var countBatchAllOpts = metrics.CounterOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "view_count_batch_all", + Help: "Amount of batched processed.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var countTxsAllOpts = metrics.CounterOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "view_count_txs_all", + Help: "Total amount of transactions.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var sizeOfBatchOpts = metrics.CounterOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "view_size_batch", + Help: "An average batch size.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var latencyBatchProcessingOpts = metrics.HistogramOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "view_latency_batch_processing", + Help: "Amount of time it take to process batch.", + Buckets: []float64{0.005, 0.01, 0.015, 0.05, 0.1, 1, 10}, + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var latencyBatchSaveOpts = metrics.HistogramOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "view_latency_batch_save", + Help: "An average time it takes to persist batch.", + Buckets: []float64{0.005, 0.01, 0.015, 0.05, 0.1, 1, 10}, + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +// MetricsView encapsulates view metrics +type MetricsView struct { + ViewNumber metrics.Gauge + LeaderID metrics.Gauge + ProposalSequence metrics.Gauge + DecisionsInView metrics.Gauge + Phase metrics.Gauge + CountTxsInBatch metrics.Gauge + CountBatchAll metrics.Counter + CountTxsAll metrics.Counter + SizeOfBatch metrics.Counter + LatencyBatchProcessing metrics.Histogram + LatencyBatchSave metrics.Histogram +} + +// NewMetricsView create new view metrics +func NewMetricsView(p *metrics.CustomerProvider) *MetricsView { + viewNumberOptsTmp := p.NewGaugeOpts(viewNumberOpts) + leaderIDOptsTmp := p.NewGaugeOpts(leaderIDOpts) + proposalSequenceOptsTmp := p.NewGaugeOpts(proposalSequenceOpts) + decisionsInViewOptsTmp := p.NewGaugeOpts(decisionsInViewOpts) + phaseOptsTmp := p.NewGaugeOpts(phaseOpts) + countTxsInBatchOptsTmp := p.NewGaugeOpts(countTxsInBatchOpts) + countBatchAllOptsTmp := p.NewCounterOpts(countBatchAllOpts) + countTxsAllOptsTmp := p.NewCounterOpts(countTxsAllOpts) + sizeOfBatchOptsTmp := p.NewCounterOpts(sizeOfBatchOpts) + latencyBatchProcessingOptsTmp := p.NewHistogramOpts(latencyBatchProcessingOpts) + latencyBatchSaveOptsTmp := p.NewHistogramOpts(latencyBatchSaveOpts) + return &MetricsView{ + ViewNumber: p.NewGauge(viewNumberOptsTmp).With(p.LabelsForWith()...), + LeaderID: p.NewGauge(leaderIDOptsTmp).With(p.LabelsForWith()...), + ProposalSequence: p.NewGauge(proposalSequenceOptsTmp).With(p.LabelsForWith()...), + DecisionsInView: p.NewGauge(decisionsInViewOptsTmp).With(p.LabelsForWith()...), + Phase: p.NewGauge(phaseOptsTmp).With(p.LabelsForWith()...), + CountTxsInBatch: p.NewGauge(countTxsInBatchOptsTmp).With(p.LabelsForWith()...), + CountBatchAll: p.NewCounter(countBatchAllOptsTmp).With(p.LabelsForWith()...), + CountTxsAll: p.NewCounter(countTxsAllOptsTmp).With(p.LabelsForWith()...), + SizeOfBatch: p.NewCounter(sizeOfBatchOptsTmp).With(p.LabelsForWith()...), + LatencyBatchProcessing: p.NewHistogram(latencyBatchProcessingOptsTmp).With(p.LabelsForWith()...), + LatencyBatchSave: p.NewHistogram(latencyBatchSaveOptsTmp).With(p.LabelsForWith()...), + } +} + +var currentViewOpts = metrics.GaugeOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "viewchange_current_view", + Help: "current view of viewchange on this channel.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var nextViewOpts = metrics.GaugeOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "viewchange_next_view", + Help: "next view of viewchange on this channel.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +var realViewOpts = metrics.GaugeOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "viewchange_real_view", + Help: "real view of viewchange on this channel.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +// MetricsViewChange encapsulates view change metrics +type MetricsViewChange struct { + CurrentView metrics.Gauge + NextView metrics.Gauge + RealView metrics.Gauge +} + +// NewMetricsViewChange create new view change metrics +func NewMetricsViewChange(p *metrics.CustomerProvider) *MetricsViewChange { + currentViewOptsTmp := p.NewGaugeOpts(currentViewOpts) + nextViewOptsTmp := p.NewGaugeOpts(nextViewOpts) + realViewOptsTmp := p.NewGaugeOpts(realViewOpts) + return &MetricsViewChange{ + CurrentView: p.NewGauge(currentViewOptsTmp).With(p.LabelsForWith()...), + NextView: p.NewGauge(nextViewOptsTmp).With(p.LabelsForWith()...), + RealView: p.NewGauge(realViewOptsTmp).With(p.LabelsForWith()...), + } +} diff --git a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/requestpool.go b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/requestpool.go index 39b9afb5ed0..e81121ea9ff 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/requestpool.go +++ b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/requestpool.go @@ -13,6 +13,7 @@ import ( "time" "github.com/SmartBFT-Go/consensus/pkg/api" + "github.com/SmartBFT-Go/consensus/pkg/metrics/disabled" "github.com/SmartBFT-Go/consensus/pkg/types" "github.com/pkg/errors" "golang.org/x/sync/semaphore" @@ -37,13 +38,10 @@ var ( // RequestTimeoutHandler defines the methods called by request timeout timers created by time.AfterFunc. // This interface is implemented by the bft.Controller. type RequestTimeoutHandler interface { - // OnRequestTimeout is called when a request timeout expires. OnRequestTimeout(request []byte, requestInfo types.RequestInfo) - // OnLeaderFwdRequestTimeout is called when a leader forwarding timeout expires. OnLeaderFwdRequestTimeout(request []byte, requestInfo types.RequestInfo) - // OnAutoRemoveTimeout is called when a auto-remove timeout expires. OnAutoRemoveTimeout(requestInfo types.RequestInfo) } @@ -53,6 +51,7 @@ type RequestTimeoutHandler interface { // block during submit until there will be place to submit new ones. type Pool struct { logger api.Logger + metrics *MetricsRequestPool inspector api.RequestInspector options PoolOptions @@ -72,8 +71,9 @@ type Pool struct { // requestItem captures request related information type requestItem struct { - request []byte - timeout *time.Timer + request []byte + timeout *time.Timer + additionTimestamp time.Time } // PoolOptions is the pool configuration @@ -84,6 +84,7 @@ type PoolOptions struct { AutoRemoveTimeout time.Duration RequestMaxBytes uint64 SubmitTimeout time.Duration + MetricsProvider *api.CustomerProvider } // NewPool constructs new requests pool @@ -103,6 +104,9 @@ func NewPool(log api.Logger, inspector api.RequestInspector, th RequestTimeoutHa if options.SubmitTimeout == 0 { options.SubmitTimeout = defaultRequestTimeout } + if options.MetricsProvider == nil { + options.MetricsProvider = api.NewCustomerProvider(&disabled.Provider{}) + } ctx, cancel := context.WithCancel(context.Background()) @@ -110,6 +114,7 @@ func NewPool(log api.Logger, inspector api.RequestInspector, th RequestTimeoutHa cancel: cancel, timeoutHandler: th, logger: log, + metrics: NewMetricsRequestPool(options.MetricsProvider), inspector: inspector, fifo: list.New(), semaphore: semaphore.NewWeighted(options.QueueSize), @@ -182,6 +187,9 @@ func (rp *Pool) Submit(request []byte) error { } if uint64(len(request)) > rp.options.RequestMaxBytes { + rp.metrics.CountOfFailAddRequestToPool.With( + rp.metrics.LabelsForWith(nameReasonFailAdd, reasonRequestMaxBytes)..., + ).Add(1) return fmt.Errorf( "submitted request (%d) is bigger than request max bytes (%d)", len(request), @@ -208,6 +216,9 @@ func (rp *Pool) Submit(request []byte) error { defer cancel() // do not wait for a semaphore with a lock, as it will prevent draining the pool. if err := rp.semaphore.Acquire(ctx, 1); err != nil { + rp.metrics.CountOfFailAddRequestToPool.With( + rp.metrics.LabelsForWith(nameReasonFailAdd, reasonSemaphoreAcquireFail)..., + ).Add(1) return errors.Wrapf(err, "acquiring semaphore for request: %s", reqInfo) } @@ -237,11 +248,14 @@ func (rp *Pool) Submit(request []byte) error { to.Stop() } reqItem := &requestItem{ - request: reqCopy, - timeout: to, + request: reqCopy, + timeout: to, + additionTimestamp: time.Now(), } element := rp.fifo.PushBack(reqItem) + rp.metrics.CountOfRequestPool.Add(1) + rp.metrics.CountOfRequestPoolAll.Add(1) rp.existMap[reqInfo] = element if len(rp.existMap) != rp.fifo.Len() { @@ -285,7 +299,7 @@ func (rp *Pool) NextRequests(maxCount int, maxSizeBytes uint64, check bool) (bat count := minInt(rp.fifo.Len(), maxCount) var totalSize uint64 batch = make([][]byte, 0, count) - var element = rp.fifo.Front() + element := rp.fifo.Front() for i := 0; i < count; i++ { req := element.Value.(*requestItem).request reqLen := uint64(len(req)) @@ -295,7 +309,7 @@ func (rp *Pool) NextRequests(maxCount int, maxSizeBytes uint64, check bool) (bat return batch, true } batch = append(batch, req) - totalSize = totalSize + reqLen + totalSize += reqLen element = element.Next() } @@ -371,6 +385,8 @@ func (rp *Pool) deleteRequest(element *list.Element, requestInfo types.RequestIn item.timeout.Stop() rp.fifo.Remove(element) + rp.metrics.CountOfRequestPool.Add(-1) + rp.metrics.LatencyOfRequestPool.Observe(time.Since(item.additionTimestamp).Seconds()) delete(rp.existMap, requestInfo) rp.moveToDelSlice(requestInfo) rp.logger.Infof("Removed request %s from request pool", requestInfo) @@ -465,19 +481,8 @@ func (rp *Pool) RestartTimers() { rp.logger.Debugf("Restarted all timers: size=%d", len(rp.existMap)) } -func (rp *Pool) contains(reqInfo types.RequestInfo) bool { - rp.lock.Lock() - defer rp.lock.Unlock() - _, contains := rp.existMap[reqInfo] - return contains -} - // called by the goroutine spawned by time.AfterFunc func (rp *Pool) onRequestTO(request []byte, reqInfo types.RequestInfo) { - if !rp.contains(reqInfo) { - return - } - rp.lock.Lock() element, contains := rp.existMap[reqInfo] @@ -505,15 +510,12 @@ func (rp *Pool) onRequestTO(request []byte, reqInfo types.RequestInfo) { // may take time, in case Comm channel to leader is full; hence w/o the lock. rp.logger.Debugf("Request %s timeout expired, going to send to leader", reqInfo) + rp.metrics.CountOfLeaderForwardRequest.Add(1) rp.timeoutHandler.OnRequestTimeout(request, reqInfo) } // called by the goroutine spawned by time.AfterFunc func (rp *Pool) onLeaderFwdRequestTO(request []byte, reqInfo types.RequestInfo) { - if !rp.contains(reqInfo) { - return - } - rp.lock.Lock() element, contains := rp.existMap[reqInfo] @@ -541,6 +543,7 @@ func (rp *Pool) onLeaderFwdRequestTO(request []byte, reqInfo types.RequestInfo) // may take time, in case Comm channel is full; hence w/o the lock. rp.logger.Debugf("Request %s leader-forwarding timeout expired, going to complain on leader", reqInfo) + rp.metrics.CountTimeoutTwoStep.Add(1) rp.timeoutHandler.OnLeaderFwdRequestTimeout(request, reqInfo) } @@ -551,6 +554,6 @@ func (rp *Pool) onAutoRemoveTO(reqInfo types.RequestInfo) { rp.logger.Errorf("Removal of request %s failed; error: %s", reqInfo, err) return } + rp.metrics.CountOfDeleteRequestPool.Add(1) rp.timeoutHandler.OnAutoRemoveTimeout(reqInfo) - return } diff --git a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/sched.go b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/sched.go index 0e444bce201..5ca944282a5 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/sched.go +++ b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/sched.go @@ -39,6 +39,7 @@ func (h backingHeap) Len() int { func (h backingHeap) Less(i, j int) bool { return h[i].Deadline.Before(h[j].Deadline) } + func (h backingHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] } @@ -82,7 +83,7 @@ func (q *TaskQueue) Top() *Task { return (*q.h)[0] } -func (q TaskQueue) Size() int { +func (q *TaskQueue) Size() int { return q.h.Len() } @@ -132,7 +133,6 @@ func (s *Scheduler) Stop() { case <-s.stopChan: return default: - } defer s.running.Wait() close(s.stopChan) @@ -215,7 +215,6 @@ func (s *Scheduler) checkAndExecute() bool { case <-s.exec.stopChan: return } - } // Check if there is room in the executor queue by trying to enqueue into it. diff --git a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/statecollector.go b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/statecollector.go index d5a4e8e3a06..ce83d2a5529 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/statecollector.go +++ b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/statecollector.go @@ -98,7 +98,6 @@ func (s *StateCollector) CollectStateResponses() *types.ViewAndSeq { } } } - } func (s *StateCollector) collectedEnoughEqualVotes() *types.ViewAndSeq { @@ -120,11 +119,7 @@ func (s *StateCollector) collectedEnoughEqualVotes() *types.ViewAndSeq { } s.Logger.Debugf("Node %d collected a responses with view - %d and seq - %d", s.SelfID, viewAndSeq.View, viewAndSeq.Seq) s.responses.votes <- vote - if _, exist := votesMap[viewAndSeq]; exist { - votesMap[viewAndSeq]++ - } else { - votesMap[viewAndSeq] = 1 - } + votesMap[viewAndSeq]++ } for viewAndSeq, count := range votesMap { if count > uint64(s.f) { diff --git a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/support.go b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/support.go index d881e85e5ca..618f29f7a0f 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/support.go +++ b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/support.go @@ -13,24 +13,28 @@ import ( // Generate mocks for a collection of interfaces that are defined in api/dependencies.go // VerifierMock mock for the Verifier interface +// //go:generate mockery -dir . -name VerifierMock -case underscore -output ./mocks/ type VerifierMock interface { api.Verifier } // AssemblerMock mock for the Assembler interface +// //go:generate mockery -dir . -name AssemblerMock -case underscore -output ./mocks/ type AssemblerMock interface { api.Assembler } // ApplicationMock mock for the Application interface +// //go:generate mockery -dir . -name ApplicationMock -case underscore -output ./mocks/ type ApplicationMock interface { api.Application } // CommMock mock for the Comm interface +// //go:generate mockery -dir . -name CommMock -case underscore -output ./mocks/ type CommMock interface { api.Comm @@ -38,24 +42,28 @@ type CommMock interface { } // SynchronizerMock mock for the Synchronizer interface +// //go:generate mockery -dir . -name SynchronizerMock -case underscore -output ./mocks/ type SynchronizerMock interface { api.Synchronizer } // SignerMock mock for the Signer interface +// //go:generate mockery -dir . -name SignerMock -case underscore -output ./mocks/ type SignerMock interface { api.Signer } // MembershipNotifierMock mock for the MembershipNotifier interface +// //go:generate mockery -dir . -name MembershipNotifierMock -case underscore -output ./mocks/ type MembershipNotifierMock interface { api.MembershipNotifier } // Synchronizer mock for the Synchronizer interface (no return value) +// //go:generate mockery -dir . -name Synchronizer -case underscore -output ./mocks/ type Synchronizer interface { Sync() diff --git a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/util.go b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/util.go index 59cd29ae493..74f51c7f77e 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/util.go +++ b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/util.go @@ -12,6 +12,7 @@ import ( "encoding/base64" "fmt" "math" + "strconv" "sync" "sync/atomic" @@ -77,7 +78,7 @@ func MarshalOrPanic(msg proto.Message) []byte { func getLeaderID( view uint64, - N uint64, + n uint64, nodes []uint64, leaderRotation bool, decisionsInView uint64, @@ -85,17 +86,17 @@ func getLeaderID( blacklist []uint64, ) uint64 { blackListed := make(map[uint64]struct{}) - for _, n := range blacklist { - blackListed[n] = struct{}{} + for _, i := range blacklist { + blackListed[i] = struct{}{} } if !leaderRotation { - return nodes[view%N] + return nodes[view%n] } for i := 0; i < len(nodes); i++ { index := (view + (decisionsInView / decisionsPerLeader)) + uint64(i) - node := nodes[index%N] + node := nodes[index%n] _, exists := blackListed[node] if !exists { return node @@ -170,15 +171,18 @@ type incMsg struct { // // The calculation satisfies the following: // Given a cluster size of N nodes, which tolerates f failures according to: -// f = argmax ( N >= 3f+1 ) +// +// f = argmax ( N >= 3f+1 ) +// // Q is the size of the quorum such that: -// any two subsets q1, q2 of size Q, intersect in at least f+1 nodes. +// +// any two subsets q1, q2 of size Q, intersect in at least f+1 nodes. // // Note that this is different from N-f (the number of correct nodes), when N=3f+3. That is, we have two extra nodes // above the minimum required to tolerate f failures. -func computeQuorum(N uint64) (Q int, F int) { - F = int((int(N) - 1) / 3) - Q = int(math.Ceil((float64(N) + float64(F) + 1) / 2.0)) +func computeQuorum(n uint64) (q int, f int) { + f = (int(n) - 1) / 3 + q = int(math.Ceil((float64(n) + float64(f) + 1) / 2.0)) return } @@ -258,6 +262,8 @@ type ProposalMaker struct { FailureDetector FailureDetector Sync Synchronizer Logger api.Logger + MetricsBlacklist *MetricsBlacklist + MetricsView *MetricsView Comm Comm Verifier api.Verifier Signer api.Signer @@ -292,6 +298,8 @@ func (pm *ProposalMaker) NewProposer(leader, proposalSequence, viewNum, decision State: pm.State, InMsgQSize: pm.InMsqQSize, ViewSequences: pm.ViewSequences, + MetricsBlacklist: pm.MetricsBlacklist, + MetricsView: pm.MetricsView, } view.ViewSequences.Store(ViewSequence{ @@ -316,6 +324,12 @@ func (pm *ProposalMaker) NewProposer(leader, proposalSequence, viewNum, decision view.DecisionsInView = decisionsInView } + view.MetricsView.ViewNumber.Set(float64(view.Number)) + view.MetricsView.LeaderID.Set(float64(view.LeaderID)) + view.MetricsView.ProposalSequence.Set(float64(view.ProposalSequence)) + view.MetricsView.DecisionsInView.Set(float64(view.DecisionsInView)) + view.MetricsView.Phase.Set(float64(view.Phase)) + return view } @@ -412,6 +426,7 @@ type blacklist struct { currView uint64 preparesFrom map[uint64]*protos.PreparesFrom logger api.Logger + metricsBlacklist *MetricsBlacklist f int decisionsPerLeader uint64 } @@ -464,9 +479,28 @@ func (bl blacklist) computeUpdate() []uint64 { bl.logger.Infof("Blacklist changed: %v --> %v", bl.prevMD.BlackList, newBlacklist) } + newBlacklistMap := make(map[uint64]bool, len(newBlacklist)) + for _, node := range newBlacklist { + newBlacklistMap[node] = true + } + for _, node := range bl.nodes { + inBlacklist := newBlacklistMap[node] + bl.metricsBlacklist.NodesInBlackList.With( + bl.metricsBlacklist.LabelsForWith(nameBlackListNodeID, strconv.FormatUint(node, 10))..., + ).Set(btoi(inBlacklist)) + } + bl.metricsBlacklist.CountBlackList.Set(float64(len(newBlacklist))) + return newBlacklist } +func btoi(b bool) float64 { + if b { + return 1 + } + return 0 +} + // pruneBlacklist receives the previous blacklist, prepare acknowledgements from nodes, and returns // the new blacklist such that a node that was observed by more than f observers is removed from the blacklist, // and all nodes that no longer exist are also removed from the blacklist. diff --git a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/view.go b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/view.go index 57950e8610e..b6f9e9a8d1c 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/view.go +++ b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/view.go @@ -10,6 +10,7 @@ import ( "fmt" "sync" "sync/atomic" + "time" "github.com/SmartBFT-Go/consensus/pkg/api" "github.com/SmartBFT-Go/consensus/pkg/types" @@ -30,6 +31,7 @@ const ( ) // State can save and restore the state +// //go:generate mockery -dir . -name State -case underscore -output ./mocks/ type State interface { // Save saves a message. @@ -46,7 +48,7 @@ type Comm interface { BroadcastConsensus(m *protos.Message) } -type CheckpointRetriever func() (protos.Proposal, []*protos.Signature) +type CheckpointRetriever func() (*protos.Proposal, []*protos.Signature) // View is responsible for running the view protocol type View struct { @@ -72,7 +74,7 @@ type View struct { Phase Phase InMsgQSize int // Runtime - lastVotedProposalByID map[uint64]protos.Commit + lastVotedProposalByID map[uint64]*protos.Commit incMsgs chan *incMsg myProposalSig *types.Signature inFlightProposal *types.Proposal @@ -94,6 +96,9 @@ type View struct { nextPrepares *voteSet nextCommits *voteSet + beginPrePrepare time.Time + MetricsBlacklist *MetricsBlacklist + MetricsView *MetricsView blacklistSupported bool abortChan chan struct{} stopOnce sync.Once @@ -107,7 +112,7 @@ func (v *View) Start() { v.stopOnce = sync.Once{} v.incMsgs = make(chan *incMsg, v.InMsgQSize) v.abortChan = make(chan struct{}) - v.lastVotedProposalByID = make(map[uint64]protos.Commit) + v.lastVotedProposalByID = make(map[uint64]*protos.Commit) v.viewEnded.Add(1) v.prePrepare = make(chan *protos.Message, 1) @@ -273,6 +278,8 @@ func (v *View) doPhase() { default: v.Logger.Panicf("Unknown phase in view : %v", v) } + + v.MetricsView.Phase.Set(float64(v.Phase)) } func (v *View) processPrePrepare(pp *protos.PrePrepare, m *protos.Message, msgForNextProposal bool, sender uint64) { @@ -311,6 +318,16 @@ func (v *View) prepared() Phase { v.Logger.Infof("%d processed commits for proposal with seq %d", v.SelfID, seq) + v.MetricsView.CountBatchAll.Add(1) + v.MetricsView.CountTxsAll.Add(float64(len(v.inFlightRequests))) + size := 0 + size += len(proposal.Metadata) + len(proposal.Header) + len(proposal.Payload) + for i := range signatures { + size += len(signatures[i].Value) + len(signatures[i].Msg) + } + v.MetricsView.SizeOfBatch.Add(float64(size)) + v.MetricsView.LatencyBatchProcessing.Observe(time.Since(v.beginPrePrepare).Seconds()) + v.decide(proposal, signatures, v.inFlightRequests) return COMMITTED } @@ -359,6 +376,9 @@ func (v *View) processProposal() Phase { return ABORT } + v.MetricsView.CountTxsInBatch.Set(float64(len(requests))) + v.beginPrePrepare = time.Now() + seq := v.ProposalSequence prepareMessage := v.createPrepare(seq, proposal) @@ -373,7 +393,7 @@ func (v *View) processProposal() Phase { }, }, } - if err := v.State.Save(savedMsg); err != nil { + if err = v.State.Save(savedMsg); err != nil { v.Logger.Panicf("Failed to save message to state, error: %v", err) } v.lastBroadcastSent = prepareMessage @@ -469,7 +489,7 @@ func (v *View) processPrepares() Phase { // We received enough prepares to send a commit. // Save the commit message we are about to send. - if err := v.State.Save(preparedProof); err != nil { + if err = v.State.Save(preparedProof); err != nil { v.Logger.Panicf("Failed to save message to state, error: %v", err) } v.currCommitSent = proto.Clone(commitMsg).(*protos.Message) @@ -524,7 +544,7 @@ func (v *View) verifyProposal(proposal types.Proposal, prevCommits []*protos.Sig // Verify proposal's metadata is valid. md := &protos.ViewMetadata{} - if err := proto.Unmarshal(proposal.Metadata, md); err != nil { + if err = proto.Unmarshal(proposal.Metadata, md); err != nil { return nil, err } @@ -554,7 +574,7 @@ func (v *View) verifyProposal(proposal types.Proposal, prevCommits []*protos.Sig return nil, err } - if err := v.verifyBlacklist(prevCommits, expectedSeq, md.BlackList, prepareAcknowledgements); err != nil { + if err = v.verifyBlacklist(prevCommits, expectedSeq, md.BlackList, prepareAcknowledgements); err != nil { return nil, err } @@ -601,7 +621,7 @@ func (v *View) verifyPrevCommitSignatures(prevCommitSignatures []*protos.Signatu return nil, errors.Errorf("failed verifying consenter signature of %d: %v", sig.Signer, err) } prpf := &protos.PreparesFrom{} - if err := proto.Unmarshal(aux, prpf); err != nil { + if err = proto.Unmarshal(aux, prpf); err != nil { return nil, errors.Errorf("failed unmarshaling auxiliary input from %d: %v", sig.Signer, err) } prepareAcknowledgements[sig.Signer] = prpf @@ -666,6 +686,7 @@ func (v *View) verifyBlacklist(prevCommitSignatures []*protos.Signature, currVer preparesFrom: prepareAcknowledgements, f: f, logger: v.Logger, + metricsBlacklist: v.MetricsBlacklist, nodes: v.Comm.Nodes(), currView: v.Number, } @@ -734,7 +755,7 @@ func (v *View) discoverIfSyncNeeded(sender uint64, m *protos.Message) { _, f := computeQuorum(v.N) threshold := f + 1 - v.lastVotedProposalByID[sender] = *commit + v.lastVotedProposalByID[sender] = commit v.Logger.Debugf("Got commit of seq %d in view %d from %d while being in seq %d in view %d", commit.Seq, commit.View, sender, v.ProposalSequence, v.Number) @@ -828,6 +849,9 @@ func (v *View) startNextSeq() { nextSeq := v.ProposalSequence + v.MetricsView.ProposalSequence.Set(float64(v.ProposalSequence)) + v.MetricsView.DecisionsInView.Set(float64(v.DecisionsInView)) + v.Logger.Infof("Sequence: %d-->%d", prevSeq, nextSeq) // swap next prePrepare @@ -861,8 +885,10 @@ func (v *View) GetMetadata() []byte { DecisionsInView: v.DecisionsInView, } - var prevSigs []*protos.Signature - var prevProp protos.Proposal + var ( + prevSigs []*protos.Signature + prevProp *protos.Proposal + ) verificationSeq := v.Verifier.VerificationSequence() prevProp, prevSigs = v.RetrieveCheckpoint() @@ -880,7 +906,7 @@ func (v *View) GetMetadata() []byte { return MarshalOrPanic(metadata) } -func (v *View) metadataWithUpdatedBlacklist(metadata *protos.ViewMetadata, verificationSeq uint64, prevProp protos.Proposal, prevSigs []*protos.Signature) *protos.ViewMetadata { +func (v *View) metadataWithUpdatedBlacklist(metadata *protos.ViewMetadata, verificationSeq uint64, prevProp *protos.Proposal, prevSigs []*protos.Signature) *protos.ViewMetadata { var membershipChange bool if v.MembershipNotifier != nil { membershipChange = v.MembershipNotifier.MembershipChange() @@ -1006,6 +1032,7 @@ func (v *View) updateBlacklistMetadata(metadata *protos.ViewMetadata, prevSigs [ f: f, n: v.N, logger: v.Logger, + metricsBlacklist: v.MetricsBlacklist, preparesFrom: preparesFrom, decisionsPerLeader: v.DecisionsPerLeader, } diff --git a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/viewchanger.go b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/viewchanger.go index e38aff9363b..2507ce2ab83 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/internal/bft/viewchanger.go +++ b/vendor/github.com/SmartBFT-Go/consensus/internal/bft/viewchanger.go @@ -13,6 +13,7 @@ import ( "time" "github.com/SmartBFT-Go/consensus/pkg/api" + "github.com/SmartBFT-Go/consensus/pkg/metrics/disabled" "github.com/SmartBFT-Go/consensus/pkg/types" protos "github.com/SmartBFT-Go/consensus/smartbftprotos" "github.com/golang/protobuf/proto" @@ -92,17 +93,21 @@ type ViewChanger struct { backOffFactor uint64 // Runtime - Restore chan struct{} - InMsqQSize int - incMsgs chan *incMsg - viewChangeMsgs *voteSet - viewDataMsgs *voteSet - nvs *nextViews - realView uint64 - currView uint64 - nextView uint64 - startChangeChan chan *change - informChan chan uint64 + MetricsViewChange *MetricsViewChange + MetricsBlacklist *MetricsBlacklist + MetricsView *MetricsView + Restore chan struct{} + InMsqQSize int + incMsgs chan *incMsg + viewChangeMsgs *voteSet + viewDataMsgs *voteSet + nvs *nextViews + realView uint64 + currView uint64 + nextView uint64 + startChangeChan chan *change + informChan chan uint64 + committedDuringViewChange *protos.ViewMetadata stopOnce sync.Once stopChan chan struct{} @@ -117,6 +122,10 @@ func (v *ViewChanger) Start(startViewNumber uint64) { v.startChangeChan = make(chan *change, 2) v.informChan = make(chan uint64, 1) + if v.MetricsViewChange == nil { + v.MetricsViewChange = NewMetricsViewChange(api.NewCustomerProvider(&disabled.Provider{})) + } + v.quorum, v.f = computeQuorum(v.N) v.stopChan = make(chan struct{}) @@ -131,6 +140,9 @@ func (v *ViewChanger) Start(startViewNumber uint64) { v.currView = startViewNumber v.realView = v.currView v.nextView = v.currView + v.MetricsViewChange.CurrentView.Set(float64(v.currView)) + v.MetricsViewChange.RealView.Set(float64(v.realView)) + v.MetricsViewChange.NextView.Set(float64(v.nextView)) v.lastTick = time.Now() v.lastResend = v.lastTick @@ -330,6 +342,9 @@ func (v *ViewChanger) informNewView(view uint64) { v.currView = view v.realView = v.currView v.nextView = v.currView + v.MetricsViewChange.CurrentView.Set(float64(v.currView)) + v.MetricsViewChange.RealView.Set(float64(v.realView)) + v.MetricsViewChange.NextView.Set(float64(v.nextView)) v.nvs.clear() v.viewChangeMsgs.clear(v.N) v.viewDataMsgs.clear(v.N) @@ -358,6 +373,7 @@ func (v *ViewChanger) startViewChange(change *change) { return } v.nextView = v.currView + 1 + v.MetricsViewChange.NextView.Set(float64(v.nextView)) v.RequestsTimer.StopTimers() msg := &protos.Message{ Content: &protos.Message_ViewChange{ @@ -401,6 +417,7 @@ func (v *ViewChanger) processViewChangeMsg(restore bool) { } } v.currView = v.nextView + v.MetricsViewChange.CurrentView.Set(float64(v.currView)) v.viewChangeMsgs.clear(v.N) v.viewDataMsgs.clear(v.N) // clear because currView changed msg := v.prepareViewDataMsg() @@ -415,11 +432,11 @@ func (v *ViewChanger) processViewChangeMsg(restore bool) { func (v *ViewChanger) prepareViewDataMsg() *protos.Message { lastDecision, lastDecisionSignatures := v.Checkpoint.Get() - inFlight := v.getInFlight(&lastDecision) + inFlight := v.getInFlight(lastDecision) prepared := v.InFlight.IsInFlightPrepared() vd := &protos.ViewData{ NextView: v.currView, - LastDecision: &lastDecision, + LastDecision: lastDecision, LastDecisionSignatures: lastDecisionSignatures, InFlightProposal: inFlight, InFlightPrepared: prepared, @@ -458,7 +475,8 @@ func (v *ViewChanger) getInFlight(lastDecision *protos.Proposal) *protos.Proposa VerificationSequence: uint64(inFlight.VerificationSequence), } if lastDecision == nil { - v.Logger.Panicf("￿The given last decision is nil", v.SelfID) + v.Logger.Panicf("%d The given last decision is nil", v.SelfID) + return nil } if lastDecision.Metadata == nil { return proposal // this is the first proposal after genesis @@ -471,8 +489,11 @@ func (v *ViewChanger) getInFlight(lastDecision *protos.Proposal) *protos.Proposa v.Logger.Debugf("Node %d's in flight proposal and the last decision has the same sequence: %d", v.SelfID, inFlightMetadata.LatestSequence) return nil // this is not an actual in flight proposal } - if inFlightMetadata.LatestSequence != lastDecisionMetadata.LatestSequence+1 { - v.Logger.Panicf("Node %d's in flight proposal sequence is %d while its last decision sequence is %d", v.SelfID, inFlightMetadata.LatestSequence, lastDecisionMetadata.LatestSequence) + if inFlightMetadata.LatestSequence+1 == lastDecisionMetadata.LatestSequence && v.committedDuringViewChange != nil && + v.committedDuringViewChange.LatestSequence == lastDecisionMetadata.LatestSequence { + v.Logger.Infof("Node %d's in flight proposal sequence is %d while already committed decision %d, "+ + "but that is because it committed it during the view change", v.SelfID, inFlightMetadata.LatestSequence, lastDecisionMetadata.LatestSequence) + return nil } return proposal } @@ -618,6 +639,14 @@ func (v *ViewChanger) checkLastDecision(svd *protos.SignedViewData, sender uint6 } v.deliverDecision(proposal, signatures) + // Make note that we have advanced the sequence during a view change, + // so our in-flight sequence may be behind. + md := &protos.ViewMetadata{} + if err := proto.Unmarshal(proposal.Metadata, md); err != nil { + v.Logger.Panicf("Node %d got %s from %d, but was unable to unmarshal proposal metadata, err: %v", v.SelfID, signedViewDataToString(svd), sender, err) + } + v.committedDuringViewChange = md + select { // if there was a delivery with a reconfig we need to stop here before verify signature case <-v.stopChan: return false, 0 @@ -640,12 +669,12 @@ func (v *ViewChanger) extractCurrentSequence() (uint64, *protos.Proposal) { myMetadata := &protos.ViewMetadata{} myLastDesicion, _ := v.Checkpoint.Get() if myLastDesicion.Metadata == nil { - return 0, &myLastDesicion + return 0, myLastDesicion } if err := proto.Unmarshal(myLastDesicion.Metadata, myMetadata); err != nil { v.Logger.Panicf("Node %d is unable to unmarshal its own last decision metadata from checkpoint, err: %v", v.SelfID, err) } - return myMetadata.LatestSequence, &myLastDesicion + return myMetadata.LatestSequence, myLastDesicion } // ValidateLastDecision validates the given decision, and returns its sequence when valid @@ -1129,6 +1158,7 @@ func (v *ViewChanger) processNewViewMsg(msg *protos.NewView) { } v.realView = v.currView + v.MetricsViewChange.RealView.Set(float64(v.realView)) v.nvs.clear() v.Controller.ViewChanged(v.currView, mySequence+1) @@ -1174,6 +1204,7 @@ func (v *ViewChanger) commitInFlightProposal(proposal *protos.Proposal) (success myLastDecision, _ := v.Checkpoint.Get() if proposal == nil { v.Logger.Panicf("The in flight proposal is nil") + return } proposalMD := &protos.ViewMetadata{} if err := proto.Unmarshal(proposal.Metadata, proposalMD); err != nil { @@ -1187,8 +1218,8 @@ func (v *ViewChanger) commitInFlightProposal(proposal *protos.Proposal) (success } if lastDecisionMD.LatestSequence == proposalMD.LatestSequence { v.Logger.Debugf("Node %d already decided on sequence %d and so it will not commit the in flight proposal with the same sequence", v.SelfID, lastDecisionMD.LatestSequence) - v.Logger.Debugf("Node %d is comparing its last decision with the in flight proposal with the same sequence", v.SelfID, lastDecisionMD.LatestSequence) - if !proto.Equal(&myLastDecision, proposal) { + v.Logger.Debugf("Node %d is comparing its last decision with the in flight proposal with the same sequence %d", v.SelfID, lastDecisionMD.LatestSequence) + if !proto.Equal(myLastDecision, proposal) { v.Logger.Warnf("Node %d compared its last decision with the in flight proposal, which has the same sequence, but they are not equal", v.SelfID) return false } @@ -1199,7 +1230,7 @@ func (v *ViewChanger) commitInFlightProposal(proposal *protos.Proposal) (success } } - v.Logger.Debugf("Node %d is creating a view for the in flight proposal", v.SelfID) + v.Logger.Debugf("Node %d is creating a view %d for the in flight proposal", v.SelfID, proposalMD.ViewId) inFlightViewNum := proposalMD.ViewId inFlightViewLatestSeq := proposalMD.LatestSequence @@ -1225,7 +1256,15 @@ func (v *ViewChanger) commitInFlightProposal(proposal *protos.Proposal) (success InMsgQSize: v.InMsqQSize, ViewSequences: v.ViewSequences, Phase: PREPARED, + MetricsBlacklist: v.MetricsBlacklist, + MetricsView: v.MetricsView, } + inFlightView.MetricsView.ViewNumber.Set(float64(inFlightView.Number)) + inFlightView.MetricsView.LeaderID.Set(float64(inFlightView.LeaderID)) + inFlightView.MetricsView.ProposalSequence.Set(float64(inFlightView.ProposalSequence)) + inFlightView.MetricsView.DecisionsInView.Set(float64(inFlightView.DecisionsInView)) + inFlightView.MetricsView.Phase.Set(float64(inFlightView.Phase)) + v.inFlightView = inFlightView v.inFlightView.inFlightProposal = &types.Proposal{ VerificationSequence: int64(proposal.VerificationSequence), @@ -1258,7 +1297,7 @@ func (v *ViewChanger) commitInFlightProposal(proposal *protos.Proposal) (success v.inFlightViewLock.Unlock() - v.Logger.Debugf("Node %d started a view for the in flight proposal", v.SelfID) + v.Logger.Debugf("Node %d started a view %d for the in flight proposal", v.SelfID, v.inFlightView.Number) // wait for view to finish or time out for { diff --git a/vendor/github.com/SmartBFT-Go/consensus/pkg/api/dependencies.go b/vendor/github.com/SmartBFT-Go/consensus/pkg/api/dependencies.go index cfab37e929b..12cc9a3f4d1 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/pkg/api/dependencies.go +++ b/vendor/github.com/SmartBFT-Go/consensus/pkg/api/dependencies.go @@ -36,7 +36,7 @@ type Assembler interface { AssembleProposal(metadata []byte, requests [][]byte) bft.Proposal } -// WriteAheadLog is a write ahead log. +// WriteAheadLog is write ahead log. type WriteAheadLog interface { // Append appends a data item to the end of the WAL // and indicate whether this entry is a truncation point. @@ -72,7 +72,7 @@ type Verifier interface { // MembershipNotifier notifies if there was a membership change in the last proposal. type MembershipNotifier interface { - //MembershipChange returns true if there was a membership change in the last proposal. + // MembershipChange returns true if there was a membership change in the last proposal. MembershipChange() bool } diff --git a/vendor/github.com/SmartBFT-Go/consensus/pkg/api/metrics.go b/vendor/github.com/SmartBFT-Go/consensus/pkg/api/metrics.go new file mode 100644 index 00000000000..c59e0b2e60c --- /dev/null +++ b/vendor/github.com/SmartBFT-Go/consensus/pkg/api/metrics.go @@ -0,0 +1,272 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package api + +import ( + "fmt" + "sort" +) + +// CustomerProvider encapsulates provider and labels +type CustomerProvider struct { + Provider + labels map[string]string +} + +// NewCustomerProvider create new provide for metrics +func NewCustomerProvider(mp Provider, labelValues ...string) *CustomerProvider { + return &CustomerProvider{ + Provider: mp, + labels: labelsToMap(labelValues), + } +} + +func (c *CustomerProvider) NewGaugeOpts(old GaugeOpts) GaugeOpts { + return GaugeOpts{ + Namespace: old.Namespace, + Subsystem: old.Subsystem, + Name: old.Name, + Help: old.Help, + LabelNames: c.makeLabelNames(old.LabelNames...), + LabelHelp: old.LabelHelp, + StatsdFormat: c.makeStatsdFormat(old.StatsdFormat), + } +} + +func (c *CustomerProvider) NewCounterOpts(old CounterOpts) CounterOpts { + return CounterOpts{ + Namespace: old.Namespace, + Subsystem: old.Subsystem, + Name: old.Name, + Help: old.Help, + LabelNames: c.makeLabelNames(old.LabelNames...), + LabelHelp: old.LabelHelp, + StatsdFormat: c.makeStatsdFormat(old.StatsdFormat), + } +} + +func (c *CustomerProvider) NewHistogramOpts(old HistogramOpts) HistogramOpts { + return HistogramOpts{ + Namespace: old.Namespace, + Subsystem: old.Subsystem, + Name: old.Name, + Help: old.Help, + Buckets: old.Buckets, + LabelNames: c.makeLabelNames(old.LabelNames...), + LabelHelp: old.LabelHelp, + StatsdFormat: c.makeStatsdFormat(old.StatsdFormat), + } +} + +func (c *CustomerProvider) LabelsForWith(labelValues ...string) []string { + result := make([]string, 0, len(labelValues)+len(c.labels)*2) + result = append(result, labelValues...) + for _, s := range c.getLabels() { + result = append(result, s, c.labels[s]) + } + return result +} + +func (c *CustomerProvider) makeStatsdFormat(str string) string { + for _, s := range c.getLabels() { + str += fmt.Sprintf(".%%{%s}", s) + } + + return str +} + +func (c *CustomerProvider) makeLabelNames(names ...string) []string { + ln := make([]string, 0, len(names)+len(c.labels)) + ln = append(ln, names...) + ln = append(ln, c.getLabels()...) + return ln +} + +func (c *CustomerProvider) getLabels() []string { + lbs := make([]string, 0, len(c.labels)) + for l := range c.labels { + lbs = append(lbs, l) + } + sort.Strings(lbs) + + return lbs +} + +func labelsToMap(labelValues []string) map[string]string { + labels := make(map[string]string) + for i := 0; i < len(labelValues); i += 2 { + key := labelValues[i] + if i == len(labelValues)-1 { + labels[key] = "unknown" + } else { + labels[key] = labelValues[i+1] + } + } + return labels +} + +// A Provider is an abstraction for a metrics provider. It is a factory for +// Counter, Gauge, and Histogram meters. +type Provider interface { + // NewCounter creates a new instance of a Counter. + NewCounter(CounterOpts) Counter + // NewGauge creates a new instance of a Gauge. + NewGauge(GaugeOpts) Gauge + // NewHistogram creates a new instance of a Histogram. + NewHistogram(HistogramOpts) Histogram +} + +// A Counter represents a monotonically increasing value. +type Counter interface { + // With is used to provide label values when updating a Counter. This must be + // used to provide values for all LabelNames provided to CounterOpts. + With(labelValues ...string) Counter + + // Add increments a counter value. + Add(delta float64) +} + +// CounterOpts is used to provide basic information about a counter to the +// metrics subsystem. +type CounterOpts struct { + // Namespace, Subsystem, and Name are components of the fully-qualified name + // of the Metric. The fully-qualified aneme is created by joining these + // components with an appropriate separator. Only Name is mandatory, the + // others merely help structuring the name. + Namespace string + Subsystem string + Name string + + // Help provides information about this metric. + Help string + + // LabelNames provides the names of the labels that can be attached to this + // metric. When a metric is recorded, label values must be provided for each + // of these label names. + LabelNames []string + + // LabelHelp provides help information for labels. When set, this information + // will be used to populate the documentation. + LabelHelp map[string]string + + // StatsdFormat determines how the fully-qualified statsd bucket name is + // constructed from Namespace, Subsystem, Name, and Labels. This is done by + // including field references in `%{reference}` escape sequences. + // + // The following reference names are supported: + // - #namespace - the value of Namespace + // - #subsystem - the value of Subsystem + // - #name - the value of Name + // - #fqname - the fully-qualified metric name + // - label_name - the value associated with the named label + // + // The result of the formatting must be a valid statsd bucket name. + StatsdFormat string +} + +// A Gauge is a meter that expresses the current value of some metric. +type Gauge interface { + // With is used to provide label values when recording a Gauge value. This + // must be used to provide values for all LabelNames provided to GaugeOpts. + With(labelValues ...string) Gauge + + // Add increments a Gauge value. + Add(delta float64) // TODO: consider removing + + // Set is used to update the current value associated with a Gauge. + Set(value float64) +} + +// GaugeOpts is used to provide basic information about a gauge to the +// metrics subsystem. +type GaugeOpts struct { + // Namespace, Subsystem, and Name are components of the fully-qualified name + // of the Metric. The fully-qualified aneme is created by joining these + // components with an appropriate separator. Only Name is mandatory, the + // others merely help structuring the name. + Namespace string + Subsystem string + Name string + + // Help provides information about this metric. + Help string + + // LabelNames provides the names of the labels that can be attached to this + // metric. When a metric is recorded, label values must be provided for each + // of these label names. + LabelNames []string + + // LabelHelp provides help information for labels. When set, this information + // will be used to populate the documentation. + LabelHelp map[string]string + + // StatsdFormat determines how the fully-qualified statsd bucket name is + // constructed from Namespace, Subsystem, Name, and Labels. This is done by + // including field references in `%{reference}` escape sequences. + // + // The following reference names are supported: + // - #namespace - the value of Namespace + // - #subsystem - the value of Subsystem + // - #name - the value of Name + // - #fqname - the fully-qualified metric name + // - label_name - the value associated with the named label + // + // The result of the formatting must be a valid statsd bucket name. + StatsdFormat string +} + +// A Histogram is a meter that records an observed value into quantized +// buckets. +type Histogram interface { + // With is used to provide label values when recording a Histogram + // observation. This must be used to provide values for all LabelNames + // provided to HistogramOpts. + With(labelValues ...string) Histogram + Observe(value float64) +} + +// HistogramOpts is used to provide basic information about a histogram to the +// metrics subsystem. +type HistogramOpts struct { + // Namespace, Subsystem, and Name are components of the fully-qualified name + // of the Metric. The fully-qualified aneme is created by joining these + // components with an appropriate separator. Only Name is mandatory, the + // others merely help structuring the name. + Namespace string + Subsystem string + Name string + + // Help provides information about this metric. + Help string + + // Buckets can be used to provide the bucket boundaries for Prometheus. When + // omitted, the default Prometheus bucket values are used. + Buckets []float64 + + // LabelNames provides the names of the labels that can be attached to this + // metric. When a metric is recorded, label values must be provided for each + // of these label names. + LabelNames []string + + // LabelHelp provides help information for labels. When set, this information + // will be used to populate the documentation. + LabelHelp map[string]string + + // StatsdFormat determines how the fully-qualified statsd bucket name is + // constructed from Namespace, Subsystem, Name, and Labels. This is done by + // including field references in `%{reference}` escape sequences. + // + // The following reference names are supported: + // - #namespace - the value of Namespace + // - #subsystem - the value of Subsystem + // - #name - the value of Name + // - #fqname - the fully-qualified metric name + // - label_name - the value associated with the named label + // + // The result of the formatting must be a valid statsd bucket name. + StatsdFormat string +} diff --git a/vendor/github.com/SmartBFT-Go/consensus/pkg/consensus/consensus.go b/vendor/github.com/SmartBFT-Go/consensus/pkg/consensus/consensus.go index 05c13ce9e63..bb836e6981a 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/pkg/consensus/consensus.go +++ b/vendor/github.com/SmartBFT-Go/consensus/pkg/consensus/consensus.go @@ -12,12 +12,12 @@ import ( "sync/atomic" "time" - "github.com/golang/protobuf/proto" - algorithm "github.com/SmartBFT-Go/consensus/internal/bft" bft "github.com/SmartBFT-Go/consensus/pkg/api" + "github.com/SmartBFT-Go/consensus/pkg/metrics/disabled" "github.com/SmartBFT-Go/consensus/pkg/types" protos "github.com/SmartBFT-Go/consensus/smartbftprotos" + "github.com/golang/protobuf/proto" "github.com/pkg/errors" ) @@ -37,7 +37,8 @@ type Consensus struct { RequestInspector bft.RequestInspector Synchronizer bft.Synchronizer Logger bft.Logger - Metadata protos.ViewMetadata + MetricsProvider *bft.CustomerProvider + Metadata *protos.ViewMetadata LastProposal types.Proposal LastSignatures []types.Signature Scheduler <-chan time.Time @@ -61,7 +62,10 @@ type Consensus struct { consensusLock sync.RWMutex - reconfigChan chan types.Reconfig + reconfigChan chan types.Reconfig + metricsBlacklist *algorithm.MetricsBlacklist + metricsConsensus *algorithm.MetricsConsensus + metricsView *algorithm.MetricsView running uint64 } @@ -82,7 +86,9 @@ func (c *Consensus) Deliver(proposal types.Proposal, signatures []types.Signatur } func (c *Consensus) Sync() types.SyncResponse { + begin := time.Now() syncResponse := c.Synchronizer.Sync() + c.metricsConsensus.LatencySync.Observe(time.Since(begin).Seconds()) if syncResponse.Reconfig.InReplicatedDecisions { c.Logger.Debugf("Detected a reconfig in sync") c.reconfigChan <- types.Reconfig{ @@ -107,6 +113,13 @@ func (c *Consensus) Start() error { return errors.Wrapf(err, "configuration is invalid") } + if c.MetricsProvider == nil { + c.MetricsProvider = bft.NewCustomerProvider(&disabled.Provider{}) + } + c.metricsConsensus = algorithm.NewMetricsConsensus(c.MetricsProvider) + c.metricsBlacklist = algorithm.NewMetricsBlacklist(c.MetricsProvider) + c.metricsView = algorithm.NewMetricsView(c.MetricsProvider) + c.consensusDone.Add(1) c.stopOnce = sync.Once{} c.stopChan = make(chan struct{}) @@ -136,6 +149,7 @@ func (c *Consensus) Start() error { AutoRemoveTimeout: c.Config.RequestAutoRemoveTimeout, RequestMaxBytes: c.Config.RequestMaxBytes, SubmitTimeout: c.Config.RequestPoolSubmitTimeout, + MetricsProvider: c.MetricsProvider, } c.submittedChan = make(chan struct{}, 1) c.Pool = algorithm.NewPool(c.Logger, c.RequestInspector, c.controller, opts, c.submittedChan) @@ -204,9 +218,8 @@ func (c *Consensus) reconfig(reconfig types.Reconfig) { c.close() c.Logger.Infof("Closing consensus since this node is not in the current set of nodes") return - } else { - c.Logger.Panicf("Configuration is invalid, error: %v", err) } + c.Logger.Panicf("Configuration is invalid, error: %v", err) } c.setNodes(reconfig.CurrentNodes) @@ -237,6 +250,8 @@ func (c *Consensus) reconfig(reconfig types.Reconfig) { c.Pool.RestartTimers() + c.metricsConsensus.CountConsensusReconfig.Add(1) + c.Logger.Debugf("Reconfig is done") } @@ -297,6 +312,8 @@ func (c *Consensus) proposalMaker() *algorithm.ProposalMaker { Comm: c.controller, Decider: c.controller, Logger: c.Logger, + MetricsBlacklist: c.metricsBlacklist, + MetricsView: c.metricsView, Signer: c.Signer, MembershipNotifier: c.MembershipNotifier, SelfID: c.Config.SelfID, @@ -374,6 +391,9 @@ func (c *Consensus) createComponents() { ResendTimeout: c.Config.ViewChangeResendInterval, ViewChangeTimeout: c.Config.ViewChangeTimeout, InMsqQSize: int(c.Config.IncomingMessageBufferSize), + MetricsViewChange: algorithm.NewMetricsViewChange(c.MetricsProvider), + MetricsBlacklist: c.metricsBlacklist, + MetricsView: c.metricsView, } c.collector = &algorithm.StateCollector{ @@ -405,6 +425,7 @@ func (c *Consensus) createComponents() { Collector: c.collector, State: c.state, InFlight: c.inFlight, + MetricsView: c.metricsView, } c.viewChanger.Application = &algorithm.MutuallyExclusiveDeliver{C: c.controller} c.viewChanger.Comm = c.controller @@ -443,15 +464,13 @@ func (c *Consensus) setViewAndSeq(view, seq, dec uint64) (newView, newSeq, newDe } if viewChange == nil { c.Logger.Debugf("No view change to restore") - } else { + } else if viewChange.NextView >= view { // Check if the view change has a newer view - if viewChange.NextView >= view { - c.Logger.Debugf("Restoring from view change with view %d", viewChange.NextView) - newView = viewChange.NextView - restoreChan := make(chan struct{}, 1) - restoreChan <- struct{}{} - c.viewChanger.Restore = restoreChan - } + c.Logger.Debugf("Restoring from view change with view %d", viewChange.NextView) + newView = viewChange.NextView + restoreChan := make(chan struct{}, 1) + restoreChan <- struct{}{} + c.viewChanger.Restore = restoreChan } viewSeq, err := c.state.LoadNewViewIfApplicable() @@ -460,14 +479,12 @@ func (c *Consensus) setViewAndSeq(view, seq, dec uint64) (newView, newSeq, newDe } if viewSeq == nil { c.Logger.Debugf("No new view to restore") - } else { + } else if viewSeq.Seq >= seq { // Check if metadata should be taken from the restored new view - if viewSeq.Seq >= seq { - c.Logger.Debugf("Restoring from new view with view %d and seq %d", viewSeq.View, viewSeq.Seq) - newView = viewSeq.View - newSeq = viewSeq.Seq - newDec = 0 - } + c.Logger.Debugf("Restoring from new view with view %d and seq %d", viewSeq.View, viewSeq.Seq) + newView = viewSeq.View + newSeq = viewSeq.Seq + newDec = 0 } return newView, newSeq, newDec } diff --git a/vendor/github.com/SmartBFT-Go/consensus/pkg/metrics/disabled/provider.go b/vendor/github.com/SmartBFT-Go/consensus/pkg/metrics/disabled/provider.go new file mode 100644 index 00000000000..e6babb97f65 --- /dev/null +++ b/vendor/github.com/SmartBFT-Go/consensus/pkg/metrics/disabled/provider.go @@ -0,0 +1,39 @@ +/* +Copyright IBM Corp. All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ + +package disabled + +import ( + bft "github.com/SmartBFT-Go/consensus/pkg/api" +) + +type Provider struct{} + +func (p *Provider) NewCounter(bft.CounterOpts) bft.Counter { return &Counter{} } +func (p *Provider) NewGauge(bft.GaugeOpts) bft.Gauge { return &Gauge{} } +func (p *Provider) NewHistogram(bft.HistogramOpts) bft.Histogram { return &Histogram{} } + +type Counter struct{} + +func (c *Counter) Add(float64) {} +func (c *Counter) With(...string) bft.Counter { + return c +} + +type Gauge struct{} + +func (g *Gauge) Add(float64) {} +func (g *Gauge) Set(float64) {} +func (g *Gauge) With(...string) bft.Gauge { + return g +} + +type Histogram struct{} + +func (h *Histogram) Observe(float64) {} +func (h *Histogram) With(...string) bft.Histogram { + return h +} diff --git a/vendor/github.com/SmartBFT-Go/consensus/pkg/types/types.go b/vendor/github.com/SmartBFT-Go/consensus/pkg/types/types.go index 82c2ccc27a6..c58eb3874d1 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/pkg/types/types.go +++ b/vendor/github.com/SmartBFT-Go/consensus/pkg/types/types.go @@ -54,7 +54,6 @@ func (p Proposal) Digest() string { Payload: p.Payload, Header: p.Header, }) - if err != nil { panic(fmt.Sprintf("failed marshaling proposal: %v", err)) } @@ -75,18 +74,18 @@ type Checkpoint struct { signatures []Signature } -func (c *Checkpoint) Get() (smartbftprotos.Proposal, []*smartbftprotos.Signature) { +func (c *Checkpoint) Get() (*smartbftprotos.Proposal, []*smartbftprotos.Signature) { c.lock.RLock() defer c.lock.RUnlock() - p := smartbftprotos.Proposal{ + p := &smartbftprotos.Proposal{ Header: c.proposal.Header, Payload: c.proposal.Payload, Metadata: c.proposal.Metadata, VerificationSequence: uint64(c.proposal.VerificationSequence), } - var signatures []*smartbftprotos.Signature + signatures := make([]*smartbftprotos.Signature, 0, len(c.signatures)) for _, sig := range c.signatures { signatures = append(signatures, &smartbftprotos.Signature{ Msg: sig.Msg, diff --git a/vendor/github.com/SmartBFT-Go/consensus/pkg/wal/metrics.go b/vendor/github.com/SmartBFT-Go/consensus/pkg/wal/metrics.go new file mode 100644 index 00000000000..16559e81f70 --- /dev/null +++ b/vendor/github.com/SmartBFT-Go/consensus/pkg/wal/metrics.go @@ -0,0 +1,25 @@ +package wal + +import metrics "github.com/SmartBFT-Go/consensus/pkg/api" + +var countOfFilesOpts = metrics.GaugeOpts{ + Namespace: "consensus", + Subsystem: "bft", + Name: "wal_count_of_files", + Help: "Count of wal-files.", + LabelNames: []string{}, + StatsdFormat: "%{#fqname}", +} + +// Metrics encapsulates wal metrics +type Metrics struct { + CountOfFiles metrics.Gauge +} + +// NewMetrics create new wal metrics +func NewMetrics(p *metrics.CustomerProvider) *Metrics { + countOfFilesOptsTmp := p.NewGaugeOpts(countOfFilesOpts) + return &Metrics{ + CountOfFiles: p.NewGauge(countOfFilesOptsTmp).With(p.LabelsForWith()...), + } +} diff --git a/vendor/github.com/SmartBFT-Go/consensus/pkg/wal/util.go b/vendor/github.com/SmartBFT-Go/consensus/pkg/wal/util.go index f8b3cbf4d62..582cdce0807 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/pkg/wal/util.go +++ b/vendor/github.com/SmartBFT-Go/consensus/pkg/wal/util.go @@ -9,7 +9,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" "path/filepath" "sort" @@ -85,7 +84,7 @@ func dirReadWalNames(dirPath string) ([]string, error) { } // checkWalFiles for continuous sequence, readable CRC-Anchor. -// If the the last file cannot be read, it may be ignored, (or repaired). +// If the last file cannot be read, it may be ignored, (or repaired). func checkWalFiles(logger api.Logger, dirName string, walNames []string) ([]uint64, error) { sort.Strings(walNames) @@ -162,12 +161,12 @@ func parseWalFileName(fileName string) (index uint64, err error) { } func copyFile(source, target string) error { - input, err := ioutil.ReadFile(source) + input, err := os.ReadFile(source) if err != nil { return err } - return ioutil.WriteFile(target, input, 0644) + return os.WriteFile(target, input, 0o644) } func truncateCloseFile(f *os.File, offset int64) error { diff --git a/vendor/github.com/SmartBFT-Go/consensus/pkg/wal/writeaheadlog.go b/vendor/github.com/SmartBFT-Go/consensus/pkg/wal/writeaheadlog.go index a4e51cc81aa..228260684da 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/pkg/wal/writeaheadlog.go +++ b/vendor/github.com/SmartBFT-Go/consensus/pkg/wal/writeaheadlog.go @@ -16,6 +16,7 @@ import ( "sync" "github.com/SmartBFT-Go/consensus/pkg/api" + "github.com/SmartBFT-Go/consensus/pkg/metrics/disabled" protos "github.com/SmartBFT-Go/consensus/smartbftprotos" "github.com/golang/protobuf/proto" "github.com/pkg/errors" @@ -25,8 +26,8 @@ const ( walFileSuffix string = ".wal" walFileTemplate = "%016x" + walFileSuffix - walFilePermPrivateRW os.FileMode = 0600 - walDirPermPrivateRWX os.FileMode = 0700 + walFilePermPrivateRW os.FileMode = 0o600 + walDirPermPrivateRWX os.FileMode = 0o700 recordHeaderSize int = 8 recordLengthMask uint64 = 0x00000000FFFFFFFF @@ -76,12 +77,12 @@ type LogRecordHeader uint64 // // In append mode the WAL can accept Append() and TruncateTo() calls. // The WAL must be closed after use to release all resources. -// type WriteAheadLogFile struct { dirName string options *Options - logger api.Logger + logger api.Logger + metrics *Metrics mutex sync.Mutex dirFile *os.File @@ -98,6 +99,7 @@ type WriteAheadLogFile struct { type Options struct { FileSizeBytes int64 BufferSizeBytes int64 + MetricsProvider *api.CustomerProvider } // DefaultOptions returns the set of default options. @@ -105,6 +107,7 @@ func DefaultOptions() *Options { return &Options{ FileSizeBytes: FileSizeBytesDefault, BufferSizeBytes: BufferSizeBytesDefault, + MetricsProvider: api.NewCustomerProvider(&disabled.Provider{}), } } @@ -130,7 +133,15 @@ func Create(logger api.Logger, dirPath string, options *Options) (*WriteAheadLog opt := DefaultOptions() if options != nil { - opt = options + if options.MetricsProvider != nil { + opt.MetricsProvider = options.MetricsProvider + } + if options.FileSizeBytes != 0 { + opt.FileSizeBytes = options.FileSizeBytes + } + if options.BufferSizeBytes != 0 { + opt.BufferSizeBytes = options.BufferSizeBytes + } } // TODO BACKLOG: create the directory & file atomically by creation in a temp dir and renaming @@ -145,6 +156,7 @@ func Create(logger api.Logger, dirPath string, options *Options) (*WriteAheadLog dirName: cleanDirName, options: opt, logger: logger, + metrics: NewMetrics(opt.MetricsProvider), index: 1, headerBuff: make([]byte, 8), dataBuff: proto.NewBuffer(make([]byte, opt.BufferSizeBytes)), @@ -152,6 +164,7 @@ func Create(logger api.Logger, dirPath string, options *Options) (*WriteAheadLog truncateIndex: 1, activeIndexes: []uint64{1}, } + wal.metrics.CountOfFiles.Set(float64(len(wal.activeIndexes))) wal.dirFile, err = os.Open(cleanDirName) if err != nil { @@ -208,7 +221,15 @@ func Open(logger api.Logger, dirPath string, options *Options) (*WriteAheadLogFi opt := DefaultOptions() if options != nil { - opt = options + if options.MetricsProvider != nil { + opt.MetricsProvider = options.MetricsProvider + } + if options.FileSizeBytes != 0 { + opt.FileSizeBytes = options.FileSizeBytes + } + if options.BufferSizeBytes != 0 { + opt.BufferSizeBytes = options.BufferSizeBytes + } } cleanDirName := filepath.Clean(dirPath) @@ -217,6 +238,7 @@ func Open(logger api.Logger, dirPath string, options *Options) (*WriteAheadLogFi dirName: cleanDirName, options: opt, logger: logger, + metrics: NewMetrics(opt.MetricsProvider), headerBuff: make([]byte, 8), dataBuff: proto.NewBuffer(make([]byte, opt.BufferSizeBytes)), readMode: true, @@ -232,10 +254,12 @@ func Open(logger api.Logger, dirPath string, options *Options) (*WriteAheadLogFi // After the check we have an increasing, continuous sequence, with valid CRC-Anchors in each file. wal.activeIndexes, err = checkWalFiles(logger, dirPath, walNames) if err != nil { + wal.metrics.CountOfFiles.Set(float64(len(wal.activeIndexes))) _ = wal.Close() return nil, err } + wal.metrics.CountOfFiles.Set(float64(len(wal.activeIndexes))) wal.index, err = parseWalFileName(walNames[0]) // first valid file if err != nil { @@ -475,12 +499,12 @@ func (w *WriteAheadLogFile) append(record *protos.LogRecord) error { // After a successful invocation the WAL moves to write mode, and is ready to Append(). // // In case of failure: -// - an error of type io.ErrUnexpectedEOF is returned when the WAL can possibly be repaired by truncating the last -// log file after the last good record. -// - all other errors indicate that the WAL is either -// - is closed, or -// - is in write mode, or -// - is corrupted beyond the simple repair measure described above. +// - an error of type io.ErrUnexpectedEOF is returned when the WAL can possibly be repaired by truncating the last +// log file after the last good record. +// - all other errors indicate that the WAL is either +// - is closed, or +// - is in write mode, or +// - is corrupted beyond the simple repair measure described above. func (w *WriteAheadLogFile) ReadAll() ([][]byte, error) { w.mutex.Lock() defer w.mutex.Unlock() @@ -657,6 +681,7 @@ func (w *WriteAheadLogFile) deleteAndCreateFile() error { } w.activeIndexes = w.activeIndexes[j+1:] + w.metrics.CountOfFiles.Set(float64(len(w.activeIndexes))) } w.logger.Debugf("Creating log file: %s", nextFileName) @@ -675,6 +700,7 @@ func (w *WriteAheadLogFile) deleteAndCreateFile() error { } w.activeIndexes = append(w.activeIndexes, w.index) + w.metrics.CountOfFiles.Set(float64(len(w.activeIndexes))) return nil } diff --git a/vendor/github.com/SmartBFT-Go/consensus/smartbftprotos/generate.go b/vendor/github.com/SmartBFT-Go/consensus/smartbftprotos/generate.go new file mode 100644 index 00000000000..40b8fab7a38 --- /dev/null +++ b/vendor/github.com/SmartBFT-Go/consensus/smartbftprotos/generate.go @@ -0,0 +1,4 @@ +package smartbftprotos + +//go:generate protoc --go_out=paths=source_relative:. logrecord.proto +//go:generate protoc --go_out=paths=source_relative:. messages.proto diff --git a/vendor/github.com/SmartBFT-Go/consensus/smartbftprotos/logrecord.pb.go b/vendor/github.com/SmartBFT-Go/consensus/smartbftprotos/logrecord.pb.go index c7e61588384..b94c7bea970 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/smartbftprotos/logrecord.pb.go +++ b/vendor/github.com/SmartBFT-Go/consensus/smartbftprotos/logrecord.pb.go @@ -5,18 +5,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0-devel -// protoc v3.12.3 -// source: smartbftprotos/logrecord.proto +// protoc-gen-go v1.29.1 +// protoc v3.21.12 +// source: logrecord.proto package smartbftprotos import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( @@ -59,11 +58,11 @@ func (x LogRecord_Type) String() string { } func (LogRecord_Type) Descriptor() protoreflect.EnumDescriptor { - return file_smartbftprotos_logrecord_proto_enumTypes[0].Descriptor() + return file_logrecord_proto_enumTypes[0].Descriptor() } func (LogRecord_Type) Type() protoreflect.EnumType { - return &file_smartbftprotos_logrecord_proto_enumTypes[0] + return &file_logrecord_proto_enumTypes[0] } func (x LogRecord_Type) Number() protoreflect.EnumNumber { @@ -72,7 +71,7 @@ func (x LogRecord_Type) Number() protoreflect.EnumNumber { // Deprecated: Use LogRecord_Type.Descriptor instead. func (LogRecord_Type) EnumDescriptor() ([]byte, []int) { - return file_smartbftprotos_logrecord_proto_rawDescGZIP(), []int{0, 0} + return file_logrecord_proto_rawDescGZIP(), []int{0, 0} } type LogRecord struct { @@ -88,7 +87,7 @@ type LogRecord struct { func (x *LogRecord) Reset() { *x = LogRecord{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_logrecord_proto_msgTypes[0] + mi := &file_logrecord_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -101,7 +100,7 @@ func (x *LogRecord) String() string { func (*LogRecord) ProtoMessage() {} func (x *LogRecord) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_logrecord_proto_msgTypes[0] + mi := &file_logrecord_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -114,7 +113,7 @@ func (x *LogRecord) ProtoReflect() protoreflect.Message { // Deprecated: Use LogRecord.ProtoReflect.Descriptor instead. func (*LogRecord) Descriptor() ([]byte, []int) { - return file_smartbftprotos_logrecord_proto_rawDescGZIP(), []int{0} + return file_logrecord_proto_rawDescGZIP(), []int{0} } func (x *LogRecord) GetType() LogRecord_Type { @@ -138,48 +137,47 @@ func (x *LogRecord) GetData() []byte { return nil } -var File_smartbftprotos_logrecord_proto protoreflect.FileDescriptor - -var file_smartbftprotos_logrecord_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, - 0x2f, 0x6c, 0x6f, 0x67, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x0e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, - 0x22, 0xa4, 0x01, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x32, - 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x73, - 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x4c, 0x6f, - 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x74, - 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, - 0x65, 0x54, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2e, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x09, 0x0a, 0x05, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, - 0x4e, 0x54, 0x52, 0x4f, 0x4c, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x52, 0x43, 0x5f, 0x41, - 0x4e, 0x43, 0x48, 0x4f, 0x52, 0x10, 0x02, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x42, 0x46, 0x54, 0x2d, 0x47, - 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x73, 0x6d, 0x61, 0x72, - 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, +var File_logrecord_proto protoreflect.FileDescriptor + +var file_logrecord_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x6c, 0x6f, 0x67, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x22, 0xa4, 0x01, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, + 0x32, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, + 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x4c, + 0x6f, 0x67, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, 0x74, 0x65, 0x5f, + 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x74, 0x72, 0x75, 0x6e, 0x63, 0x61, + 0x74, 0x65, 0x54, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2e, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x09, 0x0a, 0x05, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, + 0x4f, 0x4e, 0x54, 0x52, 0x4f, 0x4c, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x52, 0x43, 0x5f, + 0x41, 0x4e, 0x43, 0x48, 0x4f, 0x52, 0x10, 0x02, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x42, 0x46, 0x54, 0x2d, + 0x47, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x73, 0x6d, 0x61, + 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( - file_smartbftprotos_logrecord_proto_rawDescOnce sync.Once - file_smartbftprotos_logrecord_proto_rawDescData = file_smartbftprotos_logrecord_proto_rawDesc + file_logrecord_proto_rawDescOnce sync.Once + file_logrecord_proto_rawDescData = file_logrecord_proto_rawDesc ) -func file_smartbftprotos_logrecord_proto_rawDescGZIP() []byte { - file_smartbftprotos_logrecord_proto_rawDescOnce.Do(func() { - file_smartbftprotos_logrecord_proto_rawDescData = protoimpl.X.CompressGZIP(file_smartbftprotos_logrecord_proto_rawDescData) +func file_logrecord_proto_rawDescGZIP() []byte { + file_logrecord_proto_rawDescOnce.Do(func() { + file_logrecord_proto_rawDescData = protoimpl.X.CompressGZIP(file_logrecord_proto_rawDescData) }) - return file_smartbftprotos_logrecord_proto_rawDescData + return file_logrecord_proto_rawDescData } -var file_smartbftprotos_logrecord_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_smartbftprotos_logrecord_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_smartbftprotos_logrecord_proto_goTypes = []interface{}{ +var file_logrecord_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_logrecord_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_logrecord_proto_goTypes = []interface{}{ (LogRecord_Type)(0), // 0: smartbftprotos.LogRecord.Type (*LogRecord)(nil), // 1: smartbftprotos.LogRecord } -var file_smartbftprotos_logrecord_proto_depIdxs = []int32{ +var file_logrecord_proto_depIdxs = []int32{ 0, // 0: smartbftprotos.LogRecord.type:type_name -> smartbftprotos.LogRecord.Type 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type @@ -188,13 +186,13 @@ var file_smartbftprotos_logrecord_proto_depIdxs = []int32{ 0, // [0:1] is the sub-list for field type_name } -func init() { file_smartbftprotos_logrecord_proto_init() } -func file_smartbftprotos_logrecord_proto_init() { - if File_smartbftprotos_logrecord_proto != nil { +func init() { file_logrecord_proto_init() } +func file_logrecord_proto_init() { + if File_logrecord_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_smartbftprotos_logrecord_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_logrecord_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LogRecord); i { case 0: return &v.state @@ -211,19 +209,19 @@ func file_smartbftprotos_logrecord_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_smartbftprotos_logrecord_proto_rawDesc, + RawDescriptor: file_logrecord_proto_rawDesc, NumEnums: 1, NumMessages: 1, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_smartbftprotos_logrecord_proto_goTypes, - DependencyIndexes: file_smartbftprotos_logrecord_proto_depIdxs, - EnumInfos: file_smartbftprotos_logrecord_proto_enumTypes, - MessageInfos: file_smartbftprotos_logrecord_proto_msgTypes, + GoTypes: file_logrecord_proto_goTypes, + DependencyIndexes: file_logrecord_proto_depIdxs, + EnumInfos: file_logrecord_proto_enumTypes, + MessageInfos: file_logrecord_proto_msgTypes, }.Build() - File_smartbftprotos_logrecord_proto = out.File - file_smartbftprotos_logrecord_proto_rawDesc = nil - file_smartbftprotos_logrecord_proto_goTypes = nil - file_smartbftprotos_logrecord_proto_depIdxs = nil + File_logrecord_proto = out.File + file_logrecord_proto_rawDesc = nil + file_logrecord_proto_goTypes = nil + file_logrecord_proto_depIdxs = nil } diff --git a/vendor/github.com/SmartBFT-Go/consensus/smartbftprotos/messages.pb.go b/vendor/github.com/SmartBFT-Go/consensus/smartbftprotos/messages.pb.go index 98f79ff1890..a9e2244a929 100644 --- a/vendor/github.com/SmartBFT-Go/consensus/smartbftprotos/messages.pb.go +++ b/vendor/github.com/SmartBFT-Go/consensus/smartbftprotos/messages.pb.go @@ -5,18 +5,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0-devel -// protoc v3.12.3 -// source: smartbftprotos/messages.proto +// protoc-gen-go v1.29.1 +// protoc v3.21.12 +// source: messages.proto package smartbftprotos import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) const ( @@ -48,7 +47,7 @@ type Message struct { func (x *Message) Reset() { *x = Message{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[0] + mi := &file_messages_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -61,7 +60,7 @@ func (x *Message) String() string { func (*Message) ProtoMessage() {} func (x *Message) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[0] + mi := &file_messages_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -74,7 +73,7 @@ func (x *Message) ProtoReflect() protoreflect.Message { // Deprecated: Use Message.ProtoReflect.Descriptor instead. func (*Message) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{0} + return file_messages_proto_rawDescGZIP(), []int{0} } func (m *Message) GetContent() isMessage_Content { @@ -232,7 +231,7 @@ type PrePrepare struct { func (x *PrePrepare) Reset() { *x = PrePrepare{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[1] + mi := &file_messages_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -245,7 +244,7 @@ func (x *PrePrepare) String() string { func (*PrePrepare) ProtoMessage() {} func (x *PrePrepare) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[1] + mi := &file_messages_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -258,7 +257,7 @@ func (x *PrePrepare) ProtoReflect() protoreflect.Message { // Deprecated: Use PrePrepare.ProtoReflect.Descriptor instead. func (*PrePrepare) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{1} + return file_messages_proto_rawDescGZIP(), []int{1} } func (x *PrePrepare) GetView() uint64 { @@ -303,7 +302,7 @@ type Prepare struct { func (x *Prepare) Reset() { *x = Prepare{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[2] + mi := &file_messages_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -316,7 +315,7 @@ func (x *Prepare) String() string { func (*Prepare) ProtoMessage() {} func (x *Prepare) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[2] + mi := &file_messages_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -329,7 +328,7 @@ func (x *Prepare) ProtoReflect() protoreflect.Message { // Deprecated: Use Prepare.ProtoReflect.Descriptor instead. func (*Prepare) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{2} + return file_messages_proto_rawDescGZIP(), []int{2} } func (x *Prepare) GetView() uint64 { @@ -372,7 +371,7 @@ type ProposedRecord struct { func (x *ProposedRecord) Reset() { *x = ProposedRecord{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[3] + mi := &file_messages_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -385,7 +384,7 @@ func (x *ProposedRecord) String() string { func (*ProposedRecord) ProtoMessage() {} func (x *ProposedRecord) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[3] + mi := &file_messages_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -398,7 +397,7 @@ func (x *ProposedRecord) ProtoReflect() protoreflect.Message { // Deprecated: Use ProposedRecord.ProtoReflect.Descriptor instead. func (*ProposedRecord) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{3} + return file_messages_proto_rawDescGZIP(), []int{3} } func (x *ProposedRecord) GetPrePrepare() *PrePrepare { @@ -430,7 +429,7 @@ type Commit struct { func (x *Commit) Reset() { *x = Commit{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[4] + mi := &file_messages_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -443,7 +442,7 @@ func (x *Commit) String() string { func (*Commit) ProtoMessage() {} func (x *Commit) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[4] + mi := &file_messages_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -456,7 +455,7 @@ func (x *Commit) ProtoReflect() protoreflect.Message { // Deprecated: Use Commit.ProtoReflect.Descriptor instead. func (*Commit) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{4} + return file_messages_proto_rawDescGZIP(), []int{4} } func (x *Commit) GetView() uint64 { @@ -505,7 +504,7 @@ type PreparesFrom struct { func (x *PreparesFrom) Reset() { *x = PreparesFrom{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[5] + mi := &file_messages_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -518,7 +517,7 @@ func (x *PreparesFrom) String() string { func (*PreparesFrom) ProtoMessage() {} func (x *PreparesFrom) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[5] + mi := &file_messages_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -531,7 +530,7 @@ func (x *PreparesFrom) ProtoReflect() protoreflect.Message { // Deprecated: Use PreparesFrom.ProtoReflect.Descriptor instead. func (*PreparesFrom) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{5} + return file_messages_proto_rawDescGZIP(), []int{5} } func (x *PreparesFrom) GetIds() []uint64 { @@ -553,7 +552,7 @@ type ViewChange struct { func (x *ViewChange) Reset() { *x = ViewChange{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[6] + mi := &file_messages_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -566,7 +565,7 @@ func (x *ViewChange) String() string { func (*ViewChange) ProtoMessage() {} func (x *ViewChange) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[6] + mi := &file_messages_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -579,7 +578,7 @@ func (x *ViewChange) ProtoReflect() protoreflect.Message { // Deprecated: Use ViewChange.ProtoReflect.Descriptor instead. func (*ViewChange) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{6} + return file_messages_proto_rawDescGZIP(), []int{6} } func (x *ViewChange) GetNextView() uint64 { @@ -611,7 +610,7 @@ type ViewData struct { func (x *ViewData) Reset() { *x = ViewData{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[7] + mi := &file_messages_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -624,7 +623,7 @@ func (x *ViewData) String() string { func (*ViewData) ProtoMessage() {} func (x *ViewData) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[7] + mi := &file_messages_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -637,7 +636,7 @@ func (x *ViewData) ProtoReflect() protoreflect.Message { // Deprecated: Use ViewData.ProtoReflect.Descriptor instead. func (*ViewData) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{7} + return file_messages_proto_rawDescGZIP(), []int{7} } func (x *ViewData) GetNextView() uint64 { @@ -688,7 +687,7 @@ type SignedViewData struct { func (x *SignedViewData) Reset() { *x = SignedViewData{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[8] + mi := &file_messages_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -701,7 +700,7 @@ func (x *SignedViewData) String() string { func (*SignedViewData) ProtoMessage() {} func (x *SignedViewData) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[8] + mi := &file_messages_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -714,7 +713,7 @@ func (x *SignedViewData) ProtoReflect() protoreflect.Message { // Deprecated: Use SignedViewData.ProtoReflect.Descriptor instead. func (*SignedViewData) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{8} + return file_messages_proto_rawDescGZIP(), []int{8} } func (x *SignedViewData) GetRawViewData() []byte { @@ -749,7 +748,7 @@ type NewView struct { func (x *NewView) Reset() { *x = NewView{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[9] + mi := &file_messages_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -762,7 +761,7 @@ func (x *NewView) String() string { func (*NewView) ProtoMessage() {} func (x *NewView) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[9] + mi := &file_messages_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -775,7 +774,7 @@ func (x *NewView) ProtoReflect() protoreflect.Message { // Deprecated: Use NewView.ProtoReflect.Descriptor instead. func (*NewView) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{9} + return file_messages_proto_rawDescGZIP(), []int{9} } func (x *NewView) GetSignedViewData() []*SignedViewData { @@ -797,7 +796,7 @@ type HeartBeat struct { func (x *HeartBeat) Reset() { *x = HeartBeat{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[10] + mi := &file_messages_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -810,7 +809,7 @@ func (x *HeartBeat) String() string { func (*HeartBeat) ProtoMessage() {} func (x *HeartBeat) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[10] + mi := &file_messages_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -823,7 +822,7 @@ func (x *HeartBeat) ProtoReflect() protoreflect.Message { // Deprecated: Use HeartBeat.ProtoReflect.Descriptor instead. func (*HeartBeat) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{10} + return file_messages_proto_rawDescGZIP(), []int{10} } func (x *HeartBeat) GetView() uint64 { @@ -851,7 +850,7 @@ type HeartBeatResponse struct { func (x *HeartBeatResponse) Reset() { *x = HeartBeatResponse{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[11] + mi := &file_messages_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -864,7 +863,7 @@ func (x *HeartBeatResponse) String() string { func (*HeartBeatResponse) ProtoMessage() {} func (x *HeartBeatResponse) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[11] + mi := &file_messages_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -877,7 +876,7 @@ func (x *HeartBeatResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use HeartBeatResponse.ProtoReflect.Descriptor instead. func (*HeartBeatResponse) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{11} + return file_messages_proto_rawDescGZIP(), []int{11} } func (x *HeartBeatResponse) GetView() uint64 { @@ -900,7 +899,7 @@ type Signature struct { func (x *Signature) Reset() { *x = Signature{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[12] + mi := &file_messages_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -913,7 +912,7 @@ func (x *Signature) String() string { func (*Signature) ProtoMessage() {} func (x *Signature) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[12] + mi := &file_messages_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -926,7 +925,7 @@ func (x *Signature) ProtoReflect() protoreflect.Message { // Deprecated: Use Signature.ProtoReflect.Descriptor instead. func (*Signature) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{12} + return file_messages_proto_rawDescGZIP(), []int{12} } func (x *Signature) GetSigner() uint64 { @@ -964,7 +963,7 @@ type Proposal struct { func (x *Proposal) Reset() { *x = Proposal{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[13] + mi := &file_messages_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -977,7 +976,7 @@ func (x *Proposal) String() string { func (*Proposal) ProtoMessage() {} func (x *Proposal) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[13] + mi := &file_messages_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -990,7 +989,7 @@ func (x *Proposal) ProtoReflect() protoreflect.Message { // Deprecated: Use Proposal.ProtoReflect.Descriptor instead. func (*Proposal) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{13} + return file_messages_proto_rawDescGZIP(), []int{13} } func (x *Proposal) GetHeader() []byte { @@ -1036,7 +1035,7 @@ type ViewMetadata struct { func (x *ViewMetadata) Reset() { *x = ViewMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[14] + mi := &file_messages_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1049,7 +1048,7 @@ func (x *ViewMetadata) String() string { func (*ViewMetadata) ProtoMessage() {} func (x *ViewMetadata) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[14] + mi := &file_messages_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1062,7 +1061,7 @@ func (x *ViewMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use ViewMetadata.ProtoReflect.Descriptor instead. func (*ViewMetadata) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{14} + return file_messages_proto_rawDescGZIP(), []int{14} } func (x *ViewMetadata) GetViewId() uint64 { @@ -1116,7 +1115,7 @@ type SavedMessage struct { func (x *SavedMessage) Reset() { *x = SavedMessage{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[15] + mi := &file_messages_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1129,7 +1128,7 @@ func (x *SavedMessage) String() string { func (*SavedMessage) ProtoMessage() {} func (x *SavedMessage) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[15] + mi := &file_messages_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1142,7 +1141,7 @@ func (x *SavedMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use SavedMessage.ProtoReflect.Descriptor instead. func (*SavedMessage) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{15} + return file_messages_proto_rawDescGZIP(), []int{15} } func (m *SavedMessage) GetContent() isSavedMessage_Content { @@ -1217,7 +1216,7 @@ type StateTransferRequest struct { func (x *StateTransferRequest) Reset() { *x = StateTransferRequest{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[16] + mi := &file_messages_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1230,7 +1229,7 @@ func (x *StateTransferRequest) String() string { func (*StateTransferRequest) ProtoMessage() {} func (x *StateTransferRequest) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[16] + mi := &file_messages_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1243,7 +1242,7 @@ func (x *StateTransferRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StateTransferRequest.ProtoReflect.Descriptor instead. func (*StateTransferRequest) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{16} + return file_messages_proto_rawDescGZIP(), []int{16} } type StateTransferResponse struct { @@ -1258,7 +1257,7 @@ type StateTransferResponse struct { func (x *StateTransferResponse) Reset() { *x = StateTransferResponse{} if protoimpl.UnsafeEnabled { - mi := &file_smartbftprotos_messages_proto_msgTypes[17] + mi := &file_messages_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1271,7 +1270,7 @@ func (x *StateTransferResponse) String() string { func (*StateTransferResponse) ProtoMessage() {} func (x *StateTransferResponse) ProtoReflect() protoreflect.Message { - mi := &file_smartbftprotos_messages_proto_msgTypes[17] + mi := &file_messages_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1284,7 +1283,7 @@ func (x *StateTransferResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StateTransferResponse.ProtoReflect.Descriptor instead. func (*StateTransferResponse) Descriptor() ([]byte, []int) { - return file_smartbftprotos_messages_proto_rawDescGZIP(), []int{17} + return file_messages_proto_rawDescGZIP(), []int{17} } func (x *StateTransferResponse) GetViewNum() uint64 { @@ -1301,207 +1300,206 @@ func (x *StateTransferResponse) GetSequence() uint64 { return 0 } -var File_smartbftprotos_messages_proto protoreflect.FileDescriptor - -var file_smartbftprotos_messages_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, - 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x0e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x22, - 0xbe, 0x05, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3d, 0x0a, 0x0b, 0x70, - 0x72, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x73, 0x2e, 0x50, 0x72, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x48, 0x00, 0x52, 0x0a, - 0x70, 0x72, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x70, 0x72, - 0x65, 0x70, 0x61, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x6d, - 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x65, - 0x70, 0x61, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, - 0x30, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, - 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x12, 0x3d, 0x0a, 0x0b, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, - 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x76, 0x69, 0x65, 0x77, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x12, 0x3d, 0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x69, 0x65, 0x77, 0x44, - 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x08, 0x76, 0x69, 0x65, 0x77, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x34, 0x0a, 0x08, 0x6e, 0x65, 0x77, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x73, 0x2e, 0x4e, 0x65, 0x77, 0x56, 0x69, 0x65, 0x77, 0x48, 0x00, 0x52, 0x07, 0x6e, 0x65, - 0x77, 0x56, 0x69, 0x65, 0x77, 0x12, 0x3a, 0x0a, 0x0a, 0x68, 0x65, 0x61, 0x72, 0x74, 0x5f, 0x62, - 0x65, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6d, 0x61, 0x72, - 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, - 0x42, 0x65, 0x61, 0x74, 0x48, 0x00, 0x52, 0x09, 0x68, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, 0x61, - 0x74, 0x12, 0x53, 0x0a, 0x13, 0x68, 0x65, 0x61, 0x72, 0x74, 0x5f, 0x62, 0x65, 0x61, 0x74, 0x5f, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, - 0x48, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x48, 0x00, 0x52, 0x11, 0x68, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, 0x61, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, +var File_messages_proto protoreflect.FileDescriptor + +var file_messages_proto_rawDesc = []byte{ + 0x0a, 0x0e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x0e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x22, 0xbe, 0x05, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3d, 0x0a, 0x0b, + 0x70, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x48, 0x00, 0x52, + 0x0a, 0x70, 0x72, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x70, + 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, + 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x72, + 0x65, 0x70, 0x61, 0x72, 0x65, 0x48, 0x00, 0x52, 0x07, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, + 0x12, 0x30, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x73, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x74, 0x12, 0x3d, 0x0a, 0x0b, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, + 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x76, 0x69, 0x65, 0x77, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x12, 0x3d, 0x0a, 0x09, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x69, 0x65, 0x77, + 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x08, 0x76, 0x69, 0x65, 0x77, 0x44, 0x61, 0x74, 0x61, + 0x12, 0x34, 0x0a, 0x08, 0x6e, 0x65, 0x77, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x73, 0x2e, 0x4e, 0x65, 0x77, 0x56, 0x69, 0x65, 0x77, 0x48, 0x00, 0x52, 0x07, 0x6e, + 0x65, 0x77, 0x56, 0x69, 0x65, 0x77, 0x12, 0x3a, 0x0a, 0x0a, 0x68, 0x65, 0x61, 0x72, 0x74, 0x5f, + 0x62, 0x65, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6d, 0x61, + 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x48, 0x65, 0x61, 0x72, + 0x74, 0x42, 0x65, 0x61, 0x74, 0x48, 0x00, 0x52, 0x09, 0x68, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, + 0x61, 0x74, 0x12, 0x53, 0x0a, 0x13, 0x68, 0x65, 0x61, 0x72, 0x74, 0x5f, 0x62, 0x65, 0x61, 0x74, + 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x48, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x48, 0x00, 0x52, 0x11, 0x68, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, 0x61, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x16, 0x73, 0x74, 0x61, 0x74, 0x65, + 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, + 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, + 0x14, 0x73, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5f, 0x0a, 0x17, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x14, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x5f, 0x0a, 0x17, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x15, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x22, 0xb9, 0x01, 0x0a, 0x0a, 0x50, 0x72, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x76, - 0x69, 0x65, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x03, 0x73, 0x65, 0x71, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, - 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x4f, 0x0a, 0x16, 0x70, - 0x72, 0x65, 0x76, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6d, - 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x14, 0x70, 0x72, 0x65, 0x76, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x5f, 0x0a, 0x07, - 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x73, - 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x73, 0x65, 0x71, 0x12, 0x16, 0x0a, - 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, - 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x22, 0x80, 0x01, - 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x12, 0x3b, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, - 0x65, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x31, 0x0a, - 0x07, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, - 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x52, 0x07, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, - 0x22, 0x97, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x76, - 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, 0x12, - 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x73, 0x65, - 0x71, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, + 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, + 0x15, 0x73, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x22, 0xb9, 0x01, 0x0a, 0x0a, 0x50, 0x72, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, + 0x76, 0x69, 0x65, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x03, 0x73, 0x65, 0x71, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, + 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x4f, 0x0a, 0x16, + 0x70, 0x72, 0x65, 0x76, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x22, 0x20, 0x0a, 0x0c, 0x50, 0x72, - 0x65, 0x70, 0x61, 0x72, 0x65, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x41, 0x0a, 0x0a, - 0x56, 0x69, 0x65, 0x77, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, - 0x78, 0x74, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6e, - 0x65, 0x78, 0x74, 0x56, 0x69, 0x65, 0x77, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x22, - 0xb1, 0x02, 0x0a, 0x08, 0x56, 0x69, 0x65, 0x77, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, 0x09, - 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x08, 0x6e, 0x65, 0x78, 0x74, 0x56, 0x69, 0x65, 0x77, 0x12, 0x3d, 0x0a, 0x0d, 0x6c, 0x61, 0x73, - 0x74, 0x5f, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, - 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x53, 0x0a, 0x18, 0x6c, 0x61, 0x73, 0x74, - 0x5f, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, - 0x75, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6d, 0x61, - 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x16, 0x6c, 0x61, 0x73, 0x74, 0x44, 0x65, 0x63, 0x69, 0x73, - 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x46, 0x0a, - 0x12, 0x69, 0x6e, 0x5f, 0x66, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x6d, 0x61, 0x72, - 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x61, 0x6c, 0x52, 0x10, 0x69, 0x6e, 0x46, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x50, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x2c, 0x0a, 0x12, 0x69, 0x6e, 0x5f, 0x66, 0x6c, 0x69, 0x67, - 0x68, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x10, 0x69, 0x6e, 0x46, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x50, 0x72, 0x65, 0x70, 0x61, - 0x72, 0x65, 0x64, 0x22, 0x6a, 0x0a, 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x69, 0x65, - 0x77, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x0d, 0x72, 0x61, 0x77, 0x5f, 0x76, 0x69, 0x65, - 0x77, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x72, 0x61, - 0x77, 0x56, 0x69, 0x65, 0x77, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 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, 0x22, - 0x53, 0x0a, 0x07, 0x4e, 0x65, 0x77, 0x56, 0x69, 0x65, 0x77, 0x12, 0x48, 0x0a, 0x10, 0x73, 0x69, - 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x69, 0x65, 0x77, - 0x44, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x69, 0x65, 0x77, - 0x44, 0x61, 0x74, 0x61, 0x22, 0x31, 0x0a, 0x09, 0x48, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, 0x61, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x04, 0x76, 0x69, 0x65, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x03, 0x73, 0x65, 0x71, 0x22, 0x27, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x72, 0x74, - 0x42, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x14, 0x70, 0x72, 0x65, 0x76, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x5f, 0x0a, + 0x07, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, 0x12, 0x10, 0x0a, 0x03, + 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x73, 0x65, 0x71, 0x12, 0x16, + 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x22, 0x80, + 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, + 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, + 0x72, 0x65, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x12, 0x31, + 0x0a, 0x07, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x17, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, + 0x2e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x52, 0x07, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, + 0x65, 0x22, 0x97, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, - 0x22, 0x4b, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x73, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, - 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x8d, 0x01, - 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1a, 0x0a, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x33, 0x0a, 0x15, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x22, 0xdc, 0x01, - 0x0a, 0x0c, 0x56, 0x69, 0x65, 0x77, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x17, - 0x0a, 0x07, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x06, 0x76, 0x69, 0x65, 0x77, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, - 0x74, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, - 0x12, 0x2a, 0x0a, 0x11, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x69, 0x6e, - 0x5f, 0x76, 0x69, 0x65, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x64, 0x65, 0x63, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x6e, 0x56, 0x69, 0x65, 0x77, 0x12, 0x1d, 0x0a, 0x0a, - 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x04, - 0x52, 0x09, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x1c, 0x70, - 0x72, 0x65, 0x76, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x19, 0x70, 0x72, 0x65, 0x76, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x69, 0x67, - 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x91, 0x02, 0x0a, - 0x0c, 0x53, 0x61, 0x76, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x49, 0x0a, - 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, - 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x64, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x65, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x31, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, - 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x48, 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x39, 0x0a, 0x08, 0x6e, - 0x65, 0x77, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x56, - 0x69, 0x65, 0x77, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x07, 0x6e, - 0x65, 0x77, 0x56, 0x69, 0x65, 0x77, 0x12, 0x3d, 0x0a, 0x0b, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x6d, - 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x56, 0x69, 0x65, - 0x77, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x76, 0x69, 0x65, 0x77, 0x43, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x22, 0x16, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4e, 0x0a, 0x15, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x69, 0x65, 0x77, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, - 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, - 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x42, 0x46, 0x54, 0x2d, - 0x47, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x73, 0x6d, 0x61, - 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x73, + 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x09, 0x73, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x06, 0x61, 0x73, 0x73, 0x69, 0x73, 0x74, 0x22, 0x20, 0x0a, 0x0c, 0x50, + 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x69, + 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x41, 0x0a, + 0x0a, 0x56, 0x69, 0x65, 0x77, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, + 0x65, 0x78, 0x74, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, + 0x6e, 0x65, 0x78, 0x74, 0x56, 0x69, 0x65, 0x77, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, + 0x22, 0xb1, 0x02, 0x0a, 0x08, 0x56, 0x69, 0x65, 0x77, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1b, 0x0a, + 0x09, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x56, 0x69, 0x65, 0x77, 0x12, 0x3d, 0x0a, 0x0d, 0x6c, 0x61, + 0x73, 0x74, 0x5f, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x0c, 0x6c, 0x61, 0x73, + 0x74, 0x44, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x53, 0x0a, 0x18, 0x6c, 0x61, 0x73, + 0x74, 0x5f, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6d, + 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x16, 0x6c, 0x61, 0x73, 0x74, 0x44, 0x65, 0x63, 0x69, + 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x46, + 0x0a, 0x12, 0x69, 0x6e, 0x5f, 0x66, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x6d, 0x61, + 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x10, 0x69, 0x6e, 0x46, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x2c, 0x0a, 0x12, 0x69, 0x6e, 0x5f, 0x66, 0x6c, 0x69, + 0x67, 0x68, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x10, 0x69, 0x6e, 0x46, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x50, 0x72, 0x65, 0x70, + 0x61, 0x72, 0x65, 0x64, 0x22, 0x6a, 0x0a, 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x69, + 0x65, 0x77, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x0d, 0x72, 0x61, 0x77, 0x5f, 0x76, 0x69, + 0x65, 0x77, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x72, + 0x61, 0x77, 0x56, 0x69, 0x65, 0x77, 0x44, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, + 0x67, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, + 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, + 0x22, 0x53, 0x0a, 0x07, 0x4e, 0x65, 0x77, 0x56, 0x69, 0x65, 0x77, 0x12, 0x48, 0x0a, 0x10, 0x73, + 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x69, 0x65, + 0x77, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0e, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x56, 0x69, 0x65, + 0x77, 0x44, 0x61, 0x74, 0x61, 0x22, 0x31, 0x0a, 0x09, 0x48, 0x65, 0x61, 0x72, 0x74, 0x42, 0x65, + 0x61, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x03, 0x73, 0x65, 0x71, 0x22, 0x27, 0x0a, 0x11, 0x48, 0x65, 0x61, 0x72, + 0x74, 0x42, 0x65, 0x61, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x76, 0x69, 0x65, + 0x77, 0x22, 0x4b, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, + 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, + 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x8d, + 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x68, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x33, 0x0a, 0x15, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, + 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x14, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x22, 0xdc, + 0x01, 0x0a, 0x0c, 0x56, 0x69, 0x65, 0x77, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x17, 0x0a, 0x07, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x06, 0x76, 0x69, 0x65, 0x77, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x6c, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0e, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, + 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x64, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x69, + 0x6e, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x64, 0x65, + 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x49, 0x6e, 0x56, 0x69, 0x65, 0x77, 0x12, 0x1d, 0x0a, + 0x0a, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x04, 0x52, 0x09, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x1c, + 0x70, 0x72, 0x65, 0x76, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x19, 0x70, 0x72, 0x65, 0x76, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x69, + 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x22, 0x91, 0x02, + 0x0a, 0x0c, 0x53, 0x61, 0x76, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x49, + 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x72, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, + 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x65, 0x64, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x31, 0x0a, 0x06, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x6d, 0x61, 0x72, + 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x48, 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x39, 0x0a, 0x08, + 0x6e, 0x65, 0x77, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, + 0x2e, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, + 0x56, 0x69, 0x65, 0x77, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x07, + 0x6e, 0x65, 0x77, 0x56, 0x69, 0x65, 0x77, 0x12, 0x3d, 0x0a, 0x0b, 0x76, 0x69, 0x65, 0x77, 0x5f, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, + 0x6d, 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x56, 0x69, + 0x65, 0x77, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x76, 0x69, 0x65, 0x77, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x22, 0x16, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4e, 0x0a, 0x15, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x69, 0x65, 0x77, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, + 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x6d, 0x61, 0x72, 0x74, 0x42, 0x46, 0x54, + 0x2d, 0x47, 0x6f, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2f, 0x73, 0x6d, + 0x61, 0x72, 0x74, 0x62, 0x66, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( - file_smartbftprotos_messages_proto_rawDescOnce sync.Once - file_smartbftprotos_messages_proto_rawDescData = file_smartbftprotos_messages_proto_rawDesc + file_messages_proto_rawDescOnce sync.Once + file_messages_proto_rawDescData = file_messages_proto_rawDesc ) -func file_smartbftprotos_messages_proto_rawDescGZIP() []byte { - file_smartbftprotos_messages_proto_rawDescOnce.Do(func() { - file_smartbftprotos_messages_proto_rawDescData = protoimpl.X.CompressGZIP(file_smartbftprotos_messages_proto_rawDescData) +func file_messages_proto_rawDescGZIP() []byte { + file_messages_proto_rawDescOnce.Do(func() { + file_messages_proto_rawDescData = protoimpl.X.CompressGZIP(file_messages_proto_rawDescData) }) - return file_smartbftprotos_messages_proto_rawDescData + return file_messages_proto_rawDescData } -var file_smartbftprotos_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 18) -var file_smartbftprotos_messages_proto_goTypes = []interface{}{ +var file_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_messages_proto_goTypes = []interface{}{ (*Message)(nil), // 0: smartbftprotos.Message (*PrePrepare)(nil), // 1: smartbftprotos.PrePrepare (*Prepare)(nil), // 2: smartbftprotos.Prepare @@ -1521,7 +1519,7 @@ var file_smartbftprotos_messages_proto_goTypes = []interface{}{ (*StateTransferRequest)(nil), // 16: smartbftprotos.StateTransferRequest (*StateTransferResponse)(nil), // 17: smartbftprotos.StateTransferResponse } -var file_smartbftprotos_messages_proto_depIdxs = []int32{ +var file_messages_proto_depIdxs = []int32{ 1, // 0: smartbftprotos.Message.pre_prepare:type_name -> smartbftprotos.PrePrepare 2, // 1: smartbftprotos.Message.prepare:type_name -> smartbftprotos.Prepare 4, // 2: smartbftprotos.Message.commit:type_name -> smartbftprotos.Commit @@ -1552,13 +1550,13 @@ var file_smartbftprotos_messages_proto_depIdxs = []int32{ 0, // [0:23] is the sub-list for field type_name } -func init() { file_smartbftprotos_messages_proto_init() } -func file_smartbftprotos_messages_proto_init() { - if File_smartbftprotos_messages_proto != nil { +func init() { file_messages_proto_init() } +func file_messages_proto_init() { + if File_messages_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_smartbftprotos_messages_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Message); i { case 0: return &v.state @@ -1570,7 +1568,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PrePrepare); i { case 0: return &v.state @@ -1582,7 +1580,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Prepare); i { case 0: return &v.state @@ -1594,7 +1592,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ProposedRecord); i { case 0: return &v.state @@ -1606,7 +1604,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Commit); i { case 0: return &v.state @@ -1618,7 +1616,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PreparesFrom); i { case 0: return &v.state @@ -1630,7 +1628,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ViewChange); i { case 0: return &v.state @@ -1642,7 +1640,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ViewData); i { case 0: return &v.state @@ -1654,7 +1652,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignedViewData); i { case 0: return &v.state @@ -1666,7 +1664,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NewView); i { case 0: return &v.state @@ -1678,7 +1676,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HeartBeat); i { case 0: return &v.state @@ -1690,7 +1688,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HeartBeatResponse); i { case 0: return &v.state @@ -1702,7 +1700,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Signature); i { case 0: return &v.state @@ -1714,7 +1712,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Proposal); i { case 0: return &v.state @@ -1726,7 +1724,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ViewMetadata); i { case 0: return &v.state @@ -1738,7 +1736,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SavedMessage); i { case 0: return &v.state @@ -1750,7 +1748,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StateTransferRequest); i { case 0: return &v.state @@ -1762,7 +1760,7 @@ func file_smartbftprotos_messages_proto_init() { return nil } } - file_smartbftprotos_messages_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_messages_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StateTransferResponse); i { case 0: return &v.state @@ -1775,7 +1773,7 @@ func file_smartbftprotos_messages_proto_init() { } } } - file_smartbftprotos_messages_proto_msgTypes[0].OneofWrappers = []interface{}{ + file_messages_proto_msgTypes[0].OneofWrappers = []interface{}{ (*Message_PrePrepare)(nil), (*Message_Prepare)(nil), (*Message_Commit)(nil), @@ -1787,7 +1785,7 @@ func file_smartbftprotos_messages_proto_init() { (*Message_StateTransferRequest)(nil), (*Message_StateTransferResponse)(nil), } - file_smartbftprotos_messages_proto_msgTypes[15].OneofWrappers = []interface{}{ + file_messages_proto_msgTypes[15].OneofWrappers = []interface{}{ (*SavedMessage_ProposedRecord)(nil), (*SavedMessage_Commit)(nil), (*SavedMessage_NewView)(nil), @@ -1797,18 +1795,18 @@ func file_smartbftprotos_messages_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_smartbftprotos_messages_proto_rawDesc, + RawDescriptor: file_messages_proto_rawDesc, NumEnums: 0, NumMessages: 18, NumExtensions: 0, NumServices: 0, }, - GoTypes: file_smartbftprotos_messages_proto_goTypes, - DependencyIndexes: file_smartbftprotos_messages_proto_depIdxs, - MessageInfos: file_smartbftprotos_messages_proto_msgTypes, + GoTypes: file_messages_proto_goTypes, + DependencyIndexes: file_messages_proto_depIdxs, + MessageInfos: file_messages_proto_msgTypes, }.Build() - File_smartbftprotos_messages_proto = out.File - file_smartbftprotos_messages_proto_rawDesc = nil - file_smartbftprotos_messages_proto_goTypes = nil - file_smartbftprotos_messages_proto_depIdxs = nil + File_messages_proto = out.File + file_messages_proto_rawDesc = nil + file_messages_proto_goTypes = nil + file_messages_proto_depIdxs = nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index 2c5789d42ce..05d6bd557ee 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -56,11 +56,12 @@ github.com/Microsoft/hcsshim/internal/vmcompute github.com/Microsoft/hcsshim/internal/wclayer github.com/Microsoft/hcsshim/internal/winapi github.com/Microsoft/hcsshim/osversion -# github.com/SmartBFT-Go/consensus v0.0.0-20230212211744-e5a79afcea81 -## explicit; go 1.15 +# github.com/SmartBFT-Go/consensus v0.0.0-20230430133422-4dca5ba006ee +## explicit; go 1.20 github.com/SmartBFT-Go/consensus/internal/bft github.com/SmartBFT-Go/consensus/pkg/api github.com/SmartBFT-Go/consensus/pkg/consensus +github.com/SmartBFT-Go/consensus/pkg/metrics/disabled github.com/SmartBFT-Go/consensus/pkg/types github.com/SmartBFT-Go/consensus/pkg/wal github.com/SmartBFT-Go/consensus/smartbftprotos