Skip to content

feat(satin): consensus limits as protocol params, mega-evme on both engines, byte-price grid - #399

Merged
RealiCZ merged 65 commits into
cz/feat/satin-w5from
cz/feat/satin-w6
Oct 22, 2026
Merged

RealiCZ merged 65 commits into
cz/feat/satin-w5from
cz/feat/satin-w6

Conversation

@RealiCZ

@RealiCZ RealiCZ commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Satin's limits that change a result become protocol values carried by the Satin fork's parameters, mega-evme runs on both engines, and the test suite holds at other byte prices under a CI job of its own. Stacked on #390 (cz/feat/satin-w5).

  • The consensus limits are ProtocolLimits, Satin's hardfork params, read from the chain's schedule at the block's timestamp; the block context keeps only a builder's packing policy (BlockLimits), which can tighten a block budget and never loosen one. Moving the limits changes no execution result at today's default values.
  • MegaEvmFactory resolves the chain's limits, so an EVM a node builds outside block execution (an RPC call, a simulation) runs under the limits block execution holds its block to.
  • mega-evme is ported to Satin and rejoins the workspace: Satin runs on the in-tree engine, Equivalence through Rex6 on the released 1.7.1 CLI it links, and whole blocks replay on either engine and are compared with the chain's receipts; the 200 recorded mainnet blocks 26,400,000–26,400,199 replay on the legacy leg with every receipt and receipts root matching the chain.
  • The suite holds at other byte prices: a price-grid CI job runs it at five points on a pull request and 73 nightly, reporting beside each point how many tests a price guard held back; no parked test is left.
  • Three refactors of the limit layer and one fix: the exemption leaves the verdict type, the depth guard answers every start past the call-stack limit, the state gas held outside a frame lives on its lane, and the first frame's EIP-2780 upfront state gas is held once revm has decided the frame, as every other frame's is.
  • Review fixes: a legacy command's default spec now goes before a -- separator, the legacy leg's precompile and encoding backends are pinned (c-kzg back to the 2.1.7 the release shipped), a run under --override.limits says so in its output, a pending transaction's engine is decided at the block the replay runs it in, and seven tests whose "cannot pay" premise held only while a byte was dear derive it from the prices in effect.

The consensus limits as ProtocolLimits

Limit Class Where it lives
Per-transaction data size, KV updates, state gas; the frame data-size and KV caps; the two detention caps consensus, exact: a different value is a different receipt ProtocolLimits::tx_runtime_limits
Block execution gas, state gas, data size, KV updates both: a validator enforces the chain's value, a builder may pack tighter ProtocolLimits, with a builder cap in BlockLimits held below it by BlockLimits::within
A transaction's declared gas, encoded size and DA size; a block's encoded size and DA size building policy: only a builder applies them BlockLimits
Block gas limit the header's overwritten from the block environment, as before
  • No building-policy value reaches a transaction's result: the per-transaction limits never come from a block counter or a builder setting.
  • ProtocolLimits is serde-ready (camelCase, every field required, unknown fields refused). validate() refuses a zero limit (the value a configuration format that defaults a missing number to zero hands over; the type's own serde refuses a missing field), a transaction data-size limit below TX_BODY_SIZE (310), and a detention cap at or above MAX_TX_COMPUTE_GAS (199,987,900: the execution cap less EIP-2780's base cost and the warm access a frame that runs code pays at least), which no transaction's compute reaches, so no chain can turn detention off.
  • ProtocolLimits::DEFAULT is today's values, provisional with the constants: 13,107,200 bytes per transaction and per block, both detention caps at 20,000,000, every other limit unlimited.
  • validate_schedule requires the params for Satin and runs their validate() (require_params, ScheduleError::InvalidParams), so a node whose own schedule type attaches params without with_params still refuses a bad value at load.
  • A schedule entry kept one params value per fork, so attaching a second Satin params type silently replaced SequencerRegistryConfig; it now keeps one value per type, and MegaHardforks::fork_params_any takes (fork, TypeId).
  • MegaHardforks::protocol_limits(timestamp) resolves the limits of the fork active at a timestamp; the engine's schedule for a chain it does not know carries DEFAULT.
  • MegaBlockExecutor installs the chain's per-transaction limits at construction and again before every transaction, holds the block to the chain's budgets lowered to the builder's caps, and refuses a block whose schedule carries no limits at its timestamp (MissingProtocolLimits) or limits validate() refuses (InvalidProtocolLimits), both internal errors, at every entry point: the pre-block changes, a transaction's execution and the end of the block.
  • No building policy refuses a deposit: its declared gas, encoded size and DA size are never checked, and none of the four budgets refuses it; it still counts towards all of them.
  • What a node supplies now: ProtocolLimits in its Satin chain configuration, answered per type by its fork_params_any; a BlockLimits only on the builder path (a validator leaves the default, which restricts nothing); and its schedule to the EVM factory (below). Builder-side settings that raised a block budget above the protocol's no longer do; a test chain changes its schedule's params instead, and ProtocolLimits::loosest() is the loosest set a chain may carry (every limit unlimited, the detention caps at MAX_TX_COMPUTE_GAS - 1), result-identical to no limits for every transaction but one marked before execution (a sender or recipient that is the block beneficiary, an authority that is, or a recipient delegating to it) that spends the most compute any can.

The factory resolves the limits

  • MegaEvmFactory::with_schedule(schedule): every EVM it creates runs under the limits the schedule carries at the block's timestamp, the traced path included; where the schedule carries none there, or limits validate() refuses, it installs DEFAULT's, since an EVM cannot refuse to be built while block execution refuses such a block.
  • A schedule held in an Arc is handed over as a clone of the Arc: MegaHardforks holds for an Arc or a Box of a schedule, now stated and tested.
  • MegaEvmFactory::new() and default() install ProtocolLimits::DEFAULT's per-transaction limits rather than a bare context's: an RPC EVM that never touched limits gains the 13,107,200-byte data-size limit.
  • MegaEvmFactory::with_tx_runtime_limits is the explicit opt-out, for tests and for a caller that wants exactly the limits it names. A MegaContext built by hand still gets its limits from its caller: the execution-spec gate's equivalence mode installs no_limits() on a context it builds by hand and never goes through the factory.

mega-evme on both engines

  • The engine is the spec. Satin runs on the in-tree sources; Equivalence through Rex6 run on the released mega-evme and mega-evm 1.7.1, linked as mega-evme-legacy / mega-evm-legacy (feature legacy, on by default). A legacy command's arguments are handed to the 1.7.1 CLI as they are, but for --spec Rex6 added, before any --, to a run or tx that left --spec out (1.7.1's own default is Rex7, which is refused: it never activated and Satin supersedes it). A legacy command's output and errors are 1.7.1's.
  • Why the released CLI rather than a data boundary. The node needs a data boundary because its types must never see revm 27; the tool's legacy leg is already a frozen program whose thinnest boundary is its command line, and re-implementing its tracer, state dump and fixture dump behind a data boundary could only be a less faithful copy. Block replay, new code that runs on both engines, does use a data-only boundary.
  • replay picks the engine from the chain's activation table at the timestamp of the block it runs the transaction in (its own, or the latest for a pending one); mainnet and testnet schedule no Satin yet, so their blocks replay on the legacy engine, and --override.spec Satin is the counterfactual. An unknown chain runs Satin, where 1.7.1 ran its Rex7 fallback. Without --override.spec, a transaction replay reads the chain id (one eth_chainId) to pick the engine, and, on a chain whose table schedules Satin, the transaction's block as well (the latest block for a pending transaction).
  • Additive output. On Satin every legacy field keeps its name and meaning, and a satin object is added: the gas by ledger, the data size and write records kept, the limit that stopped the transaction, and, under --override.limits, the limits the run was held to.
  • Whole blocks, compared with the chain. replay --block N[..M] [--block-cache DIR] [--rpc URL] [--verify] [--json] runs each block on its engine after its pre-block changes and compares every receipt (status, gas used, cumulative gas used, every log) and the receipts root with the chain's; --verify exits 2 on a difference. It does not compare the state a block leaves with the header's state root, so a difference that leaves every receipt as it was (a storage write with no log) would pass; the docs say so.
  • The 200/200 acceptance. The recording of mainnet blocks 26,400,000–26,400,199 (Rex6) replays offline on the legacy leg with all 200 blocks matching the chain, receipts and receipts roots. CI replays the three checked-in blocks; the 200 run by hand from the recording (figures in the test plan).
  • The Satin counterfactual's limits. A Satin run is held to the limits of its chain's schedule at the block's timestamp; any other Satin run is a counterfactual on the engine's own fallback schedule and ProtocolLimits::DEFAULT. A chain whose schedule runs Satin without its params is refused: the tool does not guess a chain's limits.
  • --override.limits <JSON|FILE> on run, tx and replay: a JSON object in the chain-configuration shape, merged over the run's limits and held to what a chain configuration is (unknown fields, zeros, a data-size limit below 310 and a cap that never binds are refused); refused on a legacy command before it reaches the 1.7.1 parser. The run's output carries the merged limits in satin.limits_override, a block replay on the block's record and as limits overridden on its line.
  • What needs an archive RPC. replay --block fetches, for a block its cache lacks, the block, its receipts, a prestateTracer trace and the parent block's state for reads the trace does not cover: an endpoint with the debug namespace and historical state at the parent block. A Satin run of a block cached by a legacy run needs --rpc once, for the EIP-7997 factory Satin's pre-block changes read and no legacy spec does. A transaction replay forks state at the parent block over RPC, as 1.7.1 did.
  • The legacy line is pinned. tests/legacy_line.rs pins the released engine, CLI and their revm/op-revm/alloy line at the 1.7.1 lockfile's versions, and now the backends it shares with the engine that decide what it executes: the precompiles' (secp256k1, k256, sha2, ripemd, aurora-engine-modexp, arkworks for BN254, blst, c-kzg, p256), hashing and word arithmetic (alloy-primitives, ruint, sha3), and the encodings. c-kzg had drifted to 2.1.8 and is back at the 2.1.7 the release shipped (its 2.1.8 only wraps the same blst calls in helpers; the point evaluation's arithmetic is the same). alloy-rlp, alloy-trie and the alloy-sol-types family, which the engine's alloy 2 line holds above the release's versions, are pinned where they are. Transport and JSON crates float, as do derive crates outside the pinned alloy-rlp and alloy-sol-types families.
  • Packaging. cargo … -p mega-evme now names two packages; the tool is selected by --manifest-path bin/mega-evme/Cargo.toml (the release workflow, README and docs do). The legacy leg adds 153 packages to the tool's dependency graph (cargo tree --manifest-path bin/mega-evme/Cargo.toml -e normal --prefix none --locked | sort -u | wc -l: 590 with the default features, 437 with --no-default-features; 42 of them are crate names the Satin-only graph lacks, and the lockfile grows from 518 to 654 entries), and its release binary is 21.5 MB (21,463,488 bytes) at this head; a Satin-only build (--no-default-features) leaves out the legacy leg's revm 27, 1.7.1 CLI and alloy 1 RPC stack.
  • Behaviour changes, on purpose. An unknown chain replays on Satin; --dump-fixture is legacy-only (no Satin-priced state-test runner exists); the Satin leg's forked state reads an all-zero RPC account as absent, and prints an error once to stderr where 1.7.1 printed its Debug form twice (the legacy leg keeps 1.7.1's behaviour).
  • Expected differences, pinned. bin/mega-evme/tests/satin-differences.md is rendered from both engines on the same inputs (every run/tx fixture, three recorded blocks) and compared with the checked-in file.

The byte-price grid, and no parked tests

  • scripts/price_grid.sh builds the suite once with satin-price-override and runs it per point with MEGA_SATIN_CPSB / MEGA_SATIN_CPHB; .github/workflows/price-grid.yml runs five points on a pull request (0/0, 1/1, 312.5/20, 5000/300, 10000/1000) and the whole grid nightly: CPSB {0, 1, 312.5, 700, 1530, 2000, 5000, 10000} by CPHB {0, 1, 20, 50, 88, 100, 200, 300, 1000}, and 0.001 on both. A schedule trigger runs on the repository's default branch only, so the nightly grid stays inert while satin is not it; the job is meant to inform the review and should stay off the required checks, as REVIEW.md states.
  • Each point reports how many tests passed, were guarded and failed: every test that returns early on a price guard appends a line to a file the script names (test_utils::note_price_guard), so a point at which tests returned early is told from one at which they ran.
  • What "holds at any price" means, now stated: at a byte price of nothing, and at any price from one gas per byte up to the grid's dearest point. Below one gas per byte the schedule's entries round to nothing one at a time (at 0.005 a slot is free and an account is not), and past the grid a fixed-size scenario outgrows any transaction below the execution cap; no test is held there, and neither is a price under consideration.
  • A test sizes its gas as regular room on top of what the scenario adds at the prices in effect, and a charge it must not be able to pay as one short of that charge. Seven premises held only while a byte was dear (a deposit's and a keyless signer's account, a creation's code deposit, a system call's reservoir, a floor-lifted gas limit); the 1/1 point, new on both lists, fails all seven in their old form.
  • The 28 parked legacy test rows are ported, none retired: CREATE and CREATE2 metering, empty and oversized init code, missing operands, and the rows parked on preload-warm pricing and 63/64 forwarding, which now pin the engine's current answer (warm access as Ethereum prices it, 63/64). crates/mega-evm/tests/_pending/ holds only its README, which records where every kept row went.

The refactors, and the one fix's result changes

  • The exemption leaves the verdict. LimitCheck loses Exempt, which no outcome ever carried and which made within_limit and exceeded_limit both false for one value; the layer keeps the exemption as a sticky flag, and an exempt transaction's verdict is WithinLimit. No outcome changes.
  • The depth guard answers every start past the call-stack limit with revm's own CallTooDeep, every scheme and a creation, before anything counts the start; the code that took a counted creation back for the nonce revm never bumps is gone. No transaction reaches the limit.
  • The state gas held outside a frame lives on the frame's lane, set from the caller's lane and what the caller held when it suspended; limit/state_gas.rs and its alignment assertion are gone. No outcome changes.
  • Fix: the first frame's upfront state gas is held once revm has decided the frame. Before the first frame only what stands whatever that frame does is held (a deposit's created caller, the applied authorities); EIP-2780's charge for the account the first frame's start adds goes through the hook every child's upfront charge goes through. What changes, corner by corner, each as a child frame already behaved:
    • A first frame revm answers with a failure (a value transfer to a precompile that rejects its input) is no longer stopped for an account nobody adds: it settles as without a limit.
    • A first frame revm answers with a success (value to an account with no code, or to a precompile) is stopped on the gas its answer carries, a precompile's price included; the transaction's own frame, which no caller's revert follows, has its journal taken back to where its start began, so no value moves, no account is added and no transfer log is left.
    • A first frame whose record and transfer log cross the data-size limit while its upfront charge would cross the state-gas limit reports the data-size stop, as every frame start does.
    • A first frame an inspector answers keeps the inspector's answer: it never started, so its charge is never held.
    • The used a state-growth stop reports is the state gas held where the limit was crossed: a deposit whose created caller alone crosses reports that account (183,600 at the spec's prices), where it reported the whole state gas charged before the first frame (367,200 with a new recipient). used is on MegaTransactionOutcome::limit_exceeded and the tool's report only; the revert data carries (kind, limit), so no receipt or state moves. Documented on LimitCheck::ExceedsLimit::used and pinned.
    • A creation transaction the stop catches, a collision, and a transaction with no new account behave as before.

Breaking changes

  • MegaHardforks::fork_params_any(fork, TypeId): answered per params type; a schedule keeps one value per type of a fork.
  • ProtocolLimits (new): required by validate_schedule for Satin; require_params runs the params' validate() (ScheduleError::InvalidParams); ProtocolLimits::DEFAULT, ProtocolLimits::loosest(), MegaHardforks::protocol_limits(timestamp), constants::MAX_TX_COMPUTE_GAS.
  • BlockLimits is building policy only: it loses tx_runtime_limits, with_production_data_limits and to_evm_tx_runtime_limits, its default restricts nothing, and within holds its caps below the protocol's.
  • MegaBlockExecutor: limiter is no longer a public field (limiter() reads it); new internal errors MegaBlockExecutionError::MissingProtocolLimits and InvalidProtocolLimits; a block is refused under a schedule without valid limits.
  • MegaEvmFactory::new() / default() install ProtocolLimits::DEFAULT's per-transaction limits; with_schedule and with_tx_runtime_limits choose otherwise.
  • LimitCheck::Exempt is removed.
  • MegaHardforkConfig::with_params_unchecked exists only under cfg(test) or test-utils.
  • test_utils::note_price_guard and PRICE_GUARD_LOG_ENV_VAR are new test utilities.
  • The mega-evme library's types change (the tool's command line is additive): SatinReport (new; Clone, with limits_override), ExecutedBlock carries the limits a block ran under, and the block replay, engine and schedule modules are new.
  • Cargo.lock: the tool's legacy line added, every package at the 1.7.1 lockfile's version but the alloy-rlp, alloy-trie and alloy-sol-types families, which the engine's alloy 2 line holds above it, and c-kzg moves from 2.1.8 to 2.1.7 for the engine too.

Open items

  • MAX_TX_COMPUTE_GAS is exact only while the fork charges a first frame as it does (EIP-2780's base cost, a delegate's warm access); a fork change moves it loudly, through the test that reads GAS at the first instruction of the frame that holds the most.
  • The L1-attributes deposit is held to the per-transaction limits (it is not system-originated); nothing near the defaults binds, but validate() accepts a transaction data-size limit from 310 bytes and that deposit keeps about 486–526, so a chain configured in between would stop its own L1-attributes deposit every block. The floor or the exemption is a decision of its own.
  • A real Satin block of a known chain is refused by the tool until the chain's table carries its params (SequencerRegistryConfig and ProtocolLimits), which the table's own validate_schedule tests will demand the day a timestamp is set.
  • --override.limits is held to what a chain may carry, so a tool counterfactual with detention off is not expressible; loosest() is the closest.
  • The legacy acceptance compares receipts and receipts roots, not the state root; a state-root comparison would need the replayed post-state hashed as the chain's trie.
  • The shared encodings alloy-rlp (0.3.12 → 0.3.16), alloy-trie (0.9.0 → 0.9.5) and alloy-sol-types (1.4.1 → 1.6.0) run on the legacy leg at the engine's versions, which the engine's alloy 2 line requires; they are pinned there, and the 200/200 runs on them.
  • mega-t8n is not ported; it should follow the same rule, with its legacy leg a verbatim copy of 1.7.1's compiled against the aliased crates (it was never published).
  • RewritingInspector stays a validation error.

Changed by the stacked follow-up

The next pull request in the stack changes the following, so these statements describe this head only.

  • --genesis <FILE> on run and tx: a command that leaves --spec out runs Satin under the file's chain, and a legacy spec under --genesis is refused.
  • replay under --genesis: the file's satinTime decides the engine, and a block before it is refused.
  • --genesis is the way to supply a chain's Satin params, read by the shared parser SatinChainConfig::from_genesis_config, so a Satin block of a known chain is no longer refused for want of them once a file carries them.
  • A second, flat chain-configuration shape (satinTxDataSizeLimit, satinBlockEnvAccessComputeGasLimit, and the rest beside satinTime and the registry seeds) is parsed by the engine; the camelCase object stays the shape of --override.limits.
  • The pre-block phase also reads the L1 block contract's slots, the L1 fee overhead among them, so a Satin run of a block cached by a legacy run needs --rpc for those slots as well as for the EIP-7997 factory.
  • LimitStop::from_result and decode_mega_limit_exceeded read a stop's (kind, limit) off a result's revert data; used is unchanged.
  • A failed deposit whose body latched a limit reports its halt and keeps what it counted: a behaviour change past this pull request, not a correction of the "No outcome changes" above.
  • The lockfile is re-resolved on rust-version 1.94; the legacy line stays at the versions pinned here, and legacy_line.rs's doc names the locked alloy line as 2.1, not 2.4.
  • Further test targets are added (randomized properties, receipt goldens, among others), so the test counts in the plan below are this head's only.

Test plan

Run at the head of this branch on macOS (aarch64).

  • cargo fmt --all --check, cargo clippy --workspace --lib --examples --tests --benches --all-features --locked, cargo sort --check …, the riscv no-std check, cargo metadata --locked, Prettier on docs/**/*.md and *.md, git diff --check: all clean. cargo tree -i revm (the engine's graph, the default member): one revm, the fork (v40.0.3-mega.4); the workspace also locks revm 27.1.0, reached only by mega-evme's legacy leg.
  • cargo check --workspace --all-targets --locked on each commit of the review fixes: no warning.
  • cargo test --workspace --locked: 1,550 passed, 0 failed, 3 ignored in debug (mega-evm lib 351, block 128, satin 578, system 321; mega-evme 127 + 2 ignored live-RPC tests; mega-state-test 35; system contracts 6; state-test 4); 1,535 in release (the gap is the debug-assertion tests).
  • The byte-price grid, all 73 points of --full: every point passes 1,380 tests with 0 failed; guarded 0 at the spec's prices (1530/88), 85 or 86 at every other priced point, 168 where a state byte is free. The five pull-request points pass likewise. Sweeps between the grid's points during the fixes (62 points from CPSB 1–7,500 by CPHB 0–700): all pass; two points past the grid (15000/1500, 20000/2000) fail 34 and 58 tests, outside the range the suite is held to.
  • Execution-spec gate, equivalence mode: Osaka 19,465 executed, 52 skipped, 19,463 passed, 2 deviated as listed; Amsterdam 15,754 executed, 72 skipped, 15,717 passed, 37 deviated as listed; 0 unattributed, 0 unreproduced, gate passed on both; summaries identical to the base branch's (the KZG point-evaluation fixtures run on c-kzg 2.1.7).
  • The keyless differential record is byte-identical to the base branch's (2,431,045 bytes).
  • mega-evme replay --block 26400000..26400199 --block-cache <recording> --verify, offline: 200 block(s) replayed: 200 match the chain, 0 differ, 0 failed, exit 0; the recording unchanged.
  • The legacy-line guard fails on the previous lockfile (c-kzg: the legacy line resolves ["2.1.8"], the 1.7.1 release shipped 2.1.7); the -- separator test fails on the previous hand-off (unexpected argument '--spec' found, exit 2); the 1/1 grid point fails the seven old premises.
  • Mutation gate on the source diff against feat: Satin inspector contract, steady-state benches, fail-closed mutation gate, spec draft, no Rex7 #390's head, scripts/mutation_test.sh diff, sharded: 121 mutants, 88 caught, 33 unviable, 0 missed, 0 timed out; every shard's gate passes; no suppression added.
  • Sweeps for internal reference codes, CJK text and internal-process words over the added lines, the commit messages and this body: none.

require_params, and so validate_schedule, now runs the params type's own
validate() on the value a scheduled fork carries and reports
ScheduleError::InvalidParams, so a node whose schedule type attaches its
parameters without MegaHardforkConfig::with_params still refuses a bad value
at load. with_params_unchecked, under test-utils, attaches a value no chain
may carry for tests.
A schedule entry held one params value per fork, so attaching a second
params type to a fork silently replaced the first. The entry now keeps one
value per type, and fork_params_any looks a value up by fork and TypeId, so a
fork can require several params types as validate_schedule already allows.
ProtocolLimits holds the limits every node of a chain must share: the
per-transaction runtime limits and the block's execution-gas, state-gas,
data-size and KV budgets. It is a Satin HardforkParams type, serde-ready for a
chain configuration, whose validate() refuses a zero limit, a transaction
data-size limit below a body and an unlimited detention cap. Its default is
today's values. validate_schedule requires it, MegaHardforks::protocol_limits
resolves it at a timestamp, and the unknown-chain fallback carries the
default. Block execution does not read it yet.
…ck context

MegaBlockExecutor now reads the ProtocolLimits of the fork active at the
block's timestamp: it installs their per-transaction limits on the EVM at
construction and again before every transaction, and holds the block to their
four budgets. BlockLimits in the block context is the builder's policy only:
the transaction gas, encoded-size and data-availability limits, and caps that
can lower a block budget but never raise it (BlockLimits::within); its default
restricts nothing. A block whose schedule carries no limits is refused before
it starts (MissingProtocolLimits). The limiter is no longer a public field.

Block tests run on a test chain whose limits are the unlimited set, attached
through the test-only unchecked route, so each test runs under the limits it
ran under before; a test that holds a block to a limit attaches its own.
…s not

A block on a chain whose ProtocolLimits are not the defaults, attached through
the checked route, stops a transaction at the chain's data-size limit and
refuses one once it reached the chain's KV budget. A builder that packs under
its own policy (a DA cap, a declared-gas cap, a block data-size cap below the
chain's) and validators that re-execute its block under no policy or another
one compute the same receipts, counters and state; the same block under
different chain limits does not.
… parameters

The spec page no longer says a node supplies the limits with each block: the
per-transaction limits, the detention caps and the four block limits are
protocol values the chain configuration carries as Satin's parameters, a
configuration without them or with a value no chain can run on does not load,
and a builder's transaction gas, encoded-size and data-availability limits are
building policy a validator does not apply. AGENTS.md and the crate README
describe ProtocolLimits, the building policy and the test-only route.
… covers

The builder and validator test gave its candidates 200,000 gas, which a
measurement build's higher byte prices exhaust, so the first write ran out of
gas instead of being kept. Every transaction of the module now declares
2,000,000, and the builder's declared-gas cap is that figure.
mega-evme rejoins the workspace. A command runs on the engine its spec
names: Satin on the in-tree sources, ported to the Satin engine; a spec
from Equivalence to Rex6 on the released mega-evme and mega-evm 1.7.1,
linked under aliases, with the user's arguments handed over unchanged.
Rex7 is refused. Satin output adds a `satin` object with the gas by
ledger and keeps every legacy field. The legacy line is pinned to the
1.7.1 lockfile's versions, and the release build selects the tool by
manifest path.
…hain

`replay --block N[..M]` runs each block on the engine its spec names and
compares every receipt and the receipts root with the chain's; --verify
turns a difference into exit code 2. One driver loads the block, its
receipts and the state its parent left from a block cache or over RPC,
and hands the engine plain data: the legacy executor reaches the 1.7.1
line only through its re-exports, the Satin one runs the counterfactual.
Reads the recorded pre-state lacks fall back to the parent block over RPC
and are folded into the cache.
The single-transaction replay forks state lazily over RPC; the block
replay runs on the recorded pre-state. A mock RPC answering only from a
recorded block serves the first, and on both engines four transactions
must agree with the block replay's rows: gas, status, logs, cumulative
gas, and on Satin the ledgers.
… engine

tests/satin-differences.md is rendered from what the two engines produce
on the same inputs and compared with the checked-in file: every run and
tx fixture on both engines, and the three recorded mainnet blocks, per
block and per call target. UPDATE_EVME_DIFFERENCES=1 rewrites it.
The docs, the crate README, the help text and the agent files describe
how a spec picks the engine, the additive `satin` output, replay's
engine auto-detection (an unknown chain now runs Satin, where 1.7.1 ran
Rex7), --dump-fixture being legacy-only, and replay --block with its
cache, records and exit codes. The build command selects the tool by
manifest path.
A cache a legacy replay wrote lacks the EIP-7997 factory Satin's pre-block
changes read, so the Satin examples pass --rpc, and say that later runs
can drop it.
….7.1 did

A `?` inside each dispatch arm returned before the report, so an error
fell through to main and printed its Debug form twice. Satin commands now
print the message once to stderr and exit 1. A legacy command's error is
printed as the 1.7.1 binary printed it: Debug to stdout, then `Error:`
with the Debug form to stderr, exit 1.
A transaction's gas limit covers its body's history, the state it adds and
the records it keeps at the prices in effect, and a call that forwards all
but a 64th of its gas keeps 64 times the history of the records it pays for.
A case whose scenario is state gas to cross a limit with is skipped where a
state byte costs nothing.
LimitCheck loses its Exempt variant: no outcome ever carried it, and it made within_limit and exceeded_limit both false for one value. The layer keeps the exemption as its own sticky flag, and an exempt transaction's verdict is WithinLimit whatever it crosses.
…pth guard

The guard answered CALL and STATICCALL only; every other start past the limit reached the count and then revm's CallTooDeep, and a creation's count had to be taken back for the nonce revm never bumped. The guard now gives revm's own answer for every scheme and for a creation before anything counts the start, so the creator's nonce snapshot, creation_did_not_bump_nonce, undo_frame_start and drop_caller_record go. No transaction reaches the limit.
Gas limits cover what a scenario adds at the prices in effect, a call or
creation that forwards all but a 64th keeps 64 times the history of the
records it pays for, and a bill is the larger of the charge and the EIP-7623
floor where a cheap history byte lets the floor bind. A test whose scenario
is state or history gas to cross, scale or give back returns early where
that byte costs nothing, and says so once on stderr.
@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 dependencies Pull requests that update a dependency file comp:doc Changes in the documentation labels Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

🧬 Mutation testing — ✅ PASS

Nothing to test: the mutant list under the run's filters was empty.

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.9%. Comparing base (9f7e5a2) to head (4912ae7).

☔ 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 8, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 0.76%

⚠️ 14 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

⚠️ 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
❌ 3 regressed benchmarks
✅ 50 untouched benchmarks
⏩ 388 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ oracle_reads/satin 177.7 µs 206.1 µs -13.75%
❌ oracle_reads/op_revm 154.6 µs 170.5 µs -9.34%
❌ steady_pre_block 78.5 µs 83 µs -5.44%
⚡ storage_reads/op_revm 170.4 µs 153.2 µs +11.21%
⚡ storage_reads/satin 182.8 µs 165.5 µs +10.43%
⚡ value_calls/satin 511.2 µs 485.9 µs +5.2%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing cz/feat/satin-w6 (4912ae7) with cz/feat/satin-w5 (9f7e5a2)

Open in CodSpeed

Footnotes

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

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

🧬 Mutation testing — ✅ PASS

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

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

No new test gaps introduced by this change. 🎉

@RealiCZ
RealiCZ added this pull request to stack #403 October 12, 2026 12:39
@RealiCZ
RealiCZ removed this pull request from stack #403 October 21, 2026 06:32
…tests and four engine fixes (#400)

Co-authored-by: mega-putin <mega-putin[bot]@users.noreply.github.com>
@RealiCZ
RealiCZ added this pull request to stack #408 October 22, 2026 06:45
@RealiCZ
RealiCZ marked this pull request as ready for review October 22, 2026 06:45
@RealiCZ
RealiCZ removed this pull request from stack #408 October 22, 2026 06:47
@RealiCZ
RealiCZ merged commit 64f52f2 into cz/feat/satin-w5 Oct 22, 2026
30 of 33 checks passed
@RealiCZ
RealiCZ deleted the cz/feat/satin-w6 branch October 22, 2026 06:48
RealiCZ added a commit that referenced this pull request Oct 22, 2026
cz/feat/satin-w2 now holds W3 to W7 as squashed commits; this branch is built
on #399's final commit (4912ae7), whose tree equals that branch's tip. The
merge keeps this branch's tree unchanged.
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 dependencies Pull requests that update a dependency file spec:unstable Changes to the unstable spec (currently REX5)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant