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

Enable taskprov in draft07 #436

Merged
merged 2 commits into from
Nov 29, 2023
Merged

Enable taskprov in draft07 #436

merged 2 commits into from
Nov 29, 2023

Conversation

cjpatton
Copy link
Contributor

@cjpatton cjpatton commented Nov 23, 2023

Stacked on #435.
Partially addresses #350.

Enable taskprov in draft07

Enable support for taskprov in the latest draft. The main technical
hurdle is to ensure the Leader can advertise the taskprov config to the
Helper in an HTTP Header. The simplest solution is to add the
information to DapTaskConfig that is needed in order to reconstruct
the serialized taskprov config, in particular the "task_info" field.

To do this, we add a new method field to the DapTaskConfig struct
that conveys the method by which the task was configured. The method has
type enum DapTaskConfigMethod, of which there are two variants. The
first is Taskprov and includes the "task_info". The second is
Unknown and is a catch-all for existing, manually configured tasks.

Accordingly, we deprecate the taskprov field of the DapTaskConfig
struct. We've kept the field in the struct for backwards compatibility:
there are some situations for which the indication is sufficient; in
situations where the "task_info" field is needed, we must abort.

This change also includes a number of related, but minor changes:

  • Have resolve_advertised_task_config() return a DapAbort rather
    than a DapError (an error in this flow always leads to an abort and
    is never an internal error).

  • Opt-out of the task unless (1) the "none" variant for "DpConfig" is
    indicated and (2) the indicated max batch query count is 1. Other
    values for these parameters are not currently supported by Daphne.

  • Introduce a type DapTaskParameters that encapsulates the parameters
    used to configure a task and implement a method for generating a task
    config using the taskprov method. This change is intended to simplify
    the test code, but should be independently useful.

@cjpatton cjpatton force-pushed the cjpatton/next-dap-9 branch 2 times, most recently from 2fd5ccd to a8cc3fe Compare November 23, 2023 01:57
daphne/src/lib.rs Outdated Show resolved Hide resolved
daphne/src/lib.rs Show resolved Hide resolved
daphne/src/lib.rs Show resolved Hide resolved
@cjpatton cjpatton requested a review from mendess November 24, 2023 16:41
daphne/src/lib.rs Outdated Show resolved Hide resolved
@cjpatton cjpatton requested a review from mendess November 27, 2023 14:46
daphne/src/lib.rs Outdated Show resolved Hide resolved
@cjpatton cjpatton force-pushed the cjpatton/next-dap-8 branch from fb09b07 to fc59ed2 Compare November 29, 2023 15:29
Base automatically changed from cjpatton/next-dap-8 to main November 29, 2023 16:31
@cjpatton cjpatton force-pushed the cjpatton/next-dap-9 branch 2 times, most recently from b7ca505 to 2c967c3 Compare November 29, 2023 16:39
Enable support for taskprov in the latest draft. The main technical
hurdle is to ensure the Leader can advertise the taskprov config to the
Helper in an HTTP Header. The simplest solution is to add the
information to `DapTaskConfig` that is needed in order to reconstruct
the serialized taskprov config, in particular the "task_info" field.

To do this, we add a new `method` field to the `DapTaskConfig` struct
that conveys the method by which the task was configured. The method has
type `enum DapTaskConfigMethod`, of which there are two variants. The
first is `Taskprov` and includes the "task_info". The second is
`Unknown` and is a catch-all for existing, manually configured tasks.

Accordingly, we deprecate the `taskprov` field of the `DapTaskConfig`
struct. We've kept the field in the struct for backwards compatibility:
there are some situations for which the indication is sufficient; in
situations where the "task_info" field is needed, we must abort.

This change also includes a number of related, but minor changes:

* Have `resolve_advertised_task_config()` return a `DapAbort` rather
  than a `DapError` (an error in this flow always leads to an abort and
  is never an internal error).

* Opt-out of the task unless (1) the "none" variant for "DpConfig" is
  indicated and (2) the indicated max batch query count is 1. Other
  values for these parameters are not currently supported by Daphne.

* Introduce a type `DapTaskParameters` that encapsulates the parameters
  used to configure a task and implement a method for generating a task
  config using the taskprov method. This change is intended to simplify
  the test code, but should be independently useful.
@cjpatton cjpatton force-pushed the cjpatton/next-dap-9 branch from 2c967c3 to b53eda2 Compare November 29, 2023 16:45
@cjpatton cjpatton merged commit 7c64840 into main Nov 29, 2023
4 checks passed
@cjpatton cjpatton deleted the cjpatton/next-dap-9 branch November 29, 2023 17:16
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.

2 participants