A robust execution client for Ethereum node operators.
  • C# 99.1%
  • TypeScript 0.3%
  • Python 0.2%
  • Shell 0.2%
  • JavaScript 0.1%
Find a file
Stavros Vlachakis facce1bcb3
FCU Canonical chain corruption after beacon sync (3 fixes + startup healing) (#10876)
* FCU to canonical ancestor silently ignored, leaving descendants canonical

* fix comments

* fix comment

* change approach

* remove empty line

* HealCanonicalChain implementation & tests

* fix build

* ePBS FCU fix

* geth parity with 745b0a8c09/core/rawdb/accessors_chain.go (L47)

return null for orphaned heights post-merge in GetBlockHashOnMainOrBestDifficultyHash

* GetBlockHashOnMainOrBestDifficultyHash now returns null when
HasBlockOnMainChain=true but WasProcessed=false and blockNumber > Head.Number.

Beacon sync calls UpdateMainChain(wereProcessed=false), setting
HasBlockOnMainChain without advancing Head. If this races with a
cleanup FCU where previousHeadNumber == lastNumber, the upward scan
runs before the marker is set and cannot clear it — leaving a stale
marker that eth_getBlockByNumber would return as canonical.

The write-time scan cannot close this window; a read-time guard can.
WasProcessed=false precisely identifies beacon-sync markers: processed
canonical blocks always have WasProcessed=true, so startup/reload
paths are unaffected.

* revert change for WasProcessed=false

* test: add beacon sync + reorg stale marker reproduction test

Reproduction of the stale canonical markers bug from the Engine API
test generator: beacon sync marks H+1, H+2, H+3 canonical without
advancing Head, then FCU reorgs to a sibling at the same height as
Head. Verifies all orphaned levels are de-canonicalized.

* test: add failing gap test for beacon sync race condition

Adds UpdateMainChain_beacon_sync_gap_in_stale_markers_leaves_orphan_after_reorg
which reproduces the scenario where a concurrent MoveToMain creates a gap in
stale canonical markers during beacon sync. The break-on-first-gap upward scan
stops at the gap and leaves d3 orphaned as stale canonical.

This test FAILS on canonical-fix (expected) and PASSES on bounded-scan.

* fix: skip gaps in upward scan instead of breaking

Change Phase 2 upward scan and ClearStaleMarkersAbove to continue past
levels where HasBlockOnMainChain is false, breaking only when the level
does not exist. This handles gaps left by concurrent MoveToMain without
needing a BestKnownNumber bound.

* PR cleanup

* remove misleading comment

* minor copilot comments

* review comments

* Canonical fix refactor (#10972)

* small refactors in BlockTree

* de-duplicate tests

* Lukasz review

* fixes

* Revert "fixes"

This reverts commit b7a54d1cf4.

* Lukasz review - Refactoring

* fixes

* revert blocktree registration

---------

Co-authored-by: Kamil Chodoła <43241881+kamilchodola@users.noreply.github.com>
Co-authored-by: Kamil Chodoła <kamil.chodola@gmail.com>
Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com>
2026-03-27 18:53:25 +02:00
.agents fix: resource leak — ArrayPool, double-dispose, CTS, event handlers & Resource Leak audit skill (#10951) 2026-03-27 14:25:52 +01:00
.claude/skills fix: resource leak — ArrayPool, double-dispose, CTS, event handlers & Resource Leak audit skill (#10951) 2026-03-27 14:25:52 +01:00
.github test: add engine blockchain pyspec fixtures and fix BAL gas budget tracking (#10939) 2026-03-26 00:17:29 +00:00
scripts feat: restore edge/block collection and runtime consumption (#10869) 2026-03-19 15:01:54 +00:00
src FCU Canonical chain corruption after beacon sync (3 fixes + startup healing) (#10876) 2026-03-27 18:53:25 +02:00
tools feat: restore edge/block collection and runtime consumption (#10869) 2026-03-19 15:01:54 +00:00
.dockerignore Add Nethermind.Test.Runner Docker image (#8608) 2025-05-14 18:52:42 +02:00
.editorconfig Update file header templates (#10077) 2026-01-01 16:10:37 +01:00
.gitattributes Migrate to .NET 8 (#6150) 2023-12-06 01:11:35 +01:00
.gitignore test: add engine blockchain pyspec fixtures and fix BAL gas budget tracking (#10939) 2026-03-26 00:17:29 +00:00
.gitmodules Remove docs submodule (#6264) 2023-11-10 10:52:32 +01:00
AGENTS.md Modular agent rules and skill (#10653) 2026-03-04 23:35:53 +01:00
CLAUDE.md Add AGENTS.md (#10177) 2026-01-12 18:01:12 +01:00
CODE_OF_CONDUCT.md Revamp README and guidelines (#7996) 2025-01-03 19:02:58 +01:00
CONTRIBUTING.md docs: Clarify guideline about infra (#10767) 2026-03-10 18:03:13 +01:00
cspell.json test: add engine blockchain pyspec fixtures and fix BAL gas budget tracking (#10939) 2026-03-26 00:17:29 +00:00
Directory.Build.props Re-enable ReadyToRun AOT compilation (#10848) 2026-03-18 16:48:34 +00:00
Directory.Build.targets Re-enable ReadyToRun AOT compilation (#10848) 2026-03-18 16:48:34 +00:00
Directory.Packages.props feat(ssz): Add spec tests for ssz (#10807) 2026-03-20 12:53:20 +03:00
Dockerfile feat: restore edge/block collection and runtime consumption (#10869) 2026-03-19 15:01:54 +00:00
Dockerfile.chiseled Re-enable ReadyToRun AOT compilation (#10848) 2026-03-18 16:48:34 +00:00
Dockerfile.diag Re-enable ReadyToRun AOT compilation (#10848) 2026-03-18 16:48:34 +00:00
Dockerfile.pgo feat: restore edge/block collection and runtime consumption (#10869) 2026-03-19 15:01:54 +00:00
funding.json OP RPGF funding.json (#7391) 2024-09-04 00:31:08 +02:00
GEMINI.md Add AGENTS.md (#10177) 2026-01-12 18:01:12 +01:00
global.json Migrate to .NET 10 (#9391) 2025-11-20 09:41:51 +01:00
LICENSE-GPL Revise README and separate LICENSE files (#4359) 2022-08-04 17:26:42 +02:00
LICENSE-LGPL Revise README and separate LICENSE files (#4359) 2022-08-04 17:26:42 +02:00
nuget.config Re-enable ReadyToRun AOT compilation (#10848) 2026-03-18 16:48:34 +00:00
README.md docs: overhaul README structure and content (#10856) 2026-03-21 14:30:58 +01:00
SECURITY.md Revise README (#5728) 2023-05-23 22:38:49 +02:00

Nethermind Ethereum client

Tests Follow us on X Chat on Discord GitHub Discussions GitPOAPs

Nethermind client

Overview

Nethermind is a high-performance Ethereum execution client built on .NET. It provides fast sync, high-throughput JSON-RPC, and a plugin system for extending the client without forking. In production since 2017.

Runs on Linux, Windows, and macOS.

Supported networks

Ethereum · Gnosis · Optimism · Base · Taiko · World Chain · Linea · Energy Web

Documentation

Nethermind documentation is available at docs.nethermind.io.

Capabilities

Nethermind connects operators to the Ethereum network via JSON-RPC over HTTP, WebSocket, and IPC. Snap sync, enabled by default, reaches the chain tip up to 10x faster than traditional fast sync. Node health and performance are exposed through a built-in UI and Prometheus metrics.

  1. Performance: The EVM is optimized for low-overhead block processing: direct opcode dispatch, hardware-accelerated bitwise operations, and zero heap allocation on the execution stack. A parallel pre-execution system warms state reads before a block's main loop, cutting block processing time roughly in half.

  2. Modularity: Every component of the Nethermind is independently extendable without forking the codebase. The plugin system lets teams add consensus algorithms, transaction types, network protocols, and RPC namespaces through a .NET assembly that loads on startup. Nethermind uses this same system internally for L2 network support and health checks.

  3. Client diversity: The Ethereum protocol becomes more resilient when no single node implementation dominates. A bug in any one implementation cannot cause the network to finalize a bad block if multiple independent clients are running.

  4. L2 and rollup native: Each supported L2 network is implemented as a plugin, so the core stays untouched. For OP Stack operators, a rollup node is built directly into the client, fully replacing the separate op-node and cutting services from two down to one.

  5. ZK-readiness: ZK proving is being built directly into the production execution client. Execution witness capture, stateless block replay, and a minimal EVM binary are complete. See the ZK roadmap for current status.

Getting started

Standalone release builds are available on GitHub Releases. For hardware requirements, see System requirements.

Migrating from Geth? Nethermind supports the same JSON-RPC API. See the migration guide.

Package managers

  • Linux

    On Debian-based distros, Nethermind can be installed via Launchpad PPA:

    sudo add-apt-repository ppa:nethermindeth/nethermind
    # If command not found, run
    # sudo apt-get install software-properties-common
    
    sudo apt-get install nethermind
    
  • Windows

    On Windows, Nethermind can be installed via Windows Package Manager:

    winget install --id Nethermind.Nethermind
    
  • macOS

    On macOS, Nethermind can be installed via Homebrew:

    brew tap nethermindeth/nethermind
    brew install nethermind
    

Once installed, Nethermind can be launched as follows:

nethermind -c mainnet --data-dir path/to/data/dir

For full setup instructions, see Running a node. To spin up Nethermind alongside a consensus client in one command, see Sedge.

Docker containers

The official Docker images of Nethermind are available on Docker Hub and tagged as follows:

  • latest: the latest version of Nethermind (the default tag)
  • latest-chiseled: a rootless and chiseled image of the latest version of Nethermind
  • x.x.x: a specific version of Nethermind
  • x.x.x-chiseled: a rootless and chiseled image of the specific version of Nethermind

For more info, see Installing Nethermind.

Building from source

Docker image

This is the easiest and fastest way to build Nethermind if you don't want to clone the Nethermind repo, deal with .NET SDK installation, and other configurations. Running the following simple command builds the Docker image, which is ready to run right after:

docker build https://github.com/nethermindeth/nethermind.git -t nethermind

For more info, see Building Docker image.

Standalone binaries

Prerequisites

Install .NET SDK 10 or later.

Clone the repository

git clone --recursive https://github.com/nethermindeth/nethermind.git

Build and run

cd nethermind/src/Nethermind/Nethermind.Runner
dotnet run -c release -- -c mainnet

Test

cd nethermind/src/Nethermind

# Run Nethermind tests
dotnet test --solution Nethermind.slnx -c release

# Run Ethereum Foundation tests
dotnet test --solution EthereumTests.slnx -c release

For more info, see Building standalone binaries.

Plugin development

Nethermind's plugin system lets teams extend the client without touching the core. This is the same system used internally for L2 network support, health checks, Shutter, and more. Plugins are loaded on startup and can provide:

  • New consensus engines
  • Custom transaction types and RLP decoders
  • New P2P protocol handlers
  • Additional JSON-RPC namespaces

See the plugin development guide for a full lifecycle walkthrough, configuration auto-mapping, and working examples. Join the plugin development channel on Discord.

Getting help

Check out the docs first. If the answer is not there, see:

Contributing

Before you start working on a feature or fix, please read and follow our contributing guidelines to help avoid any wasted or duplicate effort.

Security

If you believe you have found a security vulnerability in our code, please report it to us as described in our security policy.

License

Nethermind is an open-source software licensed under the LGPL-3.0. By using this project, you agree to abide by the license and additional terms.