Update layout doc (#10739)

This commit is contained in:
Pana
2024-09-06 19:46:44 +08:00
committed by GitHub
parent b13e982cd4
commit db7834dd51

View File

@ -19,8 +19,10 @@ Generally reth is composed of a few components, with supporting crates. The main
- [RPC](#rpc) - [RPC](#rpc)
- [Transports](#transports) - [Transports](#transports)
- [Common](#common-1) - [Common](#common-1)
- [Utilities Crates](#utilities-crates)
- [Payloads](#payloads) - [Payloads](#payloads)
- [Primitives](#primitives) - [Primitives](#primitives)
- [Optimism](#optimism)
- [Misc](#misc) - [Misc](#misc)
The supporting crates are split into two categories: [primitives](#primitives) and [miscellaneous](#misc). The supporting crates are split into two categories: [primitives](#primitives) and [miscellaneous](#misc).
@ -87,7 +89,10 @@ Different consensus mechanisms.
Crates related to transaction execution. Crates related to transaction execution.
- [`revm`](../../crates/revm): An implementation of an executor using `revm` - [`revm`](../../crates/revm): Revm utils and implementations specific to reth.
- [`evm`](../../crates/evm): Traits for configuring an EVM specifics.
- [`execution-types`](../../crates/evm/execution-types): Commonly used types for (EVM) block execution.
- [`execution-errors`](../../crates/evm/execution-errors): Commonly used error types used when doing block execution.
### Sync ### Sync
@ -110,13 +115,15 @@ The RPC component mainly lives in [`rpc/rpc`](../../crates/rpc/rpc), which imple
- `txpool_` - `txpool_`
- `web3_` - `web3_`
These RPC interface is defined in [`rpc/rpc-api`](../../crates/rpc/rpc-api).
The engine API ([`engine_`][engine-spec]) lives in [`rpc/rpc-engine-api`](../../crates/rpc/rpc-engine-api) (this is *not* an interface crate despite the confusing name). The engine API ([`engine_`][engine-spec]) lives in [`rpc/rpc-engine-api`](../../crates/rpc/rpc-engine-api) (this is *not* an interface crate despite the confusing name).
There is also a crate to easily configure an RPC server: [`rpc/rpc-builder`](../../crates/rpc/rpc-builder). There is also a crate to easily configure an RPC server: [`rpc/rpc-builder`](../../crates/rpc/rpc-builder).
#### Transports #### Transports
The RPC component is based on the `jsonrpsee` crate which provides JSONRPC over WebSockets and HTTP. The RPC component is based on the [`jsonrpsee`][jsonrpsee] crate which provides JSONRPC over WebSockets and HTTP.
The IPC transport lives in [`rpc/ipc`](../../crates/rpc/ipc). The IPC transport lives in [`rpc/ipc`](../../crates/rpc/ipc).
@ -126,6 +133,15 @@ The IPC transport lives in [`rpc/ipc`](../../crates/rpc/ipc).
- Supported transports: HTTP, WS, IPC - Supported transports: HTTP, WS, IPC
- Supported namespaces: `eth_`, `engine_`, `debug_` - Supported namespaces: `eth_`, `engine_`, `debug_`
- [`rpc/rpc-types`](../../crates/rpc/rpc-types): Types relevant for the RPC endpoints above, grouped by namespace - [`rpc/rpc-types`](../../crates/rpc/rpc-types): Types relevant for the RPC endpoints above, grouped by namespace
- [`rpc/rpc-eth-api`](../../crates/rpc/rpc-eth-api/): Reth RPC 'eth' namespace API (including interface and implementation), this crate is re-exported by `rpc/rpc-api`
- [`rpc/rpc-eth-types`](../../crates/rpc/rpc-eth-types/): Types `supporting implementation` of 'eth' namespace RPC server API
- [`rpc/rpc-server-types`](../../crates/rpc/rpc-server-types/): RPC server types and constants
#### Utilities Crates
- [`rpc/rpc-types-compat`](../../crates/rpc-types-compat): This crate various helper functions to convert between reth primitive types and rpc types.
- [`rpc/layer`](../../crates/rpc/rpc-layer/): Some RPC middleware layers (e.g. `AuthValidator`, `JwtAuthValidator`)
- [`rpc/rpc-testing-util`](../../crates/rpc/rpc-testing-util/): Reth RPC testing helpers
### Payloads ### Payloads
@ -140,8 +156,13 @@ Crates related to building and validating payloads (blocks).
These crates define primitive types or algorithms. These crates define primitive types or algorithms.
- [`primitives`](../../crates/primitives): Commonly used types in Reth. - [`primitives`](../../crates/primitives): Commonly used types in Reth.
- [`primitives-traits`](../../crates/primitives-traits/): Common abstracted types in reth.
- [`trie`](../../crates/trie): An implementation of a Merkle Patricia Trie used for various roots (e.g. the state root) in Ethereum. - [`trie`](../../crates/trie): An implementation of a Merkle Patricia Trie used for various roots (e.g. the state root) in Ethereum.
### Optimism
Crates related to the Optimism rollup are lives in [optimism](../../crates/optimism/).
### Misc ### Misc
Small utility crates. Small utility crates.