Commit Graph

17 Commits

Author SHA1 Message Date
Kris Nuttycombe 4d44fb56f5
Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
Co-authored-by: ying tong <yingtong@z.cash>
2021-07-20 09:45:36 -06:00
Kris Nuttycombe 9dfc9ecdcc Auth fragment concatenation is only associative, not commutative. 2021-07-20 07:40:13 -06:00
Kris Nuttycombe 63d8437d72 Simplify leaf_value match. 2021-07-20 07:25:26 -06:00
Kris Nuttycombe e6dd1c2461 Remove value_at 2021-07-20 07:22:59 -06:00
Kris Nuttycombe d188121cbe Improve bridgetree documentation. 2021-07-08 10:16:55 -06:00
Kris Nuttycombe 5f719bb769 Rename "parent" to "ommer"
The term "parent" as it has previously been used in this module is
confusing, because it referred not to the actual parent of a leaf note,
but to the *sibling* of the leaf's future parent. "Ommer" is a
gender-neutral term for the sibling of a parent, so it is ideal
for use in this context.
2021-07-02 16:43:32 -06:00
Kris Nuttycombe 530c94a40f Apply suggestions from code review
Co-authored-by: str4d <jack@electriccoin.co>
2021-06-28 16:24:27 -06:00
Kris Nuttycombe 5e70b5cfd6 Add function to estimate dynamic memory usage of frontiers.
Also clean up Clippy complaints.
2021-06-28 16:07:09 -06:00
Kris Nuttycombe cf68d49d3f Trivial fixup. 2021-06-23 15:39:24 -06:00
Kris Nuttycombe 3decd0bf48 Use const generic parameter for tree depth. 2021-06-23 14:14:57 -06:00
Kris Nuttycombe aed785e896 Rename "Level" -> "Altitude"
The FlyClient spec uses "Altitude" for this concept in
Merkle mountain ranges, so I'm renaming for consistency.
2021-06-19 11:24:33 -06:00
Kris Nuttycombe d319262985 Add conversion from Position to usize 2021-06-19 08:07:59 -06:00
Kris Nuttycombe 205b075aa8 Expose position of possibly-empty frontier. 2021-06-18 22:06:16 -06:00
Kris Nuttycombe 06e0a5772e Add `Frontier` trait as a subset of `Tree` operations.
For some applications, it is not necessary to include the
full range of witnessing and checkpointing operations. The
Frontier trait captures the minimal operations required:
appending leaves to the tree and constructing the root
of the tree by hashing against empty nodes.
2021-06-18 14:21:03 -06:00
Kris Nuttycombe b89a359121 Remove duplicative case from witness computation. 2021-06-18 09:24:09 -06:00
Kris Nuttycombe c1fcd83329 Implement efficient incremental merkle tree. 2021-06-17 19:32:50 -06:00
Kris Nuttycombe 1267c8ec07 Rename "efficient" module to "bridgetree". 2021-06-17 19:31:26 -06:00