8000 Add RPC middleware configuration support to node builder · Issue #17076 · paradigmxyz/reth · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Add RPC middleware configuration support to node builder #17076
Open
@thaodt

Description

@thaodt

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

No one assigned

    Labels

    A-sdkRelated to reth's use as a libraryC-enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0