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
54// Used in feature flags only (`asm-keccak`, `keccak-cache-global`)
55use alloy_primitives as _;
56
57pub mod cli;
58
59/// Re-exported utils.
60pub mod utils {
61 pub use reth_db::open_db_read_only;
62
63 /// Re-exported from `reth_node_core`, also to prevent a breaking change. See the comment
64 /// on the `reth_node_core::args` re-export for more details.
65 pub use reth_node_core::utils::*;
66}
67
68/// Re-exported payload related types
69pub mod payload {
70 pub use reth_ethereum_payload_builder::EthereumExecutionPayloadValidator;
71 pub use reth_payload_builder::*;
72 pub use reth_payload_primitives::*;
73}
74
75/// Re-exported from `reth_node_api`.
76pub mod api {
77 pub use reth_node_api::*;
78}
79
80/// Re-exported from `reth_node_core`.
81pub mod core {
82 pub use reth_node_core::*;
83}
84
85/// Re-exported from `reth_node_metrics`.
86pub mod prometheus_exporter {
87 pub use reth_node_metrics::recorder::*;
88}
89
90/// Re-export of the `reth_node_core` types specifically in the `args` module.
91///
92/// This is re-exported because the types in `reth_node_core::args` originally existed in
93/// `reth::args` but were moved to the `reth_node_core` crate. This re-export avoids a breaking
94/// change.
95pub mod args {
96 pub use reth_node_core::args::*;
97}
98
99/// Re-exported from `reth_node_core`, also to prevent a breaking change. See the comment on
100/// the `reth_node_core::args` re-export for more details.
101pub mod version {
102 pub use reth_node_core::version::*;
103}
104
105/// Re-exported from `reth_node_builder`
106pub mod builder {
107 pub use reth_node_builder::*;
108}
109
110/// Re-exported from `reth_node_core`, also to prevent a breaking change. See the comment on
111/// the `reth_node_core::args` re-export for more details.
112pub mod dirs {
113 pub use reth_node_core::dirs::*;
114}
115
116/// Re-exported from `reth_chainspec`
117pub mod chainspec {
118 pub use reth_chainspec::*;
119 pub use reth_ethereum_cli::chainspec::*;
120}
121
122/// Re-exported from `reth_provider`.
123pub mod providers {
124 pub use reth_provider::*;
125}
126
127/// Re-exported primitives.
128#[allow(ambiguous_glob_reexports)]
129pub mod primitives {
130 pub use reth_ethereum_primitives::*;
131 pub use reth_primitives_traits::*;
132}
133
134/// Re-exported from `reth_ethereum_consensus`.
135pub mod beacon_consensus {
136 pub use reth_node_ethereum::consensus::*;
137}
138
139/// Re-exported from `reth_consensus`.
140pub mod consensus {
141 pub use reth_consensus::*;
142}
143
144/// Re-exported from `reth_consensus_common`.
145pub mod consensus_common {
146 pub use reth_consensus_common::*;
147}
148
149/// Re-exported from `reth_revm`.
150pub mod revm {
151 pub use reth_revm::*;
152}
153
154/// Re-exported from `reth_tasks`.
155pub mod tasks {
156 pub use reth_tasks::*;
157}
158
159/// Re-exported from `reth_network`.
160pub mod network {
161 pub use reth_network::*;
162 pub use reth_network_api::{
163 noop, test_utils::PeersHandleProvider, NetworkInfo, Peers, PeersInfo,
164 };
165}
166
167/// Re-exported from `reth_transaction_pool`.
168pub mod transaction_pool {
169 pub use reth_transaction_pool::*;
170}
171
172/// Re-export of `reth_rpc_*` crates.
173pub mod rpc {
174 /// Re-exported from `reth_rpc_builder`.
175 pub mod builder {
176 pub use reth_rpc_builder::*;
177 }
178
179 /// Re-exported from `alloy_rpc_types`.
180 pub mod types {
181 pub use alloy_rpc_types::*;
182 }
183
184 /// Re-exported from `reth_rpc_server_types`.
185 pub mod server_types {
186 pub use reth_rpc_server_types::*;
187 /// Re-exported from `reth_rpc_eth_types`.
188 pub mod eth {
189 pub use reth_rpc_eth_types::*;
190 }
191 }
192
193 /// Re-exported from `reth_rpc_api`.
194 pub mod api {
195 pub use reth_rpc_api::*;
196 }
197 /// Re-exported from `reth_rpc::eth`.
198 pub mod eth {
199 pub use reth_rpc::eth::*;
200 }
201
202 /// Re-exported from `reth_rpc_server_types::result`.
203 pub mod result {
204 pub use reth_rpc_server_types::result::*;
205 }
206
207 /// Re-exported from `reth_rpc_convert`.
208 pub mod compat {
209 pub use reth_rpc_convert::*;
210 }
211}
212
213// re-export for convenience
214#[doc(inline)]
215pub use reth_cli_runner::{CliContext, CliRunner};
216
217// for rendering diagrams
218use aquamarine as _;
219
220// used in main
221use clap as _;
222use reth_cli_util as _;
223use tracing as _;