Difficulty: Expert
Type: performance
Background
The app supports multiple chains (mainnet, base, sepolia) and configurable RPC URLs (NEXT_PUBLIC_WALLET_RPC_MAINNET, etc.) via lib/wallet/config.ts, with a currently single injected wallet connector, per the README's Environment Variables and Wallet Chains documentation.
Problem
As configured, each chain relies on a single RPC endpoint (whether the wagmi default or the configured browser-safe URL) with no fallback if that endpoint is slow, rate-limited, or down, and only one connector type is supported — if a member's injected wallet isn't available (mobile browser without an extension, etc.), there's no alternative connection path, hurting real-world reliability.
Expected outcome
lib/wallet/config.ts supports configuring multiple RPC endpoints per chain with automatic failover (and basic health-based deprioritization of a failing endpoint), and the wallet connector configuration is extended to support at least one additional connector type (e.g., WalletConnect) with graceful fallback/prompting when injected isn't available.
Suggested implementation
- Extend the
NEXT_PUBLIC_WALLET_RPC_* variables (or introduce comma-separated variants) to accept multiple URLs per chain, and use viem's fallback transport (fallback([...])) to compose them with retry/ranking behavior.
- Add health tracking (e.g., recent failure count per endpoint) to deprioritize a consistently failing RPC without permanently blacklisting it (allow recovery).
- Extend
NEXT_PUBLIC_WALLET_CONNECTORS support beyond injected to include at least one additional wagmi connector, with the connect-button UI (components/wallet/connect-button.tsx) offering a fallback path when no injected wallet is detected.
- Update
lib/wallet/config.ts's validation (ConfigError) to cover the new multi-RPC and multi-connector configuration shapes.
- Add tests simulating a failing primary RPC endpoint correctly falling back to a secondary, and simulating no injected wallet being present to verify the fallback connector path is offered.
- Document all new configuration in
.env.example and the README's Environment Variables table.
Acceptance criteria
Likely affected files/directories
lib/wallet/config.ts
lib/wallet/providers.tsx
components/wallet/connect-button.tsx
.env.example, README.md
Difficulty: Expert
Type: performance
Background
The app supports multiple chains (
mainnet,base,sepolia) and configurable RPC URLs (NEXT_PUBLIC_WALLET_RPC_MAINNET, etc.) vialib/wallet/config.ts, with a currently singleinjectedwallet connector, per the README's Environment Variables and Wallet Chains documentation.Problem
As configured, each chain relies on a single RPC endpoint (whether the wagmi default or the configured browser-safe URL) with no fallback if that endpoint is slow, rate-limited, or down, and only one connector type is supported — if a member's injected wallet isn't available (mobile browser without an extension, etc.), there's no alternative connection path, hurting real-world reliability.
Expected outcome
lib/wallet/config.tssupports configuring multiple RPC endpoints per chain with automatic failover (and basic health-based deprioritization of a failing endpoint), and the wallet connector configuration is extended to support at least one additional connector type (e.g., WalletConnect) with graceful fallback/prompting wheninjectedisn't available.Suggested implementation
NEXT_PUBLIC_WALLET_RPC_*variables (or introduce comma-separated variants) to accept multiple URLs per chain, and use viem's fallback transport (fallback([...])) to compose them with retry/ranking behavior.NEXT_PUBLIC_WALLET_CONNECTORSsupport beyondinjectedto include at least one additional wagmi connector, with the connect-button UI (components/wallet/connect-button.tsx) offering a fallback path when no injected wallet is detected.lib/wallet/config.ts's validation (ConfigError) to cover the new multi-RPC and multi-connector configuration shapes..env.exampleand the README's Environment Variables table.Acceptance criteria
.env.exampleupdatedLikely affected files/directories
lib/wallet/config.tslib/wallet/providers.tsxcomponents/wallet/connect-button.tsx.env.example,README.md