-
Notifications
You must be signed in to change notification settings - Fork 77
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
feat: reveal multiple rangesets with one rangeset. #664
base: dev
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #664 +/- ##
==========================================
+ Coverage 55.76% 56.25% +0.48%
==========================================
Files 189 189
Lines 20886 20869 -17
==========================================
+ Hits 11648 11740 +92
+ Misses 9238 9129 -109 ☔ View full report in Codecov by Sentry. |
df4b31a
to
5cf7128
Compare
This doesn't address the issue, we're not looking for a method to pass in a slice. Instead, we want to address the problem that the user has to specify each range individually which corresponds to a commitment. When the user provides a range set to reveal, we should look into the encoding tree/hash commitments and determine if we can satisfy it with one or more of the available commitments. |
Yeap! Got the same feedback from @themighty1 , and am working on it |
Just realised there is one more polishing to do, will notify when it's ready to be reviewed |
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.
Very nicely done!!!
// NOTE: Ideally, one should NOT call any `reveal` function more than once | ||
// for these superset ranges to avoid unnecessary computation time. | ||
// | ||
// Instead of `reveal` on 'superset range A', and then `reveal` again | ||
// on 'superset range B', one should union all these superset ranges, | ||
// and then `reveal` at once. |
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 would avoid putting here the rest of the comment starting from NOTE:
The way that the reveal API works now is the actual expected behaviour.
Talking about "unnecessary computation time" will cause the user to wonder about such small details. But we know that compute overhead is so miniscule, it's not worth drawing attention to.
Additionally, we encourage to use reveal() only once but then immediately a few lines below call it multiple times in this example. This will make the user think the example is wrong/the comment is wrong/the user missed something.
I feel we can allow the user to be able to both call reveal one time or multiple times, depending on their code ergonomics needs.
I feel that the user should be exposed to as few inconsequential details as possible. But feel free to keep the NOTE: if you still think it is valuable.
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 would avoid putting here the rest of the comment starting from NOTE: The way that the reveal API works now is the actual expected behaviour. Talking about "unnecessary computation time" will cause the user to wonder about such small details. But we know that compute overhead is so miniscule, it's not worth drawing attention to.
Additionally, we encourage to use reveal() only once but then immediately a few lines below call it multiple times in this example. This will make the user think the example is wrong/the comment is wrong/the user missed something.
I feel we can allow the user to be able to both call reveal one time or multiple times, depending on their code ergonomics needs. I feel that the user should be exposed to as few inconsequential details as possible. But feel free to keep the NOTE: if you still think it is valuable.
Ah i see, i guess the point i was trying to convey wasn't clear: that for superset ranges, they should call reveal
once after union-ing all of them; but for exact ranges, they can call multiple times. I was mainly worrying about the compute overhead when the following is executed N
times (the number of times user call reveal
with superset ranges):
for committed_dir_idx in encoding_tree
.transcript_indices()
.into_iter()
.filter(|(dir, _)| *dir == dir_idx.0)
{
if committed_dir_idx.1.is_subset(&dir_idx.1) {
staged_subsets.push(committed_dir_idx);
}
}
Because if N
is big, then this block might cause some noticeable overhead, since is_subset
itself contains an inner loop. But rationally users wouldn't reveal such large N
— let me try to change the wording to make it clearer and less confusing.
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.
@themighty1 just updated the example and new comments, let me know what you think :)
Co-authored-by: dan <[email protected]>
Addresses #655