Skip to content

Feature/parallel tx fix#11200

Merged
Marchhill merged 30 commits intofeature/parallel-txsfrom
feature/parallel-tx-fix
Apr 17, 2026
Merged

Feature/parallel tx fix#11200
Marchhill merged 30 commits intofeature/parallel-txsfrom
feature/parallel-tx-fix

Conversation

@Marchhill
Copy link
Copy Markdown
Contributor

Merge hive fixes into #9182

Changes

  • List the 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

Optional. Remove if not applicable.

Documentation

Requires documentation update

  • Yes
  • No

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

  • Yes
  • No

If yes, fill in the details here. Remove if not applicable.

Remarks

Optional. Remove if not applicable.

flcl42 and others added 23 commits April 8, 2026 12:41
# 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>
benaadams and others added 3 commits April 17, 2026 10:56
# Conflicts:
#	src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs
@Marchhill Marchhill merged commit 49f6d6e into feature/parallel-txs Apr 17, 2026
406 of 407 checks passed
@Marchhill Marchhill deleted the feature/parallel-tx-fix branch April 17, 2026 11:46
@github-actions
Copy link
Copy Markdown
Contributor

EVM Opcode Benchmark Diff

Aggregated runs: base=3, pr=3
Noisy rerun opcodes: DUP10

Regressions (1)

Opcode Base Median (ns) PR Median (ns) Delta Abs Δ (ns) Base CV PR CV Threshold Uncertainty Effective
DUP10 8.036 10.598 +31.88% 2.562 7.9% 6.1% ±5.0% ±8.8% ±15.7%

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.

6 participants