From ff9f24c1a28a2cb6ceb39c1964157908aadaa44d Mon Sep 17 00:00:00 2001 From: Bruce Riley Date: Fri, 5 Jul 2024 15:18:52 -0500 Subject: [PATCH] Remove measurements that were moved to PR#3988 --- node/pkg/node/node.go | 2 +- node/pkg/p2p/gossip_cutover.go | 14 -------------- node/pkg/processor/observation.go | 8 +------- node/pkg/processor/processor.go | 16 +--------------- 4 files changed, 3 insertions(+), 37 deletions(-) diff --git a/node/pkg/node/node.go b/node/pkg/node/node.go index 92cff95d29..b94e094a03 100644 --- a/node/pkg/node/node.go +++ b/node/pkg/node/node.go @@ -75,7 +75,7 @@ type G struct { runnables map[string]supervisor.Runnable // various channels - // Outbound gossip message queues (needs to be read/write because p2p needs read/write) + // Outbound gossip message queues (need to be read/write because p2p needs read/write) gossipControlSendC chan []byte gossipAttestationSendC chan []byte gossipVaaSendC chan []byte diff --git a/node/pkg/p2p/gossip_cutover.go b/node/pkg/p2p/gossip_cutover.go index f5f3ebac40..f907714dfb 100644 --- a/node/pkg/p2p/gossip_cutover.go +++ b/node/pkg/p2p/gossip_cutover.go @@ -85,17 +85,3 @@ func getCutOverTimeStr(networkID string) string { //nolint:unparam } return devnetCutOverTimeStr } - -// GossipAttestationMsg is the payload of the `gossipAttestationSendC` channel. This will be used instead of just `[]byte` -// until after the cutover is complete and support for publishing `SignedObservations` is removed. Then this can be deleted. -type GossipAttestationMsg struct { - MsgType GossipAttestationMsgType - Msg []byte -} - -type GossipAttestationMsgType uint8 - -const ( - GossipAttestationSignedObservation GossipAttestationMsgType = iota - GossipAttestationSignedObservationBatch -) diff --git a/node/pkg/processor/observation.go b/node/pkg/processor/observation.go index c45fae1d57..e1545ce49c 100644 --- a/node/pkg/processor/observation.go +++ b/node/pkg/processor/observation.go @@ -74,13 +74,12 @@ 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 @@ -88,7 +87,6 @@ func (p *Processor) handleObservation(obs *node_common.MsgWithTimeStamp[gossipv1 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 } @@ -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 } @@ -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", @@ -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) { diff --git a/node/pkg/processor/processor.go b/node/pkg/processor/processor.go index 3479b4c676..aee81bca88 100644 --- a/node/pkg/processor/processor.go +++ b/node/pkg/processor/processor.go @@ -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( @@ -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: