File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 5
5
- Remove ` Rpc ` from the public API.
6
6
See [ PR 6091] ( https://github.com/libp2p/rust-libp2p/pull/6091 )
7
7
8
+ - Report peers with Low scores.
9
+ See [ PR XXXX] ( https://github.com/libp2p/rust-libp2p/pull/6091 )
10
+
8
11
## 0.49.2
9
12
10
13
- Relax ` Behaviour::with_metrics ` requirements, do not require DataTransform and TopicSubscriptionFilter to also impl Default
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ pub enum Event {
165
165
failed_messages : FailedMessages ,
166
166
} ,
167
167
/// A Peer is below the score threshold.
168
- LowScorePeers { peer_ids : Vec < PeerId > } ,
168
+ BelowThresholdPeers { peer_ids : Vec < PeerId > } ,
169
169
}
170
170
171
171
/// A data structure for storing configuration for publishing messages. See [`MessageAuthenticity`]
@@ -2178,7 +2178,7 @@ where
2178
2178
2179
2179
if !peers_to_report. is_empty ( ) {
2180
2180
self . events
2181
- . push_back ( ToSwarm :: GenerateEvent ( Event :: LowScorePeers {
2181
+ . push_back ( ToSwarm :: GenerateEvent ( Event :: BelowThresholdPeers {
2182
2182
peer_ids : peers_to_report,
2183
2183
} ) ) ;
2184
2184
}
Original file line number Diff line number Diff line change @@ -6826,11 +6826,16 @@ fn test_low_score_peer_is_reported() {
6826
6826
let low_score_event = gs
6827
6827
. events
6828
6828
. iter ( )
6829
- . find ( |event| matches ! ( event, ToSwarm :: GenerateEvent ( Event :: LowScorePeers { .. } ) ) )
6829
+ . find ( |event| {
6830
+ matches ! (
6831
+ event,
6832
+ ToSwarm :: GenerateEvent ( Event :: BelowThresholdPeers { .. } )
6833
+ )
6834
+ } )
6830
6835
. unwrap ( ) ;
6831
6836
6832
6837
match low_score_event {
6833
- ToSwarm :: GenerateEvent ( Event :: LowScorePeers { peer_ids } ) => {
6838
+ ToSwarm :: GenerateEvent ( Event :: BelowThresholdPeers { peer_ids } ) => {
6834
6839
assert_eq ! ( peer_ids. len( ) , 2 ) ;
6835
6840
assert ! ( peer_ids. contains( & peers[ 0 ] ) ) ;
6836
6841
assert ! ( peer_ids. contains( & peers[ 1 ] ) ) ;
You can’t perform that action at this time.
0 commit comments