Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-pubsub
Commits
1c851903
Commit
1c851903
authored
May 08, 2020
by
vyzo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make p4 quadratic
parent
883f8b8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
score.go
score.go
+1
-1
score_params.go
score_params.go
+2
-1
No files found.
score.go
View file @
1c851903
...
...
@@ -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
...
...
score_params.go
View file @
1c851903
...
...
@@ -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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment