Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions prdoc/pr_5469.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
title: Syncing strategy refactoring

doc:
- audience: Node Dev
description: |
Mostly internal changes to syncing strategies that is a step towards making them configurable/extensible in the
future. It is unlikely that external developers will need to change their code.

crates:
- name: sc-network-sync
bump: major
9 changes: 5 additions & 4 deletions substrate/client/network/sync/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use crate::{
},
strategy::{
warp::{EncodedProof, WarpProofRequest, WarpSyncConfig},
StrategyKey, SyncingAction, SyncingConfig, SyncingStrategy,
PolkadotSyncingStrategy, StrategyKey, SyncingAction, SyncingConfig, SyncingStrategy,
},
types::{
BadPeer, ExtendedPeerInfo, OpaqueStateRequest, OpaqueStateResponse, PeerRequest, SyncEvent,
Expand Down Expand Up @@ -189,7 +189,7 @@ pub struct Peer<B: BlockT> {

pub struct SyncingEngine<B: BlockT, Client> {
/// Syncing strategy.
strategy: SyncingStrategy<B, Client>,
strategy: PolkadotSyncingStrategy<B, Client>,

/// Blockchain client.
client: Arc<Client>,
Expand Down Expand Up @@ -397,7 +397,8 @@ where
);

// Initialize syncing strategy.
let strategy = SyncingStrategy::new(syncing_config, client.clone(), warp_sync_config)?;
let strategy =
PolkadotSyncingStrategy::new(syncing_config, client.clone(), warp_sync_config)?;

let block_announce_protocol_name = block_announce_config.protocol_name().clone();
let (tx, service_rx) = tracing_unbounded("mpsc_chain_sync", 100_000);
Expand Down Expand Up @@ -710,7 +711,7 @@ where
number,
)
},
// Nothing to do, this is handled internally by `SyncingStrategy`.
// Nothing to do, this is handled internally by `PolkadotSyncingStrategy`.
SyncingAction::Finished => {},
}
}
Expand Down
Loading