You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two bot reviews (Codex, Claude) + one code reviewer (Greptile) flagged 7
issues. All 7 verified real and fixed in-PR per user request.
Critical (L2 consensus/liveness):
- `crates/l2/sequencer/block_producer/payload_builder.rs` now enforces
the EIP-8037 PR #2703 per-tx 2D inclusion check against the L2's
`configured_block_gas_limit` before executing each tx, matching the
L1 builder. Without this, the L2 builder could reject valid txs or
accept txs that violate one dimension of the block cap.
- `fill_transactions` now snapshots and restores
`block_regular_gas_used` / `block_state_gas_used` around
`apply_plain_transaction` on the `undo_last_tx` rollback path
(invalid L2 out-message). Previously those two counters stayed
inflated after a rejected tx, polluting `gas_used()` and the final
header `gas_used`.
High (mempool DoS avenue):
- `crates/blockchain/mempool.rs::transaction_intrinsic_gas` now
enforces `max(intrinsic_regular + intrinsic_state, floor)` for
Amsterdam+, matching the VM's `validate_min_gas_limit` check.
Previously a tx with mostly zero calldata could pass mempool
admission at the weighted EIP-2028 cost (400 gas for 100 zero
bytes) but fail the VM's 6400-gas unweighted floor at block
inclusion, polluting the pool.
New standalone helper `intrinsic_gas_floor(tx, fork)` added in
`crates/vm/levm/src/utils.rs` mirroring `VM::get_min_gas_used` so
the mempool / payload builder can compute the floor without a VM
instance. Re-exported from `ethrex-vm`.
Medium:
- `crates/vm/backends/levm/mod.rs` withdrawal index computation
switched from `.map(|n| n + 1)` to `.map(|n| n.saturating_add(1))`.
The prior form wraps to 0 in release builds when `n == u32::MAX`
(the `debug_assert` only fires in debug).
- `crates/vm/levm/src/opcode_handlers/system.rs` adds `debug_assert!`
at the two reservoir-revert sites verifying
`outstanding_delta >= credit_against_drain_delta`. If that invariant
is ever violated, the `saturating_sub` silently mischarges the
block's regular dimension; a loud debug panic is preferable.
Style:
- `crates/vm/levm/src/gas_cost.rs::access_list_bytes` — replace
`keys.len() as u64` with `u64::try_from(...).unwrap_or(u64::MAX)`
for consistency with the rest of the codebase.
- `crates/vm/levm/src/hooks/default_hook.rs::refund_sender` — rename
the currently-unused `gas_used_pre_refund` parameter to
`_gas_used_pre_refund` at the signature and drop the interior
`let _ =` that was silencing it. Expanded doc explains it's kept
in the signature for future reintroduction.
All 478 tests pass; no behavior changes except the three
intentional ones (mempool floor, L2 2D check, L2 counter rollback)
plus the already-exercised saturation edge.
0 commit comments