reth/lib.rs
1//! Rust Ethereum (reth) binary executable.
2//!
3//! ## Feature Flags
4//!
5//! ### Default Features
6//!
7//! - `jemalloc`: Uses [jemallocator](https://github.com/tikv/jemallocator) as the global allocator.
8//! This is **not recommended on Windows**. See [here](https://rust-lang.github.io/rfcs/1974-global-allocators.html#jemalloc)
9//! for more info.
10//! - `otlp`: Enables [OpenTelemetry](https://opentelemetry.io/) metrics export to a configured OTLP
11//! collector endpoint.
12//! - `js-tracer`: Enables the `JavaScript` tracer for the `debug_trace` endpoints, allowing custom
13//! `JavaScript`-based transaction tracing.
14//! - `keccak-cache-global`: Enables global caching for Keccak256 hashes to improve performance.
15//! - `asm-keccak`: Replaces the default, pure-Rust implementation of Keccak256 with one implemented
16//! in assembly; see [the `keccak-asm` crate](https://github.com/DaniPopes/keccak-asm) for more
17//! details and supported targets.
18//!
19//! ### Allocator Features
20//!
21//! - `jemalloc-prof`: Enables [jemallocator's](https://github.com/tikv/jemallocator) heap profiling
22//! and leak detection functionality. See [jemalloc's opt.prof](https://jemalloc.net/jemalloc.3.html#opt.prof)
23//! documentation for usage details. This is **not recommended on Windows**.
24//! - `jemalloc-symbols`: Enables jemalloc symbols for profiling. Includes `jemalloc-prof`.
25//! - `jemalloc-unprefixed`: Uses unprefixed jemalloc symbols.
26//! - `tracy-allocator`: Enables [Tracy](https://github.com/wolfpld/tracy) profiler allocator
27//! integration for memory profiling.
28//! - `snmalloc`: Uses [snmalloc](https://github.com/microsoft/snmalloc) as the global allocator.
29//! Use `--no-default-features` when enabling this, as jemalloc takes precedence.
30//! - `snmalloc-native`: Uses snmalloc with native CPU optimizations. Use `--no-default-features`
31//! when enabling this.
32//!
33//! ### Log Level Features
34//!
35//! - `min-error-logs`: Disables all logs below `error` level.
36//! - `min-warn-logs`: Disables all logs below `warn` level.
37//! - `min-info-logs`: Disables all logs below `info` level. This can speed up the node, since fewer
38//! calls to the logging component are made.
39//! - `min-debug-logs`: Disables all logs below `debug` level.
40//! - `min-trace-logs`: Disables all logs below `trace` level.
41//!
42//! ### Development Features
43//!
44//! - `dev`: Enables development mode features, including test vector generation commands.
45
46#![doc(
47 html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
48 html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
49 issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
50)]
51#![cfg_attr(not(test), warn(unused_crate_dependencies))]
52#![cfg_attr(docsrs, feature(doc_cfg))]
53
54pub mod cli;
55
56/// Re-exported utils.
57pub mod utils {
58 pub use reth_db::open_db_read_only;
59
60 /// Re-exported from `reth_node_core`, also to prevent a breaking change. See the comment
61 /// on the `reth_node_core::args` re-export for more details.
62 pub use reth_node_core::utils::*;
63}
64
65/// Re-exported payload related types
66pub mod payload {
67 pub use reth_ethereum_payload_builder::EthereumExecutionPayloadValidator;
68 pub use reth_payload_builder::*;
69 pub use reth_payload_primitives::*;
70}
71
72/// Re-exported from `reth_node_api`.
73pub mod api {
74 pub use reth_node_api::*;
75}
76
77/// Re-exported from `reth_node_core`.
78pub mod core {
79 pub use reth_node_core::*;
80}
81
82/// Re-exported from `reth_node_metrics`.
83pub mod prometheus_exporter {
84 pub use reth_node_metrics::recorder::*;
85}
86
87/// Re-export of the `reth_node_core` types specifically in the `args` module.
88///
89/// This is re-exported because the types in `reth_node_core::args` originally existed in
90/// `reth::args` but were moved to the `reth_node_core` crate. This re-export avoids a breaking
91/// change.
92pub mod args {
93 pub use reth_node_core::args::*;
94}
95
96/// Re-exported from `reth_node_core`, also to prevent a breaking change. See the comment on
97/// the `reth_node_core::args` re-export for more details.
98pub mod version {
99 pub use reth_node_core::version::*;
100}
101
102/// Re-exported from `reth_node_builder`
103pub mod builder {
104 pub use reth_node_builder::*;
105}
106
107/// Re-exported from `reth_node_core`, also to prevent a breaking change. See the comment on
108/// the `reth_node_core::args` re-export for more details.
109pub mod dirs {
110 pub use reth_node_core::dirs::*;
111}
112
113/// Re-exported from `reth_chainspec`
114pub mod chainspec {
115 pub use reth_chainspec::*;
116 pub use reth_ethereum_cli::chainspec::*;
117}
118
119/// Re-exported from `reth_provider`.
120pub mod providers {
121 pub use reth_provider::*;
122}
123
124/// Re-exported from `reth_primitives`.
125pub mod primitives {
126 pub use reth_primitives::*;
127}
128
129/// Re-exported from `reth_ethereum_consensus`.
130pub mod beacon_consensus {
131 pub use reth_node_ethereum::consensus::*;
132}
133
134/// Re-exported from `reth_consensus`.
135pub mod consensus {
136 pub use reth_consensus::*;
137}
138
139/// Re-exported from `reth_consensus_common`.
140pub mod consensus_common {
141 pub use reth_consensus_common::*;
142}
143
144/// Re-exported from `reth_revm`.
145pub mod revm {
146 pub use reth_revm::*;
147}
148
149/// Re-exported from `reth_tasks`.
150pub mod tasks {
151 pub use reth_tasks::*;
152}
153
154/// Re-exported from `reth_network`.
155pub mod network {
156 pub use reth_network::*;
157 pub use reth_network_api::{
158 noop, test_utils::PeersHandleProvider, NetworkInfo, Peers, PeersInfo,
159 };
160}
161
162/// Re-exported from `reth_transaction_pool`.
163pub mod transaction_pool {
164 pub use reth_transaction_pool::*;
165}
166
167/// Re-export of `reth_rpc_*` crates.
168pub mod rpc {
169 /// Re-exported from `reth_rpc_builder`.
170 pub mod builder {
171 pub use reth_rpc_builder::*;
172 }
173
174 /// Re-exported from `alloy_rpc_types`.
175 pub mod types {
176 pub use alloy_rpc_types::*;
177 }
178
179 /// Re-exported from `reth_rpc_server_types`.
180 pub mod server_types {
181 pub use reth_rpc_server_types::*;
182 /// Re-exported from `reth_rpc_eth_types`.
183 pub mod eth {
184 pub use reth_rpc_eth_types::*;
185 }
186 }
187
188 /// Re-exported from `reth_rpc_api`.
189 pub mod api {
190 pub use reth_rpc_api::*;
191 }
192 /// Re-exported from `reth_rpc::eth`.
193 pub mod eth {
194 pub use reth_rpc::eth::*;
195 }
196
197 /// Re-exported from `reth_rpc_server_types::result`.
198 pub mod result {
199 pub use reth_rpc_server_types::result::*;
200 }
201
202 /// Re-exported from `reth_rpc_convert`.
203 pub mod compat {
204 pub use reth_rpc_convert::*;
205 }
206}
207
208/// Ress subprotocol installation.
209pub mod ress;
210
211// re-export for convenience
212#[doc(inline)]
213pub use reth_cli_runner::{tokio_runtime, CliContext, CliRunner};
214
215// for rendering diagrams
216use aquamarine as _;
217
218// used in main
219use clap as _;
220use reth_cli_util as _;