Commit Graph

13 Commits

Author SHA1 Message Date
a4ada7e2ee Add CPU parallelization to buildTreBottomUp
buildTreeBottomUp splits the key-values into n Buckets (where n is the
number of CPUs), in parallel builds a subtree for each bucket, once all
the subtrees are built, uses the subtrees roots as keys for a new tree,
which as result will have the complete Tree build from bottom to up,
where until the log2(nCPU) level it has been computed in parallel.

As result of this, the tree construction can be parallelized until
almost the top level, almost dividing the time by the number of CPUs.
2021-04-25 17:55:56 +02:00
a3473079de Add AddBatch CaseC
CASE C: ALMOST CASE B --> if Tree has few Leafs (but numLeafs>=minLeafsThreshold)
==============================================================================
- Use A, B, G, F as Roots of subtrees
- Do CASE B for each subtree
- Then go from L to the Root

              R
             /  \
            /    \
           /      \
          *        *
         / |      / \
        /  |     /   \
       /   |    /     \
L:    A    B   G       D
              / \
             /   \
            /     \
           C      *
                 / \
                /   \
               /     \
              ...    ... (nLeafs >= minLeafsThreshold)
2021-04-25 17:55:46 +02:00
6f43980c0f Add Tree.emptyHash & nLeafs methods 2021-04-25 17:55:34 +02:00
8ede441191 Add Graphviz generation methods 2021-04-17 09:33:00 +02:00
c26b23c544 Add Mutex, integrate tx into Tree struct 2021-04-12 21:26:26 +02:00
8af921667f Add tree.Update(k, v) method 2021-04-03 19:58:34 +02:00
f8ac4be02b Tests migrate from stretchr/testify to frankban/quicktest 2021-04-03 19:40:18 +02:00
f1665b1a15 Add Iterate, Dump, ImportDump methods to Tree 2021-04-02 15:31:38 +02:00
cf572f628e Add tree.AddBatch (using db.Tx) 2021-04-01 16:36:58 +02:00
4cd2ff6182 Add tree.Get 2021-03-31 23:05:10 +02:00
bde87ca844 Add proof verification 2021-03-31 20:34:36 +02:00
8c63b5d192 Add proof generation 2021-03-31 20:04:30 +02:00
43cb6041c9 Add Tree.Add compatible with circomlib 2021-03-30 22:41:34 +02:00