fix(levm): perform the EIP-8272 native write on every path into the predeploy #7086
All Vouch review confidence checks passed
Residual risk 0.29 = Change Risk (0.62) × (1 − Review Confidence (0.54)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.62 · 259 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.333
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.062
Real PR Conversation Timeline
1 comments
"Review active on #7086"
general
weight: 0.35
ElFantasma
RECENT_ROOT_ADDRESScarries no runtime bytecode, so the 64-bytesalt || rootwrite is executed natively. That native handler was only reachable from the CALL opcode: a transaction sent straight to the predeploy took the codeless-recipient fast path inexecute()and succeeded without writing anything, which makes it impossible for a root source to publish a root the ordinary way.Three parts:
is_simple_transfer_fast_pathexcludes the predeploy, so the call reachesrun_execution.run_executiondispatches a top-level call into the predeploy to the native write, next to the precompile branch, and records the address as BAL-touched.gas_limit - gas_remainingrather than the bare write cost, so intrinsic gas is included. Reporting onlyRECENT_ROOT_WRITE_GASundercharged the transaction by exactly its intrinsic gas and produced a block-level access-list balance mismatch.Verified on a Nethermind/ethrex devnet: after this change a root written through a plain transaction commits the same entry hash under the same storage key on both clients, and the block carrying it has the same hash.
There is no unit coverage here because levm has no in-crate VM harness to drive a top-level transaction, so the coverage is cross-client instead: two scenarios on a two-client devnet, one writing a root through a plain transaction and one through an EIP-8141 SENDER frame targeting the predeploy. Both compare the receipt, the block hash, the state root and the block-level access-list hash between the clients, and both fail without this change.
A fourth change rides along, and it is a separate defect from the native write. When an EIP-7906 assertion discards the body, the transaction-level log set was truncated but the per-frame receipt logs were left in place, so the header bloom committed to logs the receipt no longer carried.
frame_resultsnow drops them too. Found by inspection while reading the unroll path, not by an observed divergence, and there is no unit coverage for it, so it is the part most worth a second opinion.