Incorporate sc-peerset into sc-network (#14236)

This commit is contained in:
Dmitry Markin
2023-05-29 20:56:57 +03:00
committed by GitHub
parent b8bca85e9d
commit d4b2bf7394
40 changed files with 306 additions and 337 deletions
@@ -24,7 +24,6 @@ tracing = "0.1.29"
prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", path = "../../utils/prometheus" }
sc-network = { version = "0.10.0-dev", path = "../network/" }
sc-network-common = { version = "0.10.0-dev", path = "../network/common" }
sc-peerset = { version = "4.0.0-dev", path = "../peerset" }
sp-runtime = { version = "8.0.0", path = "../../primitives/runtime" }
[dev-dependencies]
@@ -21,9 +21,8 @@ use crate::{
Network, Syncing, Validator,
};
use sc_network::{event::Event, types::ProtocolName};
use sc_network::{event::Event, types::ProtocolName, ReputationChange};
use sc_network_common::sync::SyncEvent;
use sc_peerset::ReputationChange;
use futures::{
channel::mpsc::{channel, Receiver, Sender},
@@ -43,7 +43,7 @@ const REBROADCAST_INTERVAL: time::Duration = time::Duration::from_millis(750);
pub(crate) const PERIODIC_MAINTENANCE_INTERVAL: time::Duration = time::Duration::from_millis(1100);
mod rep {
use sc_peerset::ReputationChange as Rep;
use sc_network::ReputationChange as Rep;
/// Reputation change when a peer sends us a gossip message that we didn't know about.
pub const GOSSIP_SUCCESS: Rep = Rep::new(1 << 4, "Successful gossip");
/// Reputation change when a peer sends us a gossip message that we already knew about.
@@ -529,9 +529,8 @@ mod tests {
use sc_network::{
config::MultiaddrWithPeerId, event::Event, NetworkBlock, NetworkEventStream,
NetworkNotification, NetworkPeers, NotificationSenderError,
NotificationSenderT as NotificationSender,
NotificationSenderT as NotificationSender, ReputationChange,
};
use sc_peerset::ReputationChange;
use sp_runtime::{
testing::{Block as RawBlock, ExtrinsicWrapper, H256},
traits::NumberFor,