Skip to content

Commit

Permalink
Remove std::hash::Hash bound on agg parameters (#1670)
Browse files Browse the repository at this point in the history
Somewhere along the way, `AggregationJobWriter::write` picked up a trait
bound requiring `std::hash::Hash` on `Vdaf::AggregationParam`. This
trait isn't actually needed and also breaks Poplar1: `Hash` is
implemented on `Prio3*::AggregationParam` (i.e., `()`), but not on
`Poplar1AggregationParam`.
  • Loading branch information
tgeoghegan authored Aug 3, 2023
1 parent 14b23ca commit fb4d0ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
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 @@ -35,7 +35,6 @@ use prio::{
use reqwest::Method;
use std::{
collections::{HashMap, HashSet},
hash::Hash,
sync::Arc,
time::Duration,
};
Expand Down Expand Up @@ -127,7 +126,7 @@ impl AggregationJobDriver {
) -> Result<()>
where
A: 'static + Send + Sync,
A::AggregationParam: Send + Sync + PartialEq + Eq + Hash,
A::AggregationParam: Send + Sync + PartialEq + Eq,
A::AggregateShare: Send + Sync,
A::OutputShare: PartialEq + Eq + Send + Sync,
for<'a> A::PrepareState:
Expand Down Expand Up @@ -295,7 +294,7 @@ impl AggregationJobDriver {
) -> Result<()>
where
A: 'static,
A::AggregationParam: Send + Sync + PartialEq + Eq + Hash,
A::AggregationParam: Send + Sync + PartialEq + Eq,
A::AggregateShare: Send + Sync,
A::OutputShare: PartialEq + Eq + Send + Sync,
A::PrepareState: PartialEq + Eq + Send + Sync + Encode,
Expand Down Expand Up @@ -441,7 +440,7 @@ impl AggregationJobDriver {
) -> Result<()>
where
A: 'static,
A::AggregationParam: Send + Sync + PartialEq + Eq + Hash,
A::AggregationParam: Send + Sync + PartialEq + Eq,
A::AggregateShare: Send + Sync,
A::OutputShare: Send + Sync,
A::PrepareState: Send + Sync + Encode,
Expand Down Expand Up @@ -557,7 +556,7 @@ impl AggregationJobDriver {
) -> Result<()>
where
A: 'static,
A::AggregationParam: Send + Sync + Eq + PartialEq + Hash,
A::AggregationParam: Send + Sync + Eq + PartialEq,
A::AggregateShare: Send + Sync,
A::OutputShare: Send + Sync,
A::PrepareMessage: Send + Sync,
Expand Down Expand Up @@ -765,7 +764,7 @@ impl AggregationJobDriver {
where
A: Send + Sync + 'static,
A::AggregateShare: Send + Sync,
A::AggregationParam: Send + Sync + PartialEq + Eq + Hash,
A::AggregationParam: Send + Sync + PartialEq + Eq,
A::PrepareMessage: Send + Sync,
for<'a> A::PrepareState: Send + Sync + Encode + ParameterizedDecode<(&'a A, usize)>,
{
Expand Down
3 changes: 1 addition & 2 deletions aggregator/src/aggregator/aggregation_job_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use prio::{codec::Encode, vdaf};
use std::{
borrow::Cow,
collections::{HashMap, HashSet},
hash::Hash,
sync::{Arc, Mutex},
};
use tokio::try_join;
Expand Down Expand Up @@ -162,7 +161,7 @@ impl<const SEED_SIZE: usize, Q: CollectableQueryType, A: vdaf::Aggregator<SEED_S
where
C: Clock,
A: Send + Sync,
A::AggregationParam: PartialEq + Eq + Hash,
A::AggregationParam: PartialEq + Eq,
A::PrepareState: Encode,
{
// Create a copy-on-write instance of our state to allow efficient imperative updates.
Expand Down

0 comments on commit fb4d0ee

Please sign in to comment.