Skip to content

Conversation

@jcjones
Copy link
Contributor

@jcjones jcjones commented Jan 28, 2026

  • Changes the processing of Extensions to not be a CodecError
    • We don't want to abort the stream, we want to give report-level errors!
    • Changes ExtensionType to have an Unknown type, which we then use as a sentinel
  • Adds/updates tests to also exercise this

Fixes #4021

- Changes the processing of Extensions to not be a CodecError
    - We don't want to abort the stream, we want to give report-level errors!
    - Changes ExtensionType to have an Unknown type, which we then use as a sentinel
- Adds/updates tests to also exercise this

Fixes #4021
@jcjones jcjones marked this pull request as ready for review January 28, 2026 03:39
@jcjones jcjones requested a review from a team as a code owner January 28, 2026 03:39
let mut extensions = HashMap::new();
if !plaintext_input_share.private_extensions().iter().chain(prepare_init.report_share().metadata().public_extensions()).all(|extension| {
extensions
for extension in plaintext_input_share.private_extensions().iter().chain(prepare_init.report_share().metadata().public_extensions())
Copy link
Contributor

Choose a reason for hiding this comment

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

I think rustfmt gives up on lines this long, but can we try to manually wrap it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whoops!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pub enum ExtensionType {
Tbd = 0,
Taskbind = 0xFF00,
Tbd,
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's rename this to Reserved to match the specification.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

doh, I meant to do this. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

debug!(
task_id = %task.id(),
report_id = ?prepare_init.report_share().metadata().id(),
unrecognized_etension_type = ?extension.extension_type(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: typo

Suggested change
unrecognized_etension_type = ?extension.extension_type(),
unrecognized_extension_type = ?extension.extension_type(),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

d'oh

);
metrics
.aggregate_step_failure_counter
.add(1, &[KeyValue::new("type", "unrecognized_extension")]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should add unrecognized_extension to the counter initialization loop, in aggregator/src/metrics.rs. This will keep Prometheus's rate() from missing the first nonzero sample.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked around for this but I didn't look in the right places. Thanks! 49110e8

debug!(
task_id = %task.id(),
report_id = ?report.metadata().id(),
unrecognized_etension_type = ?extension.extension_type(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: typo

Suggested change
unrecognized_etension_type = ?extension.extension_type(),
unrecognized_extension_type = ?extension.extension_type(),

@jcjones jcjones enabled auto-merge (squash) January 28, 2026 18:36
@jcjones jcjones merged commit 36f5f0e into main Jan 28, 2026
8 checks passed
@jcjones jcjones deleted the jcj/4021-input-share-validation-updates-try2 branch January 28, 2026 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.

DAP-16: Input Share Validation Updates

4 participants