Summary
Calls to the price oracle fail transiently and, on sustained outages, pile up and exhaust resources. Add bounded retries with exponential backoff + jitter and a circuit breaker that fails fast when the price oracle is unhealthy.
Why this matters
Naive calls turn a transient blip into a cascading outage. Backoff + circuit breaking is the standard resilience pattern and protects the whole service.
Requirements
- Wrap the price oracle calls with retry (bounded attempts, exponential backoff + jitter).
- Add a circuit breaker: open after N consecutive failures, half-open probe after a cooldown, close on success.
- Only retry idempotent/safe operations; never retry a non-idempotent side effect blindly.
- Surface breaker state via a metric/log and a typed
upstream_unavailable error when open.
Technical guidance
- Make attempts, backoff base, and thresholds configurable with safe defaults.
- Keep the breaker state per-dependency, not global.
Edge cases — each must have a test
Acceptance criteria
Out of scope
- Distributed/shared breaker state
- Per-endpoint bulkheads
Rewards
Part of the GrantFox OSS / Official Campaign (FWC26) — this task may be rewarded. PR quality is assessed by AI: depth, correctness under edge cases, meaningful tests, and clean design are what earn the reward. Shallow changes (typos, formatting, trivial docs) do not qualify.
Summary
Calls to the price oracle fail transiently and, on sustained outages, pile up and exhaust resources. Add bounded retries with exponential backoff + jitter and a circuit breaker that fails fast when the price oracle is unhealthy.
Why this matters
Naive calls turn a transient blip into a cascading outage. Backoff + circuit breaking is the standard resilience pattern and protects the whole service.
Requirements
upstream_unavailableerror when open.Technical guidance
Edge cases — each must have a test
Acceptance criteria
npm run lint,npm test, andnpm run buildall pass locallyCloses #<issue>Out of scope
Rewards
Part of the GrantFox OSS / Official Campaign (FWC26) — this task may be rewarded. PR quality is assessed by AI: depth, correctness under edge cases, meaningful tests, and clean design are what earn the reward. Shallow changes (typos, formatting, trivial docs) do not qualify.