feat: add RPC fallback resilience for unchained outages#12017
Draft
0xApotheosis wants to merge 1 commit intodevelopfrom
Draft
feat: add RPC fallback resilience for unchained outages#120170xApotheosis wants to merge 1 commit intodevelopfrom
0xApotheosis wants to merge 1 commit intodevelopfrom
Conversation
When unchained's RPC proxy returns 503s, first-class EVM chains lose all functionality. This adds public fallback RPCs so the app degrades gracefully instead of breaking completely. - Add FALLBACK_RPC_URLS constants and public fallback endpoints for all 32 EVM chains in viemClient.ts (viem transport layer) - Add EvmBaseAdapter fallback for getAccount, broadcastTransaction, and getGasFeeData that routes through the viem client when unchained fails - Add CSP connect-src entries for all fallback RPC origins via a shared fallbackRpcUrls.ts constants file Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
When unchained's MoralisService returns 503 errors, all first-class EVM chains break because their
VITE_*_NODE_URLenv vars point to unchained's/api/v1/jsonrpcproxy. This PR adds public fallback RPCs at both the viem transport layer and the chain adapter layer so the app degrades gracefully instead of failing completely.Three layers of change:
viemClient.ts— AddedFALLBACK_RPC_URLSconstants andcreateFallbackTransport()helper. All 32 EVM chain viem clients now have public fallback RPCs (LlamaRPC, official chain RPCs). Previously only ETH, BSC, and Base had any.EvmBaseAdapter.ts— Added fallback paths forgetAccount(),broadcastTransaction(), andgetGasFeeData()that route through the viem client (which now has public fallback transports) when unchained fails. Token balances and tx history gracefully degrade to empty during outage.CSP
connect-src— Createdheaders/csps/chains/fallbackRpcUrls.tsas a shared constants file. All 32 chain CSP configs now import and spread fallback RPC origins from this file.Issue (if applicable)
Risk
Medium — Adds fallback network paths but does not modify any happy-path behavior. When unchained is healthy, no change in behavior. Fallbacks only activate on unchained failure.
Testing
Engineering
.env:yarn devand connect a wallet with ETHUnchained getAccount failed for eip155:1, falling back to direct RPCOperations
This is infrastructure resilience — no user-facing UI changes. When unchained is healthy, behavior is identical. When unchained is down, users will see native balances (but not token balances) and can still send transactions, vs a completely broken experience today.
Screenshots (if applicable)
N/A — no UI changes
🤖 Generated with Claude Code