Skip to main content

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))]
26#![cfg_attr(not(test), warn(unused_crate_dependencies))]
27
28mod admin;
29mod aliases;
30mod debug;
31mod engine;
32pub mod eth;
33mod miner;
34mod net;
35mod otterscan;
36mod reth;
37mod rpc;
38mod testing;
39mod trace;
40mod txpool;
41mod validation;
42mod web3;
43
44pub use admin::AdminApi;
45pub use aliases::*;
46pub use debug::DebugApi;
47pub use engine::{EngineApi, EngineEthApi};
48pub use eth::{helpers::SyncListener, EthApi, EthApiBuilder, EthBundle, EthFilter, EthPubSub};
49pub use miner::MinerApi;
50pub use net::NetApi;
51pub use otterscan::OtterscanApi;
52pub use reth::RethApi;
53pub use reth_rpc_convert::RpcTypes;
54pub use rpc::RPCApi;
55pub use testing::TestingApi;
56pub use trace::TraceApi;
57pub use txpool::TxPoolApi;
58pub use validation::{ValidationApi, ValidationApiConfig};
59pub use web3::Web3Api;