Skip to content

Commit

Permalink
Continue tracking down issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoyla committed Jan 14, 2025
1 parent 1210a9c commit fcc8dc1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/daphne-server/src/storage_proxy_connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub struct RequestBuilder<'d, B: DurableMethod, P: AsRef<[u8]>> {
request: DurableRequest<P>,
}

impl<'d, B: DurableMethod + Debug, P: AsRef<[u8]>> RequestBuilder<'d, B, P> {
impl<B: DurableMethod + Debug, P: AsRef<[u8]>> RequestBuilder<'_, B, P> {
#[tracing::instrument(skip_all, fields(path = ?self.path))]
pub async fn send<R>(self) -> Result<R, Error>
where
Expand Down
2 changes: 2 additions & 0 deletions crates/daphne-server/tests/e2e/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,8 @@ async fn leader_collect_taskprov_ok(version: DapVersion) {
)
.unwrap();

println!("Now - not_before: {}", t.now - task_config.not_before);
println!("Now - batch_interval.start: {}", t.now - batch_interval.start);
let path = TestRunner::upload_path_for_task(&task_id);
let method = match version {
DapVersion::Draft09 => &Method::PUT,
Expand Down
2 changes: 1 addition & 1 deletion crates/daphne/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ impl DapTaskParameters {
)
.unwrap()
.into_opted_in(&taskprov::OptInParam {
not_before: now,
not_before: now - (now % self.time_precision) - 1,
num_agg_span_shards: self.num_agg_span_shards,
});

Expand Down
16 changes: 9 additions & 7 deletions crates/daphne/src/roles/leader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,23 +216,25 @@ pub async fn handle_upload_req<A: DapLeader>(
.into());
}

// Check that the report was generated after the task's `not_before` time.
if report.report_metadata.time < task_config.as_ref().not_before {
if report.report_metadata.time
< task_config.as_ref().not_before - task_config.as_ref().time_precision
{
return Err(DapAbort::ReportRejected {
detail: "The timestamp preceeds the start of the task".into(),
detail: "The timestamp preceeds the start of the task's validity window".into(),
}
.into());
}

if report.report_metadata.time
< task_config.as_ref().not_before - task_config.as_ref().time_precision
{
// Check that the report was generated after the task's `not_before` time.
println!("report_metadata.time - task_config.not_before: {}", report.report_metadata.time - task_config.as_ref().not_before);
if report.report_metadata.time < task_config.as_ref().not_before {
return Err(DapAbort::ReportRejected {
detail: "The timestamp preceeds the start of the task's validity window".into(),
detail: "The timestamp preceeds the start of the task".into(),
}
.into());
}


if let Some(public_extensions) = &report.report_metadata.public_extensions {
// We can be sure at this point that the ReportMetadata is well formed (as
// the decoding / error checking happens in the extractor).
Expand Down

0 comments on commit fcc8dc1

Please sign in to comment.