Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Encapsulate Client Verifier State in test vectors #1316

Merged
merged 8 commits into from
Jul 15, 2019

Conversation

gdbelvin
Copy link
Contributor

In order to remove the client mutex, we need to fully extract and isolate client verifier state.
Explicitly putting the client verifier state in the test vectors is the first step towards doing that.

Blocked on #1315
Motivated by #1311

@gdbelvin gdbelvin requested review from pav-kv and jtoohill July 11, 2019 10:14
@gdbelvin gdbelvin requested review from thaidn and a team as code owners July 11, 2019 10:14
@codecov
Copy link

codecov bot commented Jul 11, 2019

Codecov Report

Merging #1316 into master will decrease coverage by 0.07%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1316      +/-   ##
==========================================
- Coverage   30.06%   29.98%   -0.08%     
==========================================
  Files          46       46              
  Lines        3815     3828      +13     
==========================================
+ Hits         1147     1148       +1     
- Misses       2492     2504      +12     
  Partials      176      176
Impacted Files Coverage Δ
core/integration/client_tests.go 0% <0%> (ø) ⬆️
core/client/client.go 30.18% <0%> (+0.62%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c96c8df...8c6b98d. Read the comment docs.

core/api/v1/keytransparency.proto Outdated Show resolved Hide resolved
impl/integration/main_test.go Outdated Show resolved Hide resolved
// for the next rpc's request.last_verified_tree_size.
bool trust_new_log = 2;
reserved 2; // was trust_new_log
// last_verified_log_root encodes the client verifier state.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: In Go generated code the field name is formatted as LastVerifiedLogRoot, which is not consistent with formatting in the comment. My strategy is to not start comments with field names in proto files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alas, this is a common problem. I used to use the Go capitalization so the comments would come out correctly, but the mixing of different capitalization schemes in the proto file seemed messy and language specific.

Unsure if not starting comments with field names fixes the problem, since doing so still violates go style in the generated code.

core/api/v1/keytransparency.proto Outdated Show resolved Hide resolved
// LogRootRequest contains the information needed to requetst and verify LogRoot.
message LogRootRequest {
// root_hash is the log root hash.
bytes root_hash = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the log root request contain the log root hash? Isn't it supposed to be returned as a result of the request?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LogRootRequest is intended to encode the client's verifier state, as is being done in this PR; but it has a second purpose, which is to make request, response pairs statelessly verifiable. At the moment, an observer of the system, or a server interceptor can't tell if a response is valid because the first hash of the consistency proof is not included in either the request or the response.

core/api/v1/keytransparency.proto Outdated Show resolved Hide resolved
@gdbelvin
Copy link
Contributor Author

Updated. PTAL

* master:
  Pass along err message (google#1314)
  Remove unnessesary func() (google#1319)
@gdbelvin gdbelvin merged commit b13f2f5 into google:master Jul 15, 2019
@gdbelvin gdbelvin deleted the logstate branch July 15, 2019 11:36
gdbelvin added a commit to gdbelvin/keytransparency that referenced this pull request Jul 18, 2019
* master: (106 commits)
  Remove unused logVerifier (google#1324)
  Verify Revisions in StreamRevisions (google#1323)
  Pair verifier functions (google#1322)
  Split VerifyRevision into Verify{LogRoot,MapRevision (google#1318)
  Make Previous hash check optional (google#1307)
  Remove VerifySignedMapRoot from VerifierInterface (google#1320)
  Remove trailing whitespace (google#1321)
  Encapsulate Client Verifier State in test vectors (google#1316)
  Pass along err message (google#1314)
  Remove unnessesary func() (google#1319)
  New test vector transcript format (google#1315)
  Track map revision inside mutation (google#1310)
  Move verifier to its own package (google#1312)
  go generate ./... (google#1306)
  Fix proto copying in revisions and paginator tests. (google#1309)
  Fix proto copying in server_test. (google#1308)
  go mod tidy (google#1305)
  Use new TrillianMapWrite API (google#1304)
  Configurable maximum queue depth for metric reporting. (google#1303)
  Proposal to refine docker deployment (google#1302)
  ...
gdbelvin added a commit to gdbelvin/keytransparency that referenced this pull request Jul 18, 2019
* master: (95 commits)
  Remove unused logVerifier (google#1324)
  Verify Revisions in StreamRevisions (google#1323)
  Pair verifier functions (google#1322)
  Split VerifyRevision into Verify{LogRoot,MapRevision (google#1318)
  Make Previous hash check optional (google#1307)
  Remove VerifySignedMapRoot from VerifierInterface (google#1320)
  Remove trailing whitespace (google#1321)
  Encapsulate Client Verifier State in test vectors (google#1316)
  Pass along err message (google#1314)
  Remove unnessesary func() (google#1319)
  New test vector transcript format (google#1315)
  Track map revision inside mutation (google#1310)
  Move verifier to its own package (google#1312)
  go generate ./... (google#1306)
  Fix proto copying in revisions and paginator tests. (google#1309)
  Fix proto copying in server_test. (google#1308)
  go mod tidy (google#1305)
  Use new TrillianMapWrite API (google#1304)
  Configurable maximum queue depth for metric reporting. (google#1303)
  Proposal to refine docker deployment (google#1302)
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants