Architecture
The subsystem map — eth service, downloader, txpool, miner, core, state — and how work flows between them.
Third-party documentation. This is independently authored analysis of the public Go Ethereum (Geth) codebase — not the official docs, and not reviewed or endorsed by the Go Ethereum (Geth) team.
Architecture
Geth is a large Go codebase, but its runtime shape is a pipeline of cooperating subsystems orchestrated by one service loop.
The subsystems
- eth — the top-level service wiring everything together: protocol manager, sync orchestration, and the Engine API server used by consensus clients.
- p2p / eth protocols — DevP2P discovery plus the eth wire protocol versions that carry blocks, headers, receipts, and transaction gossip between peers.
- downloader — the sync engine: fetches and verifies chains of headers/bodies/receipts from peers, in full or snap mode.
- txpool — holds known-but-not-yet-included transactions: validation against balance/nonce, price-sorted eviction, and reorg-aware re-adding.
- miner — post-Merge this assembles payloads on demand when the consensus layer requests block building (via the Engine API), rather than mining autonomously.
- core — the chain rules themselves: block validation, the state processor, fork-choice bookkeeping, genesis, and chain configuration.
- core/state + trie — the state model and its Merkle-Patricia representation (see State & Storage).
- rpc / node — the JSON-RPC servers and lifecycle management for all of the above.
The happy path of a transaction
A transaction arrives via RPC or p2p gossip, lands in the txpool after local checks, gets selected into a payload during block building, executes through core's state processor (EVM + gas accounting + receipts), and its effects commit to tries whose roots seal the block header. Peers then verify the same transition independently — consensus by redundant execution.
System Diagram
The diagram summarizes the primary runtime boundaries documented for this project.
