← Back to Pull requests

fix(l1): settle frame-tx fees on max_gas and the base blob rate #7073

Closed
unknown closed this pull request without merging on Aug 18, 2026 17:07 UTC
View on GitHub
unknown unknown commented on Jul 30, 2026 14:28 UTC
Author

EIP-8141 changed its gas accounting in ethereum/EIPs#11969 ("apply charged_gas to fee settlement"), merged 2026-07-28. Our pinned spec commit predates it. Two consensus-visible gaps.

max_cost charges blobs at the base rate

The transaction is only valid for inclusion in a block if tx.max_fee_per_blob_gas >= blob_base_fee of that block. max_fee_per_blob_gas is used only for this inclusion check. The payer is charged blob_gas * blob_base_fee; no additional blob fee is collected or refunded.

We charged max_fee_per_blob_gas at APPROVE and refunded the difference at the end, so the payer's final balance was already correct. What was wrong is what the chain can observe in between:

  • TXPARAM(0x06) returned the max-rate figure, and contracts read it.

  • A frame running after APPROVE saw the payer's balance debited by that figure via BALANCE/SELFBALANCE.
  • Now the blob terms in max_cost and charged_fee are identical, so they cancel: the burn is collected once, at the base rate, and never refunded. FrameTxContext carries the block's blob base fee, captured at transaction entry, since load_tx_param has no Environment handle.

    The reservation is max_gas, not standard_gas_limit

    max_gas = max(standard_gas_limit, calldata_floor_gas)
    

    Both sides carry the mandatory costs. A transaction whose EIP-7623 data floor exceeds what it declared for execution now reserves the floor rather than being rejected, so the static floor-reservation check is gone. total_gas_limit() returns max_gas; standard_gas_limit() and calldata_floor_total() are the two inputs.

    The mempool paymaster reservation uses the same definition, so the reservation ceiling and TXPARAM(0x06) remain one number.

    Reachability

    Only blob-carrying frame transactions see the max_cost change, and only data-heavy ones see the floor change. Our mempool rejects blob-carrying frame transactions today (no sidecar transport), but block import accepts them, so a block from another builder would have diverged.

    Testing

  • max_cost_is_max_fee_times_limit_plus_base_rate_blob_cost sets max_fee_per_blob_gas a thousandfold above the base fee, so the old formula cannot pass.

  • max_gas_reserves_the_calldata_floor_instead_of_rejecting and max_gas_takes_the_calldata_floor_when_it_exceeds_the_standard_limit pin both arms of the max and the removed rejection.

  • Full suite green; cargo clippy --workspace --all-targets clean.
  • Diff: 314 lines (+235 / -79) across 3 files Reviewer: ElFantasma Review duration: 27519m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 314 lines diff across 3 files
    0.40
    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%
    60%
    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.344
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #7073"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    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: 40.3% (MEDIUM) · Higher = larger blast radius
    40.3%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 15.9% · Safe to merge
    15.9%