Refactoring Remote signers#3370
Refactoring Remote signers#3370melekes merged 76 commits intotendermint:masterfrom Zondax:jleni/privval
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3370 +/- ##
==========================================
+ Coverage 65.97% 66.07% +0.09%
==========================================
Files 234 237 +3
Lines 20244 20343 +99
==========================================
+ Hits 13356 13441 +85
- Misses 5816 5832 +16
+ Partials 1072 1070 -2
|
|
This fail is unrelated but probably interesting. Maybe we should open another issue for this: |
|
I think it makes sense that we define a way to beta test changes like this. Is there a testnet planned for this purpose? |
|
ref: #3486 |
|
Here is the link to Tony's proposal
|
|
Ah Ok this one. Hmm. I'd prefer to keep this separate and implement Tony's proposal in a follow-up PR. Let's chat about this tomorrow. |
privval/signer_client_test.go
Outdated
|
|
||
| func TestSignerClose(t *testing.T) { | ||
| for _, tc := range getSignerTestCases(t) { | ||
| func() { |
There was a problem hiding this comment.
let's drop func() {}() wrappers if they don't serve any specific purpose (async code is generally harder to support / test / etc.)
| pingTimer *time.Ticker | ||
|
|
||
| pingTimer *time.Ticker | ||
| instanceMtx sync.Mutex // Ensures instance public methods access, i.e. SendRequest |
There was a problem hiding this comment.
I think we can just say
not concurrency safe
in the godoc comment and remove the instanceMtx
There was a problem hiding this comment.
This mutex is actually very important so external calls to SendRequest never mix with internal SendRequest(&PingRequest)
not sure if it's related |
|
|
||
| ### IMPROVEMENTS: | ||
|
|
||
| - [privval] \#3370 Refactors and simplifies validator/kms connection handling. Please refer to thttps://github.com/tendermint/tendermint/pull/3370#issue-257360971 |
There was a problem hiding this comment.
| - [privval] \#3370 Refactors and simplifies validator/kms connection handling. Please refer to thttps://github.com/tendermint/tendermint/pull/3370#issue-257360971 | |
| - [privval] \#3370 Refactors and simplifies validator/kms connection handling. Please refer to [this comment](https://github.com/tendermint/tendermint/pull/3370#issue-257360971) for details. |
This PR is related to #3107 and a continuation of #3351
It is important to emphasise that in the
privvaloriginal design, client/server and listening/dialing roles are inverted and do not follow a conventional interaction.Given two hosts A and B:
When A requires a signature, it needs to wait for B to dial in before it can issue a request.
A only accepts a single connection and any failure leads to dropping the connection and waiting for B to reconnect.
The original rationale behind this design was based on security.
This PR results in the following changes:
A high level overview of the classes is as follows:
Transport (endpoints): The following classes take care of establishing a connection
Signing (client/server): The following classes take care of exchanging request/responses
This PR also closes #3601