Description
Describe the feature
Description
Currently, while reth
has excellent RPC middleware support internally (RpcAddOns::with_rpc_middleware
), there's no clean way for external projects (like L2 implementations or custom nodes) to inject middleware during the node building process.
Operators need to:
- Monitor slow RPC requests (especially
eth_getLogs
that can crash nodes) - Log problematic requests with full payload details for debugging
- Implement rate limiting for specific RPC methods
- Add custom metrics and monitoring
For example, we're experiencing crashes from massive eth_getLogs
requests. We need to log requests taking >200ms with full payload details to identify problematic queries, but can't easily inject this middleware.
Additional context
Proposed Solution
A solution I have for now is adding a with_rpc_middleware()
method to the node builder that allows configuring middleware before RPC server launch.
This way is no changes to core RPC infrastructure, can be flexible support any tower-compatible middleware.
Metadata
Metadata
Assignees
Type
Projects
Status