closes #429: Add timeout and circuit breaker for external blockchain RPC calls - #830
Open
sherifatolanike wants to merge 1 commit into
Open
Conversation
…in calls - Configurable timeout per RPC endpoint (rpcConfig.ts with per-chain defaults) - Circuit breaker state machine (CLOSED/OPEN/HALF_OPEN) with failure threshold & recovery timeout - RPC provider fallback across multiple endpoints per chain - Circuit state monitoring dashboard (GET /rpc/dashboard, GET /rpc/health/:chainId) - Graceful degradation on circuit open (cache_stale / fail_fast modes) - Manual circuit reset (POST /rpc/reset with reset/open/reset_all/reset_metrics) - Prometheus metrics at GET /metrics/rpc - New error codes: RPC_TIMEOUT, RPC_CIRCUIT_OPEN, RPC_ALL_PROVIDERS_FAILED
|
@sherifatolanike 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! 🚀 |
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.
Description
Implements configurable timeout and circuit breaker pattern for external blockchain RPC calls to prevent cascading failures.
Changes
New files:
backend/services/rpc/Modified files
New API Endpoints
GET /rpc/dashboardGET /rpc/health/:chainIdPOST /rpc/resetGET /rpc/eventsGET /metrics/rpcError Codes
RPC_TIMEOUT(504) — Request exceeded timeoutRPC_CIRCUIT_OPEN(503) — Circuit breaker is open, request blockedRPC_ALL_PROVIDERS_FAILED(503) — All RPC providers exhaustedRPC_PROVIDER_NOT_FOUND(404) — No provider configured for chainTechnical Details
Closes #429