chore: broadcast raw tx for opethapi (#17342)

This commit is contained in:
Matthias Seitz
2025-07-11 00:04:24 +02:00
committed by GitHub
parent 5479e115f9
commit e263daebce
4 changed files with 4 additions and 11 deletions

1
Cargo.lock generated
View File

@@ -9420,7 +9420,6 @@ dependencies = [
"op-revm",
"parking_lot",
"reqwest",
"reth-chain-state",
"reth-chainspec",
"reth-evm",
"reth-metrics",

View File

@@ -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

View File

@@ -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()

View File

@@ -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