fix(l1): reconcile an unrolled atomic batch's access list, gas and status #7068
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 575 lines diff across 7 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.380
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #7068"
general
weight: 0.35
ElFantasma
Motivation
Two defects on the EIP-8141 atomic-batch unroll path. They are separate rules and are
called out separately below, because the second one is consensus-visible beyond the
receipts trie.
1. The unroll leaves the block access list holding writes the block does not contain.
An atomic batch with a reverting member halts block production. The unroll reverts the
batch's substate, state gas, approvals and logs — but not the EIP-7928 recorder. The
builder seals a block whose access list claims changes the block does not contain, and
import rejects it:
BAL=1is the in-batch write;exec=Some(9)is the prior value the unroll correctlyrestored. The builder re-selects the same tx every slot, so it rebuilds the identical
rejected block forever. Nothing is logged above
WARN.2. The unroll re-prices every batch frame at its full
gas_limit. The spec nowstates the rule: "Logs emitted by frames that executed before the failure are discarded
together with their state changes. Those frame receipts retain their execution status and
gas used, with empty logs." ethrex instead rewrote each frame as
FAILUREcharged itswhole
gas_limit, which over-bills the payer and mislabels frames that ran.Description
The access list. Checkpoint the recorder at batch entry — where the substate backup
and approval snapshot are already taken — and restore it in the unroll, as the EIP-7906
body revert does a few lines above.
BlockAccessListRecorder::restoreis written forthis: it truncates changes made after the checkpoint, re-files a freshly-written slot as
a read, and leaves
touched_addressesalone. Per EIP-7928 a reverted call's accessesstill belong in the list; only its changes do not.
The gas and status. Stop rewriting the batch's frame results; drop only their logs.
Frames that ran keep their status and their gas, the failing frame keeps what the
single-frame rule already gave it (actual
gas_usedfor aREVERT, fullgas_limitforan exceptional halt), and the remaining members stay
SKIPPEDwith their gas refunded.total_gas_usedtherefore stands as executed.This half is consensus-visible through more than the receipts trie: per-frame gas feeds
total_gas_used→ the headergasUsedand the payer refund.docs/eip-8141.md§11previously marked the choice UNRESOLVED, pending cross-client confirmation. That
confirmation has since arrived from the reference implementation: the
tests-frames-devnet@v0.0.0release covers this shape inatomic_batch_rollback,bal_atomic_batch_writeandbal_atomic_batch_skipped_frame_absent, and each of the three rejects thefull-
gas_limitbehaviour on the block headergasUsed— the exact quantity the oldnote was worried about. §11 is updated to record that, and the two halves' status is no
longer a unilateral choice.
Scope is the batch-unroll path. A batch whose members all succeed is unaffected.
How to Test
atomic_batch_revert_drops_the_batch_writes_from_the_balexecutes a frame tx whose batchwrites a slot then reverts, with BAL recording enabled as the builder and importer do. It
asserts both halves of the EIP-7928 rule: the reverted change is gone, and the
reverted access stays — the address is still in the list and the slot is re-filed as
a read. A slot in neither list is a slot the block accessed and the BAL omits, which
re-execution rejects; asserting only the first half would pass in that direction.
atomic_batch_unroll_keeps_frame_status_and_gas_but_drops_logspins the second half:the frame that ran keeps
SUCCESSand its actual gas, the failing frame is charged lessthan its
gas_limit, the remaining member isSKIPPEDat 0, and no log from the batchreaches the transaction log set.
Both fail without the corresponding fix. The three spec fixtures named above also pass
with this branch and fail without it, on
gasUsed.On a local Amsterdam + Hegotá dev node the tx that previously stalled the chain now mines
with zero BAL failures.
eip814186,eip792857,eip803746,eip803839,eip790634,eip82728,eip82503,ethrex-blockchain30 — all passing. Clippy-D warningsandfmtclean inboth workspaces.
Checklist
STORE_SCHEMA_VERSION(crates/storage/lib.rs) if the PR includes breaking changes to theStorerequiring a re-sync. _(N/A — BAL recording and frame-receipt gas only.)_