fix metric for exited validator (#13379)

Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
This commit is contained in:
Brandon Liu 2024-01-10 06:15:53 +08:00 committed by GitHub
parent 7e65378f63
commit c41a54be9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -582,6 +582,11 @@ func (v *validator) UpdateDuties(ctx context.Context, slot primitives.Slot) erro
return err
}
v.dutiesLock.Lock()
v.duties = resp
v.logDuties(slot, v.duties.CurrentEpochDuties, v.duties.NextEpochDuties)
v.dutiesLock.Unlock()
allExitedCounter := 0
for i := range resp.CurrentEpochDuties {
if resp.CurrentEpochDuties[i].Status == ethpb.ValidatorStatus_EXITED {
@ -592,11 +597,6 @@ func (v *validator) UpdateDuties(ctx context.Context, slot primitives.Slot) erro
return ErrValidatorsAllExited
}
v.dutiesLock.Lock()
v.duties = resp
v.logDuties(slot, v.duties.CurrentEpochDuties, v.duties.NextEpochDuties)
v.dutiesLock.Unlock()
// Non-blocking call for beacon node to start subscriptions for aggregators.
// Make sure to copy metadata into a new context
md, exists := metadata.FromOutgoingContext(ctx)