Skip to content
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

[saffron] Add Diff type , methods, and tests #3006

Merged
merged 3 commits into from
Feb 10, 2025

Conversation

martyall
Copy link
Contributor

@martyall martyall commented Feb 8, 2025

This PR builds on #3005

While working on #3004 I did not approach the Diff type carefully enough. This PR is meant to slow things down and make sure we have the spec fulfilled before implementing the update functionality that uses it.

  • clearly define the Diff type and it's create method using sparse representation suggested by @dannywillems.
  • clearly define Diff spec. The assumptions are:
    1. You are allowed to construct a diff if the number of polynomials (chunks) required is less than or equal to the original: test_allow_legal_updates
    2. You are not allowed to construct a diff if the new number of chunks is strictly more -- in this case we should throw an error: test_cannot_construct_bad_diff
  • add property based tests to prove the Diff spec

The storage provider will also have to enforce these invariants

@martyall martyall force-pushed the martin/saffron-add-diff-type branch from 81f6c60 to fc74cdb Compare February 8, 2025 04:32
@martyall martyall force-pushed the martin/saffron-add-diff-type branch from fc74cdb to 4eca4ce Compare February 8, 2025 04:36
@martyall martyall marked this pull request as ready for review February 8, 2025 04:37
Copy link

codecov bot commented Feb 8, 2025

Codecov Report

Attention: Patch coverage is 73.10345% with 39 lines in your changes missing coverage. Please review.

Project coverage is 76.83%. Comparing base (505b3b7) to head (82bbc48).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
saffron/src/diff.rs 70.67% 39 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3006      +/-   ##
==========================================
+ Coverage   76.80%   76.83%   +0.03%     
==========================================
  Files         261      262       +1     
  Lines       61888    62028     +140     
==========================================
+ Hits        47530    47662     +132     
- Misses      14358    14366       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from martin/saffron-commitment-type to master February 9, 2025 11:08
saffron/src/diff.rs Outdated Show resolved Hide resolved
@martyall martyall force-pushed the martin/saffron-add-diff-type branch from 73bfdde to 297bf5b Compare February 9, 2025 19:54
@martyall martyall requested a review from dannywillems February 9, 2025 19:57
@martyall
Copy link
Contributor Author

martyall commented Feb 9, 2025

@dannywillems 82bbc48 was added and PR description updated since original review

@martyall martyall force-pushed the martin/saffron-add-diff-type branch from 297bf5b to ce258d3 Compare February 10, 2025 17:16
@martyall martyall force-pushed the martin/saffron-add-diff-type branch from ce258d3 to 82bbc48 Compare February 10, 2025 17:22
@dannywillems dannywillems merged commit 28fc543 into master Feb 10, 2025
13 checks passed
@dannywillems dannywillems deleted the martin/saffron-add-diff-type branch February 10, 2025 18:58
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.

2 participants