Skip to content

Commit

Permalink
Merge branch 'master' into cli-RpcParams
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengxu authored Sep 10, 2024
2 parents 3ce5e4f + 1f1f20a commit fcc6f39
Show file tree
Hide file tree
Showing 5 changed files with 941 additions and 859 deletions.
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 @@ -389,7 +389,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 @@ -697,7 +698,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

0 comments on commit fcc6f39

Please sign in to comment.