Skip to content
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

GetDuties: Refactor assignment status to deduplicate status computation #8313

Merged
merged 1 commit into from Jan 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions beacon-chain/rpc/validator/assignments.go
Expand Up @@ -155,13 +155,15 @@ func (vs *Server) duties(ctx context.Context, req *ethpb.DutiesRequest) (*ethpb.
}
idx, ok := s.ValidatorIndexByPubkey(bytesutil.ToBytes48(pubKey))
if ok {
status := assignmentStatus(s, idx)

assignment.ValidatorIndex = idx
assignment.Status = assignmentStatus(s, idx)
assignment.Status = status
assignment.ProposerSlots = proposerIndexToSlots[idx]

// The next epoch has no lookup for proposer indexes.
nextAssignment.ValidatorIndex = idx
nextAssignment.Status = assignmentStatus(s, idx)
nextAssignment.Status = status

ca, ok := committeeAssignments[idx]
if ok {
Expand Down