-
Couldn't load subscription status.
- Fork 2k
Closed
Labels
A-op-rethRelated to Optimism and op-rethRelated to Optimism and op-rethC-enhancementNew feature or requestNew feature or request
Description
Describe the feature
It looks like I still got the type constraint when injecting middleware, for e.g.:
110 | addons.with_rpc_middleware(
| ------------------- arguments to this method are incorrect
111 | SlowRequestLogMiddleware::new(self.slow_request_log_config.clone())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Identity`, found `SlowRequestLogMiddleware`
|
help: the return type of this call is `SlowRequestLogMiddleware` due to the type of the argument passedreth/crates/optimism/node/src/node.rs
Lines 285 to 291 in 36d568a
| impl<N, NetworkT> Default | |
| for OpAddOns< | |
| N, | |
| OpEthApiBuilder<NetworkT>, | |
| OpEngineValidatorBuilder, | |
| OpEngineApiBuilder<OpEngineValidatorBuilder>, | |
| > |
I think we need to add Identity here and update the builder() method to be generic over RpcMiddleware
reth/crates/optimism/node/src/node.rs
Lines 301 to 308 in 36d568a
| impl<N, NetworkT> | |
| OpAddOns< | |
| N, | |
| OpEthApiBuilder<NetworkT>, | |
| OpEngineValidatorBuilder, | |
| OpEngineApiBuilder<OpEngineValidatorBuilder>, | |
| > | |
| where |
Also, update the OpAddOnsBuilder to support custom middleware.
I have a working solution already, I'd like to take this if you're open to it! @mattsse 🙏
Additional context
relating to #17076
Metadata
Metadata
Assignees
Labels
A-op-rethRelated to Optimism and op-rethRelated to Optimism and op-rethC-enhancementNew feature or requestNew feature or request
Type
Projects
Status
Done