Skip to content

add RPC fallback#26

Merged
timbrinded merged 1 commit intomasterfrom
fix/rpc-sepolia
Mar 12, 2026
Merged

add RPC fallback#26
timbrinded merged 1 commit intomasterfrom
fix/rpc-sepolia

Conversation

@timbrinded
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings March 12, 2026 20:16
@timbrinded timbrinded merged commit 30cd7af into master Mar 12, 2026
11 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds multi-RPC fallback support to the frontend’s wagmi/RainbowKit configuration so the app can fail over between multiple RPC endpoints per chain.

Changes:

  • Introduces per-chain RPC URL lists (optionally preferring env-provided URLs) and builds a fallback(...) transport with per-URL HTTP timeouts.
  • Updates wagmi transports to use the new fallback transport for Sepolia, Base Sepolia, and Arbitrum Sepolia.
  • Extends fe/.env.example with WalletConnect project id and optional RPC override variables.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
fe/app/config/wagmi.ts Builds RPC URL lists and switches wagmi transports to a fallback transport with timeouts.
fe/.env.example Documents optional RPC override env vars and adds WalletConnect project id example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread fe/app/config/wagmi.ts
Comment on lines +10 to +11
.map((url) => url.trim())
.filter(Boolean) ?? [];
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

splitRpcUrls will throw when the env var is undefined. value?.split(",") returns undefined when value is missing, but .map(...) then runs on that undefined. Use optional chaining for the whole chain (e.g. value?.split(",")?.map(... )?.filter(...) ?? []) or parenthesize the split result before mapping.

Suggested change
.map((url) => url.trim())
.filter(Boolean) ?? [];
?.map((url) => url.trim())
?.filter(Boolean) ?? [];

Copilot uses AI. Check for mistakes.
Comment thread fe/.env.example
@@ -1,2 +1,8 @@
CRE_HELPER_SERVER_URL=http://localhost:3000
CRE_HELPER_API_KEY=replace-me
VITE_WALLETCONNECT_PROJECT_ID=replace-me
Copy link

Copilot AI Mar 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In .env.example, setting VITE_WALLETCONNECT_PROJECT_ID=replace-me will override the in-code fallback ("demo") and likely break WalletConnect for anyone who copies this file verbatim. Consider leaving it blank/commented out or setting it to demo with a note that a real project id is required for production.

Suggested change
VITE_WALLETCONNECT_PROJECT_ID=replace-me
# WalletConnect project id. "demo" is suitable for local development only;
# replace this with a real project id for production.
VITE_WALLETCONNECT_PROJECT_ID=demo

Copilot uses AI. Check for mistakes.
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.

2 participants