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

Eliminate proposal "filtering" in favor of throwing hard errors #245

Merged
merged 7 commits into from
Jan 24, 2025

Conversation

tomleavy
Copy link
Contributor

Description of changes:

We previously had code to filter received proposals when you commit so that the commit would work based on the maximum valid set. In practice is problematic because although the proposals that aren't consumed wind up in unused_proposals, it is very easy to ignore the fact that some expected change to the group was not enacted.

As an alternative approach we are moving towards hard failing if any proposal is not valid in the context of all the cached + by value proposals we have within a commit. This also allows us to remove the forked "lite" version of filtering + batch_edit on the tree.

Call-outs:

With this PR, there is no way to recover when you get into a bad state due to receiving a proposal that is not valid in the context of the other received proposals. This is not the final form of this feature change. Follow ups are as follows:

  • Refactor the Error that is returned when a proposal is not valid to include a proposal ref and a reason. The reason should be an enum the represents the states described by the various MlsError cases we have currently.
  • Add a function to the commit builder that allows you to remove a specific proposal by passing in a proposal ref. We currently have proposals_mut, but that isn't really the most convenient way to use that functionality.
  • Add a function that mimics the older functionality by attempting to commit + remove any errored out proposal until the commit succeeds.

Testing:

Adjusted existing tests

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT license.

@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 98.70130% with 3 lines in your changes missing coverage. Please review.

Project coverage is 89.66%. Comparing base (c198d38) to head (581efd1).

Files with missing lines Patch % Lines
mls-rs/src/group/proposal_cache.rs 97.36% 1 Missing ⚠️
mls-rs/src/group/proposal_filter/filtering.rs 99.24% 1 Missing ⚠️
mls-rs/src/tree_kem/mod.rs 96.77% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           1.x-main     #245      +/-   ##
============================================
- Coverage     90.23%   89.66%   -0.57%     
============================================
  Files           176      176              
  Lines         31222    29737    -1485     
============================================
- Hits          28172    26664    -1508     
- Misses         3050     3073      +23     

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

@tomleavy tomleavy force-pushed the remove-proposal-filtering branch 2 times, most recently from 019912e to 92feb7e Compare January 23, 2025 04:02
@tomleavy
Copy link
Contributor Author

@mulmarta ignored two tests you can take a look at if you have a chance before I get back online

@tomleavy tomleavy force-pushed the remove-proposal-filtering branch from 92feb7e to d8ec776 Compare January 23, 2025 04:07
@tomleavy tomleavy force-pushed the remove-proposal-filtering branch from d8ec776 to bba48cd Compare January 23, 2025 04:28
@tomleavy tomleavy marked this pull request as ready for review January 23, 2025 13:32
@tomleavy tomleavy requested a review from a team as a code owner January 23, 2025 13:32
@mulmarta mulmarta merged commit 3052e12 into 1.x-main Jan 24, 2025
30 checks passed
@mulmarta mulmarta deleted the remove-proposal-filtering branch January 24, 2025 17:51
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.

4 participants