private-attribution / ipa

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

Change Validator trait to use UpgradedContext #1211

Closed akoshelev closed 1 month ago

akoshelev commented 1 month ago

This is a minor change that does not affect a lot of code. The reason for making it is to make trait bounds easier for the upcoming PRF eval upgrade where the validator bounds need to be expressed in a form of upgraded context.

It is also easier to reason about because at the time when validator is created, the UpgradableContext is gone

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.78%. Comparing base (23202a2) to head (909f688).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1211 +/- ## ========================================== - Coverage 92.79% 92.78% -0.02% ========================================== Files 197 197 Lines 30523 30523 ========================================== - Hits 28325 28321 -4 - Misses 2198 2202 +4 ```

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

andyleiserson commented 1 month ago

I did something slightly different in #1208 for the DZKP types -- I removed the DZKPUpgradedContext associated type on trait UpgradableContext completely and changed the type parameter on trait DZKPValidator to an associated type.

I'm not sure if there's a reason to prefer one or the other, but it's probably worth making the two variants the same unless there's a good reason they need to be different.