mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 12:27:56 +00:00
* Trivial networking changes for Substrate PR https://github.com/paritytech/substrate/pull/11940 * update lockfile for {"substrate"} Co-authored-by: parity-processbot <>
This commit is contained in:
Generated
+181
-173
File diff suppressed because it is too large
Load Diff
@@ -80,7 +80,7 @@ impl TestSyncOracleHandle {
|
||||
}
|
||||
|
||||
impl SyncOracle for TestSyncOracle {
|
||||
fn is_major_syncing(&mut self) -> bool {
|
||||
fn is_major_syncing(&self) -> bool {
|
||||
let is_major_syncing = self.flag.load(Ordering::SeqCst);
|
||||
|
||||
if !is_major_syncing {
|
||||
@@ -92,7 +92,7 @@ impl SyncOracle for TestSyncOracle {
|
||||
is_major_syncing
|
||||
}
|
||||
|
||||
fn is_offline(&mut self) -> bool {
|
||||
fn is_offline(&self) -> bool {
|
||||
unimplemented!("not used in network bridge")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ gum = { package = "tracing-gum", path = "../../gum" }
|
||||
polkadot-primitives = { path = "../../../primitives" }
|
||||
parity-scale-codec = { version = "3.1.5", 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-subsystem = {path = "../../subsystem" }
|
||||
polkadot-overseer = { path = "../../overseer" }
|
||||
|
||||
@@ -25,6 +25,9 @@ use sc_network::{
|
||||
config::parse_addr, multiaddr::Multiaddr, Event as NetworkEvent, IfDisconnected,
|
||||
NetworkService, OutboundFailure, RequestFailure,
|
||||
};
|
||||
use sc_network_common::service::{
|
||||
NetworkEventStream, NetworkNotification, NetworkPeers, NetworkRequest,
|
||||
};
|
||||
|
||||
use polkadot_node_network_protocol::{
|
||||
peer_set::PeerSet,
|
||||
@@ -121,27 +124,23 @@ impl Network for Arc<NetworkService<Block, Hash>> {
|
||||
protocol: Cow<'static, str>,
|
||||
multiaddresses: HashSet<Multiaddr>,
|
||||
) -> Result<(), String> {
|
||||
sc_network::NetworkService::set_reserved_peers(&**self, protocol, multiaddresses)
|
||||
NetworkService::set_reserved_peers(&**self, protocol, multiaddresses)
|
||||
}
|
||||
|
||||
async fn remove_from_peers_set(&mut self, protocol: Cow<'static, str>, peers: Vec<PeerId>) {
|
||||
sc_network::NetworkService::remove_peers_from_reserved_set(&**self, protocol, peers);
|
||||
NetworkService::remove_peers_from_reserved_set(&**self, protocol, peers);
|
||||
}
|
||||
|
||||
fn report_peer(&self, who: PeerId, cost_benefit: Rep) {
|
||||
sc_network::NetworkService::report_peer(&**self, who, cost_benefit.into_base_rep());
|
||||
NetworkService::report_peer(&**self, who, cost_benefit.into_base_rep());
|
||||
}
|
||||
|
||||
fn disconnect_peer(&self, who: PeerId, peer_set: PeerSet) {
|
||||
sc_network::NetworkService::disconnect_peer(
|
||||
&**self,
|
||||
who,
|
||||
peer_set.into_default_protocol_name(),
|
||||
);
|
||||
NetworkService::disconnect_peer(&**self, who, peer_set.into_default_protocol_name());
|
||||
}
|
||||
|
||||
fn write_notification(&self, who: PeerId, peer_set: PeerSet, message: Vec<u8>) {
|
||||
sc_network::NetworkService::write_notification(
|
||||
NetworkService::write_notification(
|
||||
&**self,
|
||||
who,
|
||||
peer_set.into_default_protocol_name(),
|
||||
|
||||
@@ -236,7 +236,7 @@ impl TestSyncOracleHandle {
|
||||
}
|
||||
|
||||
impl SyncOracle for TestSyncOracle {
|
||||
fn is_major_syncing(&mut self) -> bool {
|
||||
fn is_major_syncing(&self) -> bool {
|
||||
let is_major_syncing = self.is_major_syncing.load(Ordering::SeqCst);
|
||||
|
||||
if !is_major_syncing {
|
||||
@@ -248,7 +248,7 @@ impl SyncOracle for TestSyncOracle {
|
||||
is_major_syncing
|
||||
}
|
||||
|
||||
fn is_offline(&mut self) -> bool {
|
||||
fn is_offline(&self) -> bool {
|
||||
unimplemented!("not used in network bridge")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "mast
|
||||
sc-consensus-slots = { 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-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-sync-state-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
@@ -988,6 +988,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;
|
||||
|
||||
let authority_discovery_role = if role.is_authority() {
|
||||
sc_authority_discovery::Role::PublishAndDiscover(keystore_container.keystore())
|
||||
|
||||
@@ -39,6 +39,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 sp_api::ProvideRuntimeApi;
|
||||
use sp_blockchain::HeaderBackend;
|
||||
use sp_consensus_babe::BabeApi;
|
||||
|
||||
@@ -45,6 +45,7 @@ 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, features = [ "wasmtime" ] }
|
||||
|
||||
@@ -41,6 +41,7 @@ use sc_network::{
|
||||
config::{NetworkConfiguration, TransportConfig},
|
||||
multiaddr,
|
||||
};
|
||||
use sc_network_common::service::NetworkStateInfo;
|
||||
use sc_service::{
|
||||
config::{
|
||||
DatabaseSource, KeystoreConfig, MultiaddrWithPeerId, WasmExecutionMethod,
|
||||
|
||||
Reference in New Issue
Block a user