mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-07 07:13:13 +00:00
finetune sticky mesh failure penalty parameter
This commit is contained in:
parent
f40b06e515
commit
48b7d01113
7
score.go
7
score.go
@ -383,8 +383,11 @@ func (ps *peerScore) Prune(p peer.ID, topic string) {
|
||||
return
|
||||
}
|
||||
|
||||
if tstats.meshMessageDeliveriesActive && tstats.meshMessageDeliveries < ps.params.Topics[topic].MeshMessageDeliveriesThreshold {
|
||||
tstats.meshFailurePenalty += 1
|
||||
// sticky mesh delivery rate failure penalty
|
||||
threshold := ps.params.Topics[topic].MeshMessageDeliveriesThreshold
|
||||
if tstats.meshMessageDeliveriesActive && tstats.meshMessageDeliveries < threshold {
|
||||
deficit := threshold - tstats.meshMessageDeliveries
|
||||
tstats.meshFailurePenalty += deficit * deficit
|
||||
}
|
||||
|
||||
tstats.inMesh = false
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user