-
Notifications
You must be signed in to change notification settings - Fork 14
DAP-16 Input Share Validation algorithm updates #4304
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
Conversation
- 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
| 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()) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
messages/src/lib.rs
Outdated
| pub enum ExtensionType { | ||
| Tbd = 0, | ||
| Taskbind = 0xFF00, | ||
| Tbd, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: typo
| unrecognized_etension_type = ?extension.extension_type(), | |
| unrecognized_extension_type = ?extension.extension_type(), |
There was a problem hiding this comment.
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")]); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
aggregator/src/aggregator.rs
Outdated
| debug!( | ||
| task_id = %task.id(), | ||
| report_id = ?report.metadata().id(), | ||
| unrecognized_etension_type = ?extension.extension_type(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: typo
| unrecognized_etension_type = ?extension.extension_type(), | |
| unrecognized_extension_type = ?extension.extension_type(), |
Fixes #4021