Conversation
|
The |
|
The current labels ( |
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Closing this PR — it was opened against the wrong target branch ( Reopened here: #293 |
|
LGTM. The fix is correct and the reasoning is sound. Bug: Fix: The early Gas accounting: The deferred-recording design (recording Tests: All three cases are covered — OOG-resize no-panic, correct compute gas delta on success, and deferred skip when the inner CREATE2 OOGs. The deferred-recording test in particular is a nice property-level check that would catch a regression to eager recording. |
Summary
Important
Post-mainnet follow-up fix
Fix an out-of-bounds memory access in the
storage_gas_ext::create<IS_CREATE2>wrapper.The wrapper sliced initcode out of interpreter memory via
memory.slice_len(offset, len)before memory was expanded. The canonical revm CREATE2 path called later does callresize_memory!, but by then the slice has already been taken — so a CREATE2 whose(offset, len)extended past the current memory size could read past the allocated region in our wrapper.Test plan
crates/mega-evm/tests/rex4/create_safety.rscovering CREATE2 with (offset, len) extending past current memory, including the clean-OOG and successful-expansion paths.cargo test -p mega-evm(run before pushing).cargo clippy --workspace --lib --examples --tests --benches --all-features --lockedandcargo fmt --all --check.