Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
5443780
feat(interpreter): hooks for completed writes and frame starts
RealiCZ Oct 20, 2026
08d0cdb
test: the instruction hooks at their call sites, on the plain and the…
RealiCZ Oct 20, 2026
7c6172e
docs: the completed-write and frame-start hooks in MEGAETH-FORK.md
RealiCZ Oct 20, 2026
84f4bf0
refactor: keep the instruction-hook kinds exhaustive
RealiCZ Oct 20, 2026
6147a76
docs: the instruction-hook kinds are exhaustive in MEGAETH-FORK.md
RealiCZ Oct 20, 2026
f3a4e91
docs: precompiles defined outside the fork price themselves from the …
RealiCZ Oct 21, 2026
6df1665
feat(gas): a byte pool, a history allowance and a start-charge carrie…
RealiCZ Oct 21, 2026
7373a47
feat(gas): schedule entries for the byte-pool forward share and the c…
RealiCZ Oct 21, 2026
2ccf713
feat(interpreter): forward the byte pool, the start charge and the hi…
RealiCZ Oct 21, 2026
3a3c545
feat(handler): seed, settle and refund the byte pool and the start ch…
RealiCZ Oct 21, 2026
a05ef6e
test: the byte pool, the start charge and the allowance at the handle…
RealiCZ Oct 21, 2026
3351330
docs: the byte pool, the start charge and the history allowance in ME…
RealiCZ Oct 21, 2026
2726bc4
perf: the frame-start hook declares the start charge on the start, no…
RealiCZ Oct 21, 2026
f538e25
perf(gas): the byte pool's crossing is a bit beside the failed-charge…
RealiCZ Oct 21, 2026
4953722
docs: the start charge on the start, the crossing as a bit and their …
RealiCZ Oct 21, 2026
08330cf
feat(context): the code-deposit admission hook is lent the creating f…
RealiCZ Oct 21, 2026
384bb61
fix(handler): a precompile answer's pool is the share less what its p…
RealiCZ Oct 21, 2026
5ec9eaf
test: the byte pool at a creating transaction, a depth refusal, a par…
RealiCZ Oct 21, 2026
731c02d
docs: the admission hook's tracker, answers' pools and charges, and t…
RealiCZ Oct 21, 2026
4bb5dd1
feat(handler): the first frame's settlement in one function a chain's…
RealiCZ Oct 21, 2026
23aad90
fix(gas): bound the byte net to the signed range, asserted in debug b…
RealiCZ Oct 21, 2026
c3df12c
test: a precompile answer to a value call carries the history allowance
RealiCZ Oct 21, 2026
89da5cb
docs: older encodings decode with the new fields' defaults only in fo…
RealiCZ Oct 21, 2026
b5da5cf
fix(gas): the byte net stays off i64::MIN, whose negation saturates
RealiCZ Oct 21, 2026
1009efc
docs: the shared first-frame settlement, consumers at revisions and e…
RealiCZ Oct 21, 2026
e0d0f7e
feat(interpreter): a creation's start carries the address it takes
RealiCZ Oct 21, 2026
a27afdc
feat(interpreter): a SELFDESTRUCT's completed write carries the balan…
RealiCZ Oct 21, 2026
a739944
test: a destruction that puts a drained beneficiary back as loaded ta…
RealiCZ Oct 21, 2026
8306596
chore(interpreter): one helper reads the running account for both hoo…
RealiCZ Oct 21, 2026
48dc211
test: a creation's input holds the address and a CREATE2's init-code …
RealiCZ Oct 21, 2026
f29bac2
test: the destruction tests assert the rebuilt balances, not mega-evm…
RealiCZ Oct 21, 2026
2bd45ea
docs: the creation start's address and the destruction's prior balanc…
RealiCZ Oct 21, 2026
42e4c35
docs: REVIEW.md's serde(default) line keeps the format caveat
RealiCZ Oct 21, 2026
04e294d
docs: MEGAETH-FORK.md states the consumer rules, not a consumer inven…
RealiCZ Oct 22, 2026
f9a7e19
feat(gas): resource pools in place of the byte pool, and a reservoir …
RealiCZ Oct 22, 2026
cc9956f
test: each pool and the reservoir are forwarded by their own shares a…
RealiCZ Oct 22, 2026
ec7c080
test: the reservoir share at depth, past the share, on a restoration,…
RealiCZ Oct 22, 2026
3549ea9
docs: resource pools, the reservoir share and a creation start's woul…
RealiCZ Oct 22, 2026
69d42ed
fix(handler): the runtime out-of-gas stand-in takes the reservoir and…
RealiCZ Oct 22, 2026
692f411
fix(gas): a child's reservoir share is all but the caller's part, rou…
RealiCZ Oct 22, 2026
f5b8169
test: the reservoir share through a creation, a collision, a creation…
RealiCZ Oct 22, 2026
bf2ec77
chore: comments and test docs name the pools and the added-back reser…
RealiCZ Oct 22, 2026
961915e
docs: the reservoir share's rounding, the runtime out-of-gas stand-in…
RealiCZ Oct 22, 2026
c4b2bc5
test: a system call's frame takes every pool whole and settles them back
RealiCZ Oct 22, 2026
27e12c9
docs: the pools' cost at the final head in MEGAETH-FORK.md
RealiCZ Oct 22, 2026
e9eabd0
fix(gas): an answer drawn past its pool share fails closed, as a cros…
RealiCZ Oct 22, 2026
6f76ad3
fix(gas): the share entries are the caller's kept percent, so a table…
RealiCZ Oct 22, 2026
0d4b5f6
fix(handler): a debug build refuses a first frame settled into gas th…
RealiCZ Oct 22, 2026
7236a75
test(handler): a refill beside a kept reservoir and a child's spill c…
RealiCZ Oct 22, 2026
107cf3f
test: an inspector's creation answer and a creation's runtime out-of-…
RealiCZ Oct 22, 2026
c477080
docs: the two share roundings are fixed by the fork, not by the sched…
RealiCZ Oct 22, 2026
ab74a51
docs: the pools' cost at the head with the review fixes, and the adop…
RealiCZ Oct 22, 2026
3b5f9ed
fix(gas): the pools' kept entries move below the reservoir's, so a la…
RealiCZ Oct 22, 2026
0741637
test: the inspector's answers share one gas builder and name their st…
RealiCZ Oct 22, 2026
83aea8c
docs: the check's measured cost, and that only the pools' adoption fa…
RealiCZ Oct 22, 2026
41c0981
feat(interpreter): a frame's run returns an action set before it, bef…
RealiCZ Oct 22, 2026
a52e78c
feat(handler): a frame's run result reaches the EVM once, before the …
RealiCZ Oct 22, 2026
89e796d
test(inspector): revm's own EVM gives the callbacks, results and stat…
RealiCZ Oct 22, 2026
e3beab4
docs: a pending action at a frame's run and a frame's run result, as …
RealiCZ Oct 22, 2026
f38073e
test: a creation set at a frame's start runs before the frame, the re…
RealiCZ Oct 22, 2026
2812445
docs: where the run-result hook is reached for a wrapping EVM, why it…
RealiCZ Oct 22, 2026
d033fea
fix(inspector): a frame whose action is set when it is built is not h…
RealiCZ Oct 22, 2026
9f4a462
test(inspector): an inspector's halt in initialize_interp ends a fram…
RealiCZ Oct 22, 2026
897b90d
test(inspector): the run-result hook's rewrite of the transaction's f…
RealiCZ Oct 22, 2026
ff7c3ed
docs: a frame whose action is set when it is built is not handed to i…
RealiCZ Oct 22, 2026
6aee523
fix(inspector): the inspected run marks a frame finished after the in…
RealiCZ Oct 22, 2026
d352b71
test(inspector): an inspector's action in initialize_interp is return…
RealiCZ Oct 22, 2026
47d0758
docs: the initialize_interp baseline change can change an inspector's…
RealiCZ Oct 22, 2026
b83996f
docs: where a frame is marked finished around the run-result hook, by…
RealiCZ Oct 22, 2026
2fc8edf
test(inspector): name the frame type that hides once finished, and ma…
RealiCZ Oct 22, 2026
fd230a3
Merge branch 'cz/feat/mega6-s2lite-move-out' into cz/feat/mega7-hooks…
RealiCZ Oct 23, 2026
bd2ad8d
feat(state): lend an account's original info by reference
RealiCZ Oct 23, 2026
a42714c
docs: a creation's pool forward is counted under Resource pools, in M…
RealiCZ Oct 23, 2026
78276b4
test(state): compare every field of the original info lent by reference
RealiCZ Oct 26, 2026
b5fbc10
docs: rule 2 names the MegaETH accounting the fork carries, and rule …
RealiCZ Oct 23, 2026
2b48786
docs: what the fork carries, by class, as the plan for the next base-…
RealiCZ Oct 23, 2026
b747c75
docs: once a consumer spec is sealed, a result-changing pick lands be…
RealiCZ Oct 23, 2026
596f79d
docs: the state-gas price entry records its upstream signature change…
RealiCZ Oct 23, 2026
4d8e063
docs: rule 2 no longer claims necessity for accounting a consumer can…
RealiCZ Oct 23, 2026
74f4f9a
docs: the overview no longer says the carried accounting has to move …
RealiCZ Oct 23, 2026
b418c58
docs: the allowance entry says what the hook sees of a start, not tha…
RealiCZ Oct 23, 2026
b370b53
docs: the reservoir consumer entry says the kept part stays in the ca…
RealiCZ Oct 26, 2026
f9cb0b7
feat(context): a start lifecycle record in the frame stack, its hooks…
RealiCZ Oct 26, 2026
b74d3f6
feat(handler): open, settle and end the start lifecycle on revm's run…
RealiCZ Oct 26, 2026
0094ea4
feat(inspector): report an inspector's answer, a replaced tracker and…
RealiCZ Oct 26, 2026
ba0eefe
feat(interpreter): a frame-start hook may name the child's reservoir …
RealiCZ Oct 26, 2026
c3e1f5e
fix(context): the marks' docs say what their values print and when tw…
RealiCZ Oct 26, 2026
e93df93
test(inspector): the runtime out-of-gas stand-in leaves the record cl…
RealiCZ Oct 26, 2026
2fca497
fix(handler): a halted transaction consumes only the regular gas its …
RealiCZ Oct 26, 2026
ef1b78b
perf(handler): frame_run opens a child's start as the frame consumes …
RealiCZ Oct 26, 2026
67d0e86
perf(context): the record's child slots grow with the frame stack and…
RealiCZ Oct 26, 2026
c7c847d
test: the halt cases' docs describe the case, and the halt rule's tes…
RealiCZ Oct 26, 2026
337bc86
fix(context): a stack of zero-sized frames grows its child slots by t…
RealiCZ Oct 26, 2026
778f71b
docs(context): frame_settle says a halted transaction consumes only t…
RealiCZ Oct 26, 2026
f095f3a
docs: a Start lifecycle entry under Hooks says where revm opens and s…
RealiCZ Oct 26, 2026
8f44bb2
docs: the start lifecycle entry matches the delivered API: a split ca…
RealiCZ Oct 26, 2026
a3f7ded
docs: the start lifecycle entry says where each frame_run opens, that…
RealiCZ Oct 26, 2026
426217b
docs: the start lifecycle entry says a split does not guarantee a con…
RealiCZ Oct 26, 2026
bd12d7b
chore: check the fork with Rust 1.97.0
RealiCZ Oct 27, 2026
2b1c7ab
feat!: the pools, the start charge and the history allowance leave th…
RealiCZ Oct 27, 2026
d7c4265
feat!: the reservoir is forwarded and settled as upstream's again
RealiCZ Oct 27, 2026
72cdbf1
test(handler): a frame result is 208 bytes on a 64-bit target
RealiCZ Oct 27, 2026
b86f160
docs: MEGAETH-FORK.md drops the pools, the reservoir share, the start…
RealiCZ Oct 27, 2026
87ded5c
test: the reservoir settlement tests' doc comments wrap at the line w…
RealiCZ Oct 27, 2026
c71d578
refactor(interpreter): the frame-start hook's helper answers the rese…
RealiCZ Oct 27, 2026
4c8f0d4
test(handler): the frame-result size test is a test file of its own
RealiCZ Oct 27, 2026
236f6d9
fix(precompile): charge modexp before the Osaka size bound
RealiCZ Nov 12, 2026
a125b2c
fix(precompile): match modexp saturated gas boundary
RealiCZ Nov 12, 2026
df02eaa
feat(gas): give-backs to the reservoir alone behind a switch, and a l…
RealiCZ Nov 13, 2026
4109715
test(handler): drop an unused import from the give-back tests
RealiCZ Nov 13, 2026
2b71cb6
fix(gas): count what a halted child paid from regular gas on its call…
RealiCZ Nov 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
322 changes: 306 additions & 16 deletions MEGAETH-FORK.md

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ It is read by the automated reviewer as well as by people.
1. **Superset.** The public API of every published crate stays a superset of the crates.io baseline recorded in `scripts/mega/crates.txt`.
The `Semver` workflow checks API changes against the pull request base; reviewers check baseline compatibility and the documented exceptions.
A PR that must break the superset carries the `api:exception` label and lists in its body every deviating item with the consumers it was checked against (`reth`, `alloy-evm`, `revm-inspectors`, the `op-revm` fork).
2. **Thin layer.** The fork adds hooks and data, never MegaETH semantics.
2. **Hooks and data, and rule 2's set.** The fork adds hooks and data, and no MegaETH semantics beyond the bounded set of accounting `MEGAETH-FORK.md` rule 2 names.
If a change makes a design decision (a price, a limit, a policy), ask for it to move to `mega-evm` and for the fork to expose only the hook it needs.
A change that adds to rule 2's set must argue every condition rule 2 lists, the first above all: why a hook on the state revm exposes cannot make the same decision.
3. **`no_std`.** No unguarded `std::`, no new dependency that enables `std` by default, no allocation in a path that did not allocate before.
The CI checks both riscv targets; the reviewer checks the intent.
4. **One topic per PR, conventional prefix on every fork-authored commit.** Fork-authored commits and PR titles start with `feat`, `fix`, `chore`, `docs`, `ci` or `test` and say what changed; cherry-picked commits keep upstream's subject (`MEGAETH-FORK.md` rule 4); `git log --oneline <base>..main` (`<base>` from `scripts/mega/base.txt`) is the fork's changelog and must stay readable.
Expand All @@ -20,8 +21,8 @@ It is read by the automated reviewer as well as by people.

| Label | Look for |
|---|---|
| `mega:cherry-pick` | The title names the upstream commit (`chore: cherry-pick upstream <sha> — <title>`) or, for a batch, the upstream pull requests (`chore: cherry-pick upstream fixes #a #b …`); branch commits keep upstream's subject; a batch stays within one crate or subsystem; a precompile pick reports its tests under mutually exclusive feature sets (the `std`-only fallback run, the default set, all features, and the backend feature it changes); the body links the `Sweep <tag>` issue, lists the `-x` trailers and, for a performance pick, cites the upstream benchmark reference; the diff equals the upstream diff apart from conflicts the message records; nothing MegaETH-specific rides along |
| `mega:hook` | New logic in new files where practical; upstream files get a `mod` line or a call site; a default implementation keeps existing behaviour byte for byte; a new serialized field carries `serde(default)` so payloads that predate it still decode |
| `mega:cherry-pick` | The title names the upstream commit (`chore: cherry-pick upstream <sha> — <title>`) or, for a batch, the upstream pull requests (`chore: cherry-pick upstream fixes #a #b …`); branch commits keep upstream's subject; a batch stays within one crate or subsystem; a precompile pick reports its tests under mutually exclusive feature sets (the `std`-only fallback run, the default set, all features, and the backend feature it changes); the body links the `Sweep <tag>` issue, lists the `-x` trailers and, for a performance pick, cites the upstream benchmark reference; the diff equals the upstream diff apart from conflicts the message records; nothing MegaETH-specific rides along; once a consumer spec is sealed, a pick that moves a result that spec reaches carries the switch that keeps it, or is not taken, and a pick without a switch carries a code-based argument that no sealed spec reaches the changed behaviour, with targeted regression tests (the consumer's outcome check is supporting evidence) (`MEGAETH-FORK.md`, Tracking upstream) |
| `mega:hook` | New logic in new files where practical; upstream files get a `mod` line or a call site; a default implementation keeps existing behaviour byte for byte; a new serialized field carries `serde(default)`, so that in a format that carries field names (JSON) payloads that predate it decode with the default; a positional format (bincode) cannot read them whatever the attribute, as `MEGAETH-FORK.md` (Hooks) says |
| `mega:vendor` | The vendored crate keeps its upstream version number and a note of the upstream commit it was taken from; its own tests run in CI |
| `mega:ci` | Workflows pin action SHAs; nothing requires a secret the repository does not have; the local equivalent of every job is documented |
| `mega:rebase` | `scripts/mega/base.txt`, `scripts/mega/crates.txt`, `rust-toolchain.toml` and the baseline table move together; the upstream tag comes in as a merge commit, not a rebase; the merged tree is compared with the new tag and carried picks reconciled; the PR carries `api:exception` for upstream's own API changes |
Expand Down
9 changes: 9 additions & 0 deletions crates/context/interface/src/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@ pub trait Cfg {
fn legacy_journal_semantics(&self) -> bool {
false
}

/// Returns whether every give-back of state or history gas credits the reservoir alone
/// (`GasTracker::reservoir_only_give_backs`), which revm sets on the transaction's gas and on
/// every frame's. Default is `false`, EIP-8037's tracker.
#[inline]
fn reservoir_only_give_backs(&self) -> bool {
false
}
}

/// What bytecode analysis to perform
Expand Down Expand Up @@ -264,5 +272,6 @@ mod tests {
let cfg = RequiredOnly(GasParams::default());
assert!(!cfg.legacy_journal_semantics());
assert!(!cfg.enable_amsterdam_eip7708());
assert!(!cfg.reservoir_only_give_backs());
}
}
Loading
Loading