Conversation
…5706) **Motivation** * `./hive --sim ethereum/eels/execute-blobs --client ethrex` fails with `execution_testing.rpc.rpc_types.JSONRPCError: JSONRPCError(code=-32603, message=Internal Error: Parent block not found)`. * GetBlobBaseFee is using parents header which causes to get blob base fee for genesis blocks. According to the specs `excess_blob_gas` is **Running total of blob gas consumed in excess of the target, prior to this block.**. That means we need to use latest block header only. **Description** - use latest block header and remove accessing parent header. Co-authored-by: lakshya-sky <lakshya-sky@users.noreply.github.com> Co-authored-by: Edgar <git@edgl.dev>
Deduplicates the BAL gas-gated address tracking logic that was repeated in CALL, CALLCODE, DELEGATECALL, and STATICCALL handlers.
🤖 Kimi Code ReviewReview SummaryThis PR implements EIP-7928 (Block-Level Access Lists) and related Amsterdam fork features. The changes are well-structured and follow Ethereum specifications closely. Here are my findings: ✅ Good Practices
|
🤖 Codex Code ReviewFound a few correctness/consensus-risk issues and a couple of design nits. Line refs are approximate from the diff. High risk / correctness
Consensus / EIP compliance
Maintainability / robustness
If you want, I can suggest a small RAII guard for the system-call mode and a minimal fix to restore BAL touch ordering. Possible next steps:
Automated review by OpenAI Codex · custom prompt |
🤖 Claude Code ReviewPerfect! Now I have a comprehensive view of the changes. Let me compile my review: PR #6149 Code Review: Amsterdam EIP FixesSummaryThis PR implements critical fixes for Amsterdam fork EIP-7928 (Block Access Lists), EIP-7708 (ETH Transfer Logs), and EIP-7778 (Gas Accounting). It removes 158 lines of Amsterdam test skips and adds test infrastructure. The changes enable 250 Amsterdam state tests to pass. ✅ Strengths
🔴 Critical Issues1. Potential integer overflow in BAL gas check (crates/vm/levm/src/opcode_handlers/system.rs:527)if gas_remaining >= i64::try_from(basic_cost).unwrap_or(i64::MAX) {Issue: Using Recommendation: Should fail conservatively: if let Ok(cost_i64) = i64::try_from(basic_cost) {
if gas_remaining >= cost_i64 {
recorder.record_touched_address(target);
// ...
}
}Severity: Medium - Non-consensus BAL recording path, but incorrect behavior nonetheless. 2. Missing BAL cleanup on revert (crates/vm/levm/src/opcode_handlers/system.rs:638-667)The selfdestruct operation calls Issue: BAL state changes should be checkpoint/restore aware. The current implementation doesn't integrate with the checkpoint mechanism properly. Recommendation: Verify that Severity: High - Could cause incorrect BAL in reverted transactions. 3. EIP-7778 gas floor calculation (crates/vm/levm/src/hooks/default_hook.rs:187)let floor = vm.get_min_gas_used()?;
ctx_result.gas_used = gas_used_pre_refund.max(floor);Question: Is Recommendation: Add a comment explaining what Severity: Medium - Critical for EIP-7778 correctness.
|
Greptile OverviewGreptile SummaryThis PR tightens Amsterdam fork behavior across LEVM and the EF test tooling:
Main merge-blocker: Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| .gitignore | Adds pycache/ to gitignore; no functional impact. |
| crates/common/types/block_access_list.rs | Adds system-call filtering for SYSTEM_ADDRESS and selfdestruct BAL cleanup (track_selfdestruct), plus fixes undoing read→write promotion when net-zero writes revert to reads. |
| crates/vm/backends/levm/mod.rs | Wraps system contract calls with BAL recorder enter/exit system-call mode; currently leaks flag on error paths (enter without guaranteed exit). |
| crates/vm/levm/src/hooks/default_hook.rs | Adjusts Amsterdam+ block gas accounting to apply calldata floor and calls BAL selfdestruct cleanup during account deletion. |
| crates/vm/levm/src/opcode_handlers/system.rs | Moves BAL touch recording to match reference gas-check gating for CALL-family, adjusts CREATE touch timing, and tweaks EIP-7708 selfdestruct/self-transfer log comments/logic. |
| test/tests/levm/eip7928_tests.rs | Updates BAL tests to explicitly enter system-call mode when asserting SYSTEM_ADDRESS filtering behavior. |
| tooling/ef_tests/blockchain/tests/all.rs | Removes Amsterdam-specific skip list from blockchain EF tests to enable full Amsterdam coverage. |
| tooling/ef_tests/run-ef-tests.py | Adds a standalone EF test runner/analyzer script for blockchain + state tests with failure categorization and JSON lookup. |
| tooling/ef_tests/state/runner/levm_runner.rs | Plumbs EF env slot_number into VM env instead of hardcoding to zero. |
| tooling/ef_tests/state/types.rs | Adds optional slot_number field to EF state test env parsing. |
| tooling/ef_tests/state_v2/src/modules/runner.rs | Plumbs slot_number from v2 EF env into VM env instead of hardcoding zero. |
| tooling/ef_tests/state_v2/src/modules/types.rs | Adds Amsterdam to DEFAULT_FORKS and adds optional slot_number to v2 Env deserialization. |
Sequence Diagram
sequenceDiagram
participant LEVM as LEVM::prepare_block
participant SysCall as generic_system_contract_levm
participant DB as GeneralizedDatabase
participant BAL as BlockAccessListRecorder
participant VM as ethrex_levm::VM
participant Hook as DefaultHook::finalize_execution
LEVM->>SysCall: call system contract
SysCall->>DB: backup SYSTEM_ADDRESS + coinbase
SysCall->>BAL: enter_system_call()
SysCall->>VM: VM::new(env, db, tx)
VM->>VM: execute()
VM-->>SysCall: report or Err
alt success
SysCall->>BAL: exit_system_call()
SysCall->>DB: restore backed-up accounts
SysCall-->>LEVM: ExecutionReport
else error (current PR)
note over SysCall,BAL: exit_system_call() not run on Err
SysCall-->>LEVM: Err
end
note over VM,Hook: During tx finalization
Hook->>BAL: track_selfdestruct(address)
Test Infrastructure
Remove 150+ line Amsterdam skip list from blockchain/tests/all.rs
Add run-ef-tests.py for running EF state tests with fork filtering
Add Amsterdam to DEFAULT_FORKS in the state test runner
Amsterdam state tests: 250/250
Prague, Cancun, Shanghai, Paris state tests: 51,728/51,728
Added a python script which helps iterate over the ef tests, keeping it for future use in future forks