-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR is the first of several where we are moving to use native implementations of Merkle Trees for performance reasons. It includes: 1. The core tree implementations for both indexed trees and append only trees. 2. The introduction of LMDB as a dependency that we retrieve from GIT and build ourselves. 3. The creation of a set of RAII wrapper objects around the LMDB concepts. 4. The creation of a committed/uncommitted store on top of LMDB used by the trees for state management --------- Co-authored-by: IlyasRidhuan <[email protected]> Co-authored-by: Alex Gherghisan <[email protected]>
- Loading branch information
1 parent
ab018ff
commit 8a1032e
Showing
59 changed files
with
5,353 additions
and
929 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
include(ExternalProject) | ||
|
||
set(LMDB_PREFIX "${CMAKE_BINARY_DIR}/_deps/lmdb") | ||
set(LMDB_INCLUDE "${LMDB_PREFIX}/src/lmdb_repo/libraries/liblmdb") | ||
set(LMDB_LIB "${LMDB_INCLUDE}/liblmdb.a") | ||
set(LMDB_OBJECT "${LMDB_INCLUDE}/*.o") | ||
|
||
ExternalProject_Add( | ||
lmdb_repo | ||
PREFIX ${LMDB_PREFIX} | ||
GIT_REPOSITORY "https://github.com/LMDB/lmdb.git" | ||
GIT_TAG ddd0a773e2f44d38e4e31ec9ed81af81f4e4ccbb | ||
BUILD_IN_SOURCE YES | ||
CONFIGURE_COMMAND "" # No configure step | ||
BUILD_COMMAND make -C libraries/liblmdb -e XCFLAGS=-fPIC liblmdb.a | ||
INSTALL_COMMAND "" | ||
UPDATE_COMMAND "" # No update step | ||
BUILD_BYPRODUCTS ${LMDB_LIB} ${LMDB_INCLUDE} | ||
) | ||
|
||
add_library(lmdb STATIC IMPORTED GLOBAL) | ||
add_dependencies(lmdb lmdb_repo) | ||
set_target_properties(lmdb PROPERTIES IMPORTED_LOCATION ${LMDB_LIB}) | ||
|
||
add_library(lmdb_objects OBJECT IMPORTED GLOBAL) | ||
add_dependencies(lmdb_objects lmdb_repo) | ||
set_target_properties(lmdb_objects PROPERTIES IMPORTED_LOCATION ${LMDB_OBJECT}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# run commands relative to parent directory | ||
cd $(dirname $0)/.. | ||
|
||
DEFAULT_TESTS=PersistedIndexedTreeTest.*:PersistedAppendOnlyTreeTest.*:LMDBStoreTest.* | ||
TEST=${1:-$DEFAULT_TESTS} | ||
PRESET=${PRESET:-clang16} | ||
|
||
cmake --build --preset $PRESET --target crypto_merkle_tree_tests | ||
./build/bin/crypto_merkle_tree_tests --gtest_filter=$TEST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
barretenberg/cpp/src/barretenberg/benchmark/append_only_tree_bench/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
barretenberg_module(append_only_tree_bench crypto_poseidon2 crypto_merkle_tree) | ||
barretenberg_module(append_only_tree_bench crypto_poseidon2 crypto_pedersen_hash crypto_merkle_tree) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
barretenberg/cpp/src/barretenberg/benchmark/client_ivc_bench/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
barretenberg_module(client_ivc_bench client_ivc stdlib_honk_verifier stdlib_sha256 crypto_merkle_tree stdlib_primitives) | ||
barretenberg_module(client_ivc_bench client_ivc stdlib_honk_verifier stdlib_sha256 stdlib_primitives) |
2 changes: 1 addition & 1 deletion
2
barretenberg/cpp/src/barretenberg/benchmark/indexed_tree_bench/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
barretenberg_module(indexed_tree_bench crypto_poseidon2 crypto_merkle_tree) | ||
barretenberg_module(indexed_tree_bench crypto_poseidon2 crypto_pedersen_hash crypto_merkle_tree) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
barretenberg/cpp/src/barretenberg/benchmark/merkle_tree_bench/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
barretenberg_module(merkle_tree_bench crypto_poseidon2 crypto_merkle_tree) | ||
barretenberg_module(merkle_tree_bench crypto_poseidon2 crypto_pedersen_hash crypto_merkle_tree) |
2 changes: 1 addition & 1 deletion
2
barretenberg/cpp/src/barretenberg/benchmark/simulator_bench/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
barretenberg_module(simulator_bench stdlib_honk_verifier stdlib_sha256 crypto_merkle_tree) | ||
barretenberg_module(simulator_bench stdlib_honk_verifier stdlib_sha256 stdlib_pedersen_hash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.