fix(rewards): record "survey not found" as ineligible instead of a silent drop - #3675
Open
0pcom wants to merge 1 commit into
Open
fix(rewards): record "survey not found" as ineligible instead of a silent drop#36750pcom wants to merge 1 commit into
0pcom wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 parsesnode-info.json; if the survey is missing/unreadable it doeslog.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 thatcontinuein both the current (runday.gocalcDay) and legacy (calc.go) loops, so a survey-collection gap shows up inhist/{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
Onlineflag (≥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,gofmtclean.