Repository navigation
refactor!: remove REX7 and refresh stale docs - #402
Conversation
REX7 carried no behavior of its own: its instruction and gas tables, runtime limits, precompiles, constants and block limits all delegated to REX6. REX6 is now the last spec and the default; the unknown-chain fallback pins REX6 and the mega-evme --spec default is Rex6. The cross-spec ModExp pin moves into the rex6 test binary.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Claude review status
🛠️ Review did not finish Attempted This round did not publish: MODEL_SESSION_LIMIT: Claude session limit reached (5-hour quota).. Anything listed below is from the last round that did. Workflow run: https://github.com/megaeth-labs/mega-evm/actions/runs/38065733715 |
🧬 Mutation testing — ✅ PASSNothing to test — no mutants were generated on the changed lines. |
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will improve performance by 11.22%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | validate_schedule |
14.6 µs | 10.7 µs | +36.9% |
| ⚡ | is_rex_5_active_at_timestamp |
3.5 µs | 3.2 µs | +9.04% |
| ⚡ | spec_id |
3.5 µs | 3.2 µs | +9.04% |
| 👁 | revm_pinned/sstore_100 |
167 µs | 177.6 µs | -6.01% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing cz/chore/drop-rex7-refresh-docs (90321a7) with main (9be2513)
Footnotes
-
30 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
🧬 Mutation testing — ✅ PASSDiff mutation score: 100.0% (1/1 viable mutants killed)
No new test gaps introduced by this change. 🎉 |
flyq
left a comment
There was a problem hiding this comment.
Code review — remove REX7 and refresh stale docs
Reviewed at 034374579b69 · medium effort · 4 findings · 3 inline, 1 below
Inline findings
| # | Where | Finding |
|---|---|---|
| 1 | crates/mega-evm/src/evm/spec.rs:63 |
REX7 was published in 1.7.1; removal is a real API break |
| 2 | crates/mega-evm/examples/quick_start.rs:17 |
Quick Start duplicated by hand in README and example |
| 3 | crates/mega-evm/tests/rex6/modexp_gas.rs:38 |
OSAKA_SCHEDULE_SPECS is hand-maintained |
Findings that could not be anchored to the diff
crates/mega-evm/tests/rex6/main.rs:1 — line outside the diff hunks
organization · PLAUSIBLE
modexp_gas (mod at rex6/main.rs:18) covers eight specs but now sits in the Rex6 feature module whose header (lines 1-5) does not mention it.
Failure scenario
Someone looking for cross-spec ModExp pricing coverage will not find it from the Rex6 header, and the AGENTS.md layout says each spec module tests that spec's own features. Weak: the header already lists only one of ~18 modules and the rename preserves history, so this is a judgment call, not a defect.
Summary
REX7spec and theRex7hardfork entirely. Main stays frozen atREX6; the next upgrade will be introduced on the new-engine line, so there is no unstable spec on this line anymore.MegaSpecId::default(), the unknown-chain fallback (all_activated_hardforks), and the mega-evme--specdefault now resolve toREX6.ARCH.md, and a few spec pages.Why removing REX7 is behavior-neutral
REX7 carried no behavior of its own; every place it was wired was an alias of REX6:
rex7::instruction_table/rex7::gas_tablereturned therex6tables;EvmTxRuntimeLimits::rex7()returnedrex6(); block limits shared the REX6 match arm; precompiles used the same set;constants::rex7was empty.is_enabled/reachescall onREX7existed insrc.Breaking (public API):
MegaSpecId::REX7,name::REX7,MegaHardfork::Rex7,is_rex_7_active_at_timestamp,constants::rex7, andSpecName::Rex7(state-test) are removed. No downstream repository references them.Tooling:
tests/rex7/modexp_gas.rsmoved undertests/rex6/(noted in that module's header as a cross-spec pin); spec-gate mutation generation,tools/mutation, andbench_compare.pydrop REX7; one ModExp suppression is re-anchored after the line shift (all 27 suppressions still match a live mutant). Spec-gate can now only shift a REX6 check down, not up, since no later spec exists.Documentation fixes
crates/mega-evm/README.md: revm v40.0.3 / op-revm v20.0.0 (Optimism monorepo) / alloy-evm v0.36.0; upgrade links point todocs.megaeth.com/spec; REX5 and REX6 feature sections; Quick Start rewritten and run as a doctest via#[cfg(doctest)] #[doc = include_str!("../README.md")], so the README snippet is the single source.bin/mega-evme/README.mdanddocs/mega-evme/: examples that no longer parsed (--create true,--codefile,--rpcinstead of--fork.rpc, 32-byte access-list keys,--rpcon replay examples);cachesubcommand;TX_HASH/--tx-file/--blockexactly-one rule;run --help/tx --helpblocks replaced with the binary's real output; opcode/prestate tracer samples regenerated; pre-block system-call read failures documented as exit3;--dump-fixturerejects EIP-7702 too.AGENTS.md,README.md,ARCH.md,SECURITY.md,REVIEW.md,bench/replay/README.md:cachesubcommand,mega-state-testcrate row,cargo test --workspace, correct macro names and tracker paths, ARCH table of contents rebuilt (6 broken anchors), SELFDESTRUCT wording updated for revm 40's static-gas pre-charge, latest stable specREX6.compute-gas.mdSELFDESTRUCT row,sequencer-registry.md30M wording, dead Optimism link inresource-limits.md, op-revm links and version table inoverview.md; REX7 page and entries removed.Verification
cargo fmt --all --check, workspace clippy (0 warnings),cargo sort --check,cargo test --workspace --locked(2252 passed), no_std riscv check, prettier, markdownlint-cli2.mega-evme; network examples confirmed to get past argument parsing.