Closed kevinlewi closed 3 months ago
Attention: Patch coverage is 97.79412%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 88.04%. Comparing base (
3ce5335
) to head (a73b230
). Report is 18 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
akd_core/src/utils.rs | 97.79% | 3 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@dillonrg thanks for the feedback!
Implements an efficiency optimization that changes the contents of a key history proof (reducing the number of total past marker versions and future marker versions) without compromising on security.
From the doc comments of get_marker_versions() (which is basically the only function that is updated):
The past marker versions are determined as follows:
As a concrete example, if start_version = 85, the past marker versions would be [16, 64, 80, 84]. Since: 01010101 => 85 01010100 => 84 01010000 => 80 01000000 => 64
And 16 comes from MARKER_VERSION_SKIPLIST.
The future marker versions are determined as follows:
As a concrete example, if start_version = 85, the future marker versions would be [86, 88, 96, 128, 256, 65536, 2^32] (potentially truncated depending on if any of these numbers exceed epoch).
Since: 01010101 => 85 01010110 => 86 01011000 => 88 01100000 => 96 10000000 => 128
And the remainder of the list comes from MARKER_VERSION_SKIPLIST.
Note that the past marker versions do not contain start_version, as this would be redundant in the history proof (since membership is already checked for start_version).