Closed akoshelev closed 1 month ago
Attention: Patch coverage is 94.72141%
with 18 lines
in your changes missing coverage. Please review.
Project coverage is 92.77%. Comparing base (
468e1e3
) to head (322e377
). Report is 15 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This API serves multiple purposes:
We could never make the existing API work and kept discovering bugs associated with it.
Previously, the validation process was separate, detached from actual protocol and validated everything at once. We saw multiple occurrences where reveal was called before sharings were validated.
Previous approach did not integrate smoothly with vectorization
Vectorization makes data processed in chunks. Going between different chunk sizes (one for data, one for validation) has proven to be challenging. The code written for that was hard to read.
Validate record API
The core of this proposal is to put
validate_record
API on theUpgradedContext
that takes arecord_id
and blocks the execution until this record (and others in the same batch) has been validated. FWIW this is exactly how ZKP validator works now.This API allows to bring closer together MAC and ZKP validation.
In addition to bringing this API, this change also updates all the uses of MAC validators and contexts to use it.
The pros include:
UpgradedContext
now can keep track of things validated, we can add this functionality later.validate_record
and it integrates smoothly withseq_join
(no need for specialvalidated_seq_join
)Downsides:
UpgradedContext
record_id
appears more and more in the API. Traits likeShareKnownValue
must be updated to support it.