@@ -9,7 +9,7 @@ use reth_node_api::FullNodeComponents;
9
9
use reth_optimism_primitives:: { OpReceipt , OpTransactionSigned } ;
10
10
use reth_rpc_eth_api:: {
11
11
helpers:: { EthSigner , EthTransactions , LoadTransaction , SpawnBlocking } ,
12
- FromEthApiError , FullEthApiTypes , RpcNodeCore , RpcNodeCoreExt , TransactionCompat ,
12
+ EthApiTypes , FromEthApiError , FullEthApiTypes , RpcNodeCore , RpcNodeCoreExt , TransactionCompat ,
13
13
} ;
14
14
use reth_rpc_eth_types:: { utils:: recover_raw_transaction, EthApiError } ;
15
15
use reth_storage_api:: {
@@ -21,7 +21,7 @@ use crate::{eth::OpNodeCore, OpEthApi, OpEthApiError, SequencerClient};
21
21
22
22
impl < N > EthTransactions for OpEthApi < N >
23
23
where
24
- Self : LoadTransaction < Provider : BlockReaderIdExt > ,
24
+ Self : LoadTransaction < Provider : BlockReaderIdExt > + EthApiTypes < Error = OpEthApiError > ,
25
25
N : OpNodeCore < Provider : BlockReader < Transaction = ProviderTx < Self :: Provider > > > ,
26
26
{
27
27
fn signers ( & self ) -> & parking_lot:: RwLock < Vec < Box < dyn EthSigner < ProviderTx < Self :: Provider > > > > > {
39
39
// blocks that it builds.
40
40
if let Some ( client) = self . raw_tx_forwarder ( ) . as_ref ( ) {
41
41
tracing:: debug!( target: "rpc::eth" , hash = %pool_transaction. hash( ) , "forwarding raw transaction to sequencer" ) ;
42
- let _ = client. forward_raw_transaction ( & tx) . await . inspect_err ( |err| {
42
+ let hash = client. forward_raw_transaction ( & tx) . await . inspect_err ( |err| {
43
43
tracing:: debug!( target: "rpc::eth" , %err, hash=% * pool_transaction. hash( ) , "failed to forward raw transaction" ) ;
44
- } ) ;
44
+ } ) ?;
45
+
46
+ // Retain tx in local tx pool after forwarding, for local RPC usage.
47
+ let _ = self
48
+ . pool ( )
49
+ . add_transaction ( TransactionOrigin :: Local , pool_transaction)
50
+ . await . inspect_err ( |err| {
51
+ tracing:: warn!( target: "rpc::eth" , %err, %hash, "successfully sent tx to sequencer, but failed to persist in local tx pool" ) ;
52
+ } ) ;
53
+
54
+ return Ok ( hash)
45
55
}
46
56
47
57
// submit the transaction to the pool with a `Local` origin
0 commit comments