diff --git a/crates/codecs/README.md b/crates/codecs/README.md index 567894bbf..7a5fc6028 100644 --- a/crates/codecs/README.md +++ b/crates/codecs/README.md @@ -1,16 +1,13 @@ -# codecs +## Codecs This crate allows to easily configure different codecs for different purposes (benchmarks, user configuration) with minimal changes. Having them to be configurable through annotations allows us to contain their implementations/leakage to isolated portions of the project. +Examples: -Example: +- [`Header` struct](../primitives/src/header.rs) +- [DB usage](../db/src/kv/codecs/scale.rs) -[Header struct](../primitives/src/header.rs) - -[DB usage](../db/src/kv/codecs/scale.rs) - - -## Features +### Features Feature defines what is the main codec used by `#[main_codec]`. However it is still possible to define them directly: `#[use_scale]`, `#[use_postcat]`, `#[no_codec]`. diff --git a/crates/common/rlp-derive/README.md b/crates/common/rlp-derive/README.md index d69210bfc..d7badd4da 100644 --- a/crates/common/rlp-derive/README.md +++ b/crates/common/rlp-derive/README.md @@ -1,3 +1,3 @@ -# RLP derive crate +## RLP derive crate -forked from erlier Apache licenced fastrlp-derive crate, before it changed licence to GPL. \ No newline at end of file +Forked from an earlier Apache licenced version of the `fastrlp-derive` crate, before it changed licence to GPL. \ No newline at end of file diff --git a/crates/common/rlp/README.md b/crates/common/rlp/README.md index 350921bea..18b056723 100644 --- a/crates/common/rlp/README.md +++ b/crates/common/rlp/README.md @@ -1,3 +1,3 @@ -# RLP encoder decoder crate +## RLP encoder/decoder -forked from erlier Apache licenced fastrlp crate, before it changed licence to GPL \ No newline at end of file +Forked from an earlier Apache licenced version of the `fastrlp` crate, before it changed licence to GPL. \ No newline at end of file diff --git a/docs/repo/layout.md b/docs/repo/layout.md index d5334a879..017a31c82 100644 --- a/docs/repo/layout.md +++ b/docs/repo/layout.md @@ -2,19 +2,76 @@ 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: -- `crates/` - - [`db`](../../crates/db): Strongly typed database bindings to [LibMDBX](https://github.com/vorot93/libmdbx-rs/) containing read/write access to Ethereum state and historical data (transactions, blocks etc.) - - [`executor`](../../crates/executor): Blazing-fast instrumented EVM using [`revm`](https://github.com/bluealloy/revm/). Used during consensus, syncing & during transaction simulation / gas estimation. - - [`interfaces`](../../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. - - [`net/p2p`](../../crates/net/p2p): Implements the Ethereum P2P protocol. - - [`net/rpc-api`](../../crates/net/rpc-api): Traits - - Supported transports: HTTP, WS, IPC - - Supported namespaces: `eth_`, `engine_`, `debug_` - - [`net/rpc`](../../crates/net/rpc): Implementation of all ETH JSON RPC traits defined in `rpc-api`. - - [`net/rpc-types`](../../crates/net/rpc-types): Types relevant for the RPC endpoints above, grouped by namespace - - [`primitives`](../../crates/stages): Commonly used types in Reth. - - [`stages`](../../crates/stages): The staged sync pipeline, including implementations of each stage. - - [`transaction-pool`](../../crates/transaction-pool): An in-memory pending transactions pool. +### Binaries + +All binaries are stored in [`bin`](../../bin). + +### Primitives + +These crates define primitive types or algorithms such as RLP. + +- [`primitives`](../../crates/primitives): Commonly used types in Reth. +- [`common/rlp`](../../crates/common/rlp): An implementation of RLP, forked from an earlier Apache-licensed version of [`fastrlp`][fastrlp] +- [`common/rlp-derive`](../../crates/common/rlp-derive): Forked from an earlier Apache licenced version of the [`fastrlp-derive`][fastrlp-derive] crate, before it changed licence to GPL. + +### Database + +These crates are related to the database. + +- [`codecs`](../../crates/codecs): Different storage codecs. +- [`libmdbx-rs`](../../crates/libmdbx-rs): Rust bindings for [libmdbx](https://libmdbx.dqdkfa.ru). A fork of an earlier Apache-licensed version of [libmdbx-rs][libmdbx-rs]. +- [`db`](../../crates/db): Strongly typed database bindings to LibMDBX containing read/write access to Ethereum state and historical data (transactions, blocks etc.) + +### Networking + +These crates are related to networking (p2p and RPC), as well as networking protocols. + +#### P2P + +- [`net/network`](../../crates/net/network): The main P2P networking crate. +- [`net/p2p`](../../crates/net/p2p): Implements the Ethereum P2P protocol. +- [`net/discv4`](../../crates/net/discv4): An implementation of the [discv4][discv4] protocol +- [`net/ipc`](../../crates/net/ipc): IPC server and client implementation for [`jsonrpsee`][jsonrpsee]. + +#### RPC + +- [`net/rpc-api`](../../crates/net/rpc-api): RPC traits + - Supported transports: HTTP, WS, IPC + - Supported namespaces: `eth_`, `engine_`, `debug_` +- [`net/rpc`](../../crates/net/rpc): Implementation of all ETH JSON RPC traits defined in `rpc-api`. +- [`net/rpc-types`](../../crates/net/rpc-types): Types relevant for the RPC endpoints above, grouped by namespace + +#### Downloaders + +- [`net/bodies-downloaders`](../../crates/net/bodies-downloaders): Block body downloading strategies. +- [`net/headers-downloaders`](../../crates/net/headers-downloaders): Header downloading strategies. + +### Ethereum + +These crates are Ethereum-specific (e.g. EVM, consensus, transaction pools). + +- [`executor`](../../crates/executor): Blazing-fast instrumented EVM using [`revm`](https://github.com/bluealloy/revm/). Used during consensus, syncing & during transaction simulation / gas estimation. +- [`consensus`](../../crates/consensus): Implementations of consensus protocols. +- [`transaction-pool`](../../crates/transaction-pool): An in-memory pending transactions pool. + +### Staged sync + +These crates are related to staged sync. + +- [`stages`](../../crates/stages): The staged sync pipeline, including implementations of each stage. + +### Misc + +Small utility crates. + +- [`interfaces`](../../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`](../../crates/tracing): A small utility crate to install a uniform [`tracing`][tracing] subscriber - [`crate-template`](../../crate-template): Template crate to use when instantiating new crates under `crates/`. -- [`bin`](../../bin): Where all binaries are stored. - [`examples`](../../examples): Example usage of the reth stack as a library. + +[fastrlp]: https://crates.io/crates/fastrlp +[fastrlp-derive]: https://crates.io/crates/fastrlp-derive +[libmdbx-rs]: https://crates.io/crates/libmdbx +[discv4]: https://github.com/ethereum/devp2p/blob/master/discv4.md +[jsonrpsee]: https://github.com/paritytech/jsonrpsee/ +[tracing]: https://crates.io/crates/tracing \ No newline at end of file