This repository contains several Rust crates that implement the different building blocks of an Ethereum node. The high-level structure of the repository is as follows:
Contributor documentation is in docs
and end-user documentation is in book
.
All binaries are stored in bin
.
These crates define primitive types or algorithms such as RLP.
primitives
: Commonly used types in Reth.common/rlp
: An implementation of RLP, forked from an earlier Apache-licensed version offastrlp
common/rlp-derive
: Forked from an earlier Apache licenced version of thefastrlp-derive
crate, before it changed licence to GPL.
These crates are related to the database.
storage/codecs
: Different storage codecs.storage/libmdbx-rs
: Rust bindings for libmdbx. A fork of an earlier Apache-licensed version of libmdbx-rs.storage/db
: Strongly typed Database abstractions (transactions, cursors, tables) over lower level database backends.- Implemented backends: mdbx
storage/provider
: Traits which provide a higher level api over the database to access the Ethereum state and historical data (transactions, blocks etc.)
These crates are related to networking (p2p and RPC), as well as networking protocols.
net/common
: Shared types used across multiple networking crates.- Contains: Peer banlist.
net/network
: The main P2P networking crate, handling message egress, message ingress, peer management, and session management.net/eth-wire
: Implements theeth
wire protocol and the RLPx networking stack.net/discv4
: An implementation of the discv4 protocolnet/ipc
: IPC server and client implementation forjsonrpsee
.net/ecies
: Implementation of the Elliptic Curve Integrated Encryption Scheme used in the RLPx handshake.
net/rpc-api
: RPC traits- Supported transports: HTTP, WS, IPC
- Supported namespaces:
eth_
,engine_
,debug_
net/rpc
: Implementation of all ETH JSON RPC traits defined inrpc-api
.net/rpc-types
: Types relevant for the RPC endpoints above, grouped by namespace
net/downloaders
: Block body and header downloading strategies.
These crates are Ethereum-specific (e.g. EVM, consensus, transaction pools).
executor
: Blazing-fast instrumented EVM usingrevm
. Used during consensus, syncing & during transaction simulation / gas estimation.consensus
: Implementations of consensus protocols.transaction-pool
: An in-memory pending transactions pool.
These crates are related to staged sync.
stages
: The staged sync pipeline, including implementations of each stage.
Small utility crates.
interfaces
: Traits containing common abstractions across the components used in the system. For ease of unit testing, each crate importing the interface is recommended to create mock/in-memory implementations of each trait.tracing
: A small utility crate to install a uniformtracing
subscribercrate-template
: Template crate to use when instantiating new crates undercrates/
.examples
: Example usage of the reth stack as a library.