← Back to Pull requests

fix(levm): perform the EIP-8272 native write on every path into the predeploy #7086

Closed
unknown closed this pull request without merging on Oct 14, 2026 07:12 UTC
View on GitHub
unknown unknown commented on Aug 02, 2026 04:33 UTC
Author

RECENT_ROOT_ADDRESS carries no runtime bytecode, so the 64-byte salt || root write 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 in execute() 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_path excludes the predeploy, so the call reaches run_execution.

  • run_execution dispatches a top-level call into the predeploy to the native write, next to the precompile branch, and records the address as BAL-touched.

  • The write reports gas_limit - gas_remaining rather than the bare write cost, so intrinsic gas is included. Reporting only RECENT_ROOT_WRITE_GAS undercharged 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_results now 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.

    Diff: 259 lines (+194 / -65) across 3 files Reviewer: ElFantasma Review duration: 105278m
    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
    0.62
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    54%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 54.2% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 62.4% (MEDIUM) · Higher = larger blast radius
    62.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 54.2% · Lower = rushed or shallow review
    54.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 28.5% · Safe to merge
    28.5%