Skip to content

Commit

Permalink
Wait for one third before grabbing the lock (#8348)
Browse files Browse the repository at this point in the history
  • Loading branch information
terencechain committed Jan 27, 2021
1 parent 2f063d0 commit b8037b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions validator/client/attest.go
Expand Up @@ -31,6 +31,9 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot uint64, pubKey [
ctx, span := trace.StartSpan(ctx, "validator.SubmitAttestation")
defer span.End()
span.AddAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey)))

v.waitOneThirdOrValidBlock(ctx, slot)

lock := mputil.NewMultilock(string(pubKey[:]))
lock.Lock()
defer lock.Unlock()
Expand All @@ -50,8 +53,6 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot uint64, pubKey [
return
}

v.waitOneThirdOrValidBlock(ctx, slot)

req := &ethpb.AttestationDataRequest{
Slot: slot,
CommitteeIndex: duty.CommitteeIndex,
Expand Down

0 comments on commit b8037b0

Please sign in to comment.