[R4R] Add adr-034: PrivValidator file structure#2751
Merged
ebuchman merged 4 commits intotendermint:developfrom Nov 11, 2018
Merged
[R4R] Add adr-034: PrivValidator file structure#2751ebuchman merged 4 commits intotendermint:developfrom
ebuchman merged 4 commits intotendermint:developfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2751 +/- ##
===========================================
- Coverage 62.29% 62.28% -0.01%
===========================================
Files 212 212
Lines 17185 17126 -59
===========================================
- Hits 10705 10667 -38
+ Misses 5583 5568 -15
+ Partials 897 891 -6
|
ebuchman
reviewed
Nov 6, 2018
| PrivKey crypto.PrivKey `json:"priv_key"` | ||
|
|
||
| filePath string | ||
| mtx sync.Mutex |
Contributor
There was a problem hiding this comment.
Don't think we need the mtx, since this is immutable. Right?
| LastRound int `json:"last_round"` | ||
| LastStep int8 `json:"last_step"` | ||
| LastSignature []byte `json:"last_signature,omitempty"` | ||
| LastSignBytes cmn.HexBytes `json:"last_signbytes,omitempty"` |
Contributor
There was a problem hiding this comment.
last_sign_bytes.
Thought maybe instead of FilePVState we call this struct LastSignInfo or LastSignState or similar and then we can remove the Last prefix from all the fields?
Contributor
Author
|
@ebuchman , I did some changes according to you comments. Sorry for the delay, I am really busy lately. |
ebuchman
approved these changes
Nov 11, 2018
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ADR 034: PrivValidator file structure
Changelog
03-11-2018: Initial Draft
Context
For now, the PrivValidator file
priv_validator.jsoncontains mutable and immutable parts.Even in an insecure mode which does not encrypt private key on disk, it is reasonable to separate
the mutable part and immutable part.
References:
#1181
#2657
#2313
Proposed Solution
We can split mutable and immutable parts with two structs:
Then we can combine
PVKeywithPVStateand will get the originalFilePV.What we need to do next is changing the methods of
FilePV.Status
Draft.
Consequences
Positive
Negative
Neutral