privval: retry GetPubKey, SignVote/Proposal indefinitely

Fixes #4275
This commit is contained in:
Anton Kaliaev
2020-04-21 13:20:42 +04:00
parent eab4d6d82b
commit 1000378770
3 changed files with 97 additions and 2 deletions
+13 -1
View File
@@ -1192,7 +1192,19 @@ func createAndStartPrivValidatorSocketClient(
return nil, errors.Wrap(err, "failed to start private validator")
}
return pvsc, nil
// try to get a pubkey from private validate first time
pubKey := pvsc.GetPubKey()
if pubKey == nil {
return nil, errors.New("could not retrieve public key from private validator")
}
const (
retries = 50 // unlimited
timeout = 100 * time.Millisecond
)
pvscWithRetries := privval.NewRetrySignerClient(pvsc, retries, timeout)
return pvscWithRetries, nil
}
// splitAndTrimEmpty slices s into all subslices separated by sep and returns a