Dampen repeated failed SDK queries#68
Open
Seranged wants to merge 1 commit into
Open
Conversation
Cache failed query results briefly in the default SDK query cache to avoid repeated transport hits during upstream degradation.
LeonardEulerXYZ
approved these changes
Jun 28, 2026
LeonardEulerXYZ
left a comment
There was a problem hiding this comment.
Leonard review — approved
Reviewed current head c4a7670159d98c022c0c0224c61218ea62f09999 for euler-xyz/euler-sdks PR #68.
Walkthrough
- Adds
failureTtlMsto the built-inQueryCacheConfigand default query cache implementation. - Failed decorated
query*calls now rethrow from the local cache during a short cooldown instead of repeatedly hitting the underlying RPC/HTTP transport. failureTtlMs: 0preserves the prior immediate-retry behavior.- Documentation now describes the success/failure TTL split and the current V3 vault resolver path.
- Tests cover cached failures, opt-out behavior, and cooldown expiry.
Validation performed
- Inspected full diff and surrounding SDK query-cache/buildSDK context.
- Reviewed package export/type surface:
QueryCacheConfig.failureTtlMsappears in built declarations afterbuild. - Security/supply-chain sweep: no package, lockfile, workflow, script, dependency, secret, telemetry, network-target, or executable-config changes in the PR diff.
- Scalability / maintainability hygiene pass: traced the central
resolvedBuildQuery/applyBuildQuerypath across services, adapters, and plugins; this is correctly implemented once in the shared query-cache abstraction rather than duplicated per V3/RPC callsite. Similar query consumers inherit the behavior through the existing decorator wiring, while custombuildQueryconsumers remain intentionally out of scope. - Active bot/reviewer feedback: no prior comments, formal reviews, or inline review comments were present to verify/refute.
Commands run locally:
pnpm install --frozen-lockfilepnpm --filter @eulerxyz/euler-v2-sdk test -- readPathInfra.test.ts— passed; Vitest selected the package test suite, 26 files / 346 tests passed.pnpm --filter @eulerxyz/euler-v2-sdk typecheck— passed.pnpm --filter @eulerxyz/euler-v2-sdk build— passed.pnpm --filter @eulerxyz/euler-v2-sdk lint— exited 0 with existing unrelated warnings insrc/utils/irm.ts,src/utils/oracle.ts, andsrc/utils/stateOverrides/*, matching the PR test plan.
Verdict
Approved. I did not find blocking correctness, SDK API compatibility, generated-package, dependency, build, type-safety, protocol-integration, security, or downstream consumer risks.
Comment lifecycle: no prior Leonard walkthrough, formal review, or inline comments found; no cleanup needed.
Screenshots: not applicable — this PR changes SDK cache behavior and docs, not a user-visible UI.
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.
Summary
failureTtlMscache option and the current V3 vault resolve path.Changes
QueryCacheConfigwithfailureTtlMs, defaulting to 5 seconds alongside the existing success TTL.failureTtlMs: 0.Context
Test plan