Skip to content

refactor!: remove REX7 and refresh stale docs - #402

Merged
RealiCZ merged 8 commits into
mainfrom
cz/chore/drop-rex7-refresh-docs
Oct 11, 2026
Merged

RealiCZ merged 8 commits into
mainfrom
cz/chore/drop-rex7-refresh-docs

Conversation

@RealiCZ

@RealiCZ RealiCZ commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Remove the REX7 spec and the Rex7 hardfork entirely. Main stays frozen at REX6; 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 --spec default now resolve to REX6.
  • Refresh stale documentation across the repo: crate README (dependency versions, spec links, a Quick Start that runs as a doctest), mega-evme CLI docs, root guides, 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_table returned the rex6 tables; EvmTxRuntimeLimits::rex7() returned rex6(); block limits shared the REX6 match arm; precompiles used the same set; constants::rex7 was empty.
  • No is_enabled / reaches call on REX7 existed in src.
  • The 32 Rex7 rows of the cross-spec compute-gas snapshot were identical to the Rex6 rows apart from the name; the snapshot now equals main's minus those rows.
  • mega-evme goldens and fixtures are unchanged; the 84-block mainnet corpus passes.

Breaking (public API): MegaSpecId::REX7, name::REX7, MegaHardfork::Rex7, is_rex_7_active_at_timestamp, constants::rex7, and SpecName::Rex7 (state-test) are removed. No downstream repository references them.

Tooling: tests/rex7/modexp_gas.rs moved under tests/rex6/ (noted in that module's header as a cross-spec pin); spec-gate mutation generation, tools/mutation, and bench_compare.py drop 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 to docs.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.md and docs/mega-evme/: examples that no longer parsed (--create true, --codefile, --rpc instead of --fork.rpc, 32-byte access-list keys, --rpc on replay examples); cache subcommand; TX_HASH / --tx-file / --block exactly-one rule; run --help / tx --help blocks replaced with the binary's real output; opcode/prestate tracer samples regenerated; pre-block system-call read failures documented as exit 3; --dump-fixture rejects EIP-7702 too.
  • AGENTS.md, README.md, ARCH.md, SECURITY.md, REVIEW.md, bench/replay/README.md: cache subcommand, mega-state-test crate 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 spec REX6.
  • Spec pages: compute-gas.md SELFDESTRUCT row, sequencer-registry.md 30M wording, dead Optimism link in resource-limits.md, op-revm links and version table in overview.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.
  • Mutation suppression orphan check clean.
  • Every changed CLI example run against this branch's mega-evme; network examples confirmed to get past argument parsing.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T15:59:58.839047Z 90321a7 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mega-maxwell

mega-maxwell Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Claude review status

Living comment — rewritten in place. The review workflow keeps this single comment up to date instead of posting a new one each round, so it always describes the latest reviewed commit and the earlier text is intentionally gone. No reply is needed here; reply to a finding in its own review thread, and answer an open question in a reply on this PR. The next review round reconciles your answer.

🛠️ Review did not finish

Attempted 03437457..90321a7f · updated 2026-10-10T15:59:47+00:00

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

@github-actions

Copy link
Copy Markdown

🧬 Mutation testing — ✅ PASS

Nothing to test — no mutants were generated on the changed lines.

@codecov

codecov Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.7%. Comparing base (9be2513) to head (90321a7).

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed

codspeed Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 11.22%

⚠️ 16 benchmarks measured no execution time

Nothing ran under measurement, usually because the compiler removed the code under test. These results are not comparable, so they count as unchanged.

Preventing compiler optimizations

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 3 improved benchmarks
❌ 1 (👁 1) regressed benchmark
✅ 355 untouched benchmarks
⏩ 30 skipped benchmarks1

Performance Changes

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)

Open in CodSpeed

Footnotes

  1. 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. ↩

@github-actions

Copy link
Copy Markdown

🧬 Mutation testing — ✅ PASS

Diff mutation score: 100.0% (1/1 viable mutants killed)

  • caught: 1
  • survived (real gaps): 0
  • timed out (inconclusive): 0
  • suppressed (equivalent/dead-code): 0
  • unviable: 11 · timeout total: 0

No new test gaps introduced by this change. 🎉

@RealiCZ RealiCZ added spec:unstable Changes to the unstable spec (currently REX5) api:breaking Crate interface change — downstream users must update comp:mega-evme Changes to the `mega-evme` tool comp:core Changes to the `mega-evm` core crate comp:misc Changes to the miscellaneous part of this repo comp:doc Changes in the documentation labels Oct 10, 2026

@flyq flyq left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Comment thread crates/mega-evm/src/evm/spec.rs
Comment thread crates/mega-evm/examples/quick_start.rs Outdated
Comment thread crates/mega-evm/tests/rex6/modexp_gas.rs
@RealiCZ
RealiCZ merged commit f78e75c into main Oct 11, 2026
25 of 28 checks passed
@RealiCZ
RealiCZ deleted the cz/chore/drop-rex7-refresh-docs branch October 11, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api:breaking Crate interface change — downstream users must update comp:core Changes to the `mega-evm` core crate comp:doc Changes in the documentation comp:mega-evme Changes to the `mega-evme` tool comp:misc Changes to the miscellaneous part of this repo spec:unstable Changes to the unstable spec (currently REX5)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants