api: fix inclusion proof verification flake#956
Conversation
a5340bf to
94eff70
Compare
Signed-off-by: Asra Ali <asraa@google.com> update with fix Signed-off-by: Asra Ali <asraa@google.com> fix with root resp Signed-off-by: Asra Ali <asraa@google.com> fix Signed-off-by: Asra Ali <asraa@google.com> fix Signed-off-by: Asra Ali <asraa@google.com> fix Signed-off-by: Asra Ali <asraa@google.com> update Signed-off-by: Asra Ali <asraa@google.com>
94eff70 to
675eed9
Compare
|
Amazing find! |
|
This is really fantastic, great work! Can you add a comment briefly summarizing this design decision in the client so we have context for why it's designed this way? |
bobcallaway
left a comment
There was a problem hiding this comment.
great catch and RCA - just some recommendations to reuse your helper function here.
any thoughts on how we could add regression testing for this?
Adding a regression test that fires two concurrent goroutine uploading and verifying. I'm able to repro the failure at HEAD, and fix here. I had to use 50 uploads/verifies, although I suspect the number can be less. |
Signed-off-by: Asra Ali <asraa@google.com>
Codecov Report
@@ Coverage Diff @@
## main #956 +/- ##
==========================================
+ Coverage 48.20% 48.35% +0.14%
==========================================
Files 61 61
Lines 5383 5383
==========================================
+ Hits 2595 2603 +8
+ Misses 2506 2500 -6
+ Partials 282 280 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Asra Ali asraa@google.com
Fixes:
Summary
This fixes a flakey problem with Rekor entry verification.
Every once in a while, we receive errors in validating the inclusion proof from Rekor:
it may either be an error verifying the inclusion proof:
or may be caught earlier than that with incorrect inclusion proof size:
This happens because we
See code here
The trillian response for the inclusion proof includes a
SignedLogRootfor the tree size at size Y.https://github.com/google/trillian/blob/44841b0bad99d6b7ed5ab20ff24cfa5ca6add9d3/trillian_log_api.proto#L231-L235
The Rekor server validates the inclusion proof at size X, returning the proof response successfully.
rekor/pkg/api/trillian_client.go
Line 229 in 547eb3c
Rekor returns the proof response with the
SignedLogRootat tree size Y, client attempts to validate with this. This errors out.rekor/pkg/api/entries.go
Line 445 in 45fd37d
This PR returns the SignedLogRoot for the tree size in the requested proof.
On a side note, I dislike very much that Trillian's proof response does not contain the requested tree size X.
Release Note
Documentation