Skip to content

fix(validator): non-earner trace reads live quotes, not dead last_known_rates - #704

Merged
anderdc merged 1 commit into
testfrom
fix/non-earner-trace-live-rates
Aug 22, 2026
Merged

fix(validator): non-earner trace reads live quotes, not dead last_known_rates#704
anderdc merged 1 commit into
testfrom
fix/non-earner-trace-live-rates

Conversation

@anderdc

@anderdc anderdc commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Problem

The scoring trace labelled every non-earner `reason="no_rate_posted"`, regardless of actual cause. `non_earner_lines` read `getattr(self, 'last_known_rates', {})` — but every writer of that attribute was deleted in the B3.6 substrate teardown (87a6732). The `getattr` default masked the dead reference, so the dict was always empty and `diagnose_non_earner` short-circuited on its first branch.

Seen on testnet 2026-08-22: uid 12 (50 ok / 3 fail → struck out, correct per #699) with a live sol→btc quote logged as `no_rate_posted eligible=False`, which sent a debugging session chasing a restart/rate-replay theory that didn't exist. The true reason was `ineligible`.

Fix

  • `calculate_miner_rewards` already fetches `live_quote_rates(...)` for the quote reconcile; hoist that result and pass it as `live_rates` through `log_scoring_trace` → `non_earner_lines`.
  • `non_earner_lines` builds its per-hotkey rate map from those 4-tuple lanes, collapsing the backing dimension (the diagnosis already anchors on the pair's hub leg via `hub_leg()`).
  • Dead `last_known_rates` lookup removed.

No change to reward math or crown logic — diagnostic text only.

Tests

`TestNonEarnerLinesUseLiveRates`: a struck-out miner with a live quote reads `ineligible`; a miner with no live quote still reads `no_rate_posted`.

…wn_rates

non_earner_lines pulled rates from self.last_known_rates, whose writers were
deleted in the B3.6 substrate teardown; the getattr default hid the dead
reference, so every non-earner was labelled no_rate_posted regardless of
cause (a 3-strike miner with a live quote read no_rate_posted, not
ineligible). Thread the round's live_quote_rates read into the trace and
drop the dead lookup.
@anderdc
anderdc merged commit 183ae17 into test Aug 22, 2026
3 checks passed
@anderdc
anderdc deleted the fix/non-earner-trace-live-rates branch August 22, 2026 21:11
@anderdc anderdc mentioned this pull request Aug 24, 2026
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