Skip to content

Add support for public extensions in Reports.#754

Merged
cjpatton merged 2 commits intomainfrom
jhoyla/public-extensions
Jan 16, 2025
Merged

Add support for public extensions in Reports.#754
cjpatton merged 2 commits intomainfrom
jhoyla/public-extensions

Conversation

@jhoyla
Copy link
Contributor

@jhoyla jhoyla commented Dec 31, 2024

Draft 13 adds mandatory support for public extensions in the ReportMetadata, but doesn't define any (Taskprov is (for now) a private extension). This PR adds support for rejecting unknown extensions, which is all of them.

Copy link
Contributor

@cjpatton cjpatton left a comment

Choose a reason for hiding this comment

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

I believe we're missing one feature: we need to resolve repeated extensions across the public and private extension fields.

@jhoyla
Copy link
Contributor Author

jhoyla commented Jan 2, 2025

I believe we're missing one feature: we need to resolve repeated extensions across the public and private extension fields.

So the spec says:

type. (For the purposes of this check, a private report extension can conflict
with a public report extension.) If so, the Aggregator MUST mark the input share
as invalid with error invalid_message.

Which I take to mean a conflict between the public and private extensions is allowed.
If I add support for taskprov as a public extension do I reject it if it appears in both places?

Copy link
Collaborator

@mendess mendess left a comment

Choose a reason for hiding this comment

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

not even a nit, just a comment. I don't have a preference but instead of Vec::new() you can write vec![]

@cjpatton
Copy link
Contributor

cjpatton commented Jan 2, 2025

I believe we're missing one feature: we need to resolve repeated extensions across the public and private extension fields.

So the spec says:

type. (For the purposes of this check, a private report extension can conflict
with a public report extension.) If so, the Aggregator MUST mark the input share
as invalid with error invalid_message.

Which I take to mean a conflict between the public and private extensions is allowed. If I add support for taskprov as a public extension do I reject it if it appears in both places?

The intent of the text is: "if the same extension appears twice, then the report MUST be rejected - regardless of what fields the extensions appear in." In particular, if the taskprov extension appears in the public and private fields, then reject.

@jhoyla jhoyla force-pushed the jhoyla/public-extensions branch 4 times, most recently from eda9b3c to 5078b99 Compare January 8, 2025 12:41
@jhoyla jhoyla requested review from cjpatton and mendess January 8, 2025 12:49
Copy link
Contributor

@cjpatton cjpatton left a comment

Choose a reason for hiding this comment

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

The code looks largely correct, though I have some suggestions for behavior changes. I think the tests need a bit of work. Also, I have some suggestions for making the code a little cleaner/easier to read.

@jhoyla jhoyla requested review from cjpatton and mendess January 14, 2025 14:33
@jhoyla jhoyla force-pushed the jhoyla/public-extensions branch 2 times, most recently from 28ff330 to 0287417 Compare January 14, 2025 14:46
Copy link
Contributor

@cjpatton cjpatton left a comment

Choose a reason for hiding this comment

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

Looks pretty good. Let's chat in our 1:1 about the necessity of the e2e tests.

@jhoyla jhoyla force-pushed the jhoyla/public-extensions branch from 0287417 to 8f8e5b9 Compare January 15, 2025 11:22
@jhoyla jhoyla requested a review from cjpatton January 15, 2025 15:41
@jhoyla jhoyla force-pushed the jhoyla/public-extensions branch from 7e5cd9e to afbafd0 Compare January 15, 2025 15:51
@cjpatton cjpatton force-pushed the jhoyla/public-extensions branch from afbafd0 to fbbe9e9 Compare January 16, 2025 17:56
@cjpatton
Copy link
Contributor

I've rebased this PR and updated the capnp schema to include the public extensions field. I've also added unit tests to confirm encoding/decoding works (thanks @mendess for the help there).

@cjpatton cjpatton force-pushed the jhoyla/public-extensions branch from fbbe9e9 to ed04ead Compare January 16, 2025 18:00
@cjpatton
Copy link
Contributor

Updated the commit to fix clippy

vdafVerifyKey @4 :VdafVerifyKey;
}

struct PublicExtensionsList @0x8b3c98c0ddd0043e {
Copy link
Contributor

Choose a reason for hiding this comment

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

@mendess I just ran capnp id and pasted the output here. So this is really just a random ID that needs to be unique?

Copy link
Collaborator

@mendess mendess left a comment

Choose a reason for hiding this comment

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

looks good to me

@cjpatton
Copy link
Contributor

I see CI passing, so I'm gonna squash and merge.

@cjpatton cjpatton force-pushed the jhoyla/public-extensions branch from ed04ead to 483032d Compare January 16, 2025 18:11
@cjpatton cjpatton force-pushed the jhoyla/public-extensions branch from 483032d to f0bc7b1 Compare January 16, 2025 18:18
@cjpatton
Copy link
Contributor

Rebased on the PR @mendess merged, hoping that solves the cargo doc failure.

@cjpatton cjpatton merged commit 0859473 into main Jan 16, 2025
4 checks passed
@cjpatton cjpatton deleted the jhoyla/public-extensions branch January 16, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants