-
Notifications
You must be signed in to change notification settings - Fork 24
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
Value check for beacon vote fix #471
base: dev
Are you sure you want to change the base?
Conversation
* Filter shares for slot `CommitteeRunner` based on validators that have duty for that slot. * Filter duty and create share map according to owned validators * Add test: start duty with no shares for duty's validators * Add test: happy flow for committee with fraction of duty's validators * Generate JSON tests * Apply suggestions --------- Co-authored-by: MatheusFranco99 <[email protected]>
Closes #437 |
ssv/value_check.go
Outdated
duties := duty.ValidatorDuties | ||
slashablePublicKeys := []types.ShareValidatorPK{} | ||
for _, duty := range duties { |
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.
duty
variable is already defined, shadowing it with another variable is confusing and error prone. Also duties
is only used one time so no real reason to declare a var.
duties := duty.ValidatorDuties | |
slashablePublicKeys := []types.ShareValidatorPK{} | |
for _, duty := range duties { | |
slashablePublicKeys := []types.ShareValidatorPK{} | |
for _, vduty := range duty.ValidatorDuties { |
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.
I think this change complicates stuff, what was wrong with leaving the previous BeaconVoteValueCheck
and requiring the caller to pass in only slashable validators? this simple check can be done outside, its encapsulating and hiding the fact that not all ValidatorDuties
in CommitteeDuty
are slashable.
I also don't think the creation of ValueCheckF should be aware of a specific duty like here, its a dramatic change comparing to how all other value checks work.
In implementation, we are already filtering the slashable validators before passing in to the value check today, IMO spec should do the same and do the filtering in committee.go
:StartDuty
function (which passes validators to the value check) instead of encapsulating it here.
@y0sher Currently you may notice that besides testing code, nothing calls the I think the biggest issue at the moment is that before the same Do note it is not good to pass I wasn't sure how to solve this issue before. I have an idea now though... In P.S.
Another reminder: |
if you don't want to do it in I think its best to separate the logic for valuecheck, it should only do value check and not filtering/other stuff. or at least make it visible and noticeable in the name of the function that it's not just value check. |
@y0sher |
Description
The beacon vote value check is now being constructed with clear parameters