Skip to content

validator: skip no-miner rows instead of stalling the epoch#73

Merged
markdavison merged 1 commit into
mainfrom
fix/validator-skip-empty-miner-id
Jun 23, 2026
Merged

validator: skip no-miner rows instead of stalling the epoch#73
markdavison merged 1 commit into
mainfrom
fix/validator-skip-empty-miner-id

Conversation

@markdavison

Copy link
Copy Markdown
Contributor

Problem

score() in validator/src/gm_validator/scoring.py raised MalformedArtifactError on any aggregated.jsonl row whose miner_id was an empty string. MalformedArtifactError is documented as a permanent fault that "will not fix itself on the next tick", so the validator surfaces it loudly and stops — aborting scoring for the entire epoch and stalling weight-setting.

But an empty-miner_id row is a legitimate, benign artifact: when the router cannot place a request, the gateway logs a no-miner failure with miner_id='', success=False, and zero earnings, which the finalizer currently includes in aggregated.jsonl. Confirmed live: mainnet epoch 23467 stalled the validator on exactly one such row.

(The finalizer is being fixed separately to stop emitting these rows, but the validator must be resilient regardless.)

Fix

In score(), treat a missing/null/empty miner_id as the gateway's no-miner failure marker: skip the row (continue) and emit a logging.warning, instead of raising. The validator now scores the remaining valid rows and advances past the epoch.

A no-miner row carries zero earnings, so skipping loses no payout. As a guard against masking real corruption, the skip path asserts the row is zero-earning (earnings_ndollars / surcharge_ndollars both 0) — a no-miner row carrying money still fails loud.

Strict validation is preserved for every other malformation: genuinely corrupt rows (non-string non-empty miner_id, non-integer money, etc.) still raise.

Tests

validator/tests/test_scoring.py: replaced the now-obsolete raise-on-empty tests with coverage for the skip path — empty/missing/null miner_id rows are skipped, a no-miner row interleaved with valid rows does not stall them, the skip emits a warning, and a no-miner row carrying non-zero earnings still raises.

Full suite: 215 passed.

@markdavison markdavison merged commit 5d1cf3a into main Jun 23, 2026
3 checks passed
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