fix(ledger): require git anchoring only when a git submitter is configured - #9842
Conversation
…gured `runScheduledLedgerAnchor` asked `anchorBackendsMissingForRowHash` about a FIXED `["rekor", "git"]` required-success set, but git is only ever attempted when `deps.submitGit` is non-null. So on an instance with no git backend, a tip fully anchored to Rekor was permanently reported as "missing git" — every hourly tick re-anchored a quiet tip to Rekor, forever. Compute the required-success list from the backends this tick will actually attempt: `rekor` always, plus `git` only when `deps.submitGit` is configured — the same predicate the submission below already gates git on, so the check and the attempts can never disagree. A configured git backend still makes a git-less tip retry; a failed rekor row still retries. Closes JSONbored#9646
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-29 13:38:52 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.
|
|
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 #9842 +/- ##
==========================================
+ Coverage 79.04% 79.06% +0.01%
==========================================
Files 281 282 +1
Lines 58409 58447 +38
Branches 6698 6712 +14
==========================================
+ Hits 46171 46209 +38
Misses 11955 11955
Partials 283 283
Flags with carried forward coverage won't be shown. Click here to find out more.
|
What & why
runScheduledLedgerAnchorasksanchorBackendsMissingForRowHashwhich backends still lack astatus='ok'anchor for the current tip, and re-anchors if any are missing. But it passed a fixed["rekor", "git"]required-success set — whilegitis only ever attempted whendeps.submitGitis non-null (the real caller supplies it only on an instance with a git anchor backend configured).So on an instance with no git backend, a tip fully anchored to Rekor was permanently reported as "missing git", and every hourly tick re-anchored a quiet, unchanged tip to Rekor — forever.
The fix
Compute the required-success list from the backends this tick will actually attempt:
rekoralways, plusgitonly whendeps.submitGitis configured — the same predicate the submission path already gates git on (if (deps.submitGit)), so the missing-check and the attempts can never disagree.failed⇒ still retries.Tests (
test/unit/ledger-anchor-scheduler.test.ts)submitGitomitted, a tip with astatus='ok'rekor row for its exactrow_hash,isHourly: true⇒{ shouldAnchor: false, reason: "unchanged" }andsubmitRekorcalled zero times (fails onmain, which re-anchors).status='failed'⇒retry_unanchored,submitRekorcalled once.submitGitsupplied, rekor ok but git missing ⇒retry_unanchored, both submitters invoked.Validation
npm run typecheckgreen; the scheduler suite (30 tests) green.git diff --check <base> HEADclean; no schema/migration change.Closes #9646