fix(miner): governor-chokepoint-persisted's load-evaluate-save cycle isn't atomic - #8993
Conversation
|
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 #8993 +/- ##
==========================================
+ Coverage 90.56% 90.58% +0.02%
==========================================
Files 96 98 +2
Lines 22490 22653 +163
Branches 3884 3934 +50
==========================================
+ Hits 20367 20521 +154
- Misses 1945 1950 +5
- Partials 178 182 +4
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-26 15:35:41 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
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://loopover.ai/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.
|
Summary
packages/loopover-miner/lib/governor-chokepoint-persisted.ts:42-53'sloadRateLimitState()/loadCapUsage()are read outside any transaction, then fed throughevaluateGovernorChokepointGate, then saved viasaveRateLimitState's ownBEGIN IMMEDIATE-- which only protects the write, not the preceding read. Two fleet containers evaluating concurrently can both load the same bucket state and independently compute "advance by one," and the second save clobbers the first -- a lost update in the rate-limit safety core.Deliverables
governor-chokepoint-persisted.tsruns inside a single atomic transactionAll of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.
Test plan
packages/loopover-miner/**-- 99%+ patch coverage including the new concurrency test path.Fixes #8856