Skip to content

Commit

Permalink
Merge pull request #2991 from autonomys/clean-domain-tx-pool
Browse files Browse the repository at this point in the history
Remove unnecessary wrapper in domain transaction pool
  • Loading branch information
dastansam authored Aug 29, 2024
2 parents 346971a + 7608d8d commit ecaee78
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 174 deletions.
28 changes: 23 additions & 5 deletions domains/service/src/domain.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::providers::{BlockImportProvider, RpcProvider};
use crate::transaction_pool::FullChainApiWrapper;
use crate::{FullBackend, FullClient};
use cross_domain_message_gossip::ChainMsg;
use domain_client_block_preprocessor::inherents::CreateInherentDataProvider;
Expand All @@ -12,7 +11,7 @@ use futures::Stream;
use pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi;
use sc_client_api::{
AuxStore, BlockBackend, BlockImportNotification, BlockchainEvents, ExecutorProvider,
ProofProvider,
ProofProvider, UsageProvider,
};
use sc_consensus::SharedBlockImport;
use sc_domains::{ExtensionsFactory, RuntimeExecutor};
Expand All @@ -23,6 +22,7 @@ use sc_service::{
SpawnTasksParams, TFullBackend, TaskManager,
};
use sc_telemetry::{Telemetry, TelemetryWorker, TelemetryWorkerHandle};
use sc_transaction_pool::{BasicPool, FullChainApi, RevalidationType};
use sc_transaction_pool_api::OffchainTransactionPoolFactory;
use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver};
use serde::de::DeserializeOwned;
Expand Down Expand Up @@ -113,8 +113,9 @@ where
_phantom_data: PhantomData<AccountId>,
}

/// A transaction pool for a full node.
pub type FullPool<RuntimeApi> =
crate::transaction_pool::FullPool<Block, FullClient<Block, RuntimeApi>>;
BasicPool<FullChainApi<FullClient<Block, RuntimeApi>, Block>, Block>;

/// Constructs a partial domain node.
#[allow(clippy::type_complexity)]
Expand Down Expand Up @@ -196,7 +197,24 @@ where
telemetry
});

let transaction_pool = crate::transaction_pool::new_full(config, &task_manager, client.clone());
let prometheus = config.prometheus_registry();
let pool_api = Arc::new(FullChainApi::new(
client.clone(),
prometheus,
&task_manager.spawn_essential_handle(),
));

let transaction_pool = Arc::new(BasicPool::with_revalidation_type(
config.transaction_pool.clone(),
config.role.is_authority().into(),
pool_api,
prometheus,
RevalidationType::Full,
task_manager.spawn_essential_handle(),
client.usage_info().chain.best_number,
client.usage_info().chain.best_hash,
client.usage_info().chain.finalized_hash,
));

let block_import = SharedBlockImport::new(BlockImportProvider::block_import(
block_import_provider,
Expand Down Expand Up @@ -306,7 +324,7 @@ where
Block,
FullClient<Block, RuntimeApi>,
FullPool<RuntimeApi>,
FullChainApiWrapper<Block, FullClient<Block, RuntimeApi>>,
FullChainApi<FullClient<Block, RuntimeApi>, Block>,
TFullBackend<Block>,
AccountId,
CreateInherentDataProvider<CClient, CBlock>,
Expand Down
1 change: 0 additions & 1 deletion domains/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pub mod config;
mod domain;
pub mod providers;
pub mod rpc;
mod transaction_pool;

pub use self::domain::{new_full, DomainOperator, DomainParams, FullPool, NewFull};
use futures::channel::oneshot;
Expand Down
168 changes: 0 additions & 168 deletions domains/service/src/transaction_pool.rs

This file was deleted.

0 comments on commit ecaee78

Please sign in to comment.