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

Extending limited history to properly check for the existence of past values #422

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kevinlewi
Copy link
Contributor

@kevinlewi kevinlewi commented Jan 14, 2024

In general, this change improves the security properties that are supposed to be attained from a limited history proof. A (full) key history proof provides a list of all past versions for a query key. A limited history proof allows for some past version to be left out of the proof. Previously, the way this was implemented was to literally truncate the older versions.

Now, we are instead properly adding the existence proofs for past marker versions and non-existence proofs for future marker versions.

Specifically in this change, it:

  • Removes HistoryParams::SinceEpoch, since this is not really supportable by the existing construction. The only way for specifying a non-default parameter now is with HistoryParams::MostRecent.
  • Parameters in the HistoryProof struct were repurposed and renamed to support past and future marker versions
  • Added a new get_marker_versions() utility function which determines the past and future version numbers to check as part of the history proof generation and verification
  • Moved HistoryParams out from akd and into akd_core since it is also used by verification
  • Added a new InvalidVersion error type
  • Added tests for the new history proof verification behavior, and updated docs as well

I am also bumping the version to 0.12.0-pre.1, since the introduced changes are incompatible with the previous version.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 14, 2024
@kevinlewi kevinlewi changed the title Extending limited history to properly check for the existence of past… Extending limited history to properly check for the existence of past values Jan 14, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2024

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (24b11de) 87.99% compared to head (939ca72) 88.13%.

Files Patch % Lines
akd_core/src/verify/history.rs 92.10% 9 Missing ⚠️
akd/src/directory.rs 87.17% 5 Missing ⚠️
akd/src/errors.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #422      +/-   ##
==========================================
+ Coverage   87.99%   88.13%   +0.13%     
==========================================
  Files          39       39              
  Lines        9054     9200     +146     
==========================================
+ Hits         7967     8108     +141     
- Misses       1087     1092       +5     

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

@kevinlewi kevinlewi force-pushed the address_limited_history branch 5 times, most recently from 1aaeb8e to 139d0d0 Compare January 15, 2024 04:04
@kevinlewi kevinlewi marked this pull request as ready for review January 22, 2024 02:12
@kevinlewi kevinlewi marked this pull request as draft February 19, 2024 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants