Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix initialisation bug
  • Loading branch information
AgeManning committed Dec 4, 2023
commit 52eb9a810d03a79a1b8e6ae1d9a9d51692b37779
4 changes: 4 additions & 0 deletions protocols/gossipsub/src/behaviour/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2535,6 +2535,10 @@ fn test_only_send_nonnegative_scoring_peers_in_px() {

#[test]
fn test_do_not_gossip_to_peers_below_gossip_threshold() {
use tracing_subscriber::EnvFilter;
let _ = tracing_subscriber::fmt()
.with_env_filter(EnvFilter::from_default_env())
.try_init();
let config = Config::default();
let peer_score_params = PeerScoreParams::default();
let peer_score_thresholds = PeerScoreThresholds {
Expand Down
4 changes: 2 additions & 2 deletions protocols/gossipsub/src/peer_score.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl Default for PeerStats {
known_ips: HashSet::new(),
behaviour_penalty: 0f64,
application_score: 0f64,
slow_peer_penalty: 6f64,
slow_peer_penalty: 0f64,
}
}
}
Expand Down Expand Up @@ -476,7 +476,7 @@ impl PeerScore {
pub(crate) fn expired_message(&mut self, peer_id: &PeerId) {
if let Some(peer_stats) = self.peer_stats.get_mut(peer_id) {
peer_stats.slow_peer_penalty += 1.0;
tracing::trace!(peer=%peer_id, %peer_stats.slow_peer_penalty, "Added another count to slow peer score.");
tracing::debug!(peer=%peer_id, %peer_stats.slow_peer_penalty, "[Penalty] Expired message penalty.");
}
}

Expand Down