mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-13 10:25:50 +00:00
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:
@@ -91,7 +91,7 @@ use parity_scale_codec::{Decode, Encode};
|
||||
use prometheus_endpoint::{register, CounterVec, Opts, PrometheusError, Registry, U64};
|
||||
use rand::seq::SliceRandom;
|
||||
use sc_network::{PeerId, ReputationChange};
|
||||
use sc_network_common::protocol::role::ObservedRole;
|
||||
use sc_network_common::role::ObservedRole;
|
||||
use sc_network_gossip::{MessageIntent, ValidatorContext};
|
||||
use sc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG};
|
||||
use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender};
|
||||
@@ -820,7 +820,7 @@ impl<Block: BlockT> Inner<Block> {
|
||||
fn note_set(&mut self, set_id: SetId, authorities: Vec<AuthorityId>) -> MaybeMessage<Block> {
|
||||
let local_view = match self.local_view {
|
||||
ref mut x @ None => x.get_or_insert(LocalView::new(set_id, Round(1))),
|
||||
Some(ref mut v) =>
|
||||
Some(ref mut v) => {
|
||||
if v.set_id == set_id {
|
||||
let diff_authorities = self.authorities.iter().collect::<HashSet<_>>() !=
|
||||
authorities.iter().collect::<HashSet<_>>();
|
||||
@@ -841,7 +841,8 @@ impl<Block: BlockT> Inner<Block> {
|
||||
return None
|
||||
} else {
|
||||
v
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
local_view.update_set(set_id);
|
||||
|
||||
@@ -46,7 +46,7 @@ use finality_grandpa::{
|
||||
Message::{Precommit, Prevote, PrimaryPropose},
|
||||
};
|
||||
use parity_scale_codec::{Decode, Encode};
|
||||
use sc_network::ReputationChange;
|
||||
use sc_network::{NetworkBlock, NetworkSyncForkRequest, ReputationChange};
|
||||
use sc_network_gossip::{GossipEngine, Network as GossipNetwork};
|
||||
use sc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG, CONSENSUS_INFO};
|
||||
use sp_keystore::SyncCryptoStorePtr;
|
||||
@@ -59,10 +59,7 @@ use crate::{
|
||||
use gossip::{
|
||||
FullCatchUpMessage, FullCommitMessage, GossipMessage, GossipValidator, PeerReport, VoteMessage,
|
||||
};
|
||||
use sc_network_common::{
|
||||
service::{NetworkBlock, NetworkSyncForkRequest},
|
||||
sync::SyncEventStream,
|
||||
};
|
||||
use sc_network_common::sync::SyncEventStream;
|
||||
use sc_utils::mpsc::TracingUnboundedReceiver;
|
||||
use sp_consensus_grandpa::{AuthorityId, AuthoritySignature, RoundNumber, SetId as SetIdNumber};
|
||||
|
||||
@@ -77,7 +74,7 @@ pub(crate) const NEIGHBOR_REBROADCAST_PERIOD: Duration = Duration::from_secs(2 *
|
||||
|
||||
pub mod grandpa_protocol_name {
|
||||
use sc_chain_spec::ChainSpec;
|
||||
use sc_network_common::protocol::ProtocolName;
|
||||
use sc_network::types::ProtocolName;
|
||||
|
||||
pub(crate) const NAME: &str = "/grandpa/1";
|
||||
/// Old names for the notifications protocol, used for backward compatibility.
|
||||
|
||||
@@ -25,14 +25,16 @@ use super::{
|
||||
use crate::{communication::grandpa_protocol_name, environment::SharedVoterSetState};
|
||||
use futures::prelude::*;
|
||||
use parity_scale_codec::Encode;
|
||||
use sc_network::{config::Role, Multiaddr, PeerId, ReputationChange};
|
||||
use sc_network::{
|
||||
config::{MultiaddrWithPeerId, Role},
|
||||
event::Event as NetworkEvent,
|
||||
types::ProtocolName,
|
||||
Multiaddr, NetworkBlock, NetworkEventStream, NetworkNotification, NetworkPeers,
|
||||
NetworkSyncForkRequest, NotificationSenderError, NotificationSenderT as NotificationSender,
|
||||
PeerId, ReputationChange,
|
||||
};
|
||||
use sc_network_common::{
|
||||
config::MultiaddrWithPeerId,
|
||||
protocol::{event::Event as NetworkEvent, role::ObservedRole, ProtocolName},
|
||||
service::{
|
||||
NetworkBlock, NetworkEventStream, NetworkNotification, NetworkPeers,
|
||||
NetworkSyncForkRequest, NotificationSender, NotificationSenderError,
|
||||
},
|
||||
role::ObservedRole,
|
||||
sync::{SyncEvent as SyncStreamEvent, SyncEventStream},
|
||||
};
|
||||
use sc_network_gossip::Validator;
|
||||
|
||||
Reference in New Issue
Block a user