Feature/parallel tx fix#11200
Merged
Marchhill merged 30 commits intofeature/parallel-txsfrom Apr 17, 2026
Merged
Conversation
# Conflicts: # src/Nethermind/Nethermind.Evm/VirtualMachine.cs
* Simplify EIP-8037 gas accounting and error mapping in fix-g-hive - Extract EIP-8037 error path from Refund() into RefundEip8037Error to eliminate fragile spentGas mutation chain and dead code branches - Unify RefundOnFailContractCreation and RefundOnFailContractCreationBeforeExecution into a single virtual method with beforeExecution flag - Replace List<string> + AddIfMissing with HashSet<string> in error mapping - Simplify MatchesExpectedValidationError matching logic - Rename variables in ApplyCodeInsertRefunds for clarity - Add thread-safety contract to IBlockGasAccountingTracer Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Unify RefundOnFail with Func<long,long,long> for block gas calculation Replace RefundOnFailContractCreation + RefundEip8037Error with a single RefundOnFail method that takes a static Func for block gas calculation, eliminating duplication and the beforeExecution boolean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Use named BlockGasCalculation delegate instead of Func<long,long,long> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Extract assertion helpers from RunNewPayloads loop body Move inline assert blocks into AssertExpectedRpcError, AssertPayloadStatus, and AssertValidationError helpers. Fold MatchesExpectedValidationError into AssertValidationError since it was its only caller. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Decompose Refund into CalculateSpentGasAndRefund + CalculateBlockGas Break the monolithic Refund method into three clear steps: 1. CalculateSpentGasAndRefund — computes spent gas and claimable refund 2. CalculateBlockGas — computes EIP-8037/7778 block gas dimensions 3. Apply floor, pay refund, return GasConsumed Also add `in` to floorGas parameter to avoid struct copy. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * More refund refactor * more refactor * Extract SetupStaticCreateAttempt helper in Eip8037RegressionTests De-duplicate the static CREATE/CREATE2 setup code shared between the two parameterized test methods. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Extract ApplyPreExecutionDelegationRefunds from Execute Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * more refactors * Fix CalculateSpentGasAndRefund: errors must burn full gas limit For non-EIP-8037 errors, spentGas must be tx.GasLimit (all gas burned). The decomposition incorrectly always subtracted remaining gas. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Simplify CalculateSpentGasAndRefund: replace early return with conditionals Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix IDE0005 lint: fully qualify BlockErrorMessages in static local function The C# analyzer flags the using as unnecessary when it's only referenced inside a static local function. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix lint --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rename s_newPayloadParamCounts to NewPayloadParamCounts for consistency with the new PascalCase static fields - Add XML docs to BlockGasCalculation delegate (protected subclass API) - Annotate duplicate GAS_USED_OVERFLOW mapping entry Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* update jsonrpc CODEOWNERS * add facade
…11195) Mainnet Flat sync exceeded the default 180m matrix timeout (run 24526710791). Override the timeout inline for network=mainnet + mode=Flat only; other workflows consuming testnet-matrix.json are unaffected. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
#11178) * fix: EIP-8024 DUPN/SWAPN/EXCHANGE with truncated immediate must fail, not STOP When DUPN/SWAPN/EXCHANGE appeared at the end of bytecode without their required immediate byte, Nethermind returned a graceful STOP instead of failing. This caused a consensus split with Geth at Amsterdam fork activation, where Geth correctly fails with stack underflow. The root cause was StopOrBadInstruction returning EvmExceptionType.Stop when the program counter was past code end. A missing immediate is a malformed instruction — end-of-code STOP semantics are already handled by the main execution loop's bounds check. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: provide valid immediate for EIP-8024 opcodes in InvalidOpcodeTests The InvalidOpcodeTests test creates bytecode with just the bare opcode byte. For DUPN/SWAPN/EXCHANGE this now correctly returns BadInstruction due to the truncated immediate, not because the opcode is invalid. Append a valid immediate (0x80) so the test checks opcode validity. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor * revert: EIP-8024 end-of-code behavior is correct per spec Reverts the previous changes. The official Ethereum execution-spec-tests (bal@v5.6.1) have explicit test vectors (test_eip_vector_end_of_code) confirming that DUPN/SWAPN/EXCHANGE at end-of-code should be a graceful STOP, not a failure. Nethermind's original behavior matches the EIP-8024 specification. If Geth disagrees, the issue should be raised with the Geth team or EIP authors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Revert "revert: EIP-8024 end-of-code behavior is correct per spec" This reverts commit 1cb1e5d. * More fixes (#11180) * More fixes * Deduplicate --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Alexey Osipov <me@flcl.me>
* 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
Contributor
EVM Opcode Benchmark DiffAggregated runs: base=3, pr=3 Regressions (1)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge hive fixes into #9182
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Optional. Remove if not applicable.
Documentation
Requires documentation update
If yes, link the PR to the docs update or the issue with the details labeled
docs. Remove if not applicable.Requires explanation in Release Notes
If yes, fill in the details here. Remove if not applicable.
Remarks
Optional. Remove if not applicable.