-
Notifications
You must be signed in to change notification settings - Fork 247
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
Allow requests for consistency proofs where first=second #74
Conversation
These requests don't really make sense but this is for better compatibility with C++ logs, which return an empty proof. Needs log backend change in other repo.
Codecov Report
@@ Coverage Diff @@
## master #74 +/- ##
=======================================
Coverage 68.38% 68.38%
=======================================
Files 54 54
Lines 6620 6620
=======================================
Hits 4527 4527
Misses 1576 1576
Partials 517 517
Continue to review full report at Codecov.
|
@@ -875,7 +875,7 @@ func parseGetSTHConsistencyRange(r *http.Request) (int64, int64, error) { | |||
if first < 0 || second < 0 { | |||
return 0, 0, fmt.Errorf("first and second params cannot be <0: %d %d", first, second) | |||
} | |||
if second <= first { | |||
if second < first { | |||
return 0, 0, fmt.Errorf("invalid first, second params: %d %d", first, second) | |||
} | |||
|
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.
Did you consider just returning an empty proof in here and short-circuiting the RPC?
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.
I did but we then can't validate that the parameters are inside the valid tree size range.
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.
Though actually doesn't it cache STHs now? Perhaps we can.
These requests don't really make sense but this is for better compatibility with C++ logs, which return an empty proof for this case. Needs log backend change in other repo:
google/trillian#819