Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add role based lock for validator #8347

Merged
merged 2 commits into from Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion validator/client/attest.go
Expand Up @@ -34,7 +34,7 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot uint64, pubKey [

v.waitOneThirdOrValidBlock(ctx, slot)

lock := mputil.NewMultilock(string(pubKey[:]))
lock := mputil.NewMultilock(string(roleAttester), string(pubKey[:]))
lock.Lock()
defer lock.Unlock()

Expand Down
2 changes: 1 addition & 1 deletion validator/client/propose.go
Expand Up @@ -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")
Expand Down