fix: use configured rpc for ENS lookups#2392
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe ChangesProvider Caching with RPC URL Fallback
🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 |
Summary
Fixes ENS lookups so they use the RPC URL configured for the chain instead of always falling back to viem's default transport.
Problem
getEnscreates a viem public client throughgetProvider, but the client currently usestransport: http()without passing the configuredchain.rpcUrl. For mainnet ENS resolution this can fall back to viem's default RPC endpoint, which makes custom chain RPC configuration ineffective.Changes
chain.rpcUrl || chain.publicRpcUrlwhen creating the viem HTTP transport.publicRpcUrlorchain.idwhen no custom RPC is present.Verification
npm exec --yes prettier@2.8.8 -- --check packages/core/src/provider.tspasses.getProviderno longer uses barehttp()and now passes the configured RPC URL.Closes #2356
Summary by CodeRabbit