mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
Network sync refactoring (part 5) (#11825)
* Make `chain_sync` an explicit networking parameter instead of offering factory method * Derive `Copy` on `SyncMode` and remove cloning
This commit is contained in:
@@ -96,14 +96,8 @@ where
|
||||
/// valid.
|
||||
pub import_queue: Box<dyn ImportQueue<B>>,
|
||||
|
||||
/// Factory function that creates a new instance of chain sync.
|
||||
pub create_chain_sync: Box<
|
||||
dyn FnOnce(
|
||||
sc_network_common::sync::SyncMode,
|
||||
Arc<Client>,
|
||||
Option<Arc<dyn WarpSyncProvider<B>>>,
|
||||
) -> crate::error::Result<Box<dyn ChainSync<B>>>,
|
||||
>,
|
||||
/// Instance of chain sync implementation.
|
||||
pub chain_sync: Box<dyn ChainSync<B>>,
|
||||
|
||||
/// Registry for recording prometheus metrics to.
|
||||
pub metrics_registry: Option<Registry>,
|
||||
@@ -138,8 +132,8 @@ where
|
||||
/// both outgoing and incoming requests.
|
||||
pub state_request_protocol_config: RequestResponseConfig,
|
||||
|
||||
/// Optional warp sync protocol support. Include protocol config and sync provider.
|
||||
pub warp_sync: Option<(Arc<dyn WarpSyncProvider<B>>, RequestResponseConfig)>,
|
||||
/// Optional warp sync protocol config.
|
||||
pub warp_sync_protocol_config: Option<RequestResponseConfig>,
|
||||
}
|
||||
|
||||
/// Role of the local node.
|
||||
@@ -352,7 +346,7 @@ impl From<multiaddr::Error> for ParseErr {
|
||||
}
|
||||
|
||||
/// Sync operation mode.
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub enum SyncMode {
|
||||
/// Full block download and verification.
|
||||
Full,
|
||||
|
||||
Reference in New Issue
Block a user