Skip to content

chore(contracts): set EVM version to paris for OP Stack compatibility#173

Merged
iap merged 4 commits into
devfrom
chore/add-evm-paris
May 19, 2026
Merged

chore(contracts): set EVM version to paris for OP Stack compatibility#173
iap merged 4 commits into
devfrom
chore/add-evm-paris

Conversation

@iap

@iap iap commented May 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Configures Foundry to use Paris EVM version for Optimism Superchain compatibility.

Why Paris?

1. OP Stack Compatibility ⭐

  • Optimism Mainnet and OP Sepolia run Paris EVM (post-Merge)
  • Using prague (default) may generate incompatible bytecode
  • Ensures contracts behave identically in tests and on-chain

2. Stability

  • Paris is production-ready and battle-tested
  • Prague is experimental (not yet on mainnet)
  • Safer for production deployments

3. Opcodes

  • Paris includes: PUSH0 (0x5f) - gas efficient
  • Prague adds: MCOPY, TLOAD, TSTORE - not yet on OP Stack

Changes

  • Add evm_version = "paris" to [profile.default]
  • Add evm_version = "paris" to [profile.integration]

Verification

# Check EVM version
cd contracts && forge config | grep evm_version
# Output: evm_version = "paris"

# Run tests
forge test --no-match-path "test/{invariant,integration}/**"
# Result: 148 tests passed ✓

Impact

  • ✅ All tests pass with Paris EVM
  • ✅ Bytecode now matches OP Stack target
  • ✅ No breaking changes to contract logic

Risk

Low - configuration only, all tests pass.

Summary by CodeRabbit

  • Chores
    • Explicitly configured the EVM version to target Paris across all development and integration compilation profiles, ensuring consistent smart contract compilation behavior across all environments.

Review Change Stack

iap added 3 commits May 19, 2026 21:13
- Fix: Remove outdated .nvmrc reference in README (now using mise)
- Fix: Update PoseidonT3.sol Solidity version from ^0.8.24 to ^0.8.25
- Docs: Update CHANGELOG with recent merged PRs (#170, #169, #168, #163)
- Refactor: Move documentation to docs/ directory for better organization
  - CONTRIBUTING.md -> docs/CONTRIBUTING.md
  - BRANCHING.md -> docs/BRANCHING.md
  - DEPLOYMENT.md -> docs/DEPLOYMENT.md
  - TROUBLESHOOTING.md -> docs/TROUBLESHOOTING.md
  - Copy THREAT_MODEL.md, KNOWN_ISSUES.md, ARCHITECTURE.md to docs/
- Update README links to reflect new docs/ structure
- Add evm_version = "paris" to foundry.toml
- Ensures bytecode compatibility with Optimism Superchain
- Paris is the EVM version used by OP Mainnet and OP Sepolia
- All 148 tests pass with Paris EVM
@iap iap requested a review from a team as a code owner May 19, 2026 16:06
@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@greptile-apps

greptile-apps Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR sets evm_version = \"paris\" in both the [profile.default] and [profile.integration] sections of contracts/foundry.toml to align Foundry's compilation target with the OP Stack's EVM level. The accompanying .gas-snapshot is regenerated, showing a uniform ~0.1–1% gas increase across all 148 tests due to the compiler no longer emitting the PUSH0 opcode (a Shanghai-era optimization).

  • foundry.toml: Adds evm_version = \"paris\" to both Foundry profiles; no other settings are changed.
  • .gas-snapshot: All 148 test gas figures are updated upward, consistent with the absence of PUSH0 in the Paris EVM target; no tests were removed or failed.

Confidence Score: 5/5

Safe to merge — configuration-only change with all 148 tests passing and gas snapshots updated consistently.

The change is limited to adding evm_version = "paris" in two Foundry profile blocks. No contract logic is modified, both profiles are updated consistently, and the regenerated gas snapshot confirms all tests still pass. The uniform gas increase across every test is the expected consequence of the compiler no longer emitting the PUSH0 opcode under the Paris target.

No files require special attention.

Important Files Changed

Filename Overview
contracts/foundry.toml Adds evm_version = "paris" to both [profile.default] and [profile.integration]; configuration-only change with no logic impact.
contracts/.gas-snapshot All 148 test gas values updated; uniform increase of ~0.1–1% consistent with PUSH0 no longer being emitted under the Paris EVM target.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[foundry.toml] --> B[profile.default]
    A --> C[profile.integration]
    B --> D["evm_version = paris\nvia_ir = true\nremappings ..."]
    C --> E["evm_version = paris"]
    D --> F[Solidity Compiler]
    E --> F
    F --> G["Paris EVM Bytecode\n(no PUSH0, no MCOPY/TLOAD/TSTORE)"]
    G --> H["OP Stack Compatible\n(Optimism Mainnet / OP Sepolia)"]
Loading

Reviews (2): Last reviewed commit: "chore: update gas snapshot for paris EVM..." | Re-trigger Greptile

Comment thread contracts/foundry.toml
Comment thread contracts/foundry.toml
Gas costs increased by ~3-5% after switching to paris EVM target.
This is expected behavior for OP Stack compatibility.
@iap iap merged commit 1cc9e07 into dev May 19, 2026
20 checks passed
@iap iap deleted the chore/add-evm-paris branch May 19, 2026 17:41
@trade trade deleted a comment from coderabbitai Bot May 25, 2026
iap added a commit that referenced this pull request Jun 2, 2026
…#173)

* chore: fix typo, bug, update docs, and reorganize project structure

- Fix: Remove outdated .nvmrc reference in README (now using mise)
- Fix: Update PoseidonT3.sol Solidity version from ^0.8.24 to ^0.8.25
- Docs: Update CHANGELOG with recent merged PRs (#170, #169, #168, #163)
- Refactor: Move documentation to docs/ directory for better organization
  - CONTRIBUTING.md -> docs/CONTRIBUTING.md
  - BRANCHING.md -> docs/BRANCHING.md
  - DEPLOYMENT.md -> docs/DEPLOYMENT.md
  - TROUBLESHOOTING.md -> docs/TROUBLESHOOTING.md
  - Copy THREAT_MODEL.md, KNOWN_ISSUES.md, ARCHITECTURE.md to docs/
- Update README links to reflect new docs/ structure

* chore(contracts): set EVM version to paris for OP Stack compatibility

- Add evm_version = "paris" to foundry.toml
- Ensures bytecode compatibility with Optimism Superchain
- Paris is the EVM version used by OP Mainnet and OP Sepolia
- All 148 tests pass with Paris EVM

* chore: update gas snapshot for paris EVM version

Gas costs increased by ~3-5% after switching to paris EVM target.
This is expected behavior for OP Stack compatibility.
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.

1 participant