From 7db6791d9db59f8c4c72d183601b4ccfcdb69c91 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 18 Jan 2023 17:27:14 +0100 Subject: [PATCH] perf: tighten reputation change units (#916) --- crates/net/network/src/peers/reputation.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/net/network/src/peers/reputation.rs b/crates/net/network/src/peers/reputation.rs index b3a2b2a057..6f476c472b 100644 --- a/crates/net/network/src/peers/reputation.rs +++ b/crates/net/network/src/peers/reputation.rs @@ -10,19 +10,19 @@ pub(crate) const DEFAULT_REPUTATION: Reputation = 0; const REPUTATION_UNIT: i32 = -1024; /// The reputation value below which new connection from/to peers are rejected. -pub(crate) const BANNED_REPUTATION: i32 = 100 * REPUTATION_UNIT; +pub(crate) const BANNED_REPUTATION: i32 = 50 * REPUTATION_UNIT; /// The reputation change to apply to a peer that dropped the connection. const REMOTE_DISCONNECT_REPUTATION_CHANGE: i32 = 4 * REPUTATION_UNIT; /// The reputation change to apply to a peer that we failed to connect to. -const FAILED_TO_CONNECT_REPUTATION_CHANGE: i32 = 24 * REPUTATION_UNIT; +const FAILED_TO_CONNECT_REPUTATION_CHANGE: i32 = 25 * REPUTATION_UNIT; /// The reputation change to apply to a peer that failed to respond in time. -const TIMEOUT_REPUTATION_CHANGE: i32 = REPUTATION_UNIT; +const TIMEOUT_REPUTATION_CHANGE: i32 = 4 * REPUTATION_UNIT; /// The reputation change to apply to a peer that sent a bad message. -const BAD_MESSAGE_REPUTATION_CHANGE: i32 = 8 * REPUTATION_UNIT; +const BAD_MESSAGE_REPUTATION_CHANGE: i32 = 16 * REPUTATION_UNIT; /// The reputation change to apply to a peer which violates protocol rules: minimal reputation const BAD_PROTOCOL_REPUTATION_CHANGE: i32 = i32::MIN;