reth_rpc/
lib.rs

1//! Reth RPC implementation
2//!
3//! Provides the implementation of all RPC interfaces.
4//!
5//!
6//! ## Note on blocking behaviour
7//!
8//! All async RPC handlers must non-blocking, see also [What is blocking](https://ryhl.io/blog/async-what-is-blocking/).
9//!
10//! A lot of the RPC are using a mix of async and direct calls to the database, which are blocking
11//! and can reduce overall performance of all concurrent requests handled via the jsonrpsee server.
12//!
13//! To avoid this, all blocking or CPU intensive handlers must be spawned to a separate task. See
14//! the [`EthApi`] handler implementations for examples. The rpc-api traits make no use of the
15//! available jsonrpsee `blocking` attribute to give implementers more freedom because the
16//! `blocking` attribute and async handlers are mutually exclusive. However, as mentioned above, a
17//! lot of handlers make use of async functions, caching for example, but are also using blocking
18//! disk-io, hence these calls are spawned as futures to a blocking task manually.
19
20#![doc(
21    html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
22    html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
23    issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
24)]
25#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
26#![cfg_attr(not(test), warn(unused_crate_dependencies))]
27
28use http as _;
29use http_body as _;
30use hyper as _;
31use jsonwebtoken as _;
32use pin_project as _;
33use tower as _;
34
35mod admin;
36mod aliases;
37mod debug;
38mod engine;
39pub mod eth;
40mod miner;
41mod net;
42mod otterscan;
43mod reth;
44mod rpc;
45mod trace;
46mod txpool;
47mod validation;
48mod web3;
49
50pub use admin::AdminApi;
51pub use aliases::*;
52pub use debug::DebugApi;
53pub use engine::{EngineApi, EngineEthApi};
54pub use eth::{helpers::SyncListener, EthApi, EthApiBuilder, EthBundle, EthFilter, EthPubSub};
55pub use miner::MinerApi;
56pub use net::NetApi;
57pub use otterscan::OtterscanApi;
58pub use reth::RethApi;
59pub use reth_rpc_convert::RpcTypes;
60pub use rpc::RPCApi;
61pub use trace::TraceApi;
62pub use txpool::TxPoolApi;
63pub use validation::{ValidationApi, ValidationApiConfig};
64pub use web3::Web3Api;