mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 15:51:12 +00:00
Remove NetworkSpecialization (#4665)
* remove networkspecialization * Fix most of the fallout * get all tests compiling Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
committed by
GitHub
parent
e8000e7429
commit
0090fe979b
@@ -35,7 +35,7 @@ use futures::{
|
||||
use sc_keystore::{Store as Keystore};
|
||||
use log::{info, warn, error};
|
||||
use sc_network::config::{FinalityProofProvider, OnDemand, BoxFinalityProofRequestBuilder};
|
||||
use sc_network::{NetworkService, NetworkStateInfo, specialization::NetworkSpecialization};
|
||||
use sc_network::{NetworkService, NetworkStateInfo};
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
use sp_runtime::generic::BlockId;
|
||||
use sp_runtime::traits::{
|
||||
@@ -102,7 +102,6 @@ pub type BackgroundTask = Pin<Box<dyn Future<Output=()> + Send>>;
|
||||
///
|
||||
/// - [`with_select_chain`](ServiceBuilder::with_select_chain)
|
||||
/// - [`with_import_queue`](ServiceBuilder::with_import_queue)
|
||||
/// - [`with_network_protocol`](ServiceBuilder::with_network_protocol)
|
||||
/// - [`with_finality_proof_provider`](ServiceBuilder::with_finality_proof_provider)
|
||||
/// - [`with_transaction_pool`](ServiceBuilder::with_transaction_pool)
|
||||
///
|
||||
@@ -112,7 +111,7 @@ pub type BackgroundTask = Pin<Box<dyn Future<Output=()> + Send>>;
|
||||
/// generics is done when you call `build`.
|
||||
///
|
||||
pub struct ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp,
|
||||
TNetP, TExPool, TRpc, Backend>
|
||||
TExPool, TRpc, Backend>
|
||||
{
|
||||
config: Configuration<TGen, TCSExt>,
|
||||
pub (crate) client: Arc<TCl>,
|
||||
@@ -123,7 +122,6 @@ pub struct ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TF
|
||||
pub (crate) import_queue: TImpQu,
|
||||
finality_proof_request_builder: Option<TFprb>,
|
||||
finality_proof_provider: Option<TFpp>,
|
||||
network_protocol: TNetP,
|
||||
transaction_pool: Arc<TExPool>,
|
||||
rpc_extensions: TRpc,
|
||||
remote_backend: Option<Arc<dyn RemoteBlockchain<TBl>>>,
|
||||
@@ -266,7 +264,7 @@ fn new_full_parts<TBl, TRtApi, TExecDisp, TGen, TCSExt>(
|
||||
Ok((client, backend, keystore))
|
||||
}
|
||||
|
||||
impl<TGen, TCSExt> ServiceBuilder<(), (), TGen, TCSExt, (), (), (), (), (), (), (), (), (), ()>
|
||||
impl<TGen, TCSExt> ServiceBuilder<(), (), TGen, TCSExt, (), (), (), (), (), (), (), (), ()>
|
||||
where TGen: RuntimeGenesis, TCSExt: Extension {
|
||||
/// Start the service builder with a configuration.
|
||||
pub fn new_full<TBl: BlockT, TRtApi, TExecDisp: NativeExecutionDispatch + 'static>(
|
||||
@@ -284,7 +282,6 @@ where TGen: RuntimeGenesis, TCSExt: Extension {
|
||||
Arc<dyn FinalityProofProvider<TBl>>,
|
||||
(),
|
||||
(),
|
||||
(),
|
||||
TFullBackend<TBl>,
|
||||
>, Error> {
|
||||
let (client, backend, keystore) = new_full_parts(&config)?;
|
||||
@@ -301,7 +298,6 @@ where TGen: RuntimeGenesis, TCSExt: Extension {
|
||||
import_queue: (),
|
||||
finality_proof_request_builder: None,
|
||||
finality_proof_provider: None,
|
||||
network_protocol: (),
|
||||
transaction_pool: Arc::new(()),
|
||||
rpc_extensions: Default::default(),
|
||||
remote_backend: None,
|
||||
@@ -327,7 +323,6 @@ where TGen: RuntimeGenesis, TCSExt: Extension {
|
||||
Arc<dyn FinalityProofProvider<TBl>>,
|
||||
(),
|
||||
(),
|
||||
(),
|
||||
TLightBackend<TBl>,
|
||||
>, Error> {
|
||||
let keystore = match &config.keystore {
|
||||
@@ -388,7 +383,6 @@ where TGen: RuntimeGenesis, TCSExt: Extension {
|
||||
import_queue: (),
|
||||
finality_proof_request_builder: None,
|
||||
finality_proof_provider: None,
|
||||
network_protocol: (),
|
||||
transaction_pool: Arc::new(()),
|
||||
rpc_extensions: Default::default(),
|
||||
remote_backend: Some(remote_blockchain),
|
||||
@@ -399,9 +393,9 @@ where TGen: RuntimeGenesis, TCSExt: Extension {
|
||||
}
|
||||
}
|
||||
|
||||
impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TExPool, TRpc, Backend>
|
||||
impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend>
|
||||
ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp,
|
||||
TNetP, TExPool, TRpc, Backend> {
|
||||
TExPool, TRpc, Backend> {
|
||||
|
||||
/// Returns a reference to the client that was stored in this builder.
|
||||
pub fn client(&self) -> &Arc<TCl> {
|
||||
@@ -449,7 +443,7 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
&Configuration<TGen, TCSExt>, &Arc<Backend>
|
||||
) -> Result<Option<USc>, Error>
|
||||
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, USc, TImpQu, TFprb, TFpp,
|
||||
TNetP, TExPool, TRpc, Backend>, Error> {
|
||||
TExPool, TRpc, Backend>, Error> {
|
||||
let select_chain = select_chain_builder(&self.config, &self.backend)?;
|
||||
|
||||
Ok(ServiceBuilder {
|
||||
@@ -462,7 +456,6 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
import_queue: self.import_queue,
|
||||
finality_proof_request_builder: self.finality_proof_request_builder,
|
||||
finality_proof_provider: self.finality_proof_provider,
|
||||
network_protocol: self.network_protocol,
|
||||
transaction_pool: self.transaction_pool,
|
||||
rpc_extensions: self.rpc_extensions,
|
||||
remote_backend: self.remote_backend,
|
||||
@@ -477,7 +470,7 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
self,
|
||||
builder: impl FnOnce(&Configuration<TGen, TCSExt>, &Arc<Backend>) -> Result<USc, Error>
|
||||
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, USc, TImpQu, TFprb, TFpp,
|
||||
TNetP, TExPool, TRpc, Backend>, Error> {
|
||||
TExPool, TRpc, Backend>, Error> {
|
||||
self.with_opt_select_chain(|cfg, b| builder(cfg, b).map(Option::Some))
|
||||
}
|
||||
|
||||
@@ -487,7 +480,7 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
builder: impl FnOnce(&Configuration<TGen, TCSExt>, Arc<TCl>, Option<TSc>, Arc<TExPool>)
|
||||
-> Result<UImpQu, Error>
|
||||
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, UImpQu, TFprb, TFpp,
|
||||
TNetP, TExPool, TRpc, Backend>, Error>
|
||||
TExPool, TRpc, Backend>, Error>
|
||||
where TSc: Clone {
|
||||
let import_queue = builder(
|
||||
&self.config,
|
||||
@@ -506,35 +499,6 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
import_queue,
|
||||
finality_proof_request_builder: self.finality_proof_request_builder,
|
||||
finality_proof_provider: self.finality_proof_provider,
|
||||
network_protocol: self.network_protocol,
|
||||
transaction_pool: self.transaction_pool,
|
||||
rpc_extensions: self.rpc_extensions,
|
||||
remote_backend: self.remote_backend,
|
||||
background_tasks: self.background_tasks,
|
||||
marker: self.marker,
|
||||
prometheus_registry: self.prometheus_registry,
|
||||
})
|
||||
}
|
||||
|
||||
/// Defines which network specialization protocol to use.
|
||||
pub fn with_network_protocol<UNetP>(
|
||||
self,
|
||||
network_protocol_builder: impl FnOnce(&Configuration<TGen, TCSExt>) -> Result<UNetP, Error>
|
||||
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp,
|
||||
UNetP, TExPool, TRpc, Backend>, Error> {
|
||||
let network_protocol = network_protocol_builder(&self.config)?;
|
||||
|
||||
Ok(ServiceBuilder {
|
||||
config: self.config,
|
||||
client: self.client,
|
||||
backend: self.backend,
|
||||
keystore: self.keystore,
|
||||
fetcher: self.fetcher,
|
||||
select_chain: self.select_chain,
|
||||
import_queue: self.import_queue,
|
||||
finality_proof_request_builder: self.finality_proof_request_builder,
|
||||
finality_proof_provider: self.finality_proof_provider,
|
||||
network_protocol,
|
||||
transaction_pool: self.transaction_pool,
|
||||
rpc_extensions: self.rpc_extensions,
|
||||
remote_backend: self.remote_backend,
|
||||
@@ -559,7 +523,6 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
TImpQu,
|
||||
TFprb,
|
||||
Arc<dyn FinalityProofProvider<TBl>>,
|
||||
TNetP,
|
||||
TExPool,
|
||||
TRpc,
|
||||
Backend,
|
||||
@@ -576,7 +539,6 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
import_queue: self.import_queue,
|
||||
finality_proof_request_builder: self.finality_proof_request_builder,
|
||||
finality_proof_provider,
|
||||
network_protocol: self.network_protocol,
|
||||
transaction_pool: self.transaction_pool,
|
||||
rpc_extensions: self.rpc_extensions,
|
||||
remote_backend: self.remote_backend,
|
||||
@@ -601,7 +563,6 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
TImpQu,
|
||||
TFprb,
|
||||
Arc<dyn FinalityProofProvider<TBl>>,
|
||||
TNetP,
|
||||
TExPool,
|
||||
TRpc,
|
||||
Backend,
|
||||
@@ -621,7 +582,7 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
Arc<TExPool>,
|
||||
) -> Result<(UImpQu, Option<UFprb>), Error>
|
||||
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, UImpQu, UFprb, TFpp,
|
||||
TNetP, TExPool, TRpc, Backend>, Error>
|
||||
TExPool, TRpc, Backend>, Error>
|
||||
where TSc: Clone, TFchr: Clone {
|
||||
let (import_queue, fprb) = builder(
|
||||
&self.config,
|
||||
@@ -642,7 +603,6 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
import_queue,
|
||||
finality_proof_request_builder: fprb,
|
||||
finality_proof_provider: self.finality_proof_provider,
|
||||
network_protocol: self.network_protocol,
|
||||
transaction_pool: self.transaction_pool,
|
||||
rpc_extensions: self.rpc_extensions,
|
||||
remote_backend: self.remote_backend,
|
||||
@@ -664,7 +624,7 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
Arc<TExPool>,
|
||||
) -> Result<(UImpQu, UFprb), Error>
|
||||
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, UImpQu, UFprb, TFpp,
|
||||
TNetP, TExPool, TRpc, Backend>, Error>
|
||||
TExPool, TRpc, Backend>, Error>
|
||||
where TSc: Clone, TFchr: Clone {
|
||||
self.with_import_queue_and_opt_fprb(|cfg, cl, b, f, sc, tx|
|
||||
builder(cfg, cl, b, f, sc, tx)
|
||||
@@ -681,7 +641,7 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
Option<TFchr>,
|
||||
) -> Result<(UExPool, Option<BackgroundTask>), Error>
|
||||
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp,
|
||||
TNetP, UExPool, TRpc, Backend>, Error>
|
||||
UExPool, TRpc, Backend>, Error>
|
||||
where TSc: Clone, TFchr: Clone {
|
||||
let (transaction_pool, background_task) = transaction_pool_builder(
|
||||
self.config.transaction_pool.clone(),
|
||||
@@ -703,7 +663,6 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
import_queue: self.import_queue,
|
||||
finality_proof_request_builder: self.finality_proof_request_builder,
|
||||
finality_proof_provider: self.finality_proof_provider,
|
||||
network_protocol: self.network_protocol,
|
||||
transaction_pool: Arc::new(transaction_pool),
|
||||
rpc_extensions: self.rpc_extensions,
|
||||
remote_backend: self.remote_backend,
|
||||
@@ -718,7 +677,7 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
self,
|
||||
rpc_ext_builder: impl FnOnce(&Self) -> Result<URpc, Error>,
|
||||
) -> Result<ServiceBuilder<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp,
|
||||
TNetP, TExPool, URpc, Backend>, Error>
|
||||
TExPool, URpc, Backend>, Error>
|
||||
where TSc: Clone, TFchr: Clone {
|
||||
let rpc_extensions = rpc_ext_builder(&self)?;
|
||||
|
||||
@@ -732,7 +691,6 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
import_queue: self.import_queue,
|
||||
finality_proof_request_builder: self.finality_proof_request_builder,
|
||||
finality_proof_provider: self.finality_proof_provider,
|
||||
network_protocol: self.network_protocol,
|
||||
transaction_pool: self.transaction_pool,
|
||||
rpc_extensions,
|
||||
remote_backend: self.remote_backend,
|
||||
@@ -754,7 +712,6 @@ impl<TBl, TRtApi, TGen, TCSExt, TCl, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TEx
|
||||
import_queue: self.import_queue,
|
||||
finality_proof_request_builder: self.finality_proof_request_builder,
|
||||
finality_proof_provider: self.finality_proof_provider,
|
||||
network_protocol: self.network_protocol,
|
||||
transaction_pool: self.transaction_pool,
|
||||
rpc_extensions: self.rpc_extensions,
|
||||
remote_backend: self.remote_backend,
|
||||
@@ -801,7 +758,7 @@ pub trait ServiceBuilderCommand {
|
||||
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send>>;
|
||||
}
|
||||
|
||||
impl<TBl, TRtApi, TGen, TCSExt, TBackend, TExec, TSc, TImpQu, TNetP, TExPool, TRpc>
|
||||
impl<TBl, TRtApi, TGen, TCSExt, TBackend, TExec, TSc, TImpQu, TExPool, TRpc>
|
||||
ServiceBuilder<
|
||||
TBl,
|
||||
TRtApi,
|
||||
@@ -813,7 +770,6 @@ ServiceBuilder<
|
||||
TImpQu,
|
||||
BoxFinalityProofRequestBuilder<TBl>,
|
||||
Arc<dyn FinalityProofProvider<TBl>>,
|
||||
TNetP,
|
||||
TExPool,
|
||||
TRpc,
|
||||
TBackend,
|
||||
@@ -834,7 +790,6 @@ ServiceBuilder<
|
||||
TExec: 'static + sc_client::CallExecutor<TBl> + Send + Sync + Clone,
|
||||
TSc: Clone,
|
||||
TImpQu: 'static + ImportQueue<TBl>,
|
||||
TNetP: NetworkSpecialization<TBl>,
|
||||
TExPool: MaintainedTransactionPool<Block=TBl, Hash = <TBl as BlockT>::Hash> + MallocSizeOfWasm + 'static,
|
||||
TRpc: sc_rpc::RpcExtension<sc_rpc::Metadata> + Clone,
|
||||
{
|
||||
@@ -851,7 +806,7 @@ ServiceBuilder<
|
||||
Client<TBackend, TExec, TBl, TRtApi>,
|
||||
TSc,
|
||||
NetworkStatus<TBl>,
|
||||
NetworkService<TBl, TNetP, <TBl as BlockT>::Hash>,
|
||||
NetworkService<TBl, <TBl as BlockT>::Hash>,
|
||||
TExPool,
|
||||
sc_offchain::OffchainWorkers<
|
||||
Client<TBackend, TExec, TBl, TRtApi>,
|
||||
@@ -870,7 +825,6 @@ ServiceBuilder<
|
||||
import_queue,
|
||||
finality_proof_request_builder,
|
||||
finality_proof_provider,
|
||||
network_protocol,
|
||||
transaction_pool,
|
||||
rpc_extensions,
|
||||
remote_backend,
|
||||
@@ -951,7 +905,6 @@ ServiceBuilder<
|
||||
transaction_pool: transaction_pool_adapter.clone() as _,
|
||||
import_queue,
|
||||
protocol_id,
|
||||
specialization: network_protocol,
|
||||
block_announce_validator,
|
||||
};
|
||||
|
||||
|
||||
@@ -46,12 +46,12 @@ pub fn build_spec<G, E>(spec: ChainSpec<G, E>, raw: bool) -> error::Result<Strin
|
||||
|
||||
impl<
|
||||
TBl, TRtApi, TGen, TCSExt, TBackend,
|
||||
TExecDisp, TFchr, TSc, TImpQu, TFprb, TFpp, TNetP,
|
||||
TExecDisp, TFchr, TSc, TImpQu, TFprb, TFpp,
|
||||
TExPool, TRpc, Backend
|
||||
> ServiceBuilderCommand for ServiceBuilder<
|
||||
TBl, TRtApi, TGen, TCSExt,
|
||||
Client<TBackend, LocalCallExecutor<TBackend, NativeExecutor<TExecDisp>>, TBl, TRtApi>,
|
||||
TFchr, TSc, TImpQu, TFprb, TFpp, TNetP, TExPool, TRpc, Backend
|
||||
TFchr, TSc, TImpQu, TFprb, TFpp, TExPool, TRpc, Backend
|
||||
> where
|
||||
TBl: BlockT,
|
||||
TBackend: 'static + sc_client_api::backend::Backend<TBl> + Send,
|
||||
|
||||
@@ -45,10 +45,7 @@ use futures::{
|
||||
sink::SinkExt,
|
||||
task::{Spawn, FutureObj, SpawnError},
|
||||
};
|
||||
use sc_network::{
|
||||
NetworkService, network_state::NetworkState, specialization::NetworkSpecialization,
|
||||
PeerId, ReportHandle,
|
||||
};
|
||||
use sc_network::{NetworkService, network_state::NetworkState, PeerId, ReportHandle};
|
||||
use log::{log, warn, debug, error, Level};
|
||||
use codec::{Encode, Decode};
|
||||
use sp_runtime::generic::BlockId;
|
||||
@@ -176,8 +173,6 @@ pub trait AbstractService: 'static + Future<Output = Result<(), Error>> +
|
||||
type SelectChain: sp_consensus::SelectChain<Self::Block>;
|
||||
/// Transaction pool.
|
||||
type TransactionPool: TransactionPool<Block = Self::Block> + MallocSizeOfWasm;
|
||||
/// Network specialization.
|
||||
type NetworkSpecialization: NetworkSpecialization<Self::Block>;
|
||||
|
||||
/// Get event stream for telemetry connection established events.
|
||||
fn telemetry_on_connect_stream(&self) -> futures::channel::mpsc::UnboundedReceiver<()>;
|
||||
@@ -218,7 +213,7 @@ pub trait AbstractService: 'static + Future<Output = Result<(), Error>> +
|
||||
|
||||
/// Get shared network instance.
|
||||
fn network(&self)
|
||||
-> Arc<NetworkService<Self::Block, Self::NetworkSpecialization, <Self::Block as BlockT>::Hash>>;
|
||||
-> Arc<NetworkService<Self::Block, <Self::Block as BlockT>::Hash>>;
|
||||
|
||||
/// Returns a receiver that periodically receives a status of the network.
|
||||
fn network_status(&self, interval: Duration) -> mpsc::UnboundedReceiver<(NetworkStatus<Self::Block>, NetworkState)>;
|
||||
@@ -230,9 +225,9 @@ pub trait AbstractService: 'static + Future<Output = Result<(), Error>> +
|
||||
fn on_exit(&self) -> ::exit_future::Exit;
|
||||
}
|
||||
|
||||
impl<TBl, TBackend, TExec, TRtApi, TSc, TNetSpec, TExPool, TOc> AbstractService for
|
||||
impl<TBl, TBackend, TExec, TRtApi, TSc, TExPool, TOc> AbstractService for
|
||||
Service<TBl, Client<TBackend, TExec, TBl, TRtApi>, TSc, NetworkStatus<TBl>,
|
||||
NetworkService<TBl, TNetSpec, TBl::Hash>, TExPool, TOc>
|
||||
NetworkService<TBl, TBl::Hash>, TExPool, TOc>
|
||||
where
|
||||
TBl: BlockT + Unpin,
|
||||
TBackend: 'static + sc_client_api::backend::Backend<TBl>,
|
||||
@@ -241,7 +236,6 @@ where
|
||||
TSc: sp_consensus::SelectChain<TBl> + 'static + Clone + Send + Unpin,
|
||||
TExPool: 'static + TransactionPool<Block = TBl> + MallocSizeOfWasm,
|
||||
TOc: 'static + Send + Sync,
|
||||
TNetSpec: NetworkSpecialization<TBl>,
|
||||
{
|
||||
type Block = TBl;
|
||||
type Backend = TBackend;
|
||||
@@ -249,7 +243,6 @@ where
|
||||
type RuntimeApi = TRtApi;
|
||||
type SelectChain = TSc;
|
||||
type TransactionPool = TExPool;
|
||||
type NetworkSpecialization = TNetSpec;
|
||||
|
||||
fn telemetry_on_connect_stream(&self) -> futures::channel::mpsc::UnboundedReceiver<()> {
|
||||
let (sink, stream) = futures::channel::mpsc::unbounded();
|
||||
@@ -315,7 +308,7 @@ where
|
||||
}
|
||||
|
||||
fn network(&self)
|
||||
-> Arc<NetworkService<Self::Block, Self::NetworkSpecialization, <Self::Block as BlockT>::Hash>>
|
||||
-> Arc<NetworkService<Self::Block, <Self::Block as BlockT>::Hash>>
|
||||
{
|
||||
self.network.clone()
|
||||
}
|
||||
@@ -379,11 +372,10 @@ impl<TBl, TCl, TSc, TNetStatus, TNet, TTxPool, TOc> Spawn for
|
||||
fn build_network_future<
|
||||
B: BlockT,
|
||||
C: sc_client::BlockchainEvents<B>,
|
||||
S: sc_network::specialization::NetworkSpecialization<B>,
|
||||
H: sc_network::ExHashT
|
||||
> (
|
||||
roles: Roles,
|
||||
mut network: sc_network::NetworkWorker<B, S, H>,
|
||||
mut network: sc_network::NetworkWorker<B, H>,
|
||||
client: Arc<C>,
|
||||
status_sinks: Arc<Mutex<status_sinks::StatusSinks<(NetworkStatus<B>, NetworkState)>>>,
|
||||
mut rpc_rx: mpsc::UnboundedReceiver<sc_rpc::system::Request<B>>,
|
||||
@@ -397,7 +389,7 @@ fn build_network_future<
|
||||
|
||||
// We poll `imported_blocks_stream`.
|
||||
while let Poll::Ready(Some(notification)) = Pin::new(&mut imported_blocks_stream).poll_next(cx) {
|
||||
network.on_block_imported(notification.hash, notification.header, Vec::new(), notification.is_new_best);
|
||||
network.on_block_imported(notification.header, Vec::new(), notification.is_new_best);
|
||||
}
|
||||
|
||||
// We poll `finality_notification_stream`, but we only take the last event.
|
||||
|
||||
Reference in New Issue
Block a user