Commit graph

33 commits

Author SHA1 Message Date
Bobbin Threadbare
6da2a62b2b
docs: add Graviton 4 to hash benchmarks 2025-01-04 12:18:29 -08:00
b151773b0d
feat: implement concurrent Smt construction (#341)
* merkle: add parent() helper function on NodeIndex
* smt: add pairs_to_leaf() to trait
* smt: add sorted_pairs_to_leaves() and test for it
* smt: implement single subtree-8 hashing, w/ benchmarks & tests

This will be composed into depth-8-subtree-based computation of entire
sparse Merkle trees.

* merkle: add a benchmark for constructing 256-balanced trees

This is intended for comparison with the benchmarks from the previous
commit. This benchmark represents the theoretical perfect-efficiency
performance we could possibly (but impractically) get for computing
depth-8 sparse Merkle subtrees.

* smt: test that SparseMerkleTree::build_subtree() is composable

* smt: test that subtree logic can correctly construct an entire tree

This commit ensures that `SparseMerkleTree::build_subtree()` can
correctly compose into building an entire sparse Merkle tree, without
yet getting into potential complications concurrency introduces.

* smt: implement test for basic parallelized subtree computation w/ rayon

Building on the previous commit, this commit implements a test proving
that `SparseMerkleTree::build_subtree()` can be composed into itself not
just concurrently, but in parallel, without issue.

* smt: add from_raw_parts() to trait interface

This commit adds a new required method to the SparseMerkleTree trait,
to allow generic construction from pre-computed parts.

This will be used to add a generic version of `with_entries()` in a
later commit.

* smt: add parallel constructors to Smt and SimpleSmt

What the previous few commits have been leading up to: SparseMerkleTree
now has a function to construct the tree from existing data in parallel.
This is significantly faster than the singlethreaded equivalent.
Benchmarks incoming!

---------

Co-authored-by: krushimir <krushimir@reilabs.co>
Co-authored-by: krushimir <kresimir.grofelnik@reilabs.io>
2024-12-04 10:54:41 -08:00
Augusto Hack
dbab0e9aa9
fix: clippy warnings (#280) 2024-02-21 20:55:02 -08:00
Philippe Laferrière
8ea37904e3 Introduce SparseMerkleTree trait (#245) 2024-02-14 11:52:40 -08:00
Bobbin Threadbare
004a3bc7a8 docs: update changelog and readme 2024-02-14 11:52:40 -08:00
Bobbin Threadbare
525062d023 docs: update bench readme 2024-02-14 11:52:40 -08:00
Al-Kindi-0
a2a26e2aba docs: added RPX benchmarks 2024-02-14 11:52:40 -08:00
Al-Kindi-0
3125144445 feat: RPX (xHash12) hash function implementation 2024-02-14 11:52:40 -08:00
Bobbin Threadbare
cf91c89845 refactor: clean up features 2023-10-03 23:26:45 -07:00
Bobbin Threadbare
f08644e4df refactor: simplify recording MerkleStore structure 2023-06-23 23:19:12 -07:00
tohrnii
fe9aa8c28c refactor: refactor crypto APIs to use RpoDigest instead of Word 2023-06-09 21:27:09 +01:00
Bobbin Threadbare
fcf03478ba refactor: update SimpleSmt interfaces 2023-05-08 00:12:24 -07:00
Bobbin Threadbare
9be4253f19 feat: remove clone requirement for MerkleStore From constructors 2023-04-21 11:22:36 -07:00
Augusto F. Hack
59595a2e04
feat: added From convertions for the MerkleStore 2023-04-21 14:47:58 +02:00
Augusto F. Hack
eb316f51bc
store: remove SimpleSMT/MerkleTree/Mmr add/with methods 2023-04-21 14:47:48 +02:00
Augusto F. Hack
bbb1e641a3
config: add rustfmt config 2023-04-11 17:38:39 +02:00
Bobbin Threadbare
051167f2e5
Merge pull request #76 from 0xPolygonMiden/bobbin-blake3-opt
BLAKE3 hash_elements() optimization
2023-04-07 23:12:41 -07:00
Bobbin Threadbare
bd557bc68c fix: add validation to NodeIndex constructor and remove BitIterator 2023-04-05 12:08:00 -07:00
Bobbin Threadbare
433b467953 feat: optimized hash_elements for blake3 hasher 2023-04-04 01:06:51 -07:00
Victor Lopez
d37f3f5e84
feat: Add depth as store SMT argument
Prior to this commit, MerkleStore allowed the creation of Sparse Merkle
tree only with the maximum depth of 63. However, this doesn't fit the
Tiered Sparse Merkle tree requirements, as it will contain trees of
depth 16.

This commit adds the `depth` argument to the MerkleStore methods that
will create Sparse Merkle trees.
2023-03-30 01:13:05 +02:00
Augusto F. Hack
ef342cec23
bugfix: fix store benchmark 2023-03-22 10:53:12 +01:00
Augusto F. Hack
78e82f2ee6
feat: add benchmark for storages 2023-03-21 14:29:18 +01:00
Victor Lopez
3a6a4fcce6
feat: refactor simple smt to use empty subtree constants
Prior to this commit, there was an internal procedure with the merkle
trees to compute empty sub-tree for arbitrary depths.

However, this isn't ideal as this code can be reused in any merkle
implementation that uses RPO as backend.

This commit introduces a structure that will generate these empty
subtrees values.
2023-03-07 20:44:42 +01:00
Augusto F. Hack
956e4c6fad
chore: initial run pre-commit 2023-03-01 17:45:57 +01:00
Bobbin Threadbare
ad2b63ce02
Merge pull request #31 from 0xPolygonMiden/bobbin-readme-improv
Minor updates to main and benchmark README files
2022-12-14 07:44:13 -08:00
Bobbin Threadbare
527455f600 docs: minor updates to main and benchmark README files 2022-12-14 07:30:37 -08:00
Victor Lopes
aa12215d30
Merge pull request #27 from 0xPolygonMiden/add-simple-smt
feat: add simple sparse merkle tree
2022-12-14 14:32:40 +01:00
Victor Lopez
5fd0d692e8
feat: add simple sparse merkle tree
This commit moves the previous implementation of `SparseMerkleTree` from
miden-core to this crate.

It also include a couple of new tests, a bench suite, and a couple of
minor fixes. The original API was preserved to maintain compatibility
with `AdviceTape`.

closes #21
2022-12-14 14:26:01 +01:00
Al-Kindi-0
c728423902 doc: benchmark hash functions
doc: benchmark hash functions

fix nits

fix: misc. nits

fix: nits and link

fix additional nits

fix: nits
2022-12-13 18:42:38 +01:00
Al-Kindi-0
20b437f842 feat: blake3 benchmarks 2022-12-06 08:25:48 +01:00
Bobbin Threadbare
ee1d5dc2e1 chore: clean up create interfaces 2022-11-30 21:28:54 -08:00
Al-Kindi-0
0abadf327e chore: rustfmt fix + minor nits 2022-11-25 17:24:11 +01:00
Al-Kindi-0
1e177f0ba3 feat: benchmark RPO 2022-11-25 16:16:20 +01:00