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
Merkle proofs 3.0 #1729
Merkle proofs 3.0 #1729
Conversation
f2ae1d1
to
9750ae6
Compare
9750ae6
to
58b8a98
Compare
Is there anything significant remaining to be done with this one? |
|
58b8a98
to
b121e8b
Compare
It seems that the MP tests fail on codecov (but not on the CI)
|
See aantron/bisect_ppx#398 for the coverage issue. I'll replace some |
|
The streamed proofs rely on the result of There is no need to retain de laziness in |
Codecov Report
@@ Coverage Diff @@
## main #1729 +/- ##
==========================================
+ Coverage 64.56% 67.44% +2.87%
==========================================
Files 98 100 +2
Lines 12294 12914 +620
==========================================
+ Hits 7938 8710 +772
+ Misses 4356 4204 -152
Continue to review full report at Codecov.
|
(* Trigger certain paths in [S.Tree] during "verify" *) | ||
let portable = | ||
(* During "verify" [portable] is [Pruned] with [portable] in env *) | ||
t0 | ||
in | ||
let portable_dirty = t in | ||
let trigger_node_to_map t = | ||
S.Tree.fold ~depth:(`Eq 1) ~order:`Sorted ~force:`True t () | ||
in | ||
let* () = trigger_node_to_map portable in | ||
let* () = trigger_node_to_map portable_dirty in | ||
let trigger_node_length t = | ||
let+ (_ : int) = S.Tree.length t [] in | ||
() | ||
in | ||
let* () = trigger_node_length portable in | ||
let* () = trigger_node_length portable_dirty in | ||
let trigger_node_fold_undefined t = | ||
S.Tree.fold ~depth:(`Eq 1) ~order:`Undefined ~force:`True t () | ||
in | ||
let* () = trigger_node_fold_undefined portable in | ||
let* () = trigger_node_fold_undefined portable_dirty in | ||
let (_ : bool) = S.Tree.is_empty portable in | ||
let trigger_node_to_backend_portable t = | ||
match S.Tree.destruct t with | ||
| `Contents _ -> assert false | ||
| `Node n -> | ||
let+ _ = S.to_backend_portable_node n in | ||
() | ||
in | ||
let* () = trigger_node_to_backend_portable portable_dirty in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests are new. They cover all the Portable*
cases when using Scan
in tree
This is now ready for review! Most of the lines brought by this PR already exist on 2.10. See https://github.com/mirage/irmin/compare/2.10..Ngoguey42:merkle-proofs-3.0 for the full diff between 2.10 and this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks.
I've taken a look at the new tests and done a fresh pass over the docs (with some copy edits).
Forward ported from many PRs spanning from 2.9 to 2.10
When computing the segments of an extender node in a stream proof, the current implementation returns them in reverse order (i.e. deepest segment first, progressing up the tree). This commit exercises this bug by modifying the existing stream extender test to use a non-palindrome test path.
The segment list contained in a stream proof extender node is computed in reverse order, and previously was not being properly reversed at the end of this process. This commit fixes the bug and introduces a `Reversed_list.t` type to make it impossible to forget to reverse the list before use in future.
96c3a39
to
efe5dc4
Compare
I'm not writing anything in the changelog as this should already be part of the 2.10 changelog Let's merge when green :) |
Thanks for this huge work! Merging now. |
No description provided.