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

Add decoding commands to dapf #688

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

Conversation

mendess
Copy link
Collaborator

@mendess mendess commented Sep 30, 2024

This allows for easier decoding of DAP outputs

Using this

cargo run --bin dapf -- decode ./path/to/collection_output collection \
    --vdaf-config '{"prio3": { "sum": { "bits": 8 } } }' \
    --task-id "8TuT5Z5fAuutsX9DZWSqkUw6pzDl96d3tdsDJgWH2VY" \
    --hpke-config-path ./hpke-config.json \
    --report-count 2

and assuming that ./hpke-config.json has the hpke config used by the collector, this command can decode and show the aggregated value

example output:

{
  "decrypted": {
    "u128": 42
  },
  "original": {
    "encrypted_agg_shares": [
      {
        "config_id": 183,
        "enc": "e1fda76d2c9d905606886147e19ca0c7cdf6aea4d933b265db986fe7f679f86c",
        "payload": "6fdef070cbecd13e010e8bc87c8e77ab36908e37344595f78215b398126fa062"
      },
      {
        "config_id": 183,
        "enc": "413f15cc4bb3bc190175adb792bb41da9e4052adca39a59db09cb00ca62c4552",
        "payload": "ac653775e93bf82d4e7b5807fed8b81508ebaacd180df47e0f4ecf4b23479ddb"
      }
    ],
    "interval": {
      "duration": 3600,
      "start": 1727715600
    },
    "part_batch_sel": {
      "fixed_size_by_batch_id": {
        "batch_id": "544ac0e120712ac6ac3dd50ae3d3bee70c0ffb1e10a396cb250c66d1afc8cbf6"
      }
    },
    "report_count": 1
  }
}

@@ -293,6 +322,8 @@ enum Action {
/// Interact with test routes behind `test-utils` feature flags.
#[command(subcommand)]
TestRoutes(TestAction),
/// Decode various payloads
Copy link
Contributor

Choose a reason for hiding this comment

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

various could use some precision.
possibly also add an example command and how to retrieve/generate the payload from a leader/helper, maybe with dapf itself

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