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
Victor Lopes
f07ed69d2f
Merge pull request #95 from 0xPolygonMiden/vlopes11-fix-merkle-store-bounds
fix: merkle store panics on bounds
2 years ago
Augusto F. Hack
17eb8d78d3
chore: storage -> store
2 years ago
Victor Lopez
8cb245dc1f
bugfix: reverse merkle path to match other structures
The store builds the path from root to leaf, this updates the code to
return a path from leaf to root, as it is done by the other structures.
This also added custom error for missing root.
2 years ago
Victor Lopez
867b772d9a
fix: merkle store panics on bounds
Prior to this commit, the MerkleStore panicked under certain bounds. It
will prevent such panics by using checked operations.
ilog2, for instance, will panic when the operand is zero. However, there
is a documentation rule enforcing the merkle tree to be size at least 2.
If this rule is checked, then the panic is impossible.
2 years ago
Bobbin Threadbare
33d37d82e2
Merge pull request #79 from 0xPolygonMiden/hacka-ignore-pre-commit-rev
ignore pre commit rev
2 years ago
Augusto Hack
5703fef226
Merge pull request #96 from 0xPolygonMiden/hacka-check-root-in-storage
bugfix: check if the requested root is in the storage
2 years ago
Augusto F. Hack
669ebb49fb
bugfix: check if the requested root is in the storage
2 years ago
Victor Lopes
931bcc3cc3
Merge pull request #94 from 0xPolygonMiden/vlopes11-merkle-store-derive
refactor: add derive proc macros to merkle store
2 years ago
Victor Lopez
91667fd7de
refactor: add derive proc macros to merkle store
This commit introduce common derive proc macros to MerkleStore. These
are required downstream as the in-memory storage can be cloned.
It also introduces constructors common to the other types of the crate
that will help to build a merkle store, using a build pattern.
2 years ago
Augusto Hack
e4ddf6ffaf
Merge pull request #93 from 0xPolygonMiden/hacka-add-merkle-store
Add merkle store
2 years ago
Augusto F. Hack
88a646031f
feat: add merkle store
2 years ago
Bobbin Threadbare
2871e4eb27
Merge pull request #87 from 0xPolygonMiden/vlopes11-36-simple-smt-prepare
feat: refactor simple smt to use empty subtree constants
2 years ago
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.
2 years ago
Augusto Hack
7ffa0cd97d
Merge pull request #67 from 0xPolygonMiden/hacka-merkle-mountain-range-memory-implementation
feat: merkle mountain range
2 years ago
Augusto F. Hack
32d37f1591
feat: merkle mountain range
2 years ago
Augusto F. Hack
bc12fcafe9
chore: ignore pre-commit rev
2 years ago
Augusto Hack
8c08243f7a
Merge pull request #78 from 0xPolygonMiden/hacka-pre-commit
Add pre commit
2 years ago
Augusto F. Hack
956e4c6fad
chore: initial run pre-commit
2 years ago
Augusto F. Hack
efa39e5ce0
feat: added pre-commit hook config
2 years ago
Bobbin Threadbare
ae3f14e0ff
Merge pull request #74 from 0xPolygonMiden/hacka-node-index-docs
docs: mention tree form order of NodeIndex docs
2 years ago
Bobbin Threadbare
962a07292f
Merge pull request #75 from 0xPolygonMiden/next
v0.1.4 release
2 years ago
Augusto F. Hack
dfb073f784
docs: mention tree form order of NodeIndex docs
2 years ago
Bobbin Threadbare
41c38b4b5d
chore: changed version to v0.1.4 in Cargo.toml
2 years ago
Bobbin Threadbare
c4eb4a6b98
Merge pull request #73 from 0xPolygonMiden/vlopes11-72-add-winter-hasher
feat: re-export winter-crypto Hasher, Digest & ElementHasher
2 years ago
Victor Lopez
35b255b5eb
feat: re-export winter-crypto Hasher, Digest & ElementHasher
This commit introduces the re-export of the listed primitives.
They will be used inside Miden to report the security level of the
picked primitive, as well as other functionality.
closes #72
2 years ago
Bobbin Threadbare
e94b0c70a9
Merge pull request #71 from 0xPolygonMiden/bobbin-dep-updates
Dependency updates
2 years ago
Bobbin Threadbare
e6bf497500
chore: update dependencies
2 years ago
Bobbin Threadbare
835142d432
Merge pull request #70 from 0xPolygonMiden/next
v0.1.3 release
2 years ago
Bobbin Threadbare
85ba3f1a34
chore: update changelog for v0.1.3 release
2 years ago
Bobbin Threadbare
6aa226e9bb
Merge pull request #68 from 0xPolygonMiden/vlopes11-update-winterfell-to-0.5
feat: upgrade to winterfell 0.5
2 years ago
Victor Lopez
0af45b75f4
feat: upgrade to winterfell 0.5
2 years ago
Bobbin Threadbare
822c52a1d2
Merge pull request #63 from 0xPolygonMiden/next
v0.1.2 release
2 years ago
Bobbin Threadbare
3c9a5235a0
docs: fix typos in doc comments
2 years ago
Bobbin Threadbare
2d97153fd0
Merge pull request #64 from 0xPolygonMiden/vlopes11-chore-release-v.0.1.2
chore: prepare for `v0.1.2` release
2 years ago
Victor Lopez
325b3abf8b
chore: prepare for `v0.1.2` release
2 years ago
Victor Lopes
b1a5ed6b5d
Merge pull request #62 from 0xPolygonMiden/vlopes11-feat-add-node-index-from-felt
feat: add `from_elements` to `NodeIndex`
2 years ago
Victor Lopez
9307178873
feat: add `from_elements` to `NodeIndex`
2 years ago
Victor Lopes
3af53e63cf
Merge pull request #54 from 0xPolygonMiden/vlopes11-36-feat-add-merkle-index
feat: add merkle node index
2 years ago
Victor Lopez
0799b1bb9d
feat: add merkle node index
This commit introduces a wrapper structure to encapsulate the merkle
tree traversal.
related issue: #36
2 years ago