From c36f5a50221aa6f14871175fc7b66756c486574e Mon Sep 17 00:00:00 2001 From: terence tsao Date: Wed, 27 Jan 2021 08:41:52 -0800 Subject: [PATCH] Add role based lock --- validator/client/attest.go | 2 +- validator/client/propose.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/validator/client/attest.go b/validator/client/attest.go index 382aff2232cb..5e2ab99bbe9d 100644 --- a/validator/client/attest.go +++ b/validator/client/attest.go @@ -31,7 +31,7 @@ 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))) - lock := mputil.NewMultilock(string(pubKey[:])) + lock := mputil.NewMultilock(string(roleAttester), string(pubKey[:])) lock.Lock() defer lock.Unlock() diff --git a/validator/client/propose.go b/validator/client/propose.go index 09de7a094244..5cc70979ba41 100644 --- a/validator/client/propose.go +++ b/validator/client/propose.go @@ -38,7 +38,7 @@ func (v *validator) ProposeBlock(ctx context.Context, slot uint64, pubKey [48]by log.Debug("Assigned to genesis slot, skipping proposal") return } - lock := mputil.NewMultilock(string(pubKey[:])) + lock := mputil.NewMultilock(string(roleProposer), string(pubKey[:])) lock.Lock() defer lock.Unlock() ctx, span := trace.StartSpan(ctx, "validator.ProposeBlock")