Skip to content

Bal devnet 3#10697

Merged
benaadams merged 407 commits intomasterfrom
bal-devnet-3
Mar 13, 2026
Merged

Bal devnet 3#10697
benaadams merged 407 commits intomasterfrom
bal-devnet-3

Conversation

@Marchhill
Copy link
Contributor

@Marchhill Marchhill commented Mar 2, 2026

Changes

Implementation of EIPs targeting the Amsterdam hard fork (Bal Devnet 3):

  • EIP-8037: State Creation Gas Cost Increase — introduces two-dimensional gas accounting (regular + state gas), state gas reservoir, and increased gas costs for CREATE/SELFDESTRUCT operations
  • EIP-7708: ETH transfer logs — system-level log events for ETH transfers, burns, and self-destructs with conditional BurnSignature (EIP-8037) vs SelfDestructSignature topics
  • EIP-7778: Block gas accounting without refunds
  • EIP-7843: SLOTNUM opcode
  • EIP-7954: Increase maximum contract size to 32KiB
  • EIP-8024: DupN/SwapN/Exchange stack operations
  • Block Access Lists (BAL): Full BAL encoding/decoding, validation, storage in execution payloads, and Engine API v5/v6 support

Additional fixes from merging master:

  • Fix SELFDESTRUCT gas check after SpecGasCosts refactor (ConsumeSelfDestructGas return value)
  • Fix selfdestruct-to-self log to use BurnSignature when EIP-8037 is active
  • Fix flaky IsDeletedAsInvalid blockchain processor test (polling instead of fixed 200ms wait)
  • Update gas cost call sites for SpecGasCosts API (GetCallCost()spec.GasCosts.CallCost, etc.)
  • Fix .Ether() / .GWei() method-to-property syntax changes

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

  • EVM unit tests for EIP-7928 (BAL gas accounting), EIP-7954 (contract size), EIP-7708 (transfer logs), EIP-8024 (stack ops)
  • Engine API tests for v5/v6 payload handling
  • BAL encoding/decoding RLP tests
  • Ethereum Foundation Pyspec tests pass for fork_Amsterdam

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No

Amsterdam hard fork support with EIP-8037 (two-dimensional gas), EIP-7708 (ETH transfer logs), EIP-7778 (refund-free gas accounting), EIP-7843 (SLOTNUM), EIP-7954 (32KiB contracts), EIP-8024 (new stack ops), and Block Access Lists.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces support for upcoming fork rules (notably EIP-8037 two-dimensional gas accounting and EIP-7954 code size changes), updates chain-spec plumbing to toggle these EIPs by timestamp, and expands/adjusts tests (including new pyspec fixtures handling) to validate the new behavior.

Changes:

  • Add EIP-8037 enablement/configuration across specs, gas policy, VM opcode paths, transaction/block accounting, and receipt gas tracking.
  • Add EIP-7954 (max code size increase) to fork specs and chain-spec transitions, with corresponding tests.
  • Refactor/extend block-level access list (BAL) validation and engine/BAL tests; improve pyspec fixture caching & concurrency handling.

Reviewed changes

Copilot reviewed 57 out of 57 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Nethermind/Nethermind.State/StateProvider.cs Minor collection initialization update.
src/Nethermind/Nethermind.State/ParallelWorldState.cs Adds BAL validation overload and related wiring.
src/Nethermind/Nethermind.Specs/ReleaseSpec.cs Adds EIP-8037/EIP-7954 toggles to spec model.
src/Nethermind/Nethermind.Specs/Forks/25_Amsterdam.cs Enables EIP-8037/EIP-7954 defaults for Amsterdam; adds “NoEip8037” spec.
src/Nethermind/Nethermind.Specs/ChainSpecStyle/Json/ChainSpecParamsJson.cs Adds transition timestamps for EIP-8037/EIP-7954.
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoader.cs Loads new EIP transition timestamps from chainspec JSON.
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecBasedSpecProvider.cs Applies EIP-8037/EIP-7954 enablement by timestamp; adjusts max code size.
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainParameters.cs Adds chain parameter fields for EIP-8037/EIP-7954 transitions.
src/Nethermind/Nethermind.Specs.Test/OverridableReleaseSpec.cs Extends overridable spec for new EIPs and instruction overrides.
src/Nethermind/Nethermind.Specs.Test/ChainSpecStyle/ChainSpecBasedSpecProviderTests.cs Updates tests to cover max code size transitions incl. EIP-7954.
src/Nethermind/Nethermind.Optimism/OptimismTransactionProcessor.cs Updates refund override signature to match new base API.
src/Nethermind/Nethermind.Merge.Plugin.Test/EngineModuleTests.V6.cs Refactors BAL engine tests; adds more parametrization and EIP-8037 variants.
src/Nethermind/Nethermind.Merge.AuRa.Test/AuRaMergeEngineModuleTests.cs Aligns AuRa merge engine tests with refactored BAL/EIP-8037 test APIs.
src/Nethermind/Nethermind.Evm/VmState.cs Tracks initial state reservoir per frame (EIP-8037).
src/Nethermind/Nethermind.Evm/VirtualMachine.cs Implements EIP-8037 gas restore/charge behavior across call frames and code deposit; adds burn log path.
src/Nethermind/Nethermind.Evm/TransferLog.cs Adds Burn log signature and factory.
src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs Implements EIP-8037-aware intrinsic validation, code deposit charging, refunds, and block gas accounting.
src/Nethermind/Nethermind.Evm/TransactionProcessing/GasConsumed.cs Extends gas accounting with BlockStateGas for EIP-8037.
src/Nethermind/Nethermind.Evm/State/IWorldState.cs Adds convenience overloads to world-state API.
src/Nethermind/Nethermind.Evm/State/IBlockAccessListBuilder.cs Extends BAL builder interface with a headerless validation overload.
src/Nethermind/Nethermind.Evm/IntrinsicGasCalculator.cs Adjusts non-generic intrinsic gas to include EIP-8037 state component.
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.Storage.cs Splits SSTORE gas charges/refunds for EIP-8037 path.
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.Stack.cs Updates EIP-8024 immediate decoding formulas and docs.
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.Eof.cs Routes EOF call/create charging through EIP-8037-enabled paths.
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.cs Dispatches to EIP-8037-specialized opcode implementations.
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.Create.cs Splits CREATE gas (regular/state), handles “wasted regular gas” tracking, uses child frame gas creator.
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.ControlFlow.cs Adds EIP-8037 SELFDESTRUCT burn log and new-account charging logic split.
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.CodeCopy.cs Routes BAL account reads via IBlockAccessListBuilder when available.
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.Call.cs Splits new-account charging behavior for EIP-8037.
src/Nethermind/Nethermind.Evm/GasPolicy/IGasPolicy.cs Adds state reservoir/state gas APIs and helpers for EIP-8037.
src/Nethermind/Nethermind.Evm/GasPolicy/EthereumGasPolicy.cs Implements unified legacy + EIP-8037 two-dimensional gas model.
src/Nethermind/Nethermind.Evm/CodeInfoRepository.cs Integrates BAL tracing for precompile code reads.
src/Nethermind/Nethermind.Evm/CodeDepositHandler.cs Splits code deposit cost into regular/state components for EIP-8037.
src/Nethermind/Nethermind.Evm/ByteCodeBuilder.cs Adds a small For(count, action) bytecode-building helper.
src/Nethermind/Nethermind.Evm.Test/IntrinsicGasCalculatorTests.cs Adds EIP-8037 intrinsic gas split assertions.
src/Nethermind/Nethermind.Evm.Test/Eip8037RegressionTests.cs New regression test for nested CREATE code deposit charging under EIP-8037.
src/Nethermind/Nethermind.Evm.Test/Eip8024Tests.cs Refactors EIP-8024 tests for new decoding rules and shared helpers.
src/Nethermind/Nethermind.Evm.Test/Eip7954Tests.cs New tests for EIP-7954 max code/initcode limits and EIP-8037 intrinsic floor enforcement.
src/Nethermind/Nethermind.Evm.Test/Eip7928Tests.cs Adjusts gas limit derivation to account for new intrinsic calculations.
src/Nethermind/Nethermind.Evm.Test/Eip2200Tests.cs Extends tests for EIP-8037 constants and gas policy behaviors.
src/Nethermind/Nethermind.Core/Specs/ReleaseSpecDecorator.cs Exposes new EIP toggles via decorator.
src/Nethermind/Nethermind.Core/Specs/IReleaseSpec.cs Adds IsEip8037Enabled and IsEip7954Enabled to the spec contract.
src/Nethermind/Nethermind.Core/RefundOf.cs Adds EIP-8037-specific SSTORE reversal refund constant.
src/Nethermind/Nethermind.Core/GasCostOf.cs Adds EIP-8037 cost constants.
src/Nethermind/Nethermind.Core/Extensions/Bytes.cs Comment-only change.
src/Nethermind/Nethermind.Core/Eip7825Constants.cs Adjusts tx gas limit cap behavior when EIP-8037 is enabled.
src/Nethermind/Nethermind.Core/CodeSizeConstants.cs Adds EIP-7954 max code size constant.
src/Nethermind/Nethermind.Consensus/Validators/HeaderValidator.cs Makes BAL hash validation method overridable.
src/Nethermind/Nethermind.Consensus/Processing/BlockProcessor.cs Refactors ctor/fields and BAL plumbing; updates internal field usage.
src/Nethermind/Nethermind.Blockchain/Tracing/BlockReceiptsTracer.cs Tracks cumulative regular+state gas and uses max() for header gasUsed.
src/Nethermind/Nethermind.Blockchain.Test/BlockchainProcessorTests.cs Stabilizes invalid-block deletion assertion on slower CI.
src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs Sets genesis BAL hash for EIP-7928 tests.
src/Nethermind/Ethereum.Test.Base/BlockchainTestBase.cs Allows genesis processing under target fork rules for certain fixtures.
src/Nethermind/Ethereum.Blockchain.Pyspec.Test/LoadPyspecTestsStrategy.cs Adds stable fixtures cache path + process-safe download/extract.
src/Nethermind/Ethereum.Blockchain.Pyspec.Test/AmsterdamEip8037StateTests.cs New pyspec-backed state tests for EIP-8037 fixtures.
src/Nethermind/Ethereum.Blockchain.Pyspec.Test/AmsterdamEip8037BlockChainTests.cs New pyspec-backed blockchain tests for EIP-8037 fixtures.
cspell.json Adds new dictionary words used by the changes/tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

benaadams and others added 3 commits March 11, 2026 23:20
AutoDump writes block RLP/receipts to temp files on invalid blocks. On
Windows, parallel tests hitting the same block hash cause IOException
from file locking, which escapes as BlockchainException and turns
ResultWrapper.Data null — causing NRE in NewPayloadV5 assertions.

Set DumpOptions.None in PseudoNethermindModule and add a null guard on
result.Data for clearer failure messages.
# Conflicts:
#	src/Nethermind/Ethereum.Blockchain.Pyspec.Test/LoadPyspecTestsStrategy.cs
#	src/Nethermind/Nethermind.Blockchain.Test/BlockchainProcessorTests.cs
benaadams and others added 12 commits March 12, 2026 13:27
Replace runtime Spec.IsEip7708Enabled checks in AddTransferLog,
AddBurnLog, and AddSelfDestructLog with generic TEip7708 : IFlag
parameter for JIT-time branch elimination on hot instruction paths.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…ntract creation

- Restore spilled state gas to reservoir on child halt/revert (RestoreChildStateGas)
- Add RevertRefundToHalt to correct state gas when code deposit fails after Refund
- Handle EIP-8037 in RefundOnFailContractCreation: refund unused state reservoir to sender
- Charge regular gas before state gas in TryConsumeStateAndRegularGas to prevent spill inflation
- Remove WastedRegularGas tracking (collision burns count as block_regular per spec)
When initcode exceeds MaxInitCodeSize, the EIP-3860 check fires before
ConsumeStateGas(CreateState) is called, so StateGasSpill is never recorded
and block_regular incorrectly includes the state gas component.
… EEST tests

- Wire SlotNumber from test fixture JSON through state test infrastructure
- Defer destroy list processing to after PayFees so burn logs include priority fee
- Move AddSelfDestructLog after no-op guard to avoid spurious burn on selfdestruct-to-self
- Return Stop instead of BadInstruction for DUPN/SWAPN/EXCHANGE at end of code
- Fix selfdestruct-to-self no-op: post-EIP-6780, no ETH moves so no log
  should be emitted. The prior test was codifying buggy behavior.
- Update EIP-8024 tests: end-of-code missing immediate is now STOP (success)
  per spec, not BadInstruction (failure)
@benaadams
Copy link
Member

Raised issue for missing EEST test ethereum/execution-specs#2497

@benaadams benaadams merged commit b2328a6 into master Mar 13, 2026
555 of 557 checks passed
@benaadams benaadams deleted the bal-devnet-3 branch March 13, 2026 14:56
@Marchhill Marchhill restored the bal-devnet-3 branch March 13, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants