Skip to content

Commit

Permalink
Remove measurements that were moved to PR#3988
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley committed Jul 5, 2024
1 parent 681cf0b commit 7da3295
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
8 changes: 1 addition & 7 deletions node/pkg/processor/observation.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,19 @@ func signaturesToVaaFormat(signatures map[common.Address][]byte, gsKeys []common

// handleObservation processes a remote VAA observation, verifies it, checks whether the VAA has met quorum,
// and assembles and submits a valid VAA if possible.
func (p *Processor) handleObservation(obs *node_common.MsgWithTimeStamp[gossipv1.SignedObservation]) {
func (p *Processor) handleObservation(ctx context.Context, obs *node_common.MsgWithTimeStamp[gossipv1.SignedObservation]) {
// SECURITY: at this point, observations received from the p2p network are fully untrusted (all fields!)
//
// Note that observations are never tied to the (verified) p2p identity key - the p2p network
// identity is completely decoupled from the guardian identity, p2p is just transport.

start := time.Now()
observationsReceivedTotal.Inc()

m := obs.Msg
hash := hex.EncodeToString(m.Hash)
s := p.state.signatures[hash]
if s != nil && s.submitted {
// already submitted; ignoring additional signatures for it.
timeToHandleObservation.Observe(float64(time.Since(start).Microseconds()))
return
}

Expand Down Expand Up @@ -238,7 +236,6 @@ func (p *Processor) handleObservation(obs *node_common.MsgWithTimeStamp[gossipv1
zap.String("digest", hash),
)
}
timeToHandleObservation.Observe(float64(time.Since(start).Microseconds()))
return
}

Expand All @@ -261,9 +258,7 @@ func (p *Processor) handleObservation(obs *node_common.MsgWithTimeStamp[gossipv1

if len(sigsVaaFormat) >= gs.Quorum() {
// we have reached quorum *with the active guardian set*
start := time.Now()
s.ourObservation.HandleQuorum(sigsVaaFormat, hash, p)
timeToHandleQuorum.Observe(float64(time.Since(start).Microseconds()))
} else {
if p.logger.Level().Enabled(zapcore.DebugLevel) {
p.logger.Debug("quorum not met, doing nothing",
Expand All @@ -282,7 +277,6 @@ func (p *Processor) handleObservation(obs *node_common.MsgWithTimeStamp[gossipv1
}

observationTotalDelay.Observe(float64(time.Since(obs.Timestamp).Microseconds()))
timeToHandleObservation.Observe(float64(time.Since(start).Microseconds()))
}

func (p *Processor) handleInboundSignedVAAWithQuorum(ctx context.Context, m *gossipv1.SignedVAAWithQuorum) {
Expand Down
16 changes: 1 addition & 15 deletions node/pkg/processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,6 @@ var (
Help: "Latency histogram for total time to process signed observations",
Buckets: []float64{10.0, 20.0, 50.0, 100.0, 1000.0, 5000.0, 10_000.0, 100_000.0, 1_000_000.0, 10_000_000.0, 100_000_000.0, 1_000_000_000.0},
})

timeToHandleObservation = promauto.NewHistogram(
prometheus.HistogramOpts{
Name: "wormhole_time_to_handle_observation_us",
Help: "Latency histogram for total time to handle observation on an observation",
Buckets: []float64{25.0, 50.0, 75.0, 100.0, 200.0, 300.0, 400.0, 500.0, 750.0, 1000.0, 5000.0, 10_000.0},
})

timeToHandleQuorum = promauto.NewHistogram(
prometheus.HistogramOpts{
Name: "wormhole_time_to_handle_quorum_us",
Help: "Latency histogram for total time to handle quorum on an observation",
Buckets: []float64{25.0, 50.0, 75.0, 100.0, 200.0, 300.0, 400.0, 500.0, 750.0, 1000.0, 5000.0, 10_000.0},
})
)

func NewProcessor(
Expand Down Expand Up @@ -275,7 +261,7 @@ func (p *Processor) Run(ctx context.Context) error {
p.handleMessage(k)
case m := <-p.obsvC:
observationChanDelay.Observe(float64(time.Since(m.Timestamp).Microseconds()))
p.handleObservation(m)
p.handleObservation(ctx, m)
case m := <-p.signedInC:
p.handleInboundSignedVAAWithQuorum(ctx, m)
case <-cleanup.C:
Expand Down

0 comments on commit 7da3295

Please sign in to comment.