mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-24 20:37:17 +00:00
Fix assignments bug where validators don't retry for assignments on failure (#2000)
This commit is contained in:
parent
f1d77a816e
commit
5ddf367291
@ -139,6 +139,7 @@ func (v *validator) UpdateAssignments(ctx context.Context, slot uint64) error {
|
||||
|
||||
resp, err := v.validatorClient.CommitteeAssignment(ctx, req)
|
||||
if err != nil {
|
||||
v.assignment = nil // Clear assignments so we know to retry the request.
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -283,6 +283,7 @@ func TestUpdateAssignments_ReturnsError(t *testing.T) {
|
||||
v := validator{
|
||||
key: validatorKey,
|
||||
validatorClient: client,
|
||||
assignment: &pb.CommitteeAssignmentResponse{Shard: 1},
|
||||
}
|
||||
|
||||
expected := errors.New("bad")
|
||||
@ -295,6 +296,9 @@ func TestUpdateAssignments_ReturnsError(t *testing.T) {
|
||||
if err := v.UpdateAssignments(context.Background(), params.BeaconConfig().SlotsPerEpoch); err != expected {
|
||||
t.Errorf("Bad error; want=%v got=%v", expected, err)
|
||||
}
|
||||
if v.assignment != nil {
|
||||
t.Error("Assignments should have been cleared on failure")
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpdateAssignments_OK(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user