Augusto Hack
45412b5cec
Merge pull request #134 from 0xPolygonMiden/add-rustfmt-config
config: add rustfmt config
2 years ago
Augusto F. Hack
bbb1e641a3
config: add rustfmt config
2 years ago
Bobbin Threadbare
e02507d11e
chore: update version to v0.4.0
2 years ago
Bobbin Threadbare
b5eb68e46c
Merge pull request #120 from 0xPolygonMiden/next
Tracking PR for v0.3 release
2 years ago
Bobbin Threadbare
61db888b2c
chore: update crate version to v0.3
2 years ago
Bobbin Threadbare
051167f2e5
Merge pull request #76 from 0xPolygonMiden/bobbin-blake3-opt
BLAKE3 hash_elements() optimization
2 years ago
Victor Lopes
498bc93c15
Merge pull request #125 from 0xPolygonMiden/vlopes11-store-get-leaf-depth
feat: add `MerkleStore::get_leaf_depth`
2 years ago
Victor Lopez
00ffc1568a
feat: add `MerkleStore::get_leaf_depth`
This commit introduces `get_leaf_depth`, a tiered SMT helpers that will
retrieve the depth of a leaf for a given root, capped by `64`.
closes #119
2 years ago
Augusto Hack
cbf51dd3e2
Merge pull request #127 from 0xPolygonMiden/hacka-optimized-peak-hash
mmr: optimized peak hash for Miden VM
2 years ago
Augusto F. Hack
ab903a2229
mmr: optimized peak hash for Miden VM
2 years ago
Bobbin Threadbare
86dba195b4
Merge pull request #124 from 0xPolygonMiden/bobbin-merkle-fixes
Merkle fixes
2 years ago
Bobbin Threadbare
bd557bc68c
fix: add validation to NodeIndex constructor and remove BitIterator
2 years ago
Augusto Hack
cf94ac07b7
Merge pull request #121 from 0xPolygonMiden/hacka-simple-smt-parent-node-iterator
feat: add parent node iterator for SimpleSMT
2 years ago
Augusto Hack
d873866f52
Merge pull request #118 from 0xPolygonMiden/hacka-support-mmr-in-the-merkle-store
feat: add support for MMR to the MerkleStore
2 years ago
Augusto F. Hack
9275dd00ad
feat: add parent node iterator for SimpleSMT
2 years ago
Augusto F. Hack
429d3bab6f
feat: add support for MMR to the MerkleStore
2 years ago
Augusto Hack
f19fe6e739
Merge pull request #117 from 0xPolygonMiden/hacka-simplify-consuming-merkle-tree
feat: add node iterator to MerkleTree
2 years ago
Augusto F. Hack
1df4318399
feat: add node iterator to MerkleTree
2 years ago
Bobbin Threadbare
433b467953
feat: optimized hash_elements for blake3 hasher
2 years ago
Augusto Hack
f46d913b20
Merge pull request #116 from 0xPolygonMiden/hacka-remove-merke-store
Remove SimpleSmt store
2 years ago
Augusto F. Hack
f8a62dae76
chore: remove simple_smt::Store
2 years ago
Victor Lopes
49b9029b46
Merge pull request #115 from 0xPolygonMiden/vlopes11-store-smt-depth
feat: Add `depth` as store SMT argument
2 years ago
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.
2 years ago
Bobbin Threadbare
9389f2fb40
Merge pull request #80 from 0xPolygonMiden/next
v0.2 tracking PR
2 years ago
Bobbin Threadbare
703692553d
chore: add winterfell dependency update to changelog
2 years ago
Bobbin Threadbare
d68be83bc4
chore: add Mmr to readme and changelog
2 years ago
Bobbin Threadbare
80171af872
Merge pull request #114 from 0xPolygonMiden/v0.2.0-release-prep
Prepare v0.2 release
2 years ago
Augusto Hack
75af3d474b
Merge pull request #113 from 0xPolygonMiden/hacka-merkle-store-fix-empty-roots
bugfix: fix internal nodes of for empty leafs of a SMT
2 years ago
Augusto F. Hack
9e6c8ff700
bugfix: fix internal nodes of for empty leafs of a SMT
The path returned by `EmptySubtreeRoots` starts at the root, and goes to
the leaf. The MerkleStore constructor assumed the other direction, so
the parent/child hashes were reversed.
This fixes the bug and adds a test.
2 years ago
Bobbin Threadbare
a58922756a
chore: update crate versions, dependencies, and CHANGELOG
2 years ago
Augusto Hack
bf15e1331a
Merge pull request #112 from 0xPolygonMiden/hacka-add-serde-to-merklestore
Add serde to merklestore
2 years ago
Augusto F. Hack
7957cc929a
feat: added MerkleStore serde
2 years ago
Victor Lopes
854892ba9d
Merge pull request #111 from 0xPolygonMiden/vlopes11-increase-empty-subtrees
feat: add empty subtree constants to cover u8::MAX depth
2 years ago
Bobbin Threadbare
ce38ee388d
Merge pull request #104 from 0xPolygonMiden/hacka-store-docs
Store docs
2 years ago
Bobbin Threadbare
4d1b3628d3
Merge pull request #110 from 0xPolygonMiden/bobbin-pathset-fixes
Fix MerklePathSet issues
2 years ago
Augusto F. Hack
2d1bc3ba34
store: added user documentation on usage and purpose
2 years ago
Victor Lopez
2ff96f40cb
feat: add empty subtree constants to cover u8::MAX depth
Prior to this commit, we limited the constants count to 64 for the empty
subtrees depth computation. This is a hard-assumption that every tree of
Miden will have a depth up to 64 - and will cause undefined behavior if
it doesn't.
With the introduction of `MerkleStore::merge_roots` and the deprecation
of `mtree_cwm` instruction from the VM, this assumption is broken and
the user might end with trees with depth greater than 64. This broken
assumption could lead to attack vectors.
We can easily fix that by extending the pre-computed hashes list to the
maximum of `u8` (i.e. 255). This will have zero impact on functionality,
and will be completely safe to use without hard assumptions.
2 years ago
Bobbin Threadbare
9531d2bd34
fix: to paths reduction of MerklePathSet
2 years ago
Bobbin Threadbare
c79351be99
Merge pull request #107 from 0xPolygonMiden/hacka-store-add-merkle-paths
store: added with_merkle_paths constructor
2 years ago
Bobbin Threadbare
b7678619b0
Merge pull request #103 from 0xPolygonMiden/hacka-format-merkle-tree
Format merkle tree
2 years ago
Augusto F. Hack
0375f31035
feat: added utility to format MerkleTree and MerklePath to hex
Example formatted MerkleTree:
```
880abe452320966617646e7740b014954300f19a28780a0889d62ff33f4b0534
1ade1369091efa31201e9b60c9c28874d0ddce5362b335135a6bb4c917285983
3e60a9c843b4bb19f7a0572102e6507195f5240767a396335fd21981b048b807
0100000000000000000000000000000000000000000000000000000000000000
0200000000000000000000000000000000000000000000000000000000000000
0300000000000000000000000000000000000000000000000000000000000000
0400000000000000000000000000000000000000000000000000000000000000
```
Example formatted MerklePath:
```
[0400000000000000000000000000000000000000000000000000000000000000, 1ade1369091efa31201e9b60c9c28874d0ddce5362b335135a6bb4c917285983]
```
2 years ago
Augusto Hack
c96047af9d
Merge pull request #102 from 0xPolygonMiden/hacka-merkle-tree-assert-message
chore: clarified assert message
2 years ago
Augusto F. Hack
b250752883
store: added with_merkle_paths constructor
And unit tests for each constructor type.
2 years ago
Augusto Hack
482dab94c5
Merge pull request #101 from 0xPolygonMiden/hacka-fix-benchmark-code
Fix benchmark code
2 years ago
Augusto F. Hack
d6cbd178e1
chore: clarified assert message
2 years ago
Augusto F. Hack
ef342cec23
bugfix: fix store benchmark
2 years ago
Victor Lopes
7305a72295
Merge pull request #99 from 0xPolygonMiden/vlopes11-merkle-store-containers
feat: add merkle path containers and return them on tree update
2 years ago
Victor Lopez
84086bdb95
feat: add merkle path containers and return them on tree update
Returning tuples is often confusing as they don't convey meaning and it
should be used only when there is no possible ambiguity.
For `MerkleStore`, we had a couple of tuples being returned, and reading
the implementation was required in order to distinguish if they were
leaf values or computed roots.
This commit introduces two containers that will self-document these
returns: `RootPath` and `ValuePath`. It will also update `set_node` to
return both the new root & the new path, so we can prevent duplicated
traversals downstream when updating a node (one to update, the second to
fetch the new path/root).
2 years ago
Bobbin Threadbare
a681952982
Merge pull request #97 from 0xPolygonMiden/hacka-storage-benchmark
Storage benchmark
2 years ago
Augusto F. Hack
78e82f2ee6
feat: add benchmark for storages
2 years ago