0f67239bd3
feat: impl hashing Merkle leaves that don't yet exist
...
This commit implements 'prospective leaf hashing' -- computing what the
hash of a sparse Merkle tree leaf *would* be for a key-value insertion
without actually performing that insertion.
For SimpleSmt, this is trivial, since the leaf hash and its payload are
the same.
For the full Smt, the new leaf payload (and thus, its hash) depend on
the existing payload in that leaf, making the prospective hash logic a
combination of the normal insertion logic and the normal hash logic. But
because we're only interested in the hash and not the intermediate
value, we can skip allocations and sorts for the payload itself.
2024-08-22 14:16:17 -06:00
1662a0a8da
WIP: smt: implement root-checked insertion
2024-08-22 14:16:17 -06:00
2eb7a84543
WIP: add and implement get_value() to Smt trait
2024-08-22 14:16:17 -06:00
6f1de8c22d
give perspective leaf hashing a real commit message
2024-08-22 14:12:18 -06:00
6670b94ba7
WIP: smt: implement root-checked insertion
2024-08-22 13:55:39 -06:00
1307e2c948
WIP: add and implement get_value() to Smt trait
2024-08-22 13:55:39 -06:00
4c19f364ca
feat: impl hashing Merkle leaves that don't yet exist
...
This commit implements 'prospective leaf hashing' -- computing what the
hash of a sparse Merkle tree leaf *would* be for a key-value insertion
without actually performing that insertion.
For SimpleSmt, this is trivial, since the leaf hash and its payload are
the same.
For the full Smt, the new leaf payload (and thus, its hash) depend on
the existing payload in that leaf, making the prospective hash logic a
combination of the normal insertion logic and the normal hash logic. But
because we're only interested in the hash and not the intermediate
value, we can skip allocations and sorts for the payload itself.
2024-08-22 13:55:39 -06:00
6921ba0442
squash the two hash_prospective_leaf commits
2024-08-22 13:48:10 -06:00
e21b9ab8d3
WIP: smt: implement root-checked insertion
2024-08-22 13:47:06 -06:00
4a9b54f4f7
WIP: add and implement get_value() to Smt trait
2024-08-22 13:47:06 -06:00
e3dae8c8ba
WIP: implement hash_prospective_leaf()
2024-08-22 13:46:51 -06:00
ac69789525
rustfmt the things we didn't
2024-08-22 13:45:49 -06:00
78ba0d262c
WIP: remove a *bunch* of allocations and clones in hash_prospective_leaf
2024-08-22 13:43:04 -06:00
64d2bd1aaa
WIP: smt: implement root-checked insertion
2024-08-22 13:43:04 -06:00
9d0506454a
rebase onto next
2024-08-22 13:32:14 -06:00
b974005f91
WIP: add and implement get_value() to Smt trait
2024-08-22 13:31:46 -06:00
124807bf8b
WIP: remove a *bunch* of allocations and clones in hash_prospective_leaf
2024-08-22 13:31:46 -06:00
1d29c8971f
WIP: implement hash_prospective_leaf()
2024-08-22 13:31:46 -06:00
81da8e9bca
WIP: smt: implement root-checked insertion
2024-08-22 13:31:46 -06:00
434ceeb771
fixup tests and cleanup hash_prospective_leaf
2024-08-22 13:31:39 -06:00
7c7a35e887
WIP: remove a *bunch* of allocations and clones in hash_prospective_leaf
2024-08-22 13:31:09 -06:00
fdca917a43
WIP: smt: implement root-checked insertion
2024-08-22 13:31:09 -06:00
Paul-Henry Kajfasz
f4a9d5b027
Merge pull request #323 from 0xPolygonMiden/phklive-consistent-ci
...
Update `Makefile` and `CI`
2024-08-22 08:22:20 -07:00
Paul-Henry Kajfasz
ee42d87121
Replace i. by 1.
2024-08-22 16:14:19 +01:00
Paul-Henry Kajfasz
b1cb2b6ec3
Fix comments
2024-08-22 15:21:59 +01:00
d575bf1406
drop 'refactor: make Smt's node recomputation pure'
2024-08-21 15:23:45 -06:00
004ec1c088
WIP: add and implement get_value() to Smt trait
2024-08-21 15:18:17 -06:00
e1a54ea4bd
WIP: smt: implement root-checked insertion
2024-08-21 15:18:17 -06:00
8bb9f2b50f
WIP: implement hash_prospective_leaf()
2024-08-21 15:18:17 -06:00
dae3f6c2ca
rebase onto next
2024-08-21 15:15:13 -06:00
bf2ca7ab4d
WIP: smt: implement root-checked insertion
2024-08-21 15:15:07 -06:00
bd1a6fcd82
WIP: add and implement get_value() to Smt trait
2024-08-21 15:15:07 -06:00
65e8f536d7
WIP: implement hash_prospective_leaf()
2024-08-21 15:15:07 -06:00
762c821217
refactor: make Smt's node recomputation pure
...
And do mutations in its callers instead.
2024-08-21 15:15:06 -06:00
2dbd827f65
rebase, removing the Cargo.lock update
2024-08-21 15:14:58 -06:00
4290cf47d4
WIP: smt: implement root-checked insertion
2024-08-21 15:13:03 -06:00
2e8f864e67
WIP: add and implement get_value() to Smt trait
2024-08-21 15:13:03 -06:00
a8fe97afe9
WIP: implement hash_prospective_leaf()
2024-08-21 15:13:02 -06:00
77ea774e59
refactor: make Smt's node recomputation pure
...
And do mutations in its callers instead.
2024-08-21 15:13:02 -06:00
bcb836d2ae
commit checked insertion
2024-08-21 15:01:26 -06:00
fed3107229
WIP: smt: implement root-checked insertion
2024-08-21 14:49:47 -06:00
4d87226e8d
commit get_value()
2024-08-21 13:57:55 -06:00
0e1ca45ea4
WIP: add and implement get_value() to Smt trait
2024-08-21 13:57:48 -06:00
Paul-Henry Kajfasz
e4a9a2ac00
Updated test in workflow
2024-08-21 16:53:28 +01:00
Paul-Henry Kajfasz
c5077b1683
updated readme
2024-08-21 14:18:41 +01:00
Paul-Henry Kajfasz
2e74028fd4
Updated makefile
2024-08-21 14:11:17 +01:00
Paul-Henry Kajfasz
8bf6ef890d
fmt
2024-08-21 14:04:23 +01:00
Paul-Henry Kajfasz
e2aeb25e01
Updated doc comments
2024-08-21 14:03:43 +01:00
Paul-Henry Kajfasz
790846cc73
Merge next
2024-08-21 09:29:39 +01:00
d45764c585
inserting EMPTY_VALUE into multi-leaves
2024-08-20 15:10:34 -06:00