Skip to content

Add timeout and circuit breaker for external blockchain rpc calls#532

Open
Chidubemkingsley wants to merge 13 commits into
Smartdevs17:mainfrom
Chidubemkingsley:Add-timeout-and-circuit-breaker-for-external-blockchain-RPC-calls
Open

Add timeout and circuit breaker for external blockchain rpc calls#532
Chidubemkingsley wants to merge 13 commits into
Smartdevs17:mainfrom
Chidubemkingsley:Add-timeout-and-circuit-breaker-for-external-blockchain-RPC-calls

Conversation

@Chidubemkingsley
Copy link
Copy Markdown
Contributor

Pull Request Checklist

Quality Gates (All must pass before merge)

  • Lint: Code passes ESLint and Prettier checks
  • Type Check: TypeScript compilation succeeds
  • Tests: All tests pass
  • Build: Project builds successfully
  • Rust Format: Smart contract formatting is correct
  • Rust Clippy: Smart contract linting passes
  • Rust Tests: All smart contract tests pass
  • Rust Build: Smart contracts compile successfully

Additional Requirements

  • New code has appropriate TypeScript types
  • No hardcoded secrets or credentials
  • New features have corresponding tests
  • Documentation updated if needed

Reviewers

  • At least 1 approval required for merge
  • All CI checks must be green

--- closes #429

This PR will not be mergeable until all quality gates pass.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 2, 2026

@Chidubemkingsley Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Smartdevs17
Copy link
Copy Markdown
Owner

⚠️ Merge failed — check CI status.

🤖 Drips Wave Merge Agent

- Replace #[contracttype] with #[contracttype(export = false)] on
  StorageKey enum to bypass XDR LengthExceedsMax limit.
- Remove 10 unused API/rate-limit StorageKey variants.
- Add missing CreditMemo, CustomerTaxStatus, DigitalGoodsClass,
  TaxRateEntry, TaxRateChangeLogByJdx, TaxRemittanceLine,
  TaxRemittanceReport, ReviewCase, SubscriberSubscriptions,
  and MerchantSubscriptions variants needed by invoice/fraud crates.
- Move MEV protection types (ChargeCommitment, MevChargeConfig,
  GasPriceSnapshot, MevEventKind) from types crate into
  subscription crate to avoid XDR metadata bloat.
Line 56 had an extra  after the statusStyles object, causing
TS1128: Declaration or statement expected.
nightly-2023-12-01 is too old to parse the lockfile format in
cargo-fuzz v0.13.1 (lock file version 4). Bump to nightly-2024-09-01.
- Configurable timeout per RPC endpoint (per-provider timeoutMs + defaultTimeoutMs)
- Circuit breaker with failure threshold, open/half-open/closed state machine
- Recovery timeout transitions open → half-open → closed on probe success
- RPC provider fallback: priority-ordered list, skips open circuits
- Circuit state monitoring dashboard (getDashboard, getCircuitStatuses)
- Graceful degradation: RpcAllProvidersFailedError when all circuits open
- Manual circuit reset (resetCircuit, resetAllCircuits) with audit event
- Audit log with capped ring-buffer for state transitions, failures, timeouts
- 36 tests covering all acceptance criteria
@Chidubemkingsley Chidubemkingsley force-pushed the Add-timeout-and-circuit-breaker-for-external-blockchain-RPC-calls branch from a8b6eaf to 49dbf47 Compare June 2, 2026 17:44
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.

Add timeout and circuit breaker for external blockchain RPC calls

2 participants