feat(subgraph): built-in retry with exponential backoff for subgraph queries - #160
Merged
Lakes41 merged 1 commit intoJul 30, 2026
Merged
Conversation
…bgraphClient Transient failures (network errors, HTTP 5xx, invalid response bodies) are now retried automatically — 3 retries by default with exponential backoff (500ms, 1s, 2s). HTTP 4xx and GraphQL-level errors are never retried. Configurable via new SubgraphClientOptions.retries / retryDelay; retries: 0 opts out entirely. Also repairs two pre-existing JSON syntax errors in package.json (missing brace after the ./zk export, stray entries in peerDependenciesMeta) that made npm unable to parse the manifest — required to run any npm script. Closes Adamantine-guild#149
3 tasks
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.
What
Adds a built-in retry mechanism with exponential backoff to
SubgraphClient, so transient subgraph/gateway failures no longer surface instantly as errors to downstream apps.retryDelay)SubgraphClientOptions.retries(default 3) andretryDelay(default 500);retries: 0opts out entirelyAll retry logic lives in
rawQuery, so every public method (getTopTraders,getTrades,getVaultSnapshots,getSyncStatus) benefits automatically. Existing error messages andWhiteChainErrorsemantics are preserved.Acceptance criteria
Also: package.json repair (required)
package.jsononmainis not parseable JSON (missing},after the./zkexport block; strayvitest/wsentries insidepeerDependenciesMeta), so no npm script can run at all on a clean checkout. This PR repairs it minimally, matching the lockfile (ws→ devDependencies, duplicatevitestdropped). Without this, the required local verification (npm run build, tests) cannot even start.Verification
Full-workspace
npm run buildstill fails onmain-pre-existing syntax errors in unrelated files (src/utils/index.ts:13-15,tsconfig.esm.json:11) — verified present on a clean checkout before this change; left untouched as they're outside this issue's scope (and possibly other campaign issues).Closes #149