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

[Spec] Add private aggregation support for B&A response #1344

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

qingxinwu
Copy link
Collaborator

@qingxinwu qingxinwu commented Nov 22, 2024

Client side support of private aggregation reports for auctions run on bidding and auction service.
Also fix a bug that non-reserved events should be ignored for seller scripts.


Preview | Diff

@qingxinwu qingxinwu added the spec Relates to the spec label Nov 22, 2024
@qingxinwu qingxinwu requested a review from morlovich December 11, 2024 20:33
@qingxinwu
Copy link
Collaborator Author

IETF spec that handles paggResponse field: privacysandbox/draft-ietf-bidding-and-auction-services#15

@qingxinwu
Copy link
Collaborator Author

@morlovich Mind taking a look? Thanks!

get batching scope steps</a>.

Note: Each non-reserved |event| will have a different [=batching scope=]
that is created later.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is copied from on-device PAgg part. I don't see a place that creates the batching scope for non-reserved events, IIUC

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it may be because those are sent, well, on event?

@@ -6042,6 +6135,8 @@ event, PAExtendedHistogramContribution contribution)</dfn> method steps are:
reserved event types are added later.
1. If |event| is "`reserved.once`" and |function| is [=worklet function/report-result=] or
[=worklet function/report-win=], [=exception/throw=] a {{TypeError}}.
1. If |event| does not [=string/start with=] "`reserved.`", and |function| is "`scoreAd()`" or
"`report-result`", return.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand this change.


<div algorithm>
To <dfn>commit server response private aggregation contributions</dfn> given a
[=server auction response=] |contributionsMap|, a [=reporting context=] |reportingContext|, a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think server auction response is the right type here?

1. Return the result of running [=get or create a batching scope=] given |reportingOrigin|,
|coordinator| and |reportingContext|.
: <a spec="private-aggregation-api" for="scoping details">get debug scope steps</a>
:: An algorithm that returns a new [=debug scope=].
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So technically you don't need a |scopingDetails| here since you're not integrating with contributeToHistogram[OnEvent], though it might be worthwhile for consistency?

get batching scope steps</a>.

Note: Each non-reserved |event| will have a different [=batching scope=]
that is created later.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it may be because those are sent, well, on event?

1. [=list/For each=] |contribution| of |contributions|:
1. Let |entry| be a new [=on event contribution entry=] with the items:
: [=on event contribution entry/contribution=]
:: |contribution|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have some sort of an assert here that it doesn't have any baseValues?

:: |reportingOrigin|
1. If |eventToContributionsMap|[|event|] does not [=map/exist=], set
|eventToContributionsMap|[|event|] to « |entry| ».
1. Otherwise, [=list/append=] |eventToContributionsMap|[|event|] with |entry|.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

....append ... with ... is kinda strange. Append |entry| to ... ?

1. If |event| does not [=string/start with=] "`reserved.`":
1. [=list/For each=] |onEventEntry| of |contributions|:
1. If |onEventEntry|'s [=on event contribution entry/server filtered=] is false and |bidId| is
not |winnerId|, then [=list/remove=] |onEventEntry| from |contributions|.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would prefer if you checked it inside the existing loop over contributions, and just used continue as everything else, rather than have a different pre-filtering loop.

1. [=list/For each=] |onEventEntry| of |contributions|:
1. If |onEventEntry|'s [=on event contribution entry/server filtered=] is false and |bidId| is
not |winnerId|, then [=list/remove=] |onEventEntry| from |contributions|.
1. If |onEventEntry|'s [=on event contribution entry/server filtered=] is false:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and you don't even have onEventEntry at this level? I think you probably just want to move the reserved.win/reserved.loss check into the "For each onEventEntry of contributions :" loop, since now it needs to check the server filtered bit.... except shouldn't things that are server-filtered only be using reserved.always anyway?

...I am not sure you actually need the server-filtered bid if the part about them always having reserved.always are true.

(The way losing components is supposed to be handled is by not having a winnerId be set on them).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec Relates to the spec
2 participants