Commit 1c851903 authored by vyzo's avatar vyzo

make p4 quadratic

parent 883f8b8c
......@@ -219,7 +219,7 @@ func (ps *peerScore) score(p peer.ID) float64 {
// P4: invalid messages
// NOTE: the weight of P4 is negative (validated in TopicScoreParams.validate), so this detracts.
p4 := tstats.invalidMessageDeliveries
p4 := (tstats.invalidMessageDeliveries * tstats.invalidMessageDeliveries)
topicScore += p4 * topicParams.InvalidMessageDeliveriesWeight
// update score, mixing with topic weight
......
......@@ -139,7 +139,8 @@ type TopicScoreParams struct {
// P4: invalid messages
// This is the number of invalid messages in the topic.
// The value of the parameter is a counter, decaying with InvalidMessageDeliveriesDecay.
// The value of the parameter is the square of the counter, decaying with
// InvalidMessageDeliveriesDecay.
// The weight of the parameter MUST be negative (or zero to disable).
InvalidMessageDeliveriesWeight, InvalidMessageDeliveriesDecay float64
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment