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 debug;
37mod engine;
38pub mod eth;
39mod miner;
40mod net;
41mod otterscan;
42mod reth;
43mod rpc;
44mod trace;
45mod txpool;
46mod validation;
47mod web3;
48
49pub use admin::AdminApi;
50pub use debug::DebugApi;
51pub use engine::{EngineApi, EngineEthApi};
52pub use eth::{EthApi, EthApiBuilder, EthBundle, EthFilter, EthPubSub};
53pub use miner::MinerApi;
54pub use net::NetApi;
55pub use otterscan::OtterscanApi;
56pub use reth::RethApi;
57pub use rpc::RPCApi;
58pub use trace::TraceApi;
59pub use txpool::TxPoolApi;
60pub use validation::{ValidationApi, ValidationApiConfig};
61pub use web3::Web3Api;