Description
Describe the feature
Currently, the transaction request is set using an associated type on RpcTypes
.
reth/crates/rpc/rpc-convert/src/rpc.rs
Line 15 in b011ad0
There is one limitation. Most of the generic EthApi
implementations require RpcTypes::TransactionRequest
to implement From<alloy_rpc_types_eth::TransactionRequest>
.
reth/crates/optimism/rpc/src/eth/call.rs
Line 42 in b011ad0
The reason for that is that the alloy_rpc_types_eth::TransactionRequest
is the only accepted JSON encoded RPC method argument.
reth/crates/rpc/rpc-eth-api/src/core.rs
Line 336 in b011ad0
To summarize:
- Transaction request is generic and can be set to a custom type using an associated type provided in a custom
RpcTypes
implementation. - Transaction request is always created using
From<alloy_rpc_types_eth::TransactionRequest>
conversion.
The goal of this task is to get rid of this limitation. The consequece of that will be that custom nodes can have their RPC accept custom transaction request bodies without a custom EthApi
implementation.
There is already a generic in place for the transaction request called TxReq
ready on EthApi
reth/crates/rpc/rpc-eth-api/src/core.rs
Line 52 in b011ad0
So the way to go about this task is to replace alloy_rpc_types_eth::TransactionRequest
with TxReq
generic type and make it work. This will most likely require replacing all the From<alloy_rpc_types_eth::TransactionRequest>
bounds with a trait bound that every transaction request should implement. Using alloy_network::TransactionBuilder
trait should make the most sense.
Additional context
Follow-up on #15117
Metadata
Metadata
Assignees
Type
Projects
Status