Conversation
EVM Opcode Benchmark DiffAggregated runs: base=3, pr=3 Improvements (1)
|
|
@claude review |
|
Claude finished @LukaszRozmej's task in 4m 29s —— View job PR Review: Don't return state gas
SummaryThis PR fixes a correctness bug under EIP-8037: state gas consumed during a failed CREATE (code deposit failure, invalid code, or oversized code) was incorrectly contributing to block-state gas accounting even though the state changes were reverted. The fix ensures that reverted state gas is fully discarded from block accounting. The PR also fixes a related bug in Core Logic:
|
There was a problem hiding this comment.
Pull request overview
Adjusts EIP-8037 gas/state-gas accounting so reverted/failed CREATE paths don’t incorrectly contribute to committed block state gas (and updates block validation accordingly).
Changes:
- Update CREATE/code-deposit failure handling to discard specific state-gas charges from block-state accounting under EIP-8037.
- Modify transaction gas validation to account for EIP-8037’s block gas accounting semantics.
- Add/extend EIP-8037 regression tests and bump Amsterdam pyspec fixture archive version.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Nethermind/Nethermind.Xdc/XdcTransactionProcessor.cs | Adapts ValidateGas override to new base signature and forwards correct spec. |
| src/Nethermind/Nethermind.Evm/VirtualMachine.cs | Adds discard logic for CREATE state charges on specific code-deposit failures. |
| src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs | Updates gas validation for EIP-8037 and adjusts failed contract-creation gas accounting. |
| src/Nethermind/Nethermind.Evm/TransactionProcessing/SystemTransactionProcessor.cs | Updates ValidateGas override to new signature. |
| src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.Create.cs | Adjusts CREATE static/oversized-initcode charging behavior under EIP-8037. |
| src/Nethermind/Nethermind.Evm/GasPolicy/IGasPolicy.cs | Introduces DiscardStateGas hook for policies. |
| src/Nethermind/Nethermind.Evm/GasPolicy/EthereumGasPolicy.cs | Implements DiscardStateGas for Ethereum gas policy. |
| src/Nethermind/Nethermind.Evm.Test/Eip8037RegressionTests.cs | Adds regression coverage for nested CREATE failures, static-context CREATE, and block validation behavior. |
| src/Nethermind/Ethereum.Blockchain.Pyspec.Test/Amsterdam/Constants.cs | Bumps BAL fixture archive version for Amsterdam pyspec tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
LukaszRozmej
left a comment
There was a problem hiding this comment.
To be honest I'm lost with all this gas shit now. Can we not do 8037?
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?