Skip to content

refactor(evm): remove unused apply_curie_hard_fork dead code#101

Merged
panos-xyz merged 4 commits intomainfrom
chore/remove-unused-curie-hardfork-code
May 9, 2026
Merged

refactor(evm): remove unused apply_curie_hard_fork dead code#101
panos-xyz merged 4 commits intomainfrom
chore/remove-unused-curie-hardfork-code

Conversation

@panos-xyz
Copy link
Copy Markdown
Contributor

@panos-xyz panos-xyz commented Apr 22, 2026

Summary

  • Remove apply_curie_hard_fork and related constants — the function is unreachable in every Morph environment and has been dead code since Morph launched.
  • Keep MorphHardfork::Curie, is_curie(), curieBlock chainspec parsing, and the Curie L1-fee formula branch in L1BlockInfo::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:

self.spec
    .morph_fork_activation(MorphHardfork::Curie)   // ForkCondition::Block(0)
    .transitions_at_block(block_number)            // true iff block_number == 0

transitions_at_block(X) returns true only when X == curieBlock == 0. Block 0 is genesis and never flows through BlockExecutor::apply_pre_execution_changes, so the call site is unreachable. The test fixtures that use curieBlock = 200 (crates/chainspec/src/spec.rs:549/607) only exercise ForkCondition parsing and is_curie_active_at_block; they never construct a MorphBlockExecutor and 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 through commit_transaction and 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 hardhat gasOracleEnableCurie task.

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 site
  • crates/revm/src/l1block.rsCURIE_L1_GAS_PRICE_ORACLE_STORAGE plus its INITIAL_*/IS_CURIE inputs and their unit test
  • crates/revm/src/lib.rs — the five corresponding re-exports

Test plan

  • cargo check --all
  • cargo fmt --all -- --check
  • cargo clippy --all --all-targets -- -D warnings
  • cargo test --all
  • cargo test --doc --all
  • make test-e2e — 77/77 integration tests passing

Summary by CodeRabbit

  • Chores
    • Removed support for the Curie hardfork transition, including the Curie-related gas price oracle initialization and associated public constants and re-exports.
    • Updated advisory checks to ignore a specific advisory warning.
  • Tests
    • Removed Curie-related unit tests that validated oracle/storage initialization and transitions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Warning

Rate limit exceeded

@panos-xyz has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 2 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 911de97f-c637-4bc5-86a8-44fbc8cba3ee

📥 Commits

Reviewing files that changed from the base of the PR and between cd6fa69 and bf8c910.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • crates/evm/src/block/curie.rs
  • crates/evm/src/block/mod.rs
  • crates/revm/src/l1block.rs
  • crates/revm/src/lib.rs
📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Curie Hardfork Module
crates/evm/src/block/curie.rs, crates/evm/src/block/mod.rs
Deleted the Curie transition module and apply_curie_hard_fork function; removed module declaration and the conditional invocation from apply_pre_execution_changes.
Curie Constants & Re-exports
crates/revm/src/l1block.rs, crates/revm/src/lib.rs
Removed Curie-related constants (INITIAL_L1_BLOB_BASE_FEE, INITIAL_COMMIT_SCALAR, INITIAL_BLOB_SCALAR, IS_CURIE, CURIE_L1_GAS_PRICE_ORACLE_STORAGE) and their public re-exports.
Configuration
deny.toml
Added an ignore rule for advisory RUSTSEC-2026-0105 to suppress the core2 advisory.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • chengwenxi
  • anylots

Poem

🐰 I hopped through code with curious cheer,
Curie's traces gently disappear,
Constants tucked away, modules gone,
The tree grows simpler at the dawn. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: removal of unused apply_curie_hard_fork dead code. It directly relates to the primary objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/remove-unused-curie-hardfork-code

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

panos-xyz added 3 commits May 9, 2026 16:13
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).
…-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.
@panos-xyz panos-xyz force-pushed the chore/remove-unused-curie-hardfork-code branch from cd6fa69 to e2109ca Compare May 9, 2026 08:14
Resolve the deny.toml advisory-ignore conflict by keeping the current mainline cargo-deny exceptions and dropping the obsolete core2 ignore after multihash no longer depends on core2.

Constraint: Preserve PR #101's Curie dead-code removal while making the branch mergeable with main
Confidence: high
Scope-risk: narrow
Not-tested: Conflict-only merge; CI will re-run on push
@panos-xyz panos-xyz merged commit a8641b4 into main May 9, 2026
13 checks passed
@panos-xyz panos-xyz deleted the chore/remove-unused-curie-hardfork-code branch May 9, 2026 08:37
@panos-xyz panos-xyz mentioned this pull request May 9, 2026
3 tasks
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