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

Do not store output share in report aggregations. #1299

Merged
merged 3 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 0 additions & 26 deletions aggregator/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

pub use crate::aggregator::error::Error;
use crate::aggregator::{
accumulator::Accumulator,
aggregate_share::compute_aggregate_share,
error::BatchMismatch,
http_handlers::aggregator_handler,
Expand Down Expand Up @@ -281,7 +280,6 @@ impl<C: Clock> Aggregator<C> {
.handle_aggregate_init(
&self.datastore,
&self.aggregate_step_failure_counter,
self.cfg.batch_aggregation_shard_count,
aggregation_job_id,
req_bytes,
)
Expand Down Expand Up @@ -594,7 +592,6 @@ impl<C: Clock> TaskAggregator<C> {
&self,
datastore: &Datastore<C>,
aggregate_step_failure_counter: &Counter<u64>,
batch_aggregation_shard_count: u64,
aggregation_job_id: &AggregationJobId,
req_bytes: &[u8],
) -> Result<AggregationJobResp, Error> {
Expand All @@ -603,7 +600,6 @@ impl<C: Clock> TaskAggregator<C> {
datastore,
aggregate_step_failure_counter,
Arc::clone(&self.task),
batch_aggregation_shard_count,
aggregation_job_id,
req_bytes,
)
Expand Down Expand Up @@ -853,7 +849,6 @@ impl VdafOps {
datastore: &Datastore<C>,
aggregate_step_failure_counter: &Counter<u64>,
task: Arc<Task>,
batch_aggregation_shard_count: u64,
aggregation_job_id: &AggregationJobId,
req_bytes: &[u8],
) -> Result<AggregationJobResp, Error> {
Expand All @@ -865,7 +860,6 @@ impl VdafOps {
vdaf,
aggregate_step_failure_counter,
task,
batch_aggregation_shard_count,
aggregation_job_id,
verify_key,
req_bytes,
Expand All @@ -880,7 +874,6 @@ impl VdafOps {
vdaf,
aggregate_step_failure_counter,
task,
batch_aggregation_shard_count,
aggregation_job_id,
verify_key,
req_bytes,
Expand Down Expand Up @@ -1203,7 +1196,6 @@ impl VdafOps {
vdaf: &A,
aggregate_step_failure_counter: &Counter<u64>,
task: Arc<Task>,
batch_aggregation_shard_count: u64,
aggregation_job_id: &AggregationJobId,
verify_key: &VerifyKey<SEED_SIZE>,
req_bytes: &[u8],
Expand Down Expand Up @@ -1500,12 +1492,6 @@ impl VdafOps {
// Construct a response and write any new report shares and report aggregations
// as we go.
if !replayed_request {
let mut accumulator = Accumulator::<SEED_SIZE, Q, A>::new(
Arc::clone(&task),
batch_aggregation_shard_count,
aggregation_job.aggregation_parameter().clone(),
);

for report_share_data in &mut report_share_data
{
// Write client report & report aggregation.
Expand All @@ -1526,19 +1512,7 @@ impl VdafOps {
}
}
tx.put_report_aggregation(&report_share_data.report_aggregation).await?;

if let ReportAggregationState::Finished(output_share) = report_share_data.report_aggregation.state()
{
accumulator.update(
aggregation_job.partial_batch_identifier(),
report_share_data.report_share.metadata().id(),
report_share_data.report_share.metadata().time(),
output_share,
)?;
}
}

accumulator.flush_to_datastore(tx, &vdaf).await?;
}

Ok(Self::aggregation_job_resp_for(report_share_data.into_iter().map(|data| data.report_aggregation)))
Expand Down
2 changes: 1 addition & 1 deletion aggregator/src/aggregator/aggregation_job_continue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl VdafOps {
)?;
*report_aggregation = report_aggregation
.clone()
.with_state(ReportAggregationState::Finished(output_share))
.with_state(ReportAggregationState::Finished)
.with_last_prep_step(Some(PrepareStep::new(
*prep_step.report_id(),
PrepareStepResult::Finished,
Expand Down
11 changes: 5 additions & 6 deletions aggregator/src/aggregator/aggregation_job_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ impl AggregationJobDriver {
match report_aggregation.state() {
ReportAggregationState::Start => saw_start = true,
ReportAggregationState::Waiting(_, _) => saw_waiting = true,
ReportAggregationState::Finished(_) => saw_finished = true,
ReportAggregationState::Finished => saw_finished = true,
ReportAggregationState::Failed(_) | ReportAggregationState::Invalid => (), // ignore failure aggregation states
}
}
Expand Down Expand Up @@ -622,7 +622,7 @@ impl AggregationJobDriver {
report_aggregation.time(),
out_share,
) {
Ok(_) => ReportAggregationState::Finished(out_share.clone()),
Ok(_) => ReportAggregationState::Finished,
Err(error) => {
warn!(report_id = %report_aggregation.report_id(), ?error, "Could not update batch aggregation");
self.aggregate_step_failure_counter.add(
Expand Down Expand Up @@ -1107,7 +1107,7 @@ mod tests {
*report.metadata().time(),
0,
None,
ReportAggregationState::Finished(transcript.output_share(Role::Leader).clone()),
ReportAggregationState::Finished,
);

let (got_aggregation_job, got_report_aggregation) = ds
Expand Down Expand Up @@ -1863,7 +1863,7 @@ mod tests {
*report.metadata().time(),
0,
None,
ReportAggregationState::Finished(transcript.output_share(Role::Leader).clone()),
ReportAggregationState::Finished,
);
let batch_interval_start = report
.metadata()
Expand Down Expand Up @@ -2147,15 +2147,14 @@ mod tests {
AggregationJobState::Finished,
AggregationJobRound::from(1),
);
let leader_output_share = transcript.output_share(Role::Leader);
let want_report_aggregation = ReportAggregation::<PRIO3_VERIFY_KEY_LENGTH, Prio3Count>::new(
*task.id(),
aggregation_job_id,
*report.metadata().id(),
*report.metadata().time(),
0,
None,
ReportAggregationState::Finished(leader_output_share.clone()),
ReportAggregationState::Finished,
);
let want_batch_aggregations = Vec::from([BatchAggregation::<
PRIO3_VERIFY_KEY_LENGTH,
Expand Down
6 changes: 3 additions & 3 deletions aggregator/src/aggregator/collection_job_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ mod tests {
use janus_core::{
task::VdafInstance,
test_util::{
dummy_vdaf::{self, AggregationParam, OutputShare},
dummy_vdaf::{self, AggregationParam},
install_test_trace_subscriber,
runtime::TestRuntimeManager,
},
Expand Down Expand Up @@ -571,7 +571,7 @@ mod tests {
*report.metadata().time(),
0,
None,
ReportAggregationState::Finished(OutputShare()),
ReportAggregationState::Finished,
))
.await?;

Expand Down Expand Up @@ -700,7 +700,7 @@ mod tests {
*report.metadata().time(),
0,
None,
ReportAggregationState::Finished(OutputShare()),
ReportAggregationState::Finished,
))
.await?;

Expand Down
2 changes: 1 addition & 1 deletion aggregator/src/aggregator/collection_job_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ async fn setup_fixed_size_current_batch_collection_job_test_case(
time,
ord,
None,
ReportAggregationState::Finished(dummy_vdaf::OutputShare()),
ReportAggregationState::Finished,
))
.await
.unwrap();
Expand Down
4 changes: 1 addition & 3 deletions aggregator/src/aggregator/http_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2323,9 +2323,7 @@ mod tests {
*report_metadata_0.id(),
PrepareStepResult::Finished
)),
ReportAggregationState::Finished(
transcript_0.output_share(Role::Helper).clone()
),
ReportAggregationState::Finished,
),
ReportAggregation::new(
*task.id(),
Expand Down
Loading