mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-02 12:53:09 +00:00
make p4 quadratic
This commit is contained in:
parent
883f8b8c92
commit
1c85190323
2
score.go
2
score.go
@ -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
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user