-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement threshold for the intersection of lists of validators #5112
Implement threshold for the intersection of lists of validators #5112
Conversation
21fac7d
to
9e85a73
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #5112 +/- ##
=======================================
Coverage 78.0% 78.0%
=======================================
Files 789 789
Lines 66952 67007 +55
Branches 8110 8108 -2
=======================================
+ Hits 52214 52277 +63
+ Misses 14738 14730 -8
|
9d2ad80
to
98fa5e8
Compare
923d59a
to
9c58d75
Compare
9c58d75
to
32fee9e
Compare
32fee9e
to
22f73da
Compare
22f73da
to
57b451c
Compare
2e7e9c1
to
544d0ab
Compare
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.
Looks good overall. I just left a few small suggestions, questions, and comments.
Co-authored-by: Ed Hennis <[email protected]>
Co-authored-by: Ed Hennis <[email protected]>
2acb897
to
11ce42e
Compare
Co-authored-by: Ed Hennis <[email protected]>
8e3c4a4
to
9f7f1fe
Compare
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.
Looks good!
Proposed merge message
|
9c9183e
to
3e651a3
Compare
High Level Overview of Change
Improve UNL security by allowing validators to set a minimum number of UNL publishers to agree on validators
Context of Change
In the current system, every node builds an internal list of validators to use, by performing union of UNLs received from all configured UNL publishers (validator lists), where the authenticity of each single UNL is verified by a manifest with a known master key.
This union is a weak security spot of the UNL publication system, as it allows a single UNL publisher to add an arbitrary number of validators, which will be subsequently used by all nodes trusting this UNL publisher. Currently the risk is managed by recommending only the use of two UNL publishers: vl.xrplf.org and vl.ripple.com . With this union approach, a hypothetical addition of a third (or more) UNL publisher would only increase the attack surface, in this way (counterintuitively) degrading the UNL system security.
This PR is replacing union with a configurable intersection threshold between UNL publishers, which by default is calculated as:
This means that for a default 2 UNL publishers, the default threshold will be 1. Since "intersection of 1 sets" is not an intersection (it's an union) this makes the default behaviour (for one or two UNL publishers) identical to the current union system.
If a node configuration contains a third UNL publisher, the default threshold will be calculated as
floor(3 / 2) + 1
, that is1 + 1
that is 2. This means that, for 3 validator lists, the node will only use validators which are present on 2 or more lists (and will silently ignore validators which are on one list only).If the configured validator list contains 4 or 5 publishers, the default threshold will be 3. If the configured validator list contains 6 or 7 publishers, the default threshold will be 4 etc.
This PR adds an optional configuration option
[validator_list_threshold]
tovalidators.txt
which can be explicitly set to the minimum number of the lists on which a validator must be listed in order to be used (this number must not be greater than the size of[validator_list_keys]
). If it is not set, or set to 0, the value will be calculated at startup from the size of[validator_list_keys]
as explained above.The actually used threshold value will be also displayed in the output of validators RPC method (alongside with the used list of validators, and the content of each configured validator list, as is the current output).
This change is not altering the list of the default UNL publishers. The intent of this PR is to make it safe to extend this list in the future.
The security problems of the union UNL publication system were originally described by @mDuo13 and the idea to use intersection of validator lists as a solution came from @ximinez
Type of Change
.gitignore
, formatting, dropping support for older tooling)API Impact
Add new value
validator_list_threshold
to the output from validators RPC methodAdd new (optional) section
[validator_list_threshold]
to validators file.libxrpl
change (any change that may affectlibxrpl
or dependents oflibxrpl
)