mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 20:17:57 +00:00
Move syncing code from sc-network-common to sc-network-sync (#1912)
This PR moves syncing-related code from `sc-network-common` to `sc-network-sync`. Unfortunately, some parts are tightly integrated with networking, so they were left in `sc-network-common` for now: 1. `SyncMode` in `common/src/sync.rs` (used in `NetworkConfiguration`). 2. `BlockAnnouncesHandshake`, `BlockRequest`, `BlockResponse`, etc. in `common/src/sync/message.rs` (used in `src/protocol.rs` and `src/protocol/message.rs`). More substantial refactoring is needed to decouple syncing and networking completely, including getting rid of the hardcoded sync protocol. ## Release notes Move syncing-related code from `sc-network-common` to `sc-network-sync`. Delete `ChainSync` trait as it's never used (the only implementation is accessed directly from `SyncingEngine` and exposes a lot of public methods that are not part of the trait). Some new trait(s) for syncing will likely be introduced as part of Sync 2.0 refactoring to represent syncing strategies.
This commit is contained in:
@@ -30,7 +30,11 @@ pub use crate::{
|
||||
types::ProtocolName,
|
||||
};
|
||||
|
||||
pub use libp2p::{identity::Keypair, multiaddr, Multiaddr, PeerId};
|
||||
pub use libp2p::{
|
||||
build_multiaddr,
|
||||
identity::{self, ed25519, Keypair},
|
||||
multiaddr, Multiaddr, PeerId,
|
||||
};
|
||||
|
||||
use crate::peer_store::PeerStoreHandle;
|
||||
use codec::Encode;
|
||||
@@ -39,9 +43,10 @@ use zeroize::Zeroize;
|
||||
|
||||
pub use sc_network_common::{
|
||||
role::{Role, Roles},
|
||||
sync::{warp::WarpSyncProvider, SyncMode},
|
||||
sync::SyncMode,
|
||||
ExHashT,
|
||||
};
|
||||
|
||||
use sc_utils::mpsc::TracingUnboundedSender;
|
||||
use sp_runtime::traits::Block as BlockT;
|
||||
|
||||
@@ -58,11 +63,6 @@ use std::{
|
||||
str::{self, FromStr},
|
||||
};
|
||||
|
||||
pub use libp2p::{
|
||||
build_multiaddr,
|
||||
identity::{self, ed25519},
|
||||
};
|
||||
|
||||
/// Protocol name prefix, transmitted on the wire for legacy protocol names.
|
||||
/// I.e., `dot` in `/dot/sync/2`. Should be unique for each chain. Always UTF-8.
|
||||
/// Deprecated in favour of genesis hash & fork ID based protocol names.
|
||||
|
||||
Reference in New Issue
Block a user