mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-23 11:57:18 +00:00
Empty Committee Check in Submit Attestation (#5672)
* empty committee check * Merge refs/heads/master into validator-id-errs
This commit is contained in:
parent
94155191b7
commit
3b2c514c06
@ -67,6 +67,10 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot uint64, pubKey [
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if len(duty.Committee) == 0 {
|
||||||
|
log.Debug("Empty committee for validator duty, not attesting")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
v.waitToSlotOneThird(ctx, slot)
|
v.waitToSlotOneThird(ctx, slot)
|
||||||
|
|
||||||
|
@ -31,7 +31,23 @@ func TestRequestAttestation_ValidatorDutiesRequestFailure(t *testing.T) {
|
|||||||
testutil.AssertLogsContain(t, hook, "Could not fetch validator assignment")
|
testutil.AssertLogsContain(t, hook, "Could not fetch validator assignment")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAttestToBlockHead_SubmitAttestationRequestFailure(t *testing.T) {
|
func TestAttestToBlockHead_SubmitAttestation_EmptyCommittee(t *testing.T) {
|
||||||
|
hook := logTest.NewGlobal()
|
||||||
|
|
||||||
|
validator, _, finish := setup(t)
|
||||||
|
defer finish()
|
||||||
|
validator.duties = ðpb.DutiesResponse{Duties: []*ethpb.DutiesResponse_Duty{
|
||||||
|
{
|
||||||
|
PublicKey: validatorKey.PublicKey.Marshal(),
|
||||||
|
CommitteeIndex: 0,
|
||||||
|
Committee: make([]uint64, 0),
|
||||||
|
ValidatorIndex: 0,
|
||||||
|
}}}
|
||||||
|
validator.SubmitAttestation(context.Background(), 0, validatorPubKey)
|
||||||
|
testutil.AssertLogsContain(t, hook, "Empty committee")
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestAttestToBlockHead_SubmitAttestation_RequestFailure(t *testing.T) {
|
||||||
hook := logTest.NewGlobal()
|
hook := logTest.NewGlobal()
|
||||||
|
|
||||||
validator, m, finish := setup(t)
|
validator, m, finish := setup(t)
|
||||||
|
Loading…
Reference in New Issue
Block a user