Conversation
* add comments to all public types * fix comments to adhere to comment standards
| // or else generates a new one and saves it to the filePath. | ||
| func LoadOrGenPrivValidatorJSON(filePath string) *PrivValidatorJSON { | ||
| var pvj *PrivValidatorJSON | ||
| if _, err := os.Stat(filePath); err == nil { |
There was a problem hiding this comment.
cmn.FileExists(filePath) ?
|
* break out connect functionality out of OnStart * introduce max retries
As calls to the private validator can involve side-effects like network communication it is desirable for all methods returning an error to not break the control flow of the caller. * adjust PrivValidator interface
Feature/priv val sockets
|
Merged in the new priv validator socket work, but please see review from that PR: #1204 (review) |
Codecov Report
@@ Coverage Diff @@
## develop #1203 +/- ##
===========================================
- Coverage 59.66% 59.52% -0.15%
===========================================
Files 121 126 +5
Lines 11050 11527 +477
===========================================
+ Hits 6593 6861 +268
- Misses 3851 4012 +161
- Partials 606 654 +48 |
Following ADDR 008 the node will connect to an external process to handle signing requests. Operation of the external process is left to the user. * introduce alias for PrivValidator interface on socket client * integrate socket client in node * structure tests * remove unnecessary flag
privVal: Integrate socket client
|
@ebuchman What's the next step here? Should we start with the actual integration by getting rid of the old priv val, flesh out Happy to follow-up and tackle any of these. |
| var ( | ||
| chainID = flag.String("chain-id", "mychain", "chain id") | ||
| listenAddr = flag.String("laddr", ":46659", "Validator listen address (0.0.0.0:0 means any interface, any port") | ||
| maxConn = flag.Int("clients", 3, "maximum of concurrent connections") |
There was a problem hiding this comment.
why do we want to limit that?
There was a problem hiding this comment.
Originally it only accepted a single connection at a time, we had a discussion around it and decided to go with 3 for now. Usually the relation should be one-to-one, between tendermint process and external signer, as far as I know at least.
| ) | ||
| ) | ||
|
|
||
| if err := pvsc.Start(); err != nil { |
There was a problem hiding this comment.
Can't find where we stop this ...
There was a problem hiding this comment.
If we defer pvsc.Stop() here it would be killed as soon as we exit the function scope. If the client is used it's vital to the node and is kind of bound to the lifecycle of the node process itself, maybe I missed a place where we have teardown when the node shuts down, that would be the place to stop it.
There was a problem hiding this comment.
|
|
||
| func (pvj *PrivValidatorJSON) save() { | ||
| if pvj.filePath == "" { | ||
| cmn.PanicSanity("Cannot save PrivValidator: filePath not set") |
There was a problem hiding this comment.
Panic* methods are deprecated. Use panic instead.
| Round int `json:"round"` | ||
| Step int8 `json:"step"` | ||
| Signature crypto.Signature `json:"signature,omitempty"` // so we dont lose signatures | ||
| SignBytes cmn.HexBytes `json:"signbytes,omitempty"` // so we dont lose signatures |
There was a problem hiding this comment.
This would be inconsistent to other occurences of signbytes:
tendermint/types/priv_validator.go
Line 58 in c8a2bdf
| Round int `json:"round"` | ||
| Step int8 `json:"step"` | ||
| Signature crypto.Signature `json:"signature,omitempty"` // so we dont lose signatures | ||
| SignBytes data.Bytes `json:"signbytes,omitempty"` // so we dont lose signatures |
| return // Ignore error from listener closing. | ||
| } | ||
| pvss.Logger.Error( | ||
| "accpetConnections", |
|
Merging for the sake of progress, will open new issue for remaining points. Thanks @xla ! |
…not match locked block (tendermint#1203) * consensus: update state to prevote nil when proposal block does not match locked block. (tendermint#6986) * add failing test * tweak comments in failing test * failing test comment * initial attempt at removing prevote locked block logic * comment out broken function * undo reset on prevotes * fixing TestProposeValidBlock test * update test for completed POL update * comment updates * further unlock testing * update comments * Update internal/consensus/state.go * spacing nit * comment cleanup * nil check in addVote * update unlock description * update precommit on relock comment * add ensure new timeout back * rename IsZero to IsNil and replace uses of block len check with helper * add testing.T to new assertions * begin removing unlock condition * fix TestStateProposerSelection2 to precommit for nil correctly * remove erroneous sleep * update TestStatePOL comment * update relock test to be more clear * add _ into test names * rename slashing * udpate no relock function to be cleaner * do not relock on old proposal test cleanup * con state name update * remove all references to unlock * update test comments to include new * add relock test * add ensureRelock to common_test * remove all event unlock * remove unlock checks * no lint add space * lint ++ * add test for nil prevote on different proposal * fix prevote nil condition * fix defaultDoPrevote * state_test.go fixes to accomodate prevoting for nil * add failing test for POL from previous round case * update prevote logic to prevote POL from previous round * state.go comment fixes * update validatePrevotes to correctly look for nil * update new test name and comment * update POLFromPreviousRound test * fixes post merge * fix spacing * make the linter happy * change prevote log message * update prevote nil debug line * update enterPrevote comment * lint * Update internal/consensus/state.go Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * Update internal/consensus/state.go Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * add english description of alg rules * Update internal/consensus/state.go Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * comment fixes from review * fix comment * fix comment Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> * Fix UTs * Addressed comments * Add changelog * Update consensus/state.go Co-authored-by: Hernán Vanzetto <15466498+hvanz@users.noreply.github.com> --------- Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com> Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com> Co-authored-by: Hernán Vanzetto <15466498+hvanz@users.noreply.github.com>
Replaces #1044
closes #673
Note this is just the new code, none of the integration (old priv val is still there).
I didn't feel too good about the integration last time, and now its riddled with conflicts, so maybe we can figure out a simple way to make it work starting a fresh. At least with this we can merge it without affecting anything.