-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: fix inclusion proof verification flake #956
api: fix inclusion proof verification flake #956
Conversation
a5340bf
to
94eff70
Compare
Signed-off-by: Asra Ali <[email protected]> update with fix Signed-off-by: Asra Ali <[email protected]> fix with root resp Signed-off-by: Asra Ali <[email protected]> fix Signed-off-by: Asra Ali <[email protected]> fix Signed-off-by: Asra Ali <[email protected]> fix Signed-off-by: Asra Ali <[email protected]> update Signed-off-by: Asra Ali <[email protected]>
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work @asraa!
Signed-off-by: Asra Ali [email protected]
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
SignedLogRoot
for 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
SignedLogRoot
at 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