Skip to content

Bal devnet 2#10325

Merged
Marchhill merged 394 commits intomasterfrom
bal-devnet-2
Mar 9, 2026
Merged

Bal devnet 2#10325
Marchhill merged 394 commits intomasterfrom
bal-devnet-2

Conversation

@Marchhill
Copy link
Contributor

@Marchhill Marchhill commented Jan 26, 2026

Changes

Types of changes

What types of changes does your code introduce?

  • New feature (a non-breaking change that adds functionality)

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Remarks

# Conflicts:
#	src/Nethermind/Nethermind.Consensus/Processing/BlockProcessor.cs
Base automatically changed from bal-devnet-2-bals-only to master March 9, 2026 17:11
# Conflicts:
#	src/Nethermind/Ethereum.Test.Base/BlockchainTestBase.cs
#	src/Nethermind/Nethermind.Consensus/Validators/BlockValidator.cs
#	src/Nethermind/Nethermind.Consensus/Validators/HeaderValidator.cs
#	src/Nethermind/Nethermind.Core.Test/Blockchain/TestBlockchain.cs
#	src/Nethermind/Nethermind.Core.Test/Builders/BlockBuilder.cs
#	src/Nethermind/Nethermind.Core.Test/Builders/BlockHeaderBuilder.cs
#	src/Nethermind/Nethermind.Core/BlockAccessLists/BlockAccessList.cs
#	src/Nethermind/Nethermind.Core/BlockHeader.cs
#	src/Nethermind/Nethermind.Core/Specs/IReleaseSpec.cs
#	src/Nethermind/Nethermind.Core/Specs/ReleaseSpecDecorator.cs
#	src/Nethermind/Nethermind.Facade/Eth/BlockForRpc.cs
#	src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs
#	src/Nethermind/Nethermind.JsonRpc/Modules/Eth/EthRpcModule.cs
#	src/Nethermind/Nethermind.Merge.AuRa.Test/AuRaMergeEngineModuleTests.cs
#	src/Nethermind/Nethermind.Merge.Plugin.Test/EngineModuleTests.V6.cs
#	src/Nethermind/Nethermind.Merge.Plugin/Data/ExecutionPayload.cs
#	src/Nethermind/Nethermind.Merge.Plugin/Data/ExecutionPayloadV4.cs
#	src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.Amsterdam.cs
#	src/Nethermind/Nethermind.Merge.Plugin/Handlers/EngineRpcCapabilitiesProvider.cs
#	src/Nethermind/Nethermind.Merge.Plugin/IEngineRpcModule.Amsterdam.cs
#	src/Nethermind/Nethermind.Serialization.Rlp/HeaderDecoder.cs
#	src/Nethermind/Nethermind.Specs.Test/ChainParametersTests.cs
#	src/Nethermind/Nethermind.Specs.Test/OverridableReleaseSpec.cs
#	src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainParameters.cs
#	src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoader.cs
#	src/Nethermind/Nethermind.Specs/ChainSpecStyle/Json/ChainSpecParamsJson.cs
#	src/Nethermind/Nethermind.Specs/Forks/25_Amsterdam.cs
#	src/Nethermind/Nethermind.Taiko/Tdx/BlockHeaderForRpc.cs
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

Updates Nethermind to support Bal devnet 2 fork features by wiring new EIPs through specs, Engine API/RPC payloads, block/header fields, EVM execution/tracing, receipt encoding/decoding, and adding/adjusting tests.

Changes:

  • Add fork/spec toggles and chainspec transition parameters for EIP-7708/7778/7843/8024 (Amsterdam fork), plus Engine API updates (FCU V4) and SlotNumber propagation.
  • Implement EVM/runtime behavior for SLOTNUM (EIP-7843), transfer/selfdestruct logs (EIP-7708), and block gas accounting without refunds (EIP-7778).
  • Harden RLP receipt decoders and add helpers for decoding non-negative longs; add/adjust test coverage across network, EVM, RPC, and consensus layers.

Reviewed changes

Copilot reviewed 124 out of 124 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/Nethermind/Nethermind.Xdc/RLP/XdcBlockInfoDecoder.cs Decode block number as non-negative long.
src/Nethermind/Nethermind.Test.Runner/StateTestTxTracer.cs Pass GasConsumed by in to avoid copies.
src/Nethermind/Nethermind.Taiko/Tdx/BlockHeaderForRpc.cs Expose SlotNumber in Taiko RPC header view.
src/Nethermind/Nethermind.Taiko/Rpc/TaikoForkchoiceUpdatedHandler.cs Remove Taiko-specific timestamp validation override.
src/Nethermind/Nethermind.State/Proofs/ReceiptTrie.cs Minor formatting for RLP behavior flags.
src/Nethermind/Nethermind.Specs/ReleaseSpec.cs Add spec flags for new EIPs (7708/7778/7843/8024).
src/Nethermind/Nethermind.Specs/MainnetSpecProvider.cs Add Amsterdam activation to mainnet fork list.
src/Nethermind/Nethermind.Specs/Forks/25_Amsterdam.cs Enable devnet-2 EIPs on Amsterdam fork spec.
src/Nethermind/Nethermind.Specs/ChainSpecStyle/Json/ChainSpecParamsJson.cs Add transition timestamps for new EIPs.
src/Nethermind/Nethermind.Specs/ChainSpecStyle/Json/ChainSpecGenesisJson.cs Add optional genesis SlotNumber.
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoader.cs Load new transition timestamps; set genesis slot number when enabled.
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecBasedSpecProvider.cs Activate EIP flags based on transitions.
src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainParameters.cs Add new EIP transition timestamp fields.
src/Nethermind/Nethermind.Specs.Test/OverridableReleaseSpec.cs Surface new EIP flags on overridable spec wrapper.
src/Nethermind/Nethermind.Specs.Test/ChainParametersTests.cs Extend test coverage for new params keys.
src/Nethermind/Nethermind.Serialization.Rlp/TxDecoders/BaseTxDecoder.cs Decode gas limit as non-negative long.
src/Nethermind/Nethermind.Serialization.Rlp/RlpHelpers.cs Add helper to throw on negative long.
src/Nethermind/Nethermind.Serialization.Rlp/Rlp.cs Add DecodePositiveLong() to ValueDecoderContext.
src/Nethermind/Nethermind.Serialization.Rlp/ReceiptStorageDecoder.cs Harden receipt decoding boundaries; decode gas as positive long.
src/Nethermind/Nethermind.Serialization.Rlp/ReceiptMessageDecoder.cs Enforce receipt boundary handling; decode gas as positive long.
src/Nethermind/Nethermind.Serialization.Rlp/HeaderDecoder.cs Add SlotNumber optional field encode/decode.
src/Nethermind/Nethermind.Serialization.Rlp/CompactReceiptStorageDecoder.cs Decode receipt gas as positive long; handle extra trailing bytes.
src/Nethermind/Nethermind.Runner/Monitoring/DataFeed.cs Refactor receipt projection formatting.
src/Nethermind/Nethermind.Optimism/OptimismTxDecoder.cs Decode OP tx gas limit as non-negative long.
src/Nethermind/Nethermind.Optimism/OptimismReceiptStorageDecoder.cs Decode OP receipt gas as positive long.
src/Nethermind/Nethermind.Optimism/OptimismReceiptMessageDecoder.cs Decode OP receipt gas from bytes using positive-long helper.
src/Nethermind/Nethermind.Optimism/OptimismBlockReceiptTracer.cs Update receipt building to use GasConsumed + cumulative gas tracking.
src/Nethermind/Nethermind.Network/P2P/Subprotocols/Eth/V69/Messages/ReceiptMessageDecoder69.cs Decode receipt gas as positive long; enforce receipt boundary handling.
src/Nethermind/Nethermind.Network/P2P/Subprotocols/Eth/V63/Messages/ReceiptsMessageSerializer.cs Use receipt spec provider consistently for behaviors.
src/Nethermind/Nethermind.Network.Test/P2P/Subprotocols/Eth/V69/ReceiptMessageDecoder69Tests.cs Add roundtrip tests for V69 receipts.
src/Nethermind/Nethermind.Merge.Plugin/IEngineRpcModule.Amsterdam.cs Add engine_forkchoiceUpdatedV4 RPC method.
src/Nethermind/Nethermind.Merge.Plugin/Handlers/ForkchoiceUpdatedHandler.cs Validate payload timestamp + slot number; use FCU V4 path.
src/Nethermind/Nethermind.Merge.Plugin/Handlers/EngineRpcCapabilitiesProvider.cs Gate FCU V4 capability on EIP-7843.
src/Nethermind/Nethermind.Merge.Plugin/EngineRpcModule.Amsterdam.cs Implement engine_forkchoiceUpdatedV4.
src/Nethermind/Nethermind.Merge.Plugin/Data/ExecutionPayloadV4.cs Map SlotNumber between block/header and payload v4.
src/Nethermind/Nethermind.Merge.Plugin/Data/ExecutionPayload.cs Add optional SlotNumber to execution payload base.
src/Nethermind/Nethermind.Merge.Plugin.Test/EngineModuleTests.V6.cs Update Engine tests to FCU V4 + slot number.
src/Nethermind/Nethermind.Merge.AuRa.Test/AuRaMergeEngineModuleTests.cs Update AuRa merge engine tests for new vectors.
src/Nethermind/Nethermind.JsonRpc/Modules/ReceiptFinderExtensions.cs Refactor receipt-for-RPC construction formatting.
src/Nethermind/Nethermind.JsonRpc/Modules/Proof/ProofRpcModule.cs Refactor receipt-for-RPC construction formatting.
src/Nethermind/Nethermind.JsonRpc/Modules/Eth/EthRpcModule.cs Remove stray blank lines (formatting).
src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/Simulate/EthSimulateTestsBlocksAndTransactions.cs Parameterize simulate transfer log expectations with EIP-7708 toggle.
src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs Update expected block access list results; adjust pruned test input; add debug print.
src/Nethermind/Nethermind.JsonRpc.Test/Data/ReceiptsForRpcTests.cs Add missing serializer import.
src/Nethermind/Nethermind.Facade/Simulate/SimulateTxTracer.cs Use new TransferLog helper for simulated transfer logs; pass GasConsumed by in.
src/Nethermind/Nethermind.Facade/Simulate/SimulateTransactionProcessorAdapter.cs Budget simulation gas using Transaction.BlockGasUsed.
src/Nethermind/Nethermind.Facade/Simulate/SimulateReadOnlyBlocksProcessingEnv.cs Update env override call signature.
src/Nethermind/Nethermind.Facade/Simulate/SimulateBlockTracer.cs Disallow reward tracing; suppress simulated transfer logs when EIP-7708 is enabled.
src/Nethermind/Nethermind.Facade/Simulate/SimulateBlockMutatorTracerFactory.cs Pass spec provider into simulate block tracer.
src/Nethermind/Nethermind.Facade/Simulate/ISimulateBlockTracerFactory.cs Make tracer factory covariant (out).
src/Nethermind/Nethermind.Facade/Eth/BlockForRpc.cs Expose SlotNumber when EIP-7843 is enabled.
src/Nethermind/Nethermind.Facade/BlockchainBridge.cs Use spec provider from simulate env rather than global provider.
src/Nethermind/Nethermind.Facade.Test/BlockchainBridgeTests.cs Add test ensuring simulate adapter budgets by block gas used.
src/Nethermind/Nethermind.Evm/VirtualMachine.cs Add transfer/selfdestruct log emission plumbing; centralize log emission via AddLog.
src/Nethermind/Nethermind.Evm/TransferLog.cs New helper to create EIP-7708 transfer/selfdestruct logs.
src/Nethermind/Nethermind.Evm/TransactionSubstate.cs Make log collection strongly typed as JournalCollection; minor logging cleanup.
src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs Implement EIP-7778 block gas accounting; emit selfdestruct logs on account destruction list processing.
src/Nethermind/Nethermind.Evm/TransactionProcessing/GasConsumed.cs Track BlockGas separately (pre-refund) and expose EffectiveBlockGas.
src/Nethermind/Nethermind.Evm/Tracing/TxTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Evm/Tracing/NullTxTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Evm/Tracing/ITxTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Evm/Tracing/Debugger/DebugTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Evm/Tracing/CompositeTxTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Evm/Tracing/CancellationTxTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.cs Register SLOTNUM and EIP-8024 stack ops when enabled; adjust opcode gap comment.
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.Stack.cs Implement legacy DUPN/SWAPN/EXCHANGE and decode helpers; route LOG to vm.AddLog.
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.Eof.cs Rename EOF-only DUPN/SWAPN/EXCHANGE handlers to avoid clashing with legacy forms.
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.Environment.cs Implement SLOTNUM opcode.
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.ControlFlow.cs Emit transfer/selfdestruct logs on SELFDESTRUCT.
src/Nethermind/Nethermind.Evm/Instructions/EvmInstructions.Call.cs Emit transfer log for fast CALL path.
src/Nethermind/Nethermind.Evm/Instruction.cs Add SLOTNUM opcode and stack requirement metadata.
src/Nethermind/Nethermind.Evm/ByteCodeBuilderExtensions.cs Add builder helper for SLOTNUM.
src/Nethermind/Nethermind.Evm.Test/VirtualMachineTestsBase.cs Allow injecting slot number into built blocks for opcode tests.
src/Nethermind/Nethermind.Evm.Test/TestAllTracerWithOutput.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Evm.Test/Keccak256Tests.cs Update BuildBlock signature to include slot number param.
src/Nethermind/Nethermind.Evm.Test/EvmPooledMemoryTests.cs Update ITxTracer signature changes.
src/Nethermind/Nethermind.Evm.Test/Eip8024Tests.cs New test suite for legacy DUPN/SWAPN/EXCHANGE behaviors and edge cases.
src/Nethermind/Nethermind.Evm.Test/Eip7843Tests.cs New test for SLOTNUM opcode behavior/gas.
src/Nethermind/Nethermind.Evm.Test/Eip7778Tests.cs New test suite verifying pre-refund block gas accounting vs post-refund receipts.
src/Nethermind/Nethermind.Evm.Test/Eip7708Tests.cs New test suite verifying transfer/selfdestruct log emission toggled by EIP-7708.
src/Nethermind/Nethermind.Evm.Test/CoinbaseTests.cs Update BuildBlock signature to include slot number param.
src/Nethermind/Nethermind.Core/Transaction.cs Add BlockGasUsed field for pre-refund gas accounting/budgeting.
src/Nethermind/Nethermind.Core/Specs/ReleaseSpecDecorator.cs Expose new EIP flags through decorator.
src/Nethermind/Nethermind.Core/Specs/IReleaseSpecExtensions.cs Add convenience flag BlockLevelAccessListsEnabled.
src/Nethermind/Nethermind.Core/Specs/IReleaseSpec.cs Add new EIP flags (7708/7843/8024) to spec interface.
src/Nethermind/Nethermind.Core/Specs/IReceiptSpec.cs Add IsEip7778Enabled to receipt spec interface.
src/Nethermind/Nethermind.Core/Messages/BlockErrorMessages.cs Add slot number-related error messages.
src/Nethermind/Nethermind.Core/Extensions/SpanExtensions.cs Add ToPositiveLong(ReadOnlySpan<byte>) conversion helper.
src/Nethermind/Nethermind.Core/Extensions/Bytes.cs Commented out byte[] helper (span helper is primary).
src/Nethermind/Nethermind.Core/BlockHeader.cs Add SlotNumber to header (ctor + property + ToString).
src/Nethermind/Nethermind.Core/BlockAccessLists/BlockAccessList.cs Push revertible changes when deleting accounts to support revert/restore.
src/Nethermind/Nethermind.Core/Block.cs Expose SlotNumber through Block wrapper.
src/Nethermind/Nethermind.Core.Test/Encoding/ReceiptTrieEip7778Tests.cs Assert receipt trie root unchanged with/without EIP-7778.
src/Nethermind/Nethermind.Core.Test/Encoding/ReceiptDecoderTests.cs Add missing Core import (compile fix).
src/Nethermind/Nethermind.Core.Test/Encoding/CompactReceiptStorageDecoderTests.cs Formatting tweak.
src/Nethermind/Nethermind.Core.Test/BytesTests.cs Add tests for ToPositiveLong success/overflow/endian handling.
src/Nethermind/Nethermind.Core.Test/Builders/BlockHeaderBuilder.cs Rename parameter for BAL hash; add slot number builder method.
src/Nethermind/Nethermind.Core.Test/Builders/BlockBuilder.cs Add .WithSlotNumber(...) builder helper.
src/Nethermind/Nethermind.Core.Test/Blockchain/TestBlockchain.cs Set genesis slot number when EIP-7843 is enabled.
src/Nethermind/Nethermind.Consensus/Validators/HeaderValidator.cs Validate slot number monotonicity; integrate into header validation pipeline.
src/Nethermind/Nethermind.Consensus/Validators/BlockValidator.cs Ensure processed vs suggested block slot number matches.
src/Nethermind/Nethermind.Consensus/Producers/TxPoolTxSource.cs Budget tx selection by Transaction.BlockGasUsed.
src/Nethermind/Nethermind.Consensus/Producers/PayloadAttributes.cs Add SlotNumber; include in payload id; extend payload-attributes versioning.
src/Nethermind/Nethermind.Consensus/Producers/BlockProducerBase.cs Copy slot number from payload attributes into produced header.
src/Nethermind/Nethermind.Consensus/Processing/BlockProcessor.cs Preserve slot number when preparing processing header; reduce tracer overhead for miner rewards.
src/Nethermind/Nethermind.Blockchain/Tracing/Proofs/ProofTxTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Blockchain/Tracing/ParityStyle/ParityLikeTxTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Blockchain/Tracing/GethStyle/GethLikeTxTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Blockchain/Tracing/GethStyle/GethLikeTxMemoryTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Blockchain/Tracing/GethStyle/Custom/Native/Prestate/NativePrestateTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Blockchain/Tracing/GethStyle/Custom/Native/Call/NativeCallTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Blockchain/Tracing/GethStyle/Custom/JavaScript/GethLikeJavaScriptTxTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Blockchain/Tracing/EstimateGasTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Blockchain/Tracing/CallOutputTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Blockchain/Tracing/BlockReceiptsTracer.cs Track receipt gas (post-refund) separately from block gas (pre-refund) and support restore.
src/Nethermind/Nethermind.Blockchain/Tracing/AlwaysCancelTxTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Blockchain/Tracing/AccessTxTracer.cs Pass GasConsumed by in.
src/Nethermind/Nethermind.Blockchain.Test/Validators/HeaderValidatorTests.cs Add test for invalid slot number when equal to parent.
src/Nethermind/Nethermind.Blockchain.Test/TransactionSelectorTests.cs Add test asserting block gas budget uses pre-refund value for sender chain.
src/Nethermind/Ethereum.Test.Base/TestEngineNewPayloadsJson.cs Add SlotNumber to engine newPayload test JSON model.
src/Nethermind/Ethereum.Test.Base/TestBlockHeaderJson.cs Add SlotNumber to block header test JSON model.
src/Nethermind/Ethereum.Test.Base/JsonToEthereumTest.cs Parse SlotNumber from JSON into BlockHeader/ExecutionPayload.
src/Nethermind/Ethereum.Test.Base/BlockchainTestBase.cs Adjust transition initialization formatting; relax genesis spec assertion.
cspell.json Add new spellings/terms (slotnum, selfdestructs, vectorised).
Comments suppressed due to low confidence (1)

src/Nethermind/Nethermind.Consensus/Producers/PayloadAttributes.cs:158

  • PayloadAttributes.ValidateVersion is now comparing apiVersion (from EngineApiVersions, where Amsterdam == 6) to actualVersion/timestampVersion derived from PayloadAttributesVersions (where Amsterdam == 4). This makes the version checks inconsistent and the current exception clause effectively bypasses validation for Amsterdam calls. Align the version constants (e.g., have payload-attributes versions use EngineApiVersions values) and adjust the compatibility exception logic accordingly (e.g., allow newer FCU methods to accept older payload-attributes versions when the fork is not active).
        // version calculated from parameters should match api version
        if (actualVersion != apiVersion)
        {
            // except of Shanghai api handling Paris fork
            if (apiVersion == EngineApiVersions.Shanghai && timestampVersion == PayloadAttributesVersions.Paris ||
                apiVersion == EngineApiVersions.Amsterdam && timestampVersion == PayloadAttributesVersions.Amsterdam)
            {

                error = null;
                return PayloadAttributesValidationResult.Success;
            }

            error = $"{methodName}{apiVersion} expected";
            return actualVersion <= EngineApiVersions.Paris ? PayloadAttributesValidationResult.InvalidParams : PayloadAttributesValidationResult.InvalidPayloadAttributes;
        }

        // timestamp should correspond to proper api version
        if (timestampVersion != apiVersion)
        {
            error = $"{methodName}{timestampVersion} expected";
            return timestampVersion <= EngineApiVersions.Paris ? PayloadAttributesValidationResult.InvalidParams : PayloadAttributesValidationResult.UnsupportedFork;
        }

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

You can also share your feedback on Copilot code review. Take the survey.

@Marchhill Marchhill merged commit 195829e into master Mar 9, 2026
113 of 115 checks passed
@Marchhill Marchhill deleted the bal-devnet-2 branch March 9, 2026 17:55
@Marchhill Marchhill restored the bal-devnet-2 branch March 9, 2026 17:55
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