validator: skip no-miner rows instead of stalling the epoch#73
Merged
Conversation
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
score()invalidator/src/gm_validator/scoring.pyraisedMalformedArtifactErroron anyaggregated.jsonlrow whoseminer_idwas an empty string.MalformedArtifactErroris 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_idrow is a legitimate, benign artifact: when the router cannot place a request, the gateway logs a no-miner failure withminer_id='',success=False, and zero earnings, which the finalizer currently includes inaggregated.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/emptyminer_idas the gateway's no-miner failure marker: skip the row (continue) and emit alogging.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_ndollarsboth 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/nullminer_idrows 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.