-
Notifications
You must be signed in to change notification settings - Fork 186
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
Enables non-atomic validation for peer scoring parameters #499
Merged
vyzo
merged 9 commits into
libp2p:master
from
yhassanzadeh13:yahya/peer-scoring-param-setters
Sep 8, 2022
Merged
Enables non-atomic validation for peer scoring parameters #499
vyzo
merged 9 commits into
libp2p:master
from
yhassanzadeh13:yahya/peer-scoring-param-setters
Sep 8, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vyzo
approved these changes
Sep 8, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a pretty good solution i would day.
yhassanzadeh13
added a commit
to yhassanzadeh13/go-libp2p-pubsub
that referenced
this pull request
Oct 28, 2022
* Enables non-atomic validation for peer scoring parameters (libp2p#499) * decouples topic scoring parameters * adds skiping atomic validation for topic parameters * cleans up * adds skip atomic validation to peer score threshold * adds skip atomic validation for peer parameters * adds test for non-atomic validation * adds tests for peer score * adds tests for peer score thresholds * refactors tests * chore: Update .github/workflows/stale.yml [skip ci] * adds with gossipsub tracker Co-authored-by: libp2p-mgmt-read-write[bot] <104492852+libp2p-mgmt-read-write[bot]@users.noreply.github.com>
lthibault
pushed a commit
to lthibault/go-libp2p-pubsub
that referenced
this pull request
Nov 5, 2022
* decouples topic scoring parameters * adds skiping atomic validation for topic parameters * cleans up * adds skip atomic validation to peer score threshold * adds skip atomic validation for peer parameters * adds test for non-atomic validation * adds tests for peer score * adds tests for peer score thresholds * refactors tests
vyzo
pushed a commit
that referenced
this pull request
Dec 1, 2022
* Update go.mod * Refactor GossipSub Construction (#1) * Enables non-atomic validation for peer scoring parameters (#499) * decouples topic scoring parameters * adds skiping atomic validation for topic parameters * cleans up * adds skip atomic validation to peer score threshold * adds skip atomic validation for peer parameters * adds test for non-atomic validation * adds tests for peer score * adds tests for peer score thresholds * refactors tests * chore: Update .github/workflows/stale.yml [skip ci] * adds with gossipsub tracker Co-authored-by: libp2p-mgmt-read-write[bot] <104492852+libp2p-mgmt-read-write[bot]@users.noreply.github.com> * decouples options * fixes conflict * reverts back module * fixes peer score helper * Adds send control message to gossipsub router (#2) * adjusts libp2p version (#3) * Update go.mod (#4) * adds app specific rpc handler * Create ci.yml (#5) * Create Makefile (#7) * Revert "Merge branch 'yahya/gossipsub-router-interface'" (#6) This reverts commit 1c91995. * Update ci.yml (#9) * Revert "Merge branch 'master' into yahya/adds-rpc-inspector" This reverts commit 352d747. * Revert "Merge remote-tracking branch 'origin/yahya/adds-rpc-inspector' into yahya/adds-rpc-inspector" This reverts commit 586c5cb. * Revert "Merge branch 'master' into yahya/adds-rpc-inspector" This reverts commit 2e13ee8. * moves app specific inspector to pubsub * removes option from gossipsub * moves app specific rpc inspector up * refactors app specific to return an error Co-authored-by: libp2p-mgmt-read-write[bot] <104492852+libp2p-mgmt-read-write[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the context of peer scoring, looking at how the parameters and thresholds are currently set at GossipSub, leaving some parameters unset, yields an error upon initialization of the GossipSub. For some applications and experimentations, we need to selectively set some of the parameters, e.g., only enabling staked participation in a permission setup. However, individual configuration of the scoring parameters is not feasible at the current state of GossipSub without setting all parameters and threshold values at their valid range. Missing even one parameter with a valid configuration fails the GossipSub instantiation.
This PR enables non-atomic validation mode for the parameters and thresholds related to the peer scoring by adding a
SkipAtomicValidation
member field to the parameters and thresholds struct. By default, this variable is evaluated asfalse
, i.e., zero value forbool
data type.!SkipAtomicValidation
indicates an atomic mode for validating thresholds and parameters which means all values must be set at their valid ranges. This is synonymous to how the validation is currently done at GossipSub. On the other hand,SkipAtomicValidation
indicates a non-atomic mode for validating thresholds and parameters, which relaxes the validation criteria by allowing the application developer to selectively set some of the parameters and threshold values.In contrast to the atomic validation mode which imposes all parameters and thresholds having a valid value, in the non-atomic mode, the parameters and thresholds can be left at their default (i.e., Golang zero) values as long as either all or none of the parameters related to the same context are set (e.g., mesh failure).