-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Refactor validator roles into an array #4081
Conversation
validator/client/validator.go
Outdated
switch { | ||
case assignment == nil: | ||
role = pb.ValidatorRole_UNKNOWN | ||
roles = append(roles, pb.ValidatorRole_UNKNOWN) | ||
case assignment.ProposerSlot == slot && assignment.AttesterSlot == slot: |
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.
You can remove this case all together
Co-Authored-By: Preston Van Loon <preston@prysmaticlabs.com>
Codecov Report
@@ Coverage Diff @@
## master #4081 +/- ##
==========================================
- Coverage 21.54% 16.49% -5.05%
==========================================
Files 167 82 -85
Lines 10899 4923 -5976
==========================================
- Hits 2348 812 -1536
+ Misses 8249 4007 -4242
+ Partials 302 104 -198 |
Co-Authored-By: Preston Van Loon <preston@prysmaticlabs.com>
…iclabs/prysm into refactor-validator-roles
validator/client/validator.go
Outdated
var roles []pb.ValidatorRole | ||
|
||
if assignment == nil { | ||
roles = append(roles, pb.ValidatorRole_UNKNOWN) |
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 we can just leave it empty? No need to insert UNKNOWN when an empty roles array means no work to do
Previously we have roles defined in PB as
attester
,proposer
andboth
. This becomes not extensible as we introduce more roles. This PR refactors to validator client treat these roles as an array.Before:
pb.Both // attester and proposer both assigned to slot N
After:
[]pb.Roles{pb.Attester, pb.Proposer} // attester and proposer both assigned to slot N