Skip to content

Suggested fixes for review feedback on #2843 - #2862

Merged
iurii-ssv merged 1 commit into
F-ssv-1044from
F-ssv-1044-review-suggestions
Jun 25, 2026
Merged

Suggested fixes for review feedback on #2843#2862
iurii-ssv merged 1 commit into
F-ssv-1044from
F-ssv-1044-review-suggestions

Conversation

@iurii-ssv

Copy link
Copy Markdown
Contributor

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

  • Tighten ssv_p2p_pubsub_messages_received_total description so an operator reading the metric registry can immediately tell it is the pre-validation counterpart of ssv_p2p_messages_in_total.
  • Add a brief comment on recordPubsubMessageReceived noting 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.
  • Rename test loop variable that shadowed the imported go.opentelemetry.io/otel/sdk/metric package (lint-only nit).

Not included

The cross-counter attribute-key fragmentation (ssv.p2p.pubsub.topic vs ssv.p2p.message.topic vs ssv.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

…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

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.3%. Comparing base (b88c35e) to head (b183fd7).

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@iurii-ssv
iurii-ssv marked this pull request as ready for review May 28, 2026 11:14
@iurii-ssv
iurii-ssv requested review from a team as code owners May 28, 2026 11:14
@greptile-apps

greptile-apps Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Three targeted follow-up fixes after review of #2843: a tightened metric description for ssv.p2p.pubsub.messages.received that now cross-references ssv_p2p_messages_in_total, a doc comment on recordPubsubMessageReceived noting its pre-validation call site, and a loop-variable rename in the test to stop shadowing the imported metric package.

  • The metric description now explicitly labels the counter as pre-validation and points readers to the post-validation companion counter, making the two metrics easier to correlate in Prometheus/Grafana.
  • The variable rename in the test (metricm) eliminates a lint warning without changing test logic or coverage.

Confidence Score: 5/5

All 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

Filename Overview
network/topics/observability.go Expanded metric description to cross-reference ssv_p2p_messages_in_total; added doc comment on recordPubsubMessageReceived clarifying pre-validation call site — no logic changes
network/topics/observability_test.go Renamed loop variable metric → m to fix shadowing of the imported go.opentelemetry.io/otel/sdk/metric package; purely mechanical lint fix with no semantic change

Sequence Diagram

sequenceDiagram
    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
Loading

Reviews (1): Last reviewed commit: "network/topics: clarify pubsub-received ..." | Re-trigger Greptile

@momosh-ssv momosh-ssv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's dangerous to go to production alone! Take this. 🛡️✅

@iurii-ssv
iurii-ssv merged commit a925ed5 into F-ssv-1044 Jun 25, 2026
7 checks passed
@iurii-ssv
iurii-ssv deleted the F-ssv-1044-review-suggestions branch June 25, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants