Repository navigation
Conversation
🧬 Mutation testing — ✅ PASSNothing to test — no mutants were generated on the changed lines. |
Merging this PR will degrade performance by 15.79%3 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
|
Label check:
The other labels ( |
|
Label check The Since this PR makes extensive changes to the Satin engine itself (gas schedule, block executor, SALT pricing, system contract interceptors), Other labels look right: |
|
Label check Current labels:
|
Codecov Report❌ Patch coverage is ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Label check:
|
|
Label check Current labels: The previous Remaining issue:
|
🧬 Mutation testing — ✅ PASSDiff mutation score: 100.0% (885/885 viable mutants killed)
No new test gaps introduced by this change. 🎉 |
…hanges The stack merged down into #386, and the skeleton (#385) merged into `satin` first, so the guide now names #386 as the pull request under review and `a8f8c7c9..<head>` as the range that still holds the skeleton. - A table of the engine's modules says which are stable and which #407 still changes, derived from the diff of `cz/feat/satin-w9` against this branch and the work still to land in it; it replaces the old "What follows" section. - The fork bullet keeps this branch's tag pins and names the fork pull requests that review the commit pins #407 moves to. - Module headings, three checks and the decided items #407 revisits say so.
Brings the review guide's update for #386. The guide's four conflicting passages keep this branch's facts (the forks pinned by rev, block execution admitting any inspector); the rest of the update merges as is and is refreshed for this branch's code when it merges into cz/feat/satin-w2.
| let share = shares.get(pool); | ||
| let mut allowed = caps.get(pool); | ||
| let spent = caller.pool_spent(pool); | ||
| if spent < 0 { |
There was a problem hiding this comment.
The cargo-mutants gate is red on 2ec47583: it reported 22 MISSED mutants and was then cancelled after 5h31m (run 39900935987). The PR calls this gate fail-closed, so it needs a decision before merge.
This line is one of the survivors: spent < 0 → spent <= 0 is caught by no test. Others in new code that look like real test gaps:
simulate_authorization_list:execution.rs:1421(&&→||),:1434(||→&&),:1437(+=→*=)AdditionalLimit::authorization_list_may_cross:limit.rs:410,:412(-→+),:413(>→>=, twice)Counted::plusdroppingtransfer_log:limit.rs:208MegaEvm::cfg_env/chain_id:evm/mod.rs:489,:493Accounts::destroyed_parts:record.rs:312(delete!)
Some of the rest look equivalent: the >→>= and <→<= survivors on the saturating u64/i128 clamps in first_frame_pools (limit.rs:456–464) and positive (limit.rs:846).
Not a code defect, but each of these needs one of three things: a test, a suppression with a reason, or a fix to the gate's runtime so it finishes.
There was a problem hiding this comment.
Addressed in the commits folded in from #417 (ec0983f, 4115da6).
Rerun at the top of the stack, the 22 survivors resolve to 10 killed by new or extended tests, 6 equivalent and 6 removed by later commits (the list-size prefilter in authorization_list_may_cross, the positive-rise guard in check, and the failed-draw cleanup in apply).
The spent < 0 site here is killed by test_only_a_callers_negative_net_holds_its_childs_share_to_its_budget.
The six equivalents are suppressed with their proofs: += → *= on the simulated nonce, four boundaries of the clamp and the cap in first_frame_pools where both branches give the same value, and > → >= in positive.
A scored rerun of all 22 has no unsuppressed miss.
The runtime is addressed too: the pull-request gate now runs the diff in four parallel shards and scores them in one cargo-mutants gate job (0a72ada and follow-ups).
| [patch.crates-io] | ||
| # megaeth fork of revm (revm 40.0.3 + the revm 43 gas core + the megaeth hooks). | ||
| # All twelve crates move together, otherwise the build resolves a second copy of revm. | ||
| revm = { git = "https://github.com/megaeth-labs/revm", rev = "fd230a3427d1b96c88e0b581bab8a7763c8ec298" } |
There was a problem hiding this comment.
Optional: the description says the forks are pinned at "the heads under review in megaeth-labs/revm#76 … and megaeth-labs/op-revm#8". Both PRs have moved on since: revm#76 is now at 2b71cb61, not fd230a34, and op-revm#8 is at 8c0db939, not 2ecb7dce. The pinned commits are still ancestors of those branches, so nothing is orphaned. Could you either update the description or re-pin, so reviewers know which fork code this engine was tested against?
There was a problem hiding this comment.
Updated the description.
With #409 and #417 folded in, this branch pins the current heads, revm 2b71cb61 (megaeth-labs/revm#76) and op-revm 8c0db939 (megaeth-labs/op-revm#8); the description also names fd230a34 / 2ecb7dce, the pins this pull request was tested on before the fold, both ancestors of those heads.
| /// Whether `log` is the EIP-7708 transfer log revm journals for a value movement: a log from the | ||
| /// system address `0xff…fe` carrying ERC-20's `Transfer` event. | ||
| pub(crate) fn is_transfer_log(log: &Log) -> bool { | ||
| log.address == ETH_TRANSFER_LOG_ADDRESS && log.topics().first() == Some(Ð_TRANSFER_LOG_TOPIC) |
There was a problem hiding this comment.
Optional: no test kills the mutant && → || here. The unit test's "a contract's log" case has no topics, so it returns false either way. Only revm, or a node's own precompile, can journal a log between the start's mark and the count, so this is harmless today. Still, one assertion would pin the rule: a log from a contract address carrying ETH_TRANSFER_LOG_TOPIC is not a transfer log. For example, in test_a_starts_records_are_read_off_what_revm_did:
journal.log(Log::new_unchecked(OTHER, vec![ETH_TRANSFER_LOG_TOPIC], Bytes::new()));with the same (RecordDelta::NONE, Counted::NONE) expectation.
|
#409 and #417 are now folded into this pull request, and it targets |
Summary
Satin is MegaETH's new execution engine: mega-evm 2.0, on the MegaETH forks of revm 40.0.3 and op-revm 20.0.0, running one unstable spec,
SATIN. It restates MegaETH's execution rules on Optimism Karst (Ethereum Osaka): EIP-8037 regular and state gas under a 200,000,000 execution cap, state gas scaled by the SALT bucket it lands in, a history-gas ledger for the bytes a transaction appends, data-size, KV-update and state-growth limits whose crossing reverts only the frame that crosses it, gas detention, native keyless deployment, the live system address read by the transaction itself, and the witness a stateless validator re-executes a block from. The legacy engine onmainkeeps executing every block before Satin activates.This pull request targets
satinand holds the whole engine: #407, #409 and #417 have merged into this branch, andsatinis merged into it (which changed no file), so the diff no longer repeats the skeleton (#385) thatsatinalready holds. The stacked pull requests' descriptions carry the detail:satinbefore the fold, so this pull request's diff no longer includes it.mega-evmeon both engines and the byte-price grid (feat(satin): consensus limits as protocol params, mega-evme on both engines, byte-price grid #399).4c8f0d43b70f2175f9ce0132cc343283f9a29548and op-revm8c0db939291e1c4cbf2375782d1483bc371d6b94.SLOTNUM, Oracle hints and the oracle service, KeylessDeploy recognition, the activation-block rules and the later batches of the specification alignment; CI gating on Mega EEST, the conformance suite both Satin implementations share; main's faster mutation CI, with the pull-request gate in four parallel shards; the deletion of the tests that suite duplicates; and the answers to this pull request's review (its own mutation survivors and inline comments). The revm pin moves to2b71cb617f9cb401cf62f78df48e142d13eaf7de.Each linked description covers its series as it was merged, and later series changed parts of it: #404 removed the KV and state-gas limits #387 added, fixed the limits per spec rather than as #399's chain parameters, and replaced #388's latched stop with a stop the caller can catch; the engine no longer deploys the system contracts #387 deployed, and only checks them in the block where Satin activates; #407 restored the KV-update and state-growth limits, counted on Satin's write records and state growth, removed #390's inspector settlement and admission gate in favour of revm's own inspected lifecycle, and replaced #388's instruction wrappers with the fork's hooks. Review against the final tree, the specification and the review guide, not against these descriptions.
How to review
.claude/skills/satin-review/SKILL.mdon this branch gives the scope, the design changes feat!: meter Satin's writes and frame starts in the revm fork's hooks, on a per-frame byte pool #407 made to what the stacked descriptions say, the module map with the invariants to check, the reading order, how to rate a finding, the revert-or-halt rule with its deliberate exceptions, and the decisions already made. It is removed before this pull request merges.satin. GitHub shows the whole engine on top of the skeletonsatinalready holds. The local equivalent isgit diff origin/satin...cz/feat/satin-w2; the layers folded in last are2ec47583..5e3f30ad(refactor(satin): keep no copies of revm's figures, account for frame starts in the engine, and start clean after an error #409) and5e3f30ad..44d9403c(feat(satin): follow the Satin specification for SLOTNUM, Oracle hints and the oracle service, KeylessDeploy recognition and activation blocks #417). Most of its deletions arecrates/mega-evm/tests/_pending/, the legacy tests the skeleton parked until their mechanism landed, now ported or retired, and the tools the engine no longer has (mega-t8n, the replay bench): skim them, or hide them with--diff-filter=d. Judge the final tree, not commit by commit.cz/feat/satin-review-base(a8f8c7c9,satinbefore the skeleton), so that its diff also showed the skeleton. The skeleton has since been reviewed and merged intosatin(feat!: restart mega-evm as the Satin skeleton on the revm 40 forks #385), so the pull request now targetssatindirectly.docs/spec/upgrades/satin.mdstates each Satin rule against Rex6; review the code against it.AGENTS.mdholds the implementation notes, andREVIEW.mdthe repository's review rubric.What is still to come
Nothing more in this pull request. #407, #409 and #417 have merged into this branch.
This pull request merges into
satinwith a squash. After it, the fork pins move to the merged commits of the fork pull requests, and to tags once the line is final; follow-up pull requests onsatinsimplify the engine further, reading more of its accounting off revm's journal, and take up the performance work.Out of scope
main, which is frozen and executes every block before Satin activates. Satin never executes or decodes legacy-era data.2b71cb617f9cb401cf62f78df48e142d13eaf7deand the op-revm fork at8c0db939291e1c4cbf2375782d1483bc371d6b94, byrev, the current heads of feat: instruction, frame-loop and start-lifecycle hooks, and a borrowed original-info accessor revm#76 (stacked on feat(gas): record the regular gas left at every out-of-gas failure; the reservoir report and the system-call margin move to mega-evm revm#75) and feat: settle the first frame through the revm fork's shared settlement and call its start lifecycle op-revm#8. Before the fold this pull request was tested on revmfd230a3427d1b96c88e0b581bab8a7763c8ec298and op-revm2ecb7dceed1c458a2b59ca4d8993a073968cb111, ancestors of those heads; refactor(satin): keep no copies of revm's figures, account for frame starts in the engine, and start clean after an error #409 and feat(satin): follow the Satin specification for SLOTNUM, Oracle hints and the oracle service, KeylessDeploy recognition and activation blocks #417 moved the pins forward. How the engine uses a fork function is in scope.