diff --git a/.gitmodules b/.gitmodules index a7222ec6..e79f90d1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -199,3 +199,9 @@ [submodule "vendor/constantine"] path = vendor/constantine url = https://github.com/mratsim/constantine.git +[submodule "vendor/codex-storage-proofs"] + path = vendor/codex-storage-proofs + url = https://github.com/codex-storage/codex-storage-proofs.git +[submodule "vendor/codex-storage-proofs-circuits"] + path = vendor/codex-storage-proofs-circuits + url = https://github.com/codex-storage/codex-storage-proofs-circuits.git diff --git a/build.nims b/build.nims index 11eec387..bac8c3e0 100644 --- a/build.nims +++ b/build.nims @@ -21,10 +21,19 @@ proc test(name: string, srcDir = "tests/", params = "", lang = "c") = buildBinary name, srcDir, params exec "build/" & name +task buildStorageProofs, "build codex storage proofs": + ## pre-build codex-storage-proofs to cache the first cargo build + ## though `codex-storage-proofs/codex_storage_proofs.nim` calls cargo build again + withDir "vendor/codex-storage-proofs/": + exec "cargo build --release" + buildBinary "storage_proofs", srcDir = "codex/utils/", params = "-f " + task codex, "build codex binary": + buildStorageProofsTask() buildBinary "codex", params = "-d:chronicles_runtime_filtering -d:chronicles_log_level=TRACE" task testCodex, "Build & run Codex tests": + buildStorageProofsTask() test "testCodex", params = "-d:codex_enable_proof_failures=true -d:codex_use_hardhat=true" task testContracts, "Build & run Codex Contract tests": diff --git a/codex/utils/storage_proofs.nim b/codex/utils/storage_proofs.nim new file mode 100644 index 00000000..c31f1d23 --- /dev/null +++ b/codex/utils/storage_proofs.nim @@ -0,0 +1,6 @@ + +import codex_storage_proofs + +import std/os + +export codex_storage_proofs \ No newline at end of file diff --git a/vendor/codex-storage-proofs b/vendor/codex-storage-proofs new file mode 160000 index 00000000..2ac80d7a --- /dev/null +++ b/vendor/codex-storage-proofs @@ -0,0 +1 @@ +Subproject commit 2ac80d7ac2a1e0d0367b58a734ed34eae9dc9f91 diff --git a/vendor/codex-storage-proofs-circuits b/vendor/codex-storage-proofs-circuits new file mode 160000 index 00000000..c03b4322 --- /dev/null +++ b/vendor/codex-storage-proofs-circuits @@ -0,0 +1 @@ +Subproject commit c03b43221d68e34bd5015a4e4ee1a0ad3299f8ef