Skip to content

feat(collector): storj warns when satellites cannot reach the node (CashPilot-1gmy) - #321

Merged
GeiserX merged 3 commits into
mainfrom
feat/storj-reachability-warning
Aug 10, 2026
Merged

feat(collector): storj warns when satellites cannot reach the node (CashPilot-1gmy)#321
GeiserX merged 3 commits into
mainfrom
feat/storj-reachability-warning

Conversation

@GeiserX

@GeiserX GeiserX commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Why

Fix 3 of the storj dial-back incident review (follows #318, #320). The incident node's dashboard API had been saying "no satellite has ever reached me" (lastPinged zero-value, quicStatus: Misconfigured) for four months — nothing read it. The balance keeps ticking from held/storage components while inbound work is dead, so container health, earnings movement, and the dashboard all stayed green.

What

After each successful earnings collection, the storj collector probes the node's /api/sno/ and attaches a warning to the reading when:

  • no satellite has EVER reached the node (Go zero-time lastPinged),
  • the last successful dial-back is older than 3 hours (satellites ping well under hourly; the fixed incident node was re-pinged within two minutes),
  • quicStatus is Misconfigured — the one value observed to mean broken; Refreshing is a startup transient and warning on it would cry wolf.

A failing probe produces silence, never a verdict — reachability is a bonus reading on top of a successful collection. The warning rides EarningsResult.warning into the existing kind=notice alert pipeline, so it reaches the notification bell with zero UI changes.

Testing

8 reachability cases including 4 negative controls (recent ping, Refreshing, absent field, failing probe — all must stay silent), Go timestamp parsing (nanosecond fractions, Z/offset forms, naive-as-UTC), and a guard on every case that the earnings figure itself is untouched. Full suite: 4544 passed, 6 skipped, coverage 95.61%; ruff check + format clean.

Summary by CodeRabbit

  • New Features
    • Added Storj node reachability monitoring alongside payout collection.
    • Displays warnings when no satellite has reached the node, the last successful ping is more than three hours old, or QUIC is misconfigured.
    • Payout results remain successful while reachability warnings are reported separately.
  • Improvements
    • Added support for varied node timestamp formats and startup grace periods.
    • Temporary probe failures and incomplete data no longer generate unnecessary warnings.

…ashPilot-1gmy)

The node's own dashboard API states reachability directly: lastPinged is
the last successful satellite dial-back, quicStatus whether UDP 28967 got
through. The Aug 2026 incident node carried the zero-value lastPinged for
FOUR MONTHS while every dashboard surface looked healthy — the balance
keeps ticking from held/storage components while inbound work is dead,
which is exactly why the warning rides on a SUCCESSFUL collection.

- _reachability_warning probes /api/sno/ after collecting earnings:
  never-pinged (Go zero time), lastPinged staler than 3h (satellites ping
  well under hourly; a fixed node was pinged within two minutes), and
  quicStatus == Misconfigured — the one value SEEN to mean broken;
  'Refreshing' is a startup transient and warning on it would cry wolf.
- A failing probe is silence, never a verdict: reachability is a bonus
  reading, and inventing 'unreachable' from a probe that itself failed is
  the same false confidence this feature exists to remove.
- The warning flows through EarningsResult.warning into the existing
  kind=notice alert pipeline, so it reaches the notification bell with no
  UI changes.

Tests: 8 reachability cases with 4 negative controls (recent ping,
Refreshing, absent field, failing probe — all must stay silent) plus the
Go timestamp forms (nanosecond fractions, offsets, naive-as-UTC).
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@GeiserX, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 27 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0c2254da-e191-4267-ad94-d6b2dfc98649

📥 Commits

Reviewing files that changed from the base of the PR and between d47f3a5 and 0184737.

📒 Files selected for processing (2)
  • app/collectors/storj.py
  • tests/test_collectors_deep.py
📝 Walkthrough

Walkthrough

Storj payout collection now probes node reachability, parses node timestamps, detects stale or missing satellite contact, reports explicit QUIC misconfiguration, and preserves successful earnings results when reachability data is unavailable.

Changes

Storj reachability monitoring

Layer / File(s) Summary
Timestamp parsing and startup grace rules
app/collectors/storj.py, tests/test_collectors_deep.py
The collector parses RFC 3339, offset, naive UTC, zero-value, and invalid timestamps. Tests cover timestamp handling and startup grace behavior.
Reachability warnings and earnings integration
app/collectors/storj.py, tests/test_collectors_deep.py
The collector probes /api/sno/, evaluates ping age and QUIC status, suppresses unreliable probe warnings, and includes warnings in successful earnings results. Tests cover these states and probe failures.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding Storj reachability warnings when satellites cannot reach the node.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/storj-reachability-warning

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.10526% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.49%. Comparing base (94b7fd6) to head (0184737).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
app/collectors/storj.py 92.10% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #321      +/-   ##
==========================================
- Coverage   95.57%   95.49%   -0.08%     
==========================================
  Files          51       51              
  Lines        6685     6866     +181     
==========================================
+ Hits         6389     6557     +168     
- Misses        296      309      +13     
Files with missing lines Coverage Δ
app/collectors/storj.py 94.73% <92.10%> (-2.64%) ⬇️

... and 4 files with indirect coverage changes

🚀 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.

…robe diagnostics

Round 2 from independent review:

- A node started minutes ago legitimately carries the zero-value
  lastPinged — warning then makes the user's FIRST reading of a healthy
  new node an unreachability alert, teaching them to ignore the one
  notice that matters. Nodes younger than 15 minutes (startedAt, verified
  present on a live node) get grace; an absent startedAt degrades to the
  warning, never to silence.
- The probe gets its own 5s deadline instead of inheriting the
  collection's 15s — a stalling dashboard must not double the cost of
  the reading it decorates.
- Probe failures now log at debug: silence stays the product behaviour,
  but a probe that never fires was previously indistinguishable from a
  healthy node — the invisibility class this feature exists to end.

The review's notice-pipeline finding (warnings re-emit every cycle and
never reach notify.send) is real, pre-existing, and filed as a bead
rather than widened into this PR.
@GeiserX

GeiserX commented Aug 10, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 59 minutes.

@GeiserX

GeiserX commented Aug 10, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/collectors/storj.py`:
- Around line 42-45: Update the lastPinged parsing logic around
datetime.fromisoformat to accept only string values containing an explicit time
component, returning None before parsing for date-only values such as
"2026-08-10" or other unsupported shapes. Preserve timezone normalization for
valid timestamps, and add a regression test covering the date-only input.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 045ea9ac-5525-4c29-976c-fd65573626f1

📥 Commits

Reviewing files that changed from the base of the PR and between 2f8ed94 and d47f3a5.

📒 Files selected for processing (2)
  • app/collectors/storj.py
  • tests/test_collectors_deep.py

Comment thread app/collectors/storj.py Outdated
…s midnight

fromisoformat parses '2026-08-10' as 00:00:00, which would fabricate an
hours-stale ping time out of a value that never claimed a time and emit
a false offline warning. Go's time.Time marshalling always writes a time
component, so anything without one is not a node timestamp — no claim.
Flagged by CodeRabbit; regression test added.
@GeiserX
GeiserX merged commit 396ef08 into main Aug 10, 2026
8 checks passed
@GeiserX
GeiserX deleted the feat/storj-reachability-warning branch August 10, 2026 15:30
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.

1 participant