mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 12:51:05 +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:
@@ -37,6 +37,7 @@ sc-consensus = { path = "../common" }
|
||||
sc-network = { path = "../../network" }
|
||||
sc-network-gossip = { path = "../../network-gossip" }
|
||||
sc-network-common = { path = "../../network/common" }
|
||||
sc-network-sync = { path = "../../network/sync" }
|
||||
sc-telemetry = { path = "../../telemetry" }
|
||||
sc-utils = { path = "../../utils" }
|
||||
sp-api = { path = "../../../primitives/api" }
|
||||
|
||||
@@ -59,7 +59,7 @@ use crate::{
|
||||
use gossip::{
|
||||
FullCatchUpMessage, FullCommitMessage, GossipMessage, GossipValidator, PeerReport, VoteMessage,
|
||||
};
|
||||
use sc_network_common::sync::SyncEventStream;
|
||||
use sc_network_sync::SyncEventStream;
|
||||
use sc_utils::mpsc::TracingUnboundedReceiver;
|
||||
use sp_consensus_grandpa::{AuthorityId, AuthoritySignature, RoundNumber, SetId as SetIdNumber};
|
||||
|
||||
|
||||
@@ -33,11 +33,9 @@ use sc_network::{
|
||||
NetworkSyncForkRequest, NotificationSenderError, NotificationSenderT as NotificationSender,
|
||||
PeerId, ReputationChange,
|
||||
};
|
||||
use sc_network_common::{
|
||||
role::ObservedRole,
|
||||
sync::{SyncEvent as SyncStreamEvent, SyncEventStream},
|
||||
};
|
||||
use sc_network_common::role::ObservedRole;
|
||||
use sc_network_gossip::Validator;
|
||||
use sc_network_sync::{SyncEvent as SyncStreamEvent, SyncEventStream};
|
||||
use sc_network_test::{Block, Hash};
|
||||
use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender};
|
||||
use sp_consensus_grandpa::AuthorityList;
|
||||
|
||||
@@ -23,7 +23,7 @@ use crate::{
|
||||
BlockNumberOps, GrandpaJustification, SharedAuthoritySet,
|
||||
};
|
||||
use sc_client_api::Backend as ClientBackend;
|
||||
use sc_network_common::sync::warp::{EncodedProof, VerificationResult, WarpSyncProvider};
|
||||
use sc_network_sync::warp::{EncodedProof, VerificationResult, WarpSyncProvider};
|
||||
use sp_blockchain::{Backend as BlockchainBackend, HeaderBackend};
|
||||
use sp_consensus_grandpa::{AuthorityList, SetId, GRANDPA_ENGINE_ID};
|
||||
use sp_runtime::{
|
||||
|
||||
Reference in New Issue
Block a user