Skip to content

fix: circuit break non-retryable price source failures#101

Open
jamilahmadzai wants to merge 1 commit into
SmartDropLabs:mainfrom
jamilahmadzai:codex/smartdrop-cmc-nonretryable-circuit-95
Open

fix: circuit break non-retryable price source failures#101
jamilahmadzai wants to merge 1 commit into
SmartDropLabs:mainfrom
jamilahmadzai:codex/smartdrop-cmc-nonretryable-circuit-95

Conversation

@jamilahmadzai

@jamilahmadzai jamilahmadzai commented Jul 15, 2026

Copy link
Copy Markdown

Fixes #95

Bounty: GrantFox OSS campaign for issue #95

Summary

  • add oracle-level source circuit state for errors tagged nonRetryable, with configurable cooldown and reminder logging
  • stop retrying circuit-open price sources on every refresh cycle, retry after cooldown, and close the circuit after a successful fetch
  • expose price_source_circuits in /health and document PRICE_SOURCE_CIRCUIT_COOLDOWN_MS / PRICE_SOURCE_CIRCUIT_REMINDER_MS
  • tag CoinGecko 401/403 responses as nonRetryable so it follows the same permanent-auth-failure path as CoinMarketCap

Validation

  • npm test -- test/resilience.test.js test/config.test.js test/coinmarketcap.test.js test/coingecko.test.js --runInBand
  • npm test -- --runInBand (23 suites, 190 tests)
  • node --check src/services/priceOracle.js && node --check src/services/sources/coingecko.js && node --check src/index.js && node --check src/config.js
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CoinMarketCap's nonRetryable auth-failure flag is set but never consulted — invalid keys are retried every 30s forever

1 participant