-
Notifications
You must be signed in to change notification settings - Fork 106
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: add method to verify consistent precomputed data #561
base: main
Are you sure you want to change the base?
Conversation
59bfbdf
to
db46192
Compare
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.
Nice, thanks!
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.
Thanks! Unfortunately you might need to repeat all this after the major rework of #556 is merged.
payload_byte_len: u32, | ||
num_storage_nodes: u32, |
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.
@nyospe do you know payload_byte_len
, num_storage_nodes
at the time you want to call this? Normally this data is available via the VidCommon
struct. But you only get one of those after dispersal.
I worry that you'll need to add a bunch of bookkeeping on the call side to keep track of this stuff. We tried to prevent that by making it available in the VidCommon
.
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.
Presumably both committer and disperser have initialized the VID scheme with the same payload_byte_len
and num_storage_nodes
(otherwise, how will pre-computation work). And if this is not the case then this new verification check will also reveal that, no?
primitives/src/vid/advz.rs
Outdated
let (recovery_threshold, num_storage_nodes) = (4, 6); | ||
let mut rng = jf_utils::test_rng(); | ||
let srs = init_srs(recovery_threshold as usize, &mut rng); | ||
let advz = Advz::new(num_storage_nodes, recovery_threshold, srs).unwrap(); | ||
let bytes_random = init_random_payload(4000, &mut rng); | ||
(advz, bytes_random) | ||
(advz, bytes_random, num_storage_nodes) |
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.
Unfortunate that you need to add num_storage_nodes
here. Maybe we can revert this pending feedback from Nathan.
Thanks for the feedback. I've rebased on top of the (refactored) |
Description
This PR adds another method
is_consistent_precompute
to thePrecompute
trait interface. A client can use this method to verify that the precomputed data contains the same underlying commitment as the output ofcommit_only_precompute
.This is useful if a party (builder) is generating the precompute_data and commitment using
commit_only_precompute
and subsequently sends the precompute_data to a leader (disperser) and shares the commitment with the network. Instead of trusting the builder, the leader now merely checks (usingis_consistent_precompute
) that the precomputed_data agrees with the commitment before dispersing.closes: #560
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
Files changed
in the GitHub PR explorer