feat(miner): add bounded retry/backoff to claim-conflict-resolver's post-submission live-state check - #6081
Conversation
…ost-submission live-state check Fixes JSONbored#6058. resolveClaimConflict fetched the live competing-claims snapshot exactly once post-submission, so a genuine competing PR that hadn't yet propagated through GitHub's search/GraphQL index in that instant was invisible (the module's own header documented this gap). Wraps the snapshot fetch in a bounded retry-with-backoff following http-retry.js's convention: up to maxAttempts (default 3) attempts with exponential backoff between them, returning as soon as a competing claim is observed and otherwise giving a late-propagating competitor time to surface. Pure over injected sleepFn/backoffMs (no real timers in tests); the maintainer-gated write boundary (JSONbored#4833) is unchanged.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6081 +/- ##
=======================================
Coverage 95.22% 95.23%
=======================================
Files 595 595
Lines 46998 47023 +25
Branches 15015 15015
=======================================
+ Hits 44756 44781 +25
Misses 1493 1493
Partials 749 749
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-15 08:49:27 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 4 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Fixes #6058.
resolveClaimConflict(post-submission TOCTOU reconciliation, #4848) fetched the live competing-claims snapshot exactly once, so a genuine competing PR that hadn't yet propagated through GitHub's search/GraphQL index in that instant was invisible — a gap the module's own header documented as "its own separate scope."Wraps the snapshot fetch in a bounded retry-with-backoff following this repo's existing
http-retry.jsconvention: up tomaxAttempts(default 3) attempts with exponential backoff (reusingdefaultRetryBackoffMs) between them, returning as soon as a competing claim is observed, and otherwise giving a late-propagating competitor time to surface before this miner is declared the winner. Pure over injectedsleepFn/backoffMs(no real timers in tests). Scoped to the detection step only — the maintainer-gated write-authorization boundary (#4833) is unchanged.15 tests pass (3 existing updated for the retry path + 5 new retry-branch tests), 100% branch coverage on the module, caller (attempt-cli) regression green,
.d.tsupdated, typecheck clean.