Skip to content

fix(rewards): record "survey not found" as ineligible instead of a silent drop - #3675

Open
0pcom wants to merge 1 commit into
skycoin:developfrom
0pcom:fix/reward-survey-not-found-visibility
Open

fix(rewards): record "survey not found" as ineligible instead of a silent drop#3675
0pcom wants to merge 1 commit into
skycoin:developfrom
0pcom:fix/reward-survey-not-found-visibility

Conversation

@0pcom

@0pcom 0pcom commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Problem

A visor can meet the daily uptime bar yet be paid nothing, with no visible reason.

The calc iterates hist/{date}_ut.txt — the PKs that already met daily uptime (runday.go:347). For each it parses node-info.json; if the survey is missing/unreadable it does log.Debug(...); continue (runday.go:355, calc.go:951) before the PK is added to the ineligible list. So a demonstrably-up visor whose survey wasn't collected shows up as neither rewarded nor ineligible-with-reason — an invisible dash in the reward tables, with nothing an operator can inspect.

This surfaced in a real operator complaint: multiple reachable visors (surveys downloadable right now over the resolving proxy) simply not paid, with no failed-download or ineligibility record anywhere.

Fix

Emit an explicit ineligible row (Reason: "survey not found") at that continue in both the current (runday.go calcDay) and legacy (calc.go) loops, so a survey-collection gap shows up in hist/{date}_ineligible.csv.

Payout-neutral: the ineligible list is not the payout list — no reward amounts change. This only makes the omission visible.

Context

The gap itself — hourly survey collection gated on the uptime-tracker Online flag (≥2 heartbeat-credited transports), which silently skips reachable-but-flag-offline visors — is being addressed separately by a survey-push redesign (visor POSTs its survey over dmsg on-change/daily, decoupling survey freshness from the reachability snapshot). This PR is the observability half so these cases stop being invisible in the interim.

Test

go build ., go vet, gofmt clean.

…lent drop

A PK that met the daily uptime bar (present in hist/{date}_ut.txt) but whose
node-info.json was never collected hit `parseErr -> continue` in both the
current (runday.go calcDay) and legacy (calc.go) calc loops — before being
added to the ineligible list. The result: the visor appeared as NEITHER
rewarded NOR ineligible-with-reason — an invisible dash in the reward tables,
with no recorded reason an operator could inspect.

Emit an explicit ineligible row (`Reason: "survey not found"`) at that point so
a survey-collection gap surfaces in hist/{date}_ineligible.csv. Payout-neutral:
the ineligible list is not the payout list, so no reward amounts change; this
only makes the omission visible.

Root cause of the gap itself (hourly survey collection gated on the uptime-
tracker `Online` flag, which silently skips reachable-but-flag-offline visors)
is addressed separately by the survey-push redesign; this is the observability
half so these cases stop being invisible in the interim.
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