You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: utils/README.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,20 +20,23 @@ The crate supports two interchangeable Merkle tree implementations:
20
20
-**OptimalMerkleTree**
21
21
- Only stores nodes used to prove accumulation of set leaves
22
22
23
+
Both OptimalMerkleTree and FullMerkleTree use [Rayon](https://crates.io/crates/rayon) internally to speed up computation through data parallelism. This provides significant performance improvements, especially during large Merkle tree updates.
24
+
23
25
### Implementation notes
24
26
25
27
Glossary:
26
28
27
-
* depth: level of leaves if we count from levels from 0
28
-
* number of levels: depth + 1
29
-
* capacity (== number of leaves) -- 1 << depth
30
-
* total number of nodes: 1 << (depth + 1)) - 1
29
+
- depth: level of leaves if we count from levels from 0
30
+
- number of levels: depth + 1
31
+
- capacity (number of leaves): 1 << depth
32
+
- total number of nodes: 1 << (depth + 1) - 1
31
33
32
34
So for instance:
33
-
* depth: 3
34
-
* number of levels: 4
35
-
* capacity (number of leaves): 8
36
-
* total number of nodes: 15
35
+
36
+
- depth: 3
37
+
- number of levels: 4
38
+
- capacity (number of leaves): 8
39
+
- total number of nodes: 15
37
40
38
41
```mermaid
39
42
flowchart TD
@@ -53,7 +56,6 @@ flowchart TD
53
56
N6 -->|Leaf| L8
54
57
```
55
58
56
-
57
59
## Poseidon Hash Implementation
58
60
59
61
This crate provides an implementation to compute the Poseidon hash round constants and MDS matrices:
0 commit comments