Suggested fixes for review feedback on #2843 - #2862
Conversation
…owed test var - Tighten the counter description to spell out that it counts deliveries to the topic validator *before* SSV validation runs, and reference inboundMessageCounter so operators can see the post-validation counterpart at a glance. - Add a brief comment on recordPubsubMessageReceived noting it is invoked from the validator wrapper before the inner validator, so all outcomes (including reject/timeout) are counted. - Rename the test loop variable that shadowed the imported metric package.
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Greptile SummaryThree targeted follow-up fixes after review of #2843: a tightened metric description for
Confidence Score: 5/5All three changes are non-functional: a metric description update, a doc comment, and a lint-only variable rename. No logic, data flow, or API surface is altered. Every change in this PR is cosmetic or documentation-level. The metric description cross-reference uses the correct Prometheus-rendered name (ssv_p2p_messages_in_total from OTel name ssv.p2p.messages.in). The new doc comment accurately reflects the call site. The variable rename correctly avoids shadowing the imported package without touching any test assertions. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant libp2p
participant ValidatorWrapper
participant recordPubsubMessageReceived
participant pubsubMessagesReceivedCounter
participant InnerSSVValidator
participant inboundMessageCounter
libp2p->>ValidatorWrapper: deliver message
ValidatorWrapper->>recordPubsubMessageReceived: call (pre-validation)
recordPubsubMessageReceived->>pubsubMessagesReceivedCounter: +1 (ssv_p2p_pubsub_messages_received_total)
ValidatorWrapper->>InnerSSVValidator: run SSV validation
alt accept
InnerSSVValidator->>inboundMessageCounter: +1 (ssv_p2p_messages_in_total)
else ignore / reject / timeout
InnerSSVValidator-->>ValidatorWrapper: drop
end
Reviews (1): Last reviewed commit: "network/topics: clarify pubsub-received ..." | Re-trigger Greptile |
momosh-ssv
left a comment
There was a problem hiding this comment.
It's dangerous to go to production alone! Take this. 🛡️✅
Suggested resolutions for the inline review feedback on #2843. Each commit-included change matches one inline comment in that review — merge as-is, cherry-pick, or close if you'd rather address differently.
Changes
ssv_p2p_pubsub_messages_received_totaldescription so an operator reading the metric registry can immediately tell it is the pre-validation counterpart ofssv_p2p_messages_in_total.recordPubsubMessageReceivednoting it is called from the validator wrapper before the inner validator runs, so all outcomes (accept/ignore/reject/timeout) are counted — useful context for the next reader.go.opentelemetry.io/otel/sdk/metricpackage (lint-only nit).Not included
The cross-counter attribute-key fragmentation (
ssv.p2p.pubsub.topicvsssv.p2p.message.topicvsssv.p2p.topic.name) is left for you to decide on — that one is a design call rather than a mechanical fix.Test plan
go build ./network/topics/...go test -run TestRecordPubsubMessageReceived ./network/topics/ -count=1