Skip to content

fix: use cached issue-discovery scores when DAS mirror fetch fails (#1065)#1171

Closed
alpurkan17 wants to merge 1 commit into
entrius:testfrom
alpurkan17:fix/1065-mirror-issue-cache-fallback-v2
Closed

fix: use cached issue-discovery scores when DAS mirror fetch fails (#1065)#1171
alpurkan17 wants to merge 1 commit into
entrius:testfrom
alpurkan17:fix/1065-mirror-issue-cache-fallback-v2

Conversation

@alpurkan17
Copy link
Copy Markdown
Contributor

Summary

When a validator cannot fetch issue-discovery data for one miner from the DAS GitHub mirror, that miner is skipped for the round and receives a zero issue-discovery score. The remaining miners are then normalized across the full pool, unfairly redistributing the failed miner's share.

This fix adds a mirror_issue_fetch_failed flag on MinerEvaluation, set by mirror_scan.py when MirrorRequestError is raised. During issue_discovery() in forward.py, the validator restores the previous round's cached issue-discovery scores for that miner *before* normalization runs, so a transient DAS fetch failure does not distort emission distribution.

The MinerEvaluationCache.store() method also preserves previous issue-discovery scores when the current eval has zero (since the cache is stored before issue discovery runs in step 1 of forward()). A new update_issue_discovery_scores() method refreshes the cache for successful miners after discovery completes.

Validation

  • mirror_issue_fetch_failed is set on MinerEvaluation when MirrorRequestError is caught in mirror_scan.py
  • Cached scores are restored before normalize_issue_discovery_rewards() runs — emission distribution is correct
  • Cache preserves previous issue-discovery scores in store() as a safety net
  • update_issue_discovery_scores() refreshes cache entries for successful miners
  • ruff check + ruff format pass

Closes #1065

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 12, 2026
@alpurkan17 alpurkan17 force-pushed the fix/1065-mirror-issue-cache-fallback-v2 branch from 7285021 to 73ce705 Compare May 12, 2026 18:36
@alpurkan17 alpurkan17 force-pushed the fix/1065-mirror-issue-cache-fallback-v2 branch from 73ce705 to 591bb06 Compare May 12, 2026 18:39
@alpurkan17
Copy link
Copy Markdown
Contributor Author

Competitor #1066 already merged. Closing.

@alpurkan17 alpurkan17 closed this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use cached issue-discovery scores when DAS mirror fetch fails per miner

1 participant