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
+3 -3
View File
@@ -40,7 +40,7 @@ use sc_network::{
FullNetworkConfiguration, NonDefaultSetConfig, ProtocolId, SyncMode as SyncOperationMode,
},
utils::LruHashSet,
NotificationsSink, ProtocolName,
NotificationsSink, ProtocolName, ReputationChange,
};
use sc_network_common::{
role::Roles,
@@ -94,7 +94,7 @@ const INACTIVITY_EVICT_THRESHOLD: Duration = Duration::from_secs(30);
const INITIAL_EVICTION_WAIT_PERIOD: Duration = Duration::from_secs(2 * 60);
mod rep {
use sc_peerset::ReputationChange as Rep;
use sc_network::ReputationChange as Rep;
/// Peer has different genesis.
pub const GENESIS_MISMATCH: Rep = Rep::new_fatal("Genesis mismatch");
/// Peer send us a block announcement that failed at validation.
@@ -719,7 +719,7 @@ where
.disconnect_peer(peer, self.block_announce_protocol_name.clone());
self.network_service.report_peer(
peer,
sc_peerset::ReputationChange::new_fatal("Invalid justification"),
ReputationChange::new_fatal("Invalid justification"),
);
}
},