-
Notifications
You must be signed in to change notification settings - Fork 44
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
Create ValidatorSet class #15
Comments
@naterush Let me know your thoughts on this. |
Some refactoring here seems like a great call - testing w/ Quick (possibly stupid) question - would this require safety oracles (and therefore validators) to be aware of the Other than that (which might be a non-issue, or just a bit complicated) this seems like a great change to me. Let me know what you think @djrtwo. |
Well the safety oracle already does know about the validator set by referencing the VALIDATOR_NAMES and WEIGHTS. But to answer your question in general -- yes, validators must be aware of the current validator set in a real life version of this consensus protocol, otherwise they could not make any rational decisions about anything really. The validator_set being known by the public at any given time is key to a number of aspects of bonded validator PoS systems. |
I think we should get testing merged in before a medium refactor like this, right? |
Sure, more so meant as an implementation detail - if this is going to require passing a reference to the current Yep, this seems like a good refactor once we get testing merged in. It relies on the oracle PRs (or at least one of them), as well. I should be able to clean up the testing branch and soon :) |
Safety oracle will need to have A validator is the one that would be using a safety oracle, right? And when they use that safety oracle, they would pass in the full validator_set. |
Have been thinking about this a bit - and there’s one more change that I think would be useful. The current way validator set changes are specified for CBC Casper is on a “by-block” level - so (ignoring efficiency for a second), each block defines the validator set that must finalize the next block. A natural way of implementing this might be having each block define a Also, the network would have a single |
@naterush Starting this today. I'll get a work in progress ([WIP]) PR up as soon as possible for initial review. |
Issue
We should consider moving the validator set initialization and variables out of settings.py and have it be its own class ValidatorSet.
Will be useful to have it as its own logical unit for when (if) we start simulating changes to the validator set. Will also be useful to be able to test different configurations of validators more easily (number of validators, distribution of weights, etc).
Proposed implementation
ValidatorSet
NUM_VALIDATORS
,VALIDATOR_NAMES
, etc) toValidatorSet
. These can be configured on__init__
.ValidatorSet
can have list (set?) ofValidator
s.Validator
.validator_set
onnetwork
.The text was updated successfully, but these errors were encountered: