Skip to content

Commit

Permalink
Pass not_before to internal_task endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoyla committed Jan 9, 2025
1 parent 3d59936 commit 83664c1
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions crates/dapf/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,10 @@ async fn handle_test_routes(action: TestAction, http_client: HttpClient) -> anyh
|| 604_800u64,
"task should expire in",
)?,
task_commencement: SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
.unwrap()
.as_secs(),
};

print_json(&internal_task);
Expand Down
3 changes: 1 addition & 2 deletions crates/daphne-server/src/roles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ mod test_utils {
fatal_error,
hpke::{HpkeConfig, HpkeReceiverConfig},
messages::decode_base64url_vec,
roles::DapAggregator,
vdaf::{Prio3Config, VdafConfig},
DapBatchMode, DapError, DapTaskConfig, DapVersion,
};
Expand Down Expand Up @@ -304,7 +303,7 @@ mod test_utils {
leader_url: cmd.leader,
helper_url: cmd.helper,
time_precision: cmd.time_precision,
not_before: self.get_current_time(),
not_before: cmd.task_commencement,
not_after: cmd.task_expiration,
min_batch_size: cmd.min_batch_size,
query,
Expand Down
2 changes: 2 additions & 0 deletions crates/daphne-server/tests/e2e/test_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ impl TestRunner {
"time_precision": t.task_config.time_precision,
"collector_hpke_config": collector_hpke_config_base64url.clone(),
"task_expiration": t.task_config.not_after,
"task_commencement": t.task_config.not_before,
});
let add_task_path = format!("{}/internal/test/add_task", version.as_ref());
let res: InternalTestCommandResult = t
Expand Down Expand Up @@ -262,6 +263,7 @@ impl TestRunner {
"time_precision": t.task_config.time_precision,
"collector_hpke_config": collector_hpke_config_base64url.clone(),
"task_expiration": t.task_config.not_after,
"task_commencement": t.task_config.not_before,
});
let res: InternalTestCommandResult = t
.helper_post_internal(&add_task_path, &helper_add_task_cmd)
Expand Down
1 change: 1 addition & 0 deletions crates/daphne-service-utils/src/test_route_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,6 @@ pub struct InternalTestAddTask {
pub max_batch_size: Option<NonZeroU32>,
pub time_precision: Duration,
pub collector_hpke_config: String, // base64url
pub task_commencement: Time,
pub task_expiration: Time,
}
2 changes: 1 addition & 1 deletion crates/daphne/src/roles/helper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub async fn handle_agg_job_init_req<A: DapHelper + Sync>(

/// Handle a request for an aggregate share. This is called by the Leader to complete a
/// collection job.
pub async fn handle_agg_share_req<'req, A: DapHelper>(
pub async fn handle_agg_share_req<A: DapHelper>(
aggregator: &A,
req: DapRequest<AggregateShareReq>,
) -> Result<DapResponse, DapError> {
Expand Down
2 changes: 1 addition & 1 deletion crates/daphne/src/testing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ impl DapAggregator for InMemoryAggregator {
) -> Result<DapTaskConfig, DapError> {
// Always opt-in with four shards.
Ok(task_config.into_opted_in(&taskprov::OptInParam {
not_before: self.get_current_time(),
not_before: self.get_current_time() - 60,
num_agg_span_shards: NonZeroUsize::new(4).unwrap(),
}))
}
Expand Down

0 comments on commit 83664c1

Please sign in to comment.