private-attribution / ipa

A raw implementation of Interoperable Private Attribution
MIT License
41 stars 23 forks source link

Malicious aggregation and DP noising #1251

Closed andyleiserson closed 1 week ago

andyleiserson commented 1 week ago

Adds test coverage for malicious attribution and aggregation

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 93.12977% with 9 lines in your changes missing coverage. Please review.

Project coverage is 92.41%. Comparing base (8cc3fb2) to head (da67550). Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
ipa-core/src/protocol/context/batcher.rs 85.71% 4 Missing :warning:
ipa-core/src/protocol/dp/mod.rs 91.42% 3 Missing :warning:
ipa-core/src/protocol/ipa_prf/aggregation/mod.rs 93.75% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1251 +/- ## ========================================== + Coverage 92.37% 92.41% +0.03% ========================================== Files 201 201 Lines 31923 31989 +66 ========================================== + Hits 29489 29562 +73 + Misses 2434 2427 -7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

andyleiserson commented 1 week ago

The latest CI failure is real (and potentially non-deterministic):

thread 'protocol::ipa_prf::boolean_ops::share_conversion_aby::tests::test_malicious_convert_to_fp25519' panicked at library/core/src/panicking.rs:229:5:
panic in a destructor during cleanup
thread caused non-unwinding panic. aborting.
2024-09-05T19:21:38.867473Z  INFO stall_detector{role=H3}: ipa_core::helpers::gateway::stall_detection::gateway: new
2024-09-05T19:21:42.730417Z  INFO ipa_core::protocol::context::batcher: batch 0 is ready for validation
2024-09-05T19:21:42.732472Z  INFO ipa_core::protocol::context::batcher: batch 1 is ready for validation
thread 'tokio-runtime-worker' panicked at ipa-core/src/protocol/context/batcher.rs:129:13:
assertion `left == right` failed: Batches should be processed in order. Batch 1 is ready for validation, but the first batch is 0.
  left: 1
 right: 0

The failure is relevant to the following comment I had left in the code:

// I am not sure if this is okay, or if we need to tolerate batch validation requests
// arriving out of order. (If we do, I think we would still want to actually fulfill
// the validations in order.)
andyleiserson commented 1 week ago

The problem with out-of-order validation (the CI failure) applies to #1250 as well. I added the fix there.