fix: call bundle recursion (#13425)

This commit is contained in:
Matthias Seitz
2024-12-17 14:33:14 +01:00
committed by GitHub
parent dc7818cdf1
commit 30d48cc97f
3 changed files with 11 additions and 11 deletions

View File

@@ -22,8 +22,8 @@ use reth_network_peers::NodeRecord;
use reth_primitives::Receipt;
use reth_rpc_api::{
clients::{AdminApiClient, EthApiClient},
DebugApiClient, EthFilterApiClient, NetApiClient, OtterscanClient, TraceApiClient,
Web3ApiClient,
DebugApiClient, EthCallBundleApiClient, EthFilterApiClient, NetApiClient, OtterscanClient,
TraceApiClient, Web3ApiClient,
};
use reth_rpc_server_types::RethRpcModule;
use serde::{de::DeserializeOwned, Deserialize, Serialize};
@@ -352,6 +352,7 @@ where
.err()
.unwrap()
));
EthCallBundleApiClient::call_bundle(client, Default::default()).await.unwrap_err();
}
async fn test_basic_debug_calls<C>(client: &C)

View File

@@ -16,7 +16,7 @@ use reth_rpc_eth_api::{
};
use reth_rpc_eth_types::{utils::recover_raw_transaction, EthApiError, RpcInvalidTransactionError};
use reth_tasks::pool::BlockingTaskGuard;
use reth_transaction_pool::{PoolConsensusTx, PoolPooledTx, PoolTransaction, TransactionPool};
use reth_transaction_pool::{PoolPooledTx, PoolTransaction, PoolTx, TransactionPool};
use revm::{
db::{CacheDB, DatabaseCommit, DatabaseRef},
primitives::{ResultAndState, TxEnv},
@@ -45,12 +45,7 @@ impl<Eth> EthBundle<Eth> {
impl<Eth> EthBundle<Eth>
where
Eth: EthTransactions<
Pool: TransactionPool<
Transaction: PoolTransaction<
Consensus: From<PooledTransaction>,
Pooled = PooledTransaction,
>,
>,
Pool: TransactionPool<Transaction: PoolTransaction<Pooled = PooledTransaction>>,
> + LoadPendingBlock
+ Call
+ 'static,
@@ -199,7 +194,9 @@ where
})?;
}
let tx: PoolConsensusTx<Eth::Pool> = tx.into();
let tx: PoolPooledTx<Eth::Pool> = tx;
let tx = PoolTx::<Eth::Pool>::pooled_into_consensus(tx);
// let tx = PoolConsensusTx::<Eth::Pool>::Trafrom(tx);
hasher.update(*tx.tx_hash());
let gas_price = tx.effective_gas_price(basefee);
@@ -288,7 +285,7 @@ where
+ 'static,
{
async fn call_bundle(&self, request: EthCallBundle) -> RpcResult<EthCallBundleResponse> {
self.call_bundle(request).await.map_err(Into::into)
Self::call_bundle(self, request).await.map_err(Into::into)
}
}

View File

@@ -40,6 +40,8 @@ use tokio::sync::mpsc::Receiver;
/// The `PeerId` type.
pub type PeerId = alloy_primitives::B512;
/// Helper type alias to access [`PoolTransaction`] for a given [`TransactionPool`].
pub type PoolTx<P> = <P as TransactionPool>::Transaction;
/// Helper type alias to access [`PoolTransaction::Consensus`] for a given [`TransactionPool`].
pub type PoolConsensusTx<P> = <<P as TransactionPool>::Transaction as PoolTransaction>::Consensus;