refactor(evm): remove unused apply_curie_hard_fork dead code#101
refactor(evm): remove unused apply_curie_hard_fork dead code#101
Conversation
Every Morph chain config — mainnet, hoodi, devnet, and
l2-genesis-generated configs — sets `curieBlock = 0` ("already on Curie").
The pre-execution handler guards on
`ForkCondition::Block(0).transitions_at_block(block_number)`, which only
fires when `block_number == 0`. Block 0 is genesis and never flows
through `BlockExecutor::apply_pre_execution_changes`, so
`apply_curie_hard_fork` is unreachable in every Morph environment.
The L1GasPriceOracle Curie slots (6/7/8/9) are instead initialized by
the contract owner via regular transactions after launch (e.g. mainnet
block 863 calls the oracle's initializer via a standard tx), which
already flow through `commit_transaction` and the normal state hook.
This PR removes:
- `crates/evm/src/block/curie.rs` (the function + its unit test)
- the module declaration, import, and call site in
`crates/evm/src/block/mod.rs`
- `CURIE_L1_GAS_PRICE_ORACLE_STORAGE` and its `INITIAL_*`/`IS_CURIE`
inputs in `crates/revm/src/l1block.rs`, plus the associated unit test
- the re-exports in `crates/revm/src/lib.rs`
`MorphHardfork::Curie`, `is_curie()`, the chainspec `curieBlock`
parsing, and the Curie L1-fee formula branch in `L1BlockInfo::try_fetch`
are all retained — those remain active code paths.
No runtime behavior changes. Verified with `cargo check`, `cargo clippy
--all --all-targets -- -D warnings`, `cargo fmt --all -- --check`,
`cargo test --all`, `cargo test --doc --all`, and `make test-e2e` (77
integration tests passing).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThis PR removes the Curie hardfork transition implementation and its module declaration, deletes Curie-related constants and re-exports, and updates configuration to silence a specific advisory. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
…-0104 cargo-deny on this PR fails with: error[vulnerability]: Reachable panic in certificate revocation list parsing rustls-webpki 0.103.10 ID: RUSTSEC-2026-0104 Fix shipped in 0.103.13 (2026-04-21). cargo update is a clean patch bump (no other lockfile changes). Lets the cargo-deny CI step pass without us having to ignore the advisory.
… yanked) cargo-deny still failing after the rustls-webpki bump. New advisory: error[unmaintained]: core2 is unmaintained, all versions yanked ID: RUSTSEC-2026-0105 Maintainer stopped maintaining and yanked every published version, so `cargo update -p core2` can't pick a non-yanked one. core2 is a transitive dep we don't pull directly; the fix would be to drop whichever upstream crate still pulls it in. Until that lands, ignore the advisory with a note pointing at the upstream issue.
Summary
apply_curie_hard_forkand related constants — the function is unreachable in every Morph environment and has been dead code since Morph launched.MorphHardfork::Curie,is_curie(),curieBlockchainspec parsing, and the Curie L1-fee formula branch inL1BlockInfo::try_fetch— those are active code paths.Why it's dead code
Every Morph chain config — mainnet, hoodi, devnet, and l2-genesis-generated configs — sets
curieBlock = 0(semantics: already on Curie). The pre-execution handler guards on:transitions_at_block(X)returns true only whenX == curieBlock == 0. Block 0 is genesis and never flows throughBlockExecutor::apply_pre_execution_changes, so the call site is unreachable. The test fixtures that usecurieBlock = 200(crates/chainspec/src/spec.rs:549/607) only exerciseForkConditionparsing andis_curie_active_at_block; they never construct aMorphBlockExecutorand so don't invoke the removed code either.The L1GasPriceOracle's Curie slots (6/7/8/9) are in fact initialized by the contract owner via a regular transaction after launch — e.g. mainnet block 863 (tx
0x10fab2...from the oracle owner) sets slot 9 via a standard call, which already flows throughcommit_transactionand the normal state hook. devnet behaves the same way: the genesis generator (ops/l2-genesis/morph-chain-ops/genesis/config.go) only sets slots 0–4, and the Curie slots stay zero until an operator invokes the hardhatgasOracleEnableCurietask.What's removed
crates/evm/src/block/curie.rs— the entire file (function + unit test)crates/evm/src/block/mod.rs— module declaration, import, and the transition call sitecrates/revm/src/l1block.rs—CURIE_L1_GAS_PRICE_ORACLE_STORAGEplus itsINITIAL_*/IS_CURIEinputs and their unit testcrates/revm/src/lib.rs— the five corresponding re-exportsTest plan
cargo check --allcargo fmt --all -- --checkcargo clippy --all --all-targets -- -D warningscargo test --allcargo test --doc --allmake test-e2e— 77/77 integration tests passingSummary by CodeRabbit