Repository navigation
Stop treating any error containing "unknown" as an XDR failure #183
Description
Background
fetchEventsSafe decides whether to skip a ledger by substring-matching the error message: if (msg.includes("XDR") || msg.includes("unknown")) at src/rpc.ts:209, and again at :222.
"unknown" matches far too much — getaddrinfo ENOTFOUND … unknown host, a bare unknown error, provider 5xx bodies. When it matches, the ledger is silently skipped and the cursor advances past it (src/rpc.ts:211). A transient network blip is therefore indistinguishable from a genuinely unindexable ledger, and the data is gone with nothing but a console.warn.
Acceptance criteria
- Classification moves to a named predicate covering the real XDR cases and not bare "unknown"
- A transient
Error("unknown error")propagates and is retried instead of skipping the ledger — fails before, passes after - A genuine XDR error still bisects and skips; existing
fetchEventsSafetests stay green - Every skipped ledger increments a metric, so skips are visible rather than only logged
Drips Wave · Complexity: Intermediate · 150 points
How this repo is laid out
Wraith is a Soroban incoming-transfer indexer: it fills the gap Horizon leaves for SAC/SEP-41 token events by recipient address. Roughly 14k lines under src/, REST + GraphQL + WebSocket, Postgres via Prisma, deployed on Render.
- Unit tests are jest (
src/**/__tests__,tests/*.test.ts), with a coverage gate. - Integration tests are vitest (
tests/integration/,vitest.integration.config.ts, Docker). - Don't mix the two runners in one file.
Known state of main before you start
tsc --noEmit and the unit suite are green. The Integration tests CI job is red, and so is Load test — both predate this batch. Open PRs #177 and #178 address them. If the integration job is red when you open a PR, that is not your fault; say so in the PR and carry on.
Four modules are shipped, closed as done, and imported by nothing: src/indexer/checkpoint.ts, src/ingest/reorg.ts, src/middleware/opa.ts, and src/api/candles.ts + src/workers/ohlc-refresh.ts. So the live indexer today has no reorg handling and no atomic checkpointing, despite both features being closed. Two issues below start unpicking that — don't assume a closed issue means a wired feature.
Ground rules
- Every PR needs a test that fails before the change and passes after, unless the issue says otherwise.
- Don't widen a Prometheus label to something unbounded — addresses and contract ids must never become label values.
- Nothing may log or return a raw database error, a connection string, or a provider URL.
- Don't reformat a file you're changing. A diff that is 90% whitespace hides the 10% that matters.
Required: Before submitting, join the contributor Telegram so your work can be tracked and counted toward the Stellar Wave: https://t.me/+fxHXq8f1SwlkZDBk
Activity
Venrable18 commentedon Sep 24, 2026
@Venrable18 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Venrable18 to this issue.
premiuslol commentedon Sep 24, 2026
@premiuslol has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @premiuslol to this issue.
deshrajvermay9517-png commentedon Sep 25, 2026
@deshrajvermay9517-png has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @deshrajvermay9517-png to this issue.
JemimahEkong commentedon Sep 26, 2026
@JemimahEkong has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @JemimahEkong to this issue.
drips-wave commentedon Sep 26, 2026
Congratulations, @JemimahEkong! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.
🧑💻 @JemimahEkong: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
Warning
When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊