Crate reth_rpc

source ·
Expand description

Reth RPC implementation

Provides the implementation of all RPC interfaces.

Note on blocking behaviour

All async RPC handlers must non-blocking, see also What is blocking.

A lot of the RPC are using a mix of async and direct calls to the database, which are blocking and can reduce overall performance of all concurrent requests handled via the jsonrpsee server.

To avoid this, all blocking or CPU intensive handlers must be spawned to a separate task. See the EthApi handler implementations for examples. The rpc-api traits make no use of the available jsonrpsee blocking attribute to give implementors more freedom because the blocking attribute and async handlers are mutually exclusive. However, as mentioned above, a lot of handlers make use of async functions, caching for example, but are also using blocking disk-io, hence these calls are spawned as futures to a blocking task manually.



  • Additional helpers for executing tracing calls
  • eth namespace handler implementation.
  • Additional helpers for converting errors.



  • admin API implementation.
  • This is an Http middleware layer that acts as an interceptor for Authorization headers. Incoming requests are dispatched to an inner AuthValidator. Invalid requests are blocked and the validator’s error response is returned. Valid requests are instead dispatched to the next layer along the chain.
  • Claims in JWT are used to represent a set of information about an entity. Claims are essentially key-value pairs that are encoded as JSON objects and included in the payload of a JWT. They are used to transmit information such as the identity of the entity, the time the JWT was issued, and the expiration time of the JWT, among others.
  • debug API implementation.
  • The Engine API implementation that grants the Consensus layer access to data and functions in the Execution layer that are crucial for the consensus process.
  • A wrapper type for the EthApi and EthFilter implementations that only expose the required subset for the eth_ namespace used in auth server alongside the engine_ namespace.
  • Implements JWT validation logics and integrates to an Http AuthLayer by implementing the AuthValidator trait.
  • Value-object holding a reference to a hex-encoded 256-bit secret key. A JWT secret key is used to secure JWT-based authentication. The secret key is a shared secret between the server and the client and is used to calculate a digital signature for the JWT, which is included in the JWT along with its payload.
  • Net API implementation.
  • Otterscan Api
  • rpc API implementation.
  • reth API implementation.
  • trace API implementation.
  • txpool API implementation.
  • web3 API implementation.



  • General purpose trait to validate Http Authorization headers. It’s supposed to be integrated as a validator trait into an AuthLayer.