Skip to content

docs: standardize RPC configuration to use Infura#39

Merged
rplusq merged 1 commit into
mainfrom
docs/standardize-rpc-config
Oct 17, 2025
Merged

docs: standardize RPC configuration to use Infura#39
rplusq merged 1 commit into
mainfrom
docs/standardize-rpc-config

Conversation

@rplusq

@rplusq rplusq commented Oct 17, 2025

Copy link
Copy Markdown
Collaborator

Summary

Standardizes RPC URL configuration across the entire codebase to use the Infura-based pattern consistently.

Changes

  • Fork Tests: Updated ntt-storage-compatibility.sol to use vm.createSelectFork("optimism", block) instead of vm.envString("OPTIMISM_RPC_URL")
  • Documentation: Updated CLAUDE.md to document the Foundry RPC alias pattern and remove the manual OPTIMISM_RPC_URL export

Rationale

Previously, fork tests required manually setting OPTIMISM_RPC_URL, which:

  • ❌ Caused confusion for new team members
  • ❌ Was inconsistent with deployment scripts (which use Infura via Makefile)
  • ❌ Didn't follow Foundry's built-in RPC alias system

Now all RPC interactions follow the same pattern:

  • ✅ Use API_KEY_INFURA from .common.env
  • ✅ Leverage Foundry's optimism RPC alias defined in foundry.toml
  • ✅ Consistent across deployments, scripts, and tests

Testing

Verified fork test still works with the new pattern:

source .common.env && forge test --match-contract L2WCT_StorageCompatibility_ForkTest --force

Related

Aligns with existing patterns in:

  • evm/Makefile (line 209): Uses https://optimism-mainnet.infura.io/v3/${API_KEY_INFURA}
  • evm/foundry.toml (line 55): Defines optimism RPC alias
  • Other fork tests: StakingRewardDistributorUpgrade.t.sol, StakeWeightPermanentUpgradeFork.t.sol

🤖 Generated with Claude Code

Unifies RPC URL handling across deployments, tests, and documentation:

- Update fork tests to use 'optimism' Foundry RPC alias instead of OPTIMISM_RPC_URL env var
- Update CLAUDE.md to document Infura-based pattern for fork testing
- Aligns with project's existing Makefile and deployment script patterns

This ensures all RPC interactions use API_KEY_INFURA from .common.env,
eliminating setup confusion and following Foundry best practices.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings October 17, 2025 19:06
@claude

claude Bot commented Oct 17, 2025

Copy link
Copy Markdown

Claude finished @rplusq's task —— View job


Code Review Complete ✅

I've reviewed the PR changes that standardize RPC configuration to use Infura. The changes are well-structured and improve consistency across the codebase.

Summary

This PR successfully standardizes RPC URL configuration by:

  1. Updating the fork test to use Foundry's RPC alias pattern (vm.createSelectFork("optimism", block))
  2. Documenting the standardized approach in CLAUDE.md
  3. Removing the manual OPTIMISM_RPC_URL export requirement

Review Findings

✅ Verified Consistency

  • All 5 fork tests in the codebase now use the same pattern: vm.createSelectFork("optimism", BLOCK_NUMBER)
  • Files confirmed: StakeWeightPermanentUpgradeFork.t.sol:101, StakingRewardDistributorUpgrade.t.sol:80, StakeUpgrades.t.sol:19, ntt-storage-compatibility.sol:24, ntt-upgrade.sol:58

✅ Verified Configuration

  • foundry.toml:55 correctly defines: optimism = "https://optimism-mainnet.infura.io/v3/${API_KEY_INFURA}"
  • Makefile (line 209) uses the same Infura pattern for deployments
  • .common.env is the single source for API_KEY_INFURA

✅ Documentation Quality

  • CLAUDE.md accurately documents the fork testing setup
  • Clear explanation that the RPC alias automatically uses Infura
  • Proper removal of the obsolete OPTIMISM_RPC_URL export instruction

Minor Observation

The .optimism.env file is still sourced in the fork testing setup instructions (line 17 of CLAUDE.md), which is correct since it contains deployment-related environment variables (chain ID, addresses, etc.) that are separate from RPC configuration. This is appropriate.

Conclusion

No issues found. The changes are correct, consistent with existing patterns, and improve developer experience by standardizing RPC configuration across the entire codebase.


Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

Standardize RPC configuration to consistently use Foundry's Infura-backed RPC alias across tests and documentation.

  • Switch fork test to use vm.createSelectFork("optimism", FORK_BLOCK)
  • Update docs to reference the Foundry RPC alias and remove manual OPTIMISM_RPC_URL export

Reviewed Changes

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

File Description
evm/test/fork/l2wct/ntt-storage-compatibility.sol Uses Foundry RPC alias "optimism" in createSelectFork for consistency with project config
CLAUDE.md Documents the alias-based approach and removes manual OPTIMISM_RPC_URL setup

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@rplusq rplusq merged commit cb392ee into main Oct 17, 2025
7 of 8 checks passed
@rplusq rplusq deleted the docs/standardize-rpc-config branch October 17, 2025 19:18
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