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 8, 2024
1 parent 681cf0b commit ff9f24c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 37 deletions.
2 changes: 1 addition & 1 deletion node/pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 0 additions & 14 deletions node/pkg/p2p/gossip_cutover.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
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 ff9f24c

Please sign in to comment.