mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 08:11:03 +00:00
Companion for paritytech/substrate#13592 (#6869)
* Move configs
* Start using `NetworkService` traits from `sc-network`
* Fix stuff
* Remove `sc-network-common` as dependency
* update lockfile for {"substrate"}
---------
Co-authored-by: parity-processbot <>
This commit is contained in:
Generated
+193
-188
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,6 @@ gum = { package = "tracing-gum", path = "../../gum" }
|
||||
polkadot-primitives = { path = "../../../primitives" }
|
||||
parity-scale-codec = { version = "3.3.0", default-features = false, features = ["derive"] }
|
||||
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
polkadot-node-metrics = { path = "../../metrics"}
|
||||
polkadot-node-network-protocol = { path = "../protocol" }
|
||||
|
||||
@@ -22,13 +22,9 @@ use futures::{prelude::*, stream::BoxStream};
|
||||
use parity_scale_codec::Encode;
|
||||
|
||||
use sc_network::{
|
||||
multiaddr::Multiaddr, Event as NetworkEvent, IfDisconnected, NetworkService, OutboundFailure,
|
||||
RequestFailure,
|
||||
};
|
||||
use sc_network_common::{
|
||||
config::parse_addr,
|
||||
protocol::ProtocolName,
|
||||
service::{NetworkEventStream, NetworkNotification, NetworkPeers, NetworkRequest},
|
||||
config::parse_addr, multiaddr::Multiaddr, types::ProtocolName, Event as NetworkEvent,
|
||||
IfDisconnected, NetworkEventStream, NetworkNotification, NetworkPeers, NetworkRequest,
|
||||
NetworkService, OutboundFailure, RequestFailure,
|
||||
};
|
||||
|
||||
use polkadot_node_network_protocol::{
|
||||
@@ -193,8 +189,9 @@ impl Network for Arc<NetworkService<Block, Hash>> {
|
||||
match pending_response
|
||||
.send(Err(RequestFailure::Network(OutboundFailure::DialFailure)))
|
||||
{
|
||||
Err(_) =>
|
||||
gum::debug!(target: LOG_TARGET, "Sending failed request response failed."),
|
||||
Err(_) => {
|
||||
gum::debug!(target: LOG_TARGET, "Sending failed request response failed.")
|
||||
},
|
||||
Ok(_) => {},
|
||||
}
|
||||
return
|
||||
|
||||
@@ -13,7 +13,6 @@ polkadot-node-primitives = { path = "../../primitives" }
|
||||
polkadot-node-jaeger = { path = "../../jaeger" }
|
||||
parity-scale-codec = { version = "3.3.0", default-features = false, features = ["derive"] }
|
||||
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
strum = { version = "0.24", features = ["derive"] }
|
||||
futures = "0.3.21"
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
|
||||
use derive_more::Display;
|
||||
use polkadot_primitives::Hash;
|
||||
use sc_network_common::{
|
||||
use sc_network::{
|
||||
config::{NonDefaultSetConfig, SetConfig},
|
||||
protocol::ProtocolName,
|
||||
types::ProtocolName,
|
||||
};
|
||||
use std::{
|
||||
collections::{hash_map::Entry, HashMap},
|
||||
@@ -81,7 +81,7 @@ impl PeerSet {
|
||||
fallback_names,
|
||||
max_notification_size,
|
||||
handshake: None,
|
||||
set_config: sc_network_common::config::SetConfig {
|
||||
set_config: SetConfig {
|
||||
// we allow full nodes to connect to validators for gossip
|
||||
// to ensure any `MIN_GOSSIP_PEERS` always include reserved peers
|
||||
// we limit the amount of non-reserved slots to be less
|
||||
@@ -89,7 +89,7 @@ impl PeerSet {
|
||||
in_peers: super::MIN_GOSSIP_PEERS as u32 / 2 - 1,
|
||||
out_peers: super::MIN_GOSSIP_PEERS as u32 / 2 - 1,
|
||||
reserved_nodes: Vec::new(),
|
||||
non_reserved_mode: sc_network_common::config::NonReservedPeerMode::Accept,
|
||||
non_reserved_mode: sc_network::config::NonReservedPeerMode::Accept,
|
||||
},
|
||||
},
|
||||
PeerSet::Collation => NonDefaultSetConfig {
|
||||
@@ -103,9 +103,9 @@ impl PeerSet {
|
||||
out_peers: 0,
|
||||
reserved_nodes: Vec::new(),
|
||||
non_reserved_mode: if is_authority == IsAuthority::Yes {
|
||||
sc_network_common::config::NonReservedPeerMode::Accept
|
||||
sc_network::config::NonReservedPeerMode::Accept
|
||||
} else {
|
||||
sc_network_common::config::NonReservedPeerMode::Deny
|
||||
sc_network::config::NonReservedPeerMode::Deny
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -190,7 +190,7 @@ impl<T> IndexMut<PeerSet> for PerPeerSet<T> {
|
||||
pub fn peer_sets_info(
|
||||
is_authority: IsAuthority,
|
||||
peerset_protocol_names: &PeerSetProtocolNames,
|
||||
) -> Vec<sc_network_common::config::NonDefaultSetConfig> {
|
||||
) -> Vec<NonDefaultSetConfig> {
|
||||
PeerSet::iter()
|
||||
.map(|s| s.get_info(is_authority, &peerset_protocol_names))
|
||||
.collect()
|
||||
|
||||
@@ -961,8 +961,7 @@ where
|
||||
|
||||
let authority_discovery_service = if auth_or_collator || overseer_enable_anyways {
|
||||
use futures::StreamExt;
|
||||
use sc_network::Event;
|
||||
use sc_network_common::service::NetworkEventStream;
|
||||
use sc_network::{Event, NetworkEventStream};
|
||||
|
||||
let authority_discovery_role = if role.is_authority() {
|
||||
sc_authority_discovery::Role::PublishAndDiscover(keystore_container.keystore())
|
||||
|
||||
@@ -42,7 +42,7 @@ use polkadot_primitives::runtime_api::ParachainHost;
|
||||
use sc_authority_discovery::Service as AuthorityDiscoveryService;
|
||||
use sc_client_api::AuxStore;
|
||||
use sc_keystore::LocalKeystore;
|
||||
use sc_network_common::service::NetworkStateInfo;
|
||||
use sc_network::NetworkStateInfo;
|
||||
use sp_api::ProvideRuntimeApi;
|
||||
use sp_blockchain::HeaderBackend;
|
||||
use sp_consensus_babe::BabeApi;
|
||||
|
||||
@@ -45,7 +45,6 @@ sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "mas
|
||||
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-network-common = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-service = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
|
||||
@@ -37,8 +37,10 @@ use polkadot_test_runtime::{
|
||||
};
|
||||
use sc_chain_spec::ChainSpec;
|
||||
use sc_client_api::execution_extensions::ExecutionStrategies;
|
||||
use sc_network::{config::NetworkConfiguration, multiaddr};
|
||||
use sc_network_common::{config::TransportConfig, service::NetworkStateInfo};
|
||||
use sc_network::{
|
||||
config::{NetworkConfiguration, TransportConfig},
|
||||
multiaddr, NetworkStateInfo,
|
||||
};
|
||||
use sc_service::{
|
||||
config::{
|
||||
DatabaseSource, KeystoreConfig, MultiaddrWithPeerId, WasmExecutionMethod,
|
||||
|
||||
Reference in New Issue
Block a user