Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move syncing code from sc-network-common to sc-network-sync #1912

Merged
merged 13 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 9 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
5 changes: 5 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions substrate/client/consensus/grandpa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
6 changes: 2 additions & 4 deletions substrate/client/consensus/grandpa/src/communication/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion substrate/client/consensus/grandpa/src/warp_proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
1 change: 1 addition & 0 deletions substrate/client/informant/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ futures-timer = "3.0.1"
log = "0.4.17"
sc-client-api = { path = "../api" }
sc-network-common = { path = "../network/common" }
sc-network-sync = { path = "../network/sync" }
sc-network = { path = "../network" }
sp-blockchain = { path = "../../primitives/blockchain" }
sp-runtime = { path = "../../primitives/runtime" }
2 changes: 1 addition & 1 deletion substrate/client/informant/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use ansi_term::Colour;
use log::info;
use sc_client_api::ClientInfo;
use sc_network::NetworkStatus;
use sc_network_common::sync::{
use sc_network_sync::{
warp::{WarpSyncPhase, WarpSyncProgress},
SyncState, SyncStatus,
};
Expand Down
2 changes: 1 addition & 1 deletion substrate/client/informant/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use futures_timer::Delay;
use log::{debug, info, trace};
use sc_client_api::{BlockchainEvents, UsageProvider};
use sc_network::NetworkStatusProvider;
use sc_network_common::sync::SyncStatusProvider;
use sc_network_sync::SyncStatusProvider;
use sp_blockchain::HeaderMetadata;
use sp_runtime::traits::{Block as BlockT, Header};
use std::{collections::VecDeque, fmt::Display, sync::Arc, time::Duration};
Expand Down
1 change: 1 addition & 0 deletions substrate/client/network-gossip/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ tracing = "0.1.29"
prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../utils/prometheus" }
sc-network = { path = "../network" }
sc-network-common = { path = "../network/common" }
sc-network-sync = { path = "../network/sync" }
sp-runtime = { path = "../../primitives/runtime" }

[dev-dependencies]
Expand Down
5 changes: 3 additions & 2 deletions substrate/client/network-gossip/src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::{
};

use sc_network::{event::Event, types::ProtocolName, ReputationChange};
use sc_network_common::sync::SyncEvent;
use sc_network_sync::SyncEvent;

use futures::{
channel::mpsc::{channel, Receiver, Sender},
Expand Down Expand Up @@ -338,7 +338,8 @@ mod tests {
config::MultiaddrWithPeerId, NetworkBlock, NetworkEventStream, NetworkNotification,
NetworkPeers, NotificationSenderError, NotificationSenderT as NotificationSender,
};
use sc_network_common::{role::ObservedRole, sync::SyncEventStream};
use sc_network_common::role::ObservedRole;
use sc_network_sync::SyncEventStream;
use sp_runtime::{
testing::H256,
traits::{Block as BlockT, NumberFor},
Expand Down
2 changes: 1 addition & 1 deletion substrate/client/network-gossip/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ use libp2p::{multiaddr, PeerId};
use sc_network::{
types::ProtocolName, NetworkBlock, NetworkEventStream, NetworkNotification, NetworkPeers,
};
use sc_network_common::sync::SyncEventStream;
use sc_network_sync::SyncEventStream;
use sp_runtime::traits::{Block as BlockT, NumberFor};
use std::iter;

Expand Down
Loading