mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-09 21:40:11 +00:00
Compare commits
3 Commits
release/v0
...
v0.32.13-r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a4bb49a8ed | ||
|
|
25b9653df1 | ||
|
|
4cd18a8b24 |
@@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## v0.32.13
|
||||
|
||||
### BUG FIXES
|
||||
|
||||
- [privval] [\#5112](https://github.com/tendermint/tendermint/issues/5112) If remote signer errors, don't retry (@melekes)
|
||||
|
||||
## v0.32.12
|
||||
|
||||
### BUG FIXES
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## v0.32.12
|
||||
## v0.32.14
|
||||
|
||||
\*\*
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package privval
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// EndpointTimeoutError occurs when endpoint times out.
|
||||
type EndpointTimeoutError struct{}
|
||||
|
||||
// Implement the net.Error interface.
|
||||
@@ -13,15 +15,15 @@ func (e EndpointTimeoutError) Temporary() bool { return true }
|
||||
|
||||
// Socket errors.
|
||||
var (
|
||||
ErrUnexpectedResponse = fmt.Errorf("received unexpected response")
|
||||
ErrNoConnection = fmt.Errorf("endpoint is not connected")
|
||||
ErrConnectionTimeout = EndpointTimeoutError{}
|
||||
|
||||
ErrReadTimeout = fmt.Errorf("endpoint read timed out")
|
||||
ErrWriteTimeout = fmt.Errorf("endpoint write timed out")
|
||||
ErrNoConnection = errors.New("endpoint is not connected")
|
||||
ErrReadTimeout = errors.New("endpoint read timed out")
|
||||
ErrUnexpectedResponse = errors.New("empty response")
|
||||
ErrWriteTimeout = errors.New("endpoint write timed out")
|
||||
)
|
||||
|
||||
// RemoteSignerError allows (remote) validators to include meaningful error descriptions in their reply.
|
||||
// RemoteSignerError allows (remote) validators to include meaningful error
|
||||
// descriptions in their reply.
|
||||
type RemoteSignerError struct {
|
||||
// TODO(ismail): create an enum of known errors
|
||||
Code int
|
||||
|
||||
@@ -60,6 +60,10 @@ func (sc *RetrySignerClient) SignVote(chainID string, vote *types.Vote) error {
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
// If remote signer errors, we don't retry.
|
||||
if _, ok := err.(*RemoteSignerError); ok {
|
||||
return err
|
||||
}
|
||||
time.Sleep(sc.timeout)
|
||||
}
|
||||
return errors.New("exhausted all attempts to sign vote")
|
||||
@@ -71,6 +75,10 @@ func (sc *RetrySignerClient) SignProposal(chainID string, proposal *types.Propos
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
// If remote signer errors, we don't retry.
|
||||
if _, ok := err.(*RemoteSignerError); ok {
|
||||
return err
|
||||
}
|
||||
time.Sleep(sc.timeout)
|
||||
}
|
||||
return errors.New("exhausted all attempts to sign proposal")
|
||||
|
||||
@@ -50,7 +50,6 @@ func (sc *SignerClient) WaitForConnection(maxWait time.Duration) error {
|
||||
// Ping sends a ping request to the remote signer
|
||||
func (sc *SignerClient) Ping() error {
|
||||
response, err := sc.endpoint.SendRequest(&PingRequest{})
|
||||
|
||||
if err != nil {
|
||||
sc.endpoint.Logger.Error("SignerClient::Ping", "err", err)
|
||||
return nil
|
||||
@@ -58,7 +57,6 @@ func (sc *SignerClient) Ping() error {
|
||||
|
||||
_, ok := response.(*PingResponse)
|
||||
if !ok {
|
||||
sc.endpoint.Logger.Error("SignerClient::Ping", "err", "response != PingResponse")
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -91,16 +89,13 @@ func (sc *SignerClient) GetPubKey() crypto.PubKey {
|
||||
func (sc *SignerClient) SignVote(chainID string, vote *types.Vote) error {
|
||||
response, err := sc.endpoint.SendRequest(&SignVoteRequest{Vote: vote})
|
||||
if err != nil {
|
||||
sc.endpoint.Logger.Error("SignerClient::SignVote", "err", err)
|
||||
return err
|
||||
}
|
||||
|
||||
resp, ok := response.(*SignedVoteResponse)
|
||||
if !ok {
|
||||
sc.endpoint.Logger.Error("SignerClient::GetPubKey", "err", "response != SignedVoteResponse")
|
||||
return ErrUnexpectedResponse
|
||||
}
|
||||
|
||||
if resp.Error != nil {
|
||||
return resp.Error
|
||||
}
|
||||
@@ -113,13 +108,11 @@ func (sc *SignerClient) SignVote(chainID string, vote *types.Vote) error {
|
||||
func (sc *SignerClient) SignProposal(chainID string, proposal *types.Proposal) error {
|
||||
response, err := sc.endpoint.SendRequest(&SignProposalRequest{Proposal: proposal})
|
||||
if err != nil {
|
||||
sc.endpoint.Logger.Error("SignerClient::SignProposal", "err", err)
|
||||
return err
|
||||
}
|
||||
|
||||
resp, ok := response.(*SignedProposalResponse)
|
||||
if !ok {
|
||||
sc.endpoint.Logger.Error("SignerClient::SignProposal", "err", "response != SignedProposalResponse")
|
||||
return ErrUnexpectedResponse
|
||||
}
|
||||
if resp.Error != nil {
|
||||
|
||||
@@ -250,8 +250,7 @@ func TestSignerUnexpectedResponse(t *testing.T) {
|
||||
|
||||
ts := time.Now()
|
||||
want := &types.Vote{Timestamp: ts, Type: types.PrecommitType}
|
||||
|
||||
e := tc.signerClient.SignVote(tc.chainID, want)
|
||||
assert.EqualError(t, e, "received unexpected response")
|
||||
assert.EqualError(t, e, "empty response")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ const (
|
||||
// XXX: Don't change the name of this variable or you will break
|
||||
// automation :)
|
||||
|
||||
TMCoreSemVer = "0.32.12"
|
||||
TMCoreSemVer = "0.32.13"
|
||||
|
||||
// ABCISemVer is the semantic version of the ABCI library
|
||||
ABCISemVer = "0.16.1"
|
||||
|
||||
Reference in New Issue
Block a user