Commit graph

499 commits

Author SHA1 Message Date
00e2be79a4 feat: export Merkle get_value() in the trait 2024-08-22 15:54:24 -06:00
1795ef4ba3 WIP: smt: implement root-checked insertion 2024-08-22 15:54:24 -06:00
52ab7bca97 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 15:54:24 -06:00
99bac324a3 put 'prospective' first in tests for prospective commit 2024-08-22 14:50:24 -06:00
4d1f33ab67 WIP: smt: implement root-checked insertion 2024-08-22 14:50:06 -06:00
d7af60d037 feat: export Merkle get_value() in the trait 2024-08-22 14:49:31 -06:00
6178074b9f 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:49:29 -06:00
91c4260120 mark get_value commit as non-wip 2024-08-22 14:42:51 -06:00
0c97562ea2 WIP: smt: implement root-checked insertion 2024-08-22 14:32:20 -06:00
70131e892e feat: export Merkle get_value() in the trait 2024-08-22 14:32:20 -06:00
a4677dd99b remove the redundant prospective test in full/mod.rs 2024-08-22 14:17:00 -06:00
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