chore: update arbitrum event cache to use alchemy#1268
Conversation
📝 WalkthroughWalkthroughThe Arbitrum API infrastructure is migrated from Infura to Alchemy by updating the transport endpoint in the controller and replacing the API key environment variable from INFURA_API_KEY to ALCHEMY_API_KEY across configuration files. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
node/coinstacks/arbitrum/api/src/controller.ts (1)
15-21:⚠️ Potential issue | 🔴 CriticalAlchemy migration is incomplete: controller still requires
INFURA_API_KEY.The endpoint was switched to Alchemy, but this file still reads and validates
INFURA_API_KEY. Withsample.envnow usingALCHEMY_API_KEY, the service can fail fast at startup due to missing env var.Suggested fix
-const INFURA_API_KEY = process.env.INFURA_API_KEY +const ALCHEMY_API_KEY = process.env.ALCHEMY_API_KEY ... -if (!INFURA_API_KEY) throw new Error('INFURA_API_KEY env var not set') +if (!ALCHEMY_API_KEY) throw new Error('ALCHEMY_API_KEY env var not set') ... const infuraClient = createPublicClient({ chain: arbitrum, - transport: http(`https://arb-mainnet.g.alchemy.com/v2/${INFURA_API_KEY}`), + transport: http(`https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}`), })Also applies to: 34-34
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@node/coinstacks/arbitrum/api/src/controller.ts` around lines 15 - 21, The controller still reads and validates INFURA_API_KEY but the project migrated to Alchemy; add reading of ALCHEMY_API_KEY (const ALCHEMY_API_KEY = process.env.ALCHEMY_API_KEY) and replace/remove uses and checks of INFURA_API_KEY so startup validates ALCHEMY_API_KEY instead (update any throw new Error('INFURA_API_KEY env var not set') to reference ALCHEMY_API_KEY and remove the unused INFURA_API_KEY constant), locating changes around the INFURA_API_KEY, RPC_URL and RPC_API_KEY declarations in controller.ts.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@node/coinstacks/arbitrum/api/src/controller.ts`:
- Around line 15-21: The controller still reads and validates INFURA_API_KEY but
the project migrated to Alchemy; add reading of ALCHEMY_API_KEY (const
ALCHEMY_API_KEY = process.env.ALCHEMY_API_KEY) and replace/remove uses and
checks of INFURA_API_KEY so startup validates ALCHEMY_API_KEY instead (update
any throw new Error('INFURA_API_KEY env var not set') to reference
ALCHEMY_API_KEY and remove the unused INFURA_API_KEY constant), locating changes
around the INFURA_API_KEY, RPC_URL and RPC_API_KEY declarations in
controller.ts.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1996a81f-c360-4fe9-81d4-0a7b9c58ac4e
📒 Files selected for processing (2)
node/coinstacks/arbitrum/api/src/controller.tsnode/coinstacks/arbitrum/sample.env
Summary by CodeRabbit