mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-19 03:04:27 -05:00
chore: broadcast raw tx for opethapi (#17342)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -9420,7 +9420,6 @@ dependencies = [
|
||||
"op-revm",
|
||||
"parking_lot",
|
||||
"reqwest",
|
||||
"reth-chain-state",
|
||||
"reth-chainspec",
|
||||
"reth-evm",
|
||||
"reth-metrics",
|
||||
|
||||
@@ -16,7 +16,6 @@ workspace = true
|
||||
reth-evm.workspace = true
|
||||
reth-primitives-traits.workspace = true
|
||||
reth-storage-api.workspace = true
|
||||
reth-chain-state.workspace = true
|
||||
reth-rpc-eth-api = { workspace = true, features = ["op"] }
|
||||
reth-rpc-eth-types.workspace = true
|
||||
reth-rpc-server-types.workspace = true
|
||||
|
||||
@@ -13,7 +13,6 @@ use alloy_primitives::U256;
|
||||
use eyre::WrapErr;
|
||||
use op_alloy_network::Optimism;
|
||||
pub use receipt::{OpReceiptBuilder, OpReceiptFieldsBuilder};
|
||||
use reth_chain_state::CanonStateSubscriptions;
|
||||
use reth_chainspec::{ChainSpecProvider, EthChainSpec, EthereumHardforks};
|
||||
use reth_evm::ConfigureEvm;
|
||||
use reth_network_api::NetworkInfo;
|
||||
@@ -83,19 +82,11 @@ impl<N: OpNodeCore, NetworkT> OpEthApi<N, NetworkT> {
|
||||
tx_resp_builder: RpcConverter::with_mapper(OpTxInfoMapper::new(inner)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<N, NetworkT> OpEthApi<N, NetworkT>
|
||||
where
|
||||
N: OpNodeCore<
|
||||
Provider: BlockReaderIdExt + ChainSpecProvider + CanonStateSubscriptions + Clone + 'static,
|
||||
>,
|
||||
{
|
||||
/// Returns a reference to the [`EthApiNodeBackend`].
|
||||
pub fn eth_api(&self) -> &EthApiNodeBackend<N> {
|
||||
self.inner.eth_api()
|
||||
}
|
||||
|
||||
/// Returns the configured sequencer client, if any.
|
||||
pub fn sequencer_client(&self) -> Option<&SequencerClient> {
|
||||
self.inner.sequencer_client()
|
||||
|
||||
@@ -39,6 +39,10 @@ where
|
||||
/// Returns the hash of the transaction.
|
||||
async fn send_raw_transaction(&self, tx: Bytes) -> Result<B256, Self::Error> {
|
||||
let recovered = recover_raw_transaction(&tx)?;
|
||||
|
||||
// broadcast raw transaction to subscribers if there is any.
|
||||
self.eth_api().broadcast_raw_transaction(tx.clone());
|
||||
|
||||
let pool_transaction = <Self::Pool as TransactionPool>::Transaction::from_pooled(recovered);
|
||||
|
||||
// On optimism, transactions are forwarded directly to the sequencer to be included in
|
||||
|
||||
Reference in New Issue
Block a user