Fix amsterdam hive tests#11151
Conversation
# Conflicts: # src/Nethermind/Nethermind.Evm/VirtualMachine.cs
EVM Opcode Benchmark DiffAggregated runs: base=1, pr=1 No significant regressions or improvements detected. |
|
@claude review |
|
Claude finished @LukaszRozmej's task in 4m 27s —— View job Code Review
SummaryThis PR fixes several EIP-8037 (Amsterdam) correctness issues for hive tests: contract creation collision handling, CREATE state-gas charge ordering, delegation refund timing, and code-deposit failure semantics. The changes are non-trivial and touch the critical gas-accounting path. Issues FoundMedium — Parameter naming confusion in
|
LukaszRozmej
left a comment
There was a problem hiding this comment.
Can changes in TransactionProcessor be somewhat simplified/easier to reason about?
There was a problem hiding this comment.
Pull request overview
This PR updates core EVM transaction execution and block/receipt gas accounting to align with Amsterdam-era spec behavior (notably EIP-8037/EIP-7778), adds/adjusts regression coverage, and improves Ethereum engine/pyspec test handling to fix failing Amsterdam hive tests.
Changes:
- Refactors transaction gas validation to use tracer-provided cumulative gas (regular vs receipt) for correct per-tx allowance under EIP-8037/EIP-7778.
- Adjusts CREATE/code-deposit gas/state-gas accounting and failure/collision handling, including VM execution gas tracking changes.
- Improves test infrastructure and adds Amsterdam pyspec validation/transition fixtures plus expanded EIP-8037/EIP-7778 tests.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Nethermind/Nethermind.Xdc/XdcTransactionProcessor.cs | Updates ValidateGas/ValidateStatic call patterns to match new base signatures (tracer-aware). |
| src/Nethermind/Nethermind.Taiko/TaikoTransactionProcessor.cs | Updates ValidateStatic override to include tracer and forward correctly. |
| src/Nethermind/Nethermind.Optimism/OptimismTransactionProcessor.cs | Adjusts Refund signature for updated base method parameter passing. |
| src/Nethermind/Nethermind.Evm/VirtualMachine.cs | Revises CREATE/code deposit halt semantics and uses ref gas for frame-accurate accounting. |
| src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs | Core changes: tracer-aware gas allowance validation, EIP-8037 delegation refund handling, refund/failure accounting refactor. |
| src/Nethermind/Nethermind.Evm/TransactionProcessing/SystemTransactionProcessor.cs | Adapts ValidateGas override to new tracer-aware signature. |
| src/Nethermind/Nethermind.Evm/TransactionProcessing/GasConsumed.cs | Updates EffectiveBlockGas semantics for EIP-8037 “zero regular gas” cases. |
| src/Nethermind/Nethermind.Evm/Tracing/ITxTracer.cs | Introduces IBlockGasAccountingTracer for block-local allowance validation. |
| src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.Create.cs | Reorders CREATE charging so state-gas isn’t consumed on memory OOG. |
| src/Nethermind/Nethermind.Evm/GasPolicy/IGasPolicy.cs | Updates documentation around EIP-7702 refunds under EIP-8037 timing/semantics. |
| src/Nethermind/Nethermind.Evm/GasPolicy/EthereumGasPolicy.cs | Adjusts ApplyCodeInsertRefunds to make state refund available for later state-gas consumption. |
| src/Nethermind/Nethermind.Evm.Test/TestAllTracerWithOutput.cs | Implements IBlockGasAccountingTracer and tracks cumulative regular/receipt gas for tests. |
| src/Nethermind/Nethermind.Evm.Test/Eip8037Tests.cs | Adds unit coverage for code-insert state refund being usable by later state gas. |
| src/Nethermind/Nethermind.Evm.Test/Eip8037RegressionTests.cs | Updates/extends regression expectations around CREATE failures/collisions and state-gas accounting. |
| src/Nethermind/Nethermind.Evm.Test/Eip7778Tests.cs | Adds coverage for allowance based on post-refund receipt gas under EIP-7778. |
| src/Nethermind/Nethermind.Consensus/Processing/BlockProcessor.BlockValidationTransactionsExecutor.cs | Adds explicit block invalidation if cumulative header gasUsed exceeds gasLimit during validation. |
| src/Nethermind/Nethermind.Blockchain/Tracing/BlockReceiptsTracer.cs | Implements IBlockGasAccountingTracer and exposes cumulative regular/receipt gas. |
| src/Nethermind/Ethereum.Test.Base/BlockchainTestBase.cs | Improves engine newPayload test behavior (timeout) and maps validation errors to expected EEST exception IDs. |
| src/Nethermind/Ethereum.Blockchain.Pyspec.Test/Amsterdam/ValidationTests.cs | Adds Amsterdam BAL validation fixtures for selected pyspec subsets. |
| src/Nethermind/Ethereum.Blockchain.Pyspec.Test/Amsterdam/TransitionTests.cs | Adds Amsterdam transition pyspec fixtures keyed by EIP wildcard. |
| .github/workflows/nethermind-tests.yml | Removes TEST_SKIP_HEAVY env from one workflow variant. |
| .github/workflows/nethermind-tests-flat.yml | Removes TEST_SKIP_HEAVY env from one workflow variant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Though would want this one merged in first #11182 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #11151 +/- ##
===========================================
- Coverage 77.34% 0 -77.35%
===========================================
Files 2664 0 -2664
Lines 104979 0 -104979
Branches 15017 0 -15017
===========================================
- Hits 81192 0 -81192
+ Misses 21080 0 -21080
+ Partials 2707 0 -2707 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
* Move cumulative gas tracking from tracer to TransactionProcessor
Track cumulative regular and receipt gas as fields on
TransactionProcessorBase, removing the IBlockGasAccountingTracer cast
from ValidateGas. This decouples transaction validation from the
tracing infrastructure.
- Add _blockCumulativeRegularGas and _blockCumulativeReceiptGas fields
- Reset in SetBlockExecutionContext, update after each validated tx
- Remove ITxTracer parameter from ValidateGas and ValidateStatic
- Update SystemTransactionProcessor, Taiko, and Xdc overrides
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix
* cleanup
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Ben {chmark} Adams <thundercat@illyriad.co.uk>
# Conflicts: # src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs
|
@claude re-review |
|
Claude finished @LukaszRozmej's task in 5m 56s —— View job Re-review
Three commits have landed since Review #3: All previously outstanding items resolved
Commit
|
|
🥳 |
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?