Move code from sc-network-common back to sc-network (#13592)

* Move service tests to `client/network/tests`

These tests depend on `sc-network` and `sc-network-sync` so they should
live outside the crate.

* Move some configs from `sc-network-common` to `sc-network`

* Move `NetworkService` traits to `sc-network`

* Move request-responses to `sc-network`

* Remove more stuff

* Remove rest of configs from `sc-network-common` to `sc-network`

* Remove more stuff

* Fix warnings

* Update client/network/src/request_responses.rs

Co-authored-by: Dmitry Markin <dmitry@markin.tech>

* Fix cargo doc

---------

Co-authored-by: Dmitry Markin <dmitry@markin.tech>
This commit is contained in:
Aaro Altonen
2023-03-14 14:06:40 +02:00
committed by GitHub
parent 5d718e45c1
commit 9ced14e2de
85 changed files with 1411 additions and 1434 deletions
@@ -68,7 +68,7 @@ use sc_client_api::{
StorageProvider, TransactionFor,
};
use sc_consensus::BlockImport;
use sc_network_common::protocol::ProtocolName;
use sc_network::types::ProtocolName;
use sc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG, CONSENSUS_INFO};
use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver};
use sp_api::ProvideRuntimeApi;
@@ -695,19 +695,19 @@ pub struct GrandpaParams<Block: BlockT, C, N, S, SC, VR> {
/// For standard protocol name see [`crate::protocol_standard_name`].
pub fn grandpa_peers_set_config(
protocol_name: ProtocolName,
) -> sc_network_common::config::NonDefaultSetConfig {
) -> sc_network::config::NonDefaultSetConfig {
use communication::grandpa_protocol_name;
sc_network_common::config::NonDefaultSetConfig {
sc_network::config::NonDefaultSetConfig {
notifications_protocol: protocol_name,
fallback_names: grandpa_protocol_name::LEGACY_NAMES.iter().map(|&n| n.into()).collect(),
// Notifications reach ~256kiB in size at the time of writing on Kusama and Polkadot.
max_notification_size: 1024 * 1024,
handshake: None,
set_config: sc_network_common::config::SetConfig {
set_config: sc_network::config::SetConfig {
in_peers: 0,
out_peers: 0,
reserved_nodes: Vec::new(),
non_reserved_mode: sc_network_common::config::NonReservedPeerMode::Deny,
non_reserved_mode: sc_network::config::NonReservedPeerMode::Deny,
},
}
}