Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protocols/gossipsub: Allow score buckets to be set by the user and/or adjusted from the scoring thresholds #2595

Merged
merged 5 commits into from
Apr 8, 2022

Conversation

divagant-martian
Copy link
Contributor

Moves the score buckets to the metrics configuration, setting the same defaults as what we had but also allowing the user to pass a reference to the score thresholds to create them from that. Having them in the config also allows users to set them directly

/// Create buckets for the score histograms based on score thresholds.
pub fn buckets_using_scoring_thresholds(&mut self, params: &crate::PeerScoreThresholds) {
self.score_buckets = vec![
params.graylist_threshold,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure how valuable values calculated based on the bucket values are if the buckets themselves don't follow some consistent distribution. Would it not make sense to take the smallest of all the values and do an exponential distribution to the max value (100.0)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably know best from your current measurements. How well does the histogram mirror real world values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value here is to understand how often nodes are treated in a special way because they have passed the thresholds, more than to understand the distribution of scores itself. In a way is more a measure of network health/score param behaviour than a measure of the scores

protocols/gossipsub/CHANGELOG.md Outdated Show resolved Hide resolved
@mxinden mxinden changed the title Allow score buckets to be set by the user and/or adjusted from the scoring thresholds protocols/gossipsub: Allow score buckets to be set by the user and/or adjusted from the scoring thresholds Apr 8, 2022
@mxinden mxinden merged commit a1f3547 into libp2p:master Apr 8, 2022
@AgeManning AgeManning deleted the better-default-hist-buckets branch November 29, 2023 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants