Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions util/rpc-client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ export class RpcClient {
if (isRateLimitError(err)) return true
if (isExecutionTimeoutError(err)) return true
if (isRequestTimedOutError(err)) return true
if (isNoAvailableProviderError(err)) return true
if (err instanceof RpcConnectionError) return true
if (isHttpConnectionError(err)) return true
if (err instanceof HttpTimeoutError) return true
Expand Down Expand Up @@ -608,3 +609,12 @@ function isRequestTimedOutError(err: unknown): boolean {
}


function isNoAvailableProviderError(err: unknown): boolean {
// RPC aggregators (e.g. uniblock) reply with this error when none of their
// upstream providers could serve the request at that moment (a momentary
// upstream outage or quota hiccup). It is the JSON-RPC analog of an HTTP 503
// and is transient, so it must be retried rather than crash the process.
return err instanceof RpcError && /providers prevented the request from being fulfilled/i.test(err.message)
}


Loading