optimistic sig share creation for managed keys#7831
optimistic sig share creation for managed keys#7831ssd04 wants to merge 8 commits intofeat/testnet-fixesfrom
Conversation
| return false | ||
| } | ||
|
|
||
| func (sr *subroundSignature) createSignaturesForManagedKeys(ctx context.Context) bool { |
There was a problem hiding this comment.
this pre-checks here are very similar with doSignatureJobForManagedKeys but i would keep it like this for simplicity
| sr.GetHeader().GetEpoch(), | ||
| pkBytes, | ||
| ) | ||
| signatureShare, err := sr.SigningHandler().SignatureShare(uint16(idx)) |
There was a problem hiding this comment.
in each start subround, there is a Reset for all consensus state, including SigningHandler, there should't be any index collision with the signatures from the previous round; the wait time is related to the proof arrival, not with the signatures
| } | ||
| } | ||
|
|
||
| // Wait once for the entire node if competing block detected |
There was a problem hiding this comment.
shouldn't L125-128 be inside the previous if? they basically do similar loops as waitForCompetingBlockEarlyChecks
There was a problem hiding this comment.
here there is also the check for single key, will check how to integrate them better
There was a problem hiding this comment.
refactored to include them in the same condition branch
| sr.signatureThrottler.StartProcessing() | ||
| wg.Add(1) | ||
|
|
||
| go func(ctx context.Context, idx int, pk string) { |
There was a problem hiding this comment.
this starts a goroutine, but does not handle the context, so goroutines may be hanging if the process stops
There was a problem hiding this comment.
added context check in goroutine
| if err != nil { | ||
| log.Debug("sendSignatureForManagedKey.CreateSignatureShareForPublicKey", "error", err.Error()) | ||
| return false | ||
| // signature share not found (optimistic signature share creation was not triggered) |
There was a problem hiding this comment.
what if failure reason was different?
There was a problem hiding this comment.
i think we should try to create the signature share (if not already created) whatever the reason; before we tried to create it directly each time, now there is additional check
Reasoning behind the pull request
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
featbranch created?featbranch merging, do all satellite projects have a proper tag insidego.mod?