From 2162ea72dc2e7a2df8cd8102cca76b214d532a1a Mon Sep 17 00:00:00 2001 From: Karl Knutsson Date: Fri, 12 Jan 2024 09:43:58 +0100 Subject: [PATCH] Disable mean reward for new peers Newly added peers where given a boost up to the mean score. That gives too much of a bonus for them which means that they can out compete usefull, but not top performing peers. The code is commented out and the reward set to zero for now. In the future we can decide what, if any, reward should be given to new peers. --- ouroboros-network/CHANGELOG.md | 2 ++ .../src/Ouroboros/Network/PeerSelection/PeerMetric.hs | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ouroboros-network/CHANGELOG.md b/ouroboros-network/CHANGELOG.md index bd4ccf01e5..5828a1a1c7 100644 --- a/ouroboros-network/CHANGELOG.md +++ b/ouroboros-network/CHANGELOG.md @@ -52,6 +52,8 @@ * Fix hot demototion by having blockfetch give chainsync a chance to exit cleanly before killing it. +* Disable mean reward for new peers + ## 0.11.0.0 -- 2023-01-22 ### Breaking changes diff --git a/ouroboros-network/src/Ouroboros/Network/PeerSelection/PeerMetric.hs b/ouroboros-network/src/Ouroboros/Network/PeerSelection/PeerMetric.hs index 38b2bd20cb..80a8ed86bb 100644 --- a/ouroboros-network/src/Ouroboros/Network/PeerSelection/PeerMetric.hs +++ b/ouroboros-network/src/Ouroboros/Network/PeerSelection/PeerMetric.hs @@ -595,7 +595,8 @@ adjustAvg :: PeerMetricsConfiguration -> SlotNo -- ^ current slot -> Int -> Int -adjustAvg PeerMetricsConfiguration { maxEntriesToTrack } minSlotNo joinedSlotNo lastSlotNo avg +adjustAvg _ _ _ _ _ = 0 +{-adjustAvg PeerMetricsConfiguration { maxEntriesToTrack } minSlotNo joinedSlotNo lastSlotNo avg -- when there are only a few results in the 'PeerMetricsState' we don't -- take into account the average. This allows the system to start, without -- penalising the peers which we connected to early. @@ -613,4 +614,4 @@ adjustAvg PeerMetricsConfiguration { maxEntriesToTrack } minSlotNo joinedSlotNo minSlot, lastSlot, joinedSlot :: Int minSlot = maybe 1 slotToInt minSlotNo lastSlot = slotToInt lastSlotNo - joinedSlot = slotToInt joinedSlotNo + joinedSlot = slotToInt joinedSlotNo -}