Skip to content

Commit 83664c1

Browse files
committed
Pass not_before to internal_task endpoint.
1 parent 3d59936 commit 83664c1

File tree

6 files changed

+10
-4
lines changed

6 files changed

+10
-4
lines changed

crates/dapf/src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,10 @@ async fn handle_test_routes(action: TestAction, http_client: HttpClient) -> anyh
905905
|| 604_800u64,
906906
"task should expire in",
907907
)?,
908+
task_commencement: SystemTime::now()
909+
.duration_since(SystemTime::UNIX_EPOCH)
910+
.unwrap()
911+
.as_secs(),
908912
};
909913

910914
print_json(&internal_task);

crates/daphne-server/src/roles/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ mod test_utils {
111111
fatal_error,
112112
hpke::{HpkeConfig, HpkeReceiverConfig},
113113
messages::decode_base64url_vec,
114-
roles::DapAggregator,
115114
vdaf::{Prio3Config, VdafConfig},
116115
DapBatchMode, DapError, DapTaskConfig, DapVersion,
117116
};
@@ -304,7 +303,7 @@ mod test_utils {
304303
leader_url: cmd.leader,
305304
helper_url: cmd.helper,
306305
time_precision: cmd.time_precision,
307-
not_before: self.get_current_time(),
306+
not_before: cmd.task_commencement,
308307
not_after: cmd.task_expiration,
309308
min_batch_size: cmd.min_batch_size,
310309
query,

crates/daphne-server/tests/e2e/test_runner.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ impl TestRunner {
235235
"time_precision": t.task_config.time_precision,
236236
"collector_hpke_config": collector_hpke_config_base64url.clone(),
237237
"task_expiration": t.task_config.not_after,
238+
"task_commencement": t.task_config.not_before,
238239
});
239240
let add_task_path = format!("{}/internal/test/add_task", version.as_ref());
240241
let res: InternalTestCommandResult = t
@@ -262,6 +263,7 @@ impl TestRunner {
262263
"time_precision": t.task_config.time_precision,
263264
"collector_hpke_config": collector_hpke_config_base64url.clone(),
264265
"task_expiration": t.task_config.not_after,
266+
"task_commencement": t.task_config.not_before,
265267
});
266268
let res: InternalTestCommandResult = t
267269
.helper_post_internal(&add_task_path, &helper_add_task_cmd)

crates/daphne-service-utils/src/test_route_types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,6 @@ pub struct InternalTestAddTask {
113113
pub max_batch_size: Option<NonZeroU32>,
114114
pub time_precision: Duration,
115115
pub collector_hpke_config: String, // base64url
116+
pub task_commencement: Time,
116117
pub task_expiration: Time,
117118
}

crates/daphne/src/roles/helper/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub async fn handle_agg_job_init_req<A: DapHelper + Sync>(
5252

5353
/// Handle a request for an aggregate share. This is called by the Leader to complete a
5454
/// collection job.
55-
pub async fn handle_agg_share_req<'req, A: DapHelper>(
55+
pub async fn handle_agg_share_req<A: DapHelper>(
5656
aggregator: &A,
5757
req: DapRequest<AggregateShareReq>,
5858
) -> Result<DapResponse, DapError> {

crates/daphne/src/testing/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ impl DapAggregator for InMemoryAggregator {
672672
) -> Result<DapTaskConfig, DapError> {
673673
// Always opt-in with four shards.
674674
Ok(task_config.into_opted_in(&taskprov::OptInParam {
675-
not_before: self.get_current_time(),
675+
not_before: self.get_current_time() - 60,
676676
num_agg_span_shards: NonZeroUsize::new(4).unwrap(),
677677
}))
678678
}

0 commit comments

Comments
 (0)