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] Deals #1275

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

[SPEC] Deals #1275

wants to merge 23 commits into from

Conversation

HabibiYou
Copy link
Contributor

@HabibiYou HabibiYou commented Sep 9, 2024

Adding Spec changes for Deals support.


Preview | Diff

@JensenPaul JensenPaul added the spec Relates to the spec label Sep 10, 2024
Copy link
Collaborator

@orrb1 orrb1 left a comment

Choose a reason for hiding this comment

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

Thanks, Youssef!

spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
Copy link
Collaborator

@orrb1 orrb1 left a comment

Choose a reason for hiding this comment

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

A few more comments. Thanks again, Youssef!

spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
Copy link
Collaborator

@orrb1 orrb1 left a comment

Choose a reason for hiding this comment

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

Last few comments. Thanks, Youssef!

spec.bs Outdated Show resolved Hide resolved
spec.bs Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated
1. Let |igAd| be the [=interest group ad=] from |generatedBid|'s [=generated bid/interest group=]'s
[=interest group/ads=] whose [=interest group ad/render url=] is |generatedBid|'s
[=generated bid/ad descriptor=]'s [=ad descriptor/url=].
1. If both of the following return true:
Copy link
Collaborator

Choose a reason for hiding this comment

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

These four lines (7081-7084) seem to be an incomplete transition. Is this correct?

  1. If [=query generated bid k-anonymity count=] given |generatedBid| returns true AND
     (|generatedBid|'s [=generated bid/selected buyer and seller reporting ID=] does not [=map/exists|exist=] OR
      [=query reporting ID k-anonymity count=] given |generatedBid|'s [=generated bid/interest group=], |igAd|,
      and the |generatedBid|'s [=generated bid/selected buyer and seller reporting ID=] is true), then:
    1. [=list/Append=] |generatedBid| to |bidsToScore|.

This formation allows you to also remove these two lines above:

  1. Let |selectedReportingId| be a [=string=]-or-null that is set to null.
  1. If |generatedBid|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=], set |selectedReportingId| to it.

Copy link
Contributor Author

@HabibiYou HabibiYou Sep 12, 2024

Choose a reason for hiding this comment

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

Hmm This seemed to have been in a messed up state. I restructured it based on your comments. However I left creating the variables because I feel as though it makes that long if statement easier to understand. Let me know what you think.

@HabibiYou HabibiYou marked this pull request as ready for review September 13, 2024 14:33
@qingxinwu qingxinwu self-requested a review September 13, 2024 21:24
Copy link
Collaborator

@qingxinwu qingxinwu left a comment

Choose a reason for hiding this comment

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

first round comments. Will take another look later.

spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
@qingxinwu
Copy link
Collaborator

almost there.

spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
Copy link
Collaborator

@qingxinwu qingxinwu left a comment

Choose a reason for hiding this comment

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

sorry for being slow on this. A few last nits, and two questions around k-anon (mostly double check to help me understand).
After these are addressed, it'll be ready.

spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
|browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to |igAd|'s
[=interest group ad/buyer and seller reporting ID=].
1. If the |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null and the
result of running [=query reporting ID k-anonymity count=] with |winner|'s
Copy link
Collaborator

@qingxinwu qingxinwu Sep 23, 2024

Choose a reason for hiding this comment

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

I'm not very familiar with the k-anon work, so just want to double check that this matches our implementation: The reporting ids need to use this algorithm to query the k-anon server, but cannot be queried from the k-anon cache?

(scratch the below:
It seems the [=update k-anonymity cache for interest group=] does update a hash with "selected buyer and seller reporting ID", but not other reporting ids. So whenever those reporting ids need to be checked against k-anon, they need to check from the k-anon server?)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good point, Qingxin. This case, like the others here, does indeed use the k-anon cache, so it should presumably be something more like ...

1. If the |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null:
   1. Let |reportingHashCode| be the result of [=compute the key hash of reporting ID=] with |winner|'s
      [=generated bid/interest group=], |igAd|, and |winner|'s
      [=generated bid/selected buyer and seller reporting ID=].
   1. If [=query k-anonymity cache=] for |reportingHashCode| returns true:
      1. [=map/Set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] ...

Copy link
Collaborator

@qingxinwu qingxinwu Sep 23, 2024

Choose a reason for hiding this comment

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

SG. Once it's changed, it'll be ready to go.
(there're two more cases like this a few lines below, which I'd assume that can use cache as well. If that's the case, update them as well)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you guys, i just made the change so let me know if the wording sounds good!

Copy link
Collaborator

@qingxinwu qingxinwu Sep 23, 2024

Choose a reason for hiding this comment

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

it seems [=query reporting ID k-anonymity count=] itself should query the cache, instead of "querying the k-anonymity count", like what [=query generated bid k-anonymity count=] does. Then these call sites can keep what you had before (i.e., call [=query reporting ID k-anonymity count=] directly).

FYI @brusshamilton

Copy link
Collaborator

Choose a reason for hiding this comment

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

Russ confirmed that only [=update k-anonymity cache for key=] should talk to k-anon server, and other places should use cache. So please update the [=query reporting ID k-anonymity count=] algorithm to query the cache, and use it directly in these places.
You can also delete this todo after the change.

spec.bs Show resolved Hide resolved
@qingxinwu
Copy link
Collaborator

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec Relates to the spec
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants