Skip to content
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

Update libprio-rs dependency to version 0.8.0. #256

Merged
merged 2 commits into from
Jun 21, 2022
Merged

Conversation

branlwyd
Copy link
Contributor

This version of libprio-rs implements draft-irtf-cfrg-vdaf-01, which is
the version we are targeting for interop tests.

This change is large but mostly-mechanical. A large number of line
changes are due to the new L const generic parameter to the VDAF
Aggregator trait. This parameter is effectively the underlying PRG's
seed size. Unfortunately, Rust currently doesn't allow const generic
parameters to be inferred; there is an open issue to resolve this, but
it doesn't appear to have received much attention thus far[1].

[1] rust-lang/rust#80528

This version of libprio-rs implements draft-irtf-cfrg-vdaf-01, which is
the version we are targeting for interop tests.

This change is large but mostly-mechanical. A large number of line
changes are due to the new `L` const generic parameter to the VDAF
Aggregator trait.  This parameter is effectively the underlying PRG's
seed size.  Unfortunately, Rust currently doesn't allow const generic
parameters to be inferred; there is an open issue to resolve this, but
it doesn't appear to have received much attention thus far[1].

[1] rust-lang/rust#80528
@branlwyd branlwyd requested a review from a team as a code owner June 18, 2022 23:39
(false, true) => AggregationJobState::Finished,
(true, true) => {
return Err(Error::Internal(
"VDAF took an inconsistent number of rounds to reach Finish state".to_string(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may want to keep this check in. While I'm not concerned about defensive programming against the VDAF itself, it would be good to catch if we somehow tore an aggregation job, and stepped different report aggregations a different number of times. If we don't check this here, we would likely see issues later in the process when comparing report counts and checksums between aggregators.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is due to a VDAF API change: this method is for the "aggregate initialization" step. Previously, the VDAF interface required calling prepare_init followed by prepare_step (with a None prepare state); the latter call would return a PrepareTransition which could have been Finish (though no real VDAFs do so). Now, we only call prepare_init, and the return value is a (PrepareState, PrepareShare) tuple -- i.e. there is no way for the VDAF interface to signal that initialization led to a finished VDAF run.

That is, this code got removed because the Rust compiler noticed saw_finish variable had become read-only (and would always be false); the check was dead code. Note that we still have the equivalent check in the "aggregate continue" code, around L1081.

(Random thought: while it IMO makes sense for VDAFs to not be able to finish without a round of communication, I wonder if DAFs could have been implemented by allowing prepare_init to immediately transition to a finished state.)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks for the context, SGTM

@branlwyd branlwyd merged commit 9374954 into main Jun 21, 2022
@branlwyd branlwyd deleted the libprio-0.8.0 branch August 1, 2022 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants