diff options
| author | Kamen Mladenov <kamen@syndamia.com> | 2025-01-30 11:27:59 +0200 |
|---|---|---|
| committer | Kamen Mladenov <kamen@syndamia.com> | 2025-01-30 11:27:59 +0200 |
| commit | 5de4ae077e14b9e35c8d5e261462acfda911738c (patch) | |
| tree | 9ca05cd76e69cc06b62c8ed22278c52cc1d428a3 | |
| parent | 6d44c918094fd5c93aed4ca7e87ea42317d28e3b (diff) | |
| download | zkVMs-benchmarks-5de4ae077e14b9e35c8d5e261462acfda911738c.tar zkVMs-benchmarks-5de4ae077e14b9e35c8d5e261462acfda911738c.tar.gz zkVMs-benchmarks-5de4ae077e14b9e35c8d5e261462acfda911738c.zip | |
feat(zkm): Adapt to new input type and zkvmLib
| -rw-r--r-- | zkvms/zkm/Cargo.toml | 7 | ||||
| -rw-r--r-- | zkvms/zkm/default.nix | 10 | ||||
| -rw-r--r-- | zkvms/zkm/guest/Cargo.lock | 282 | ||||
| -rw-r--r-- | zkvms/zkm/guest/Cargo.toml | 2 | ||||
| l--------- | zkvms/zkm/guest/guests | 1 | ||||
| l--------- | zkvms/zkm/guest/guests_macro | 1 | ||||
| -rw-r--r-- | zkvms/zkm/host/Cargo.lock (renamed from zkvms/zkm/Cargo.lock) | 141 | ||||
| -rw-r--r-- | zkvms/zkm/host/Cargo.toml | 4 |
8 files changed, 361 insertions, 87 deletions
diff --git a/zkvms/zkm/Cargo.toml b/zkvms/zkm/Cargo.toml deleted file mode 100644 index 8078416..0000000 --- a/zkvms/zkm/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[workspace] -resolver = "2" -members = [ - "host", - "sdk", - "guest/guests/*", -] diff --git a/zkvms/zkm/default.nix b/zkvms/zkm/default.nix index 51adfd6..b2ce912 100644 --- a/zkvms/zkm/default.nix +++ b/zkvms/zkm/default.nix @@ -1,4 +1,4 @@ -{ zkVM-helpers, +{ zkvmLib, stdenv, lib, just, @@ -42,8 +42,6 @@ let ]); }; - cargoLock = ./Cargo.lock; - nativeBuildInputs = [ pkg-config openssl @@ -53,9 +51,9 @@ let }; craneLib = craneLib-default.overrideToolchain metacraft-labs.zkm; - cargoArtifacts = craneLib.buildDepsOnly (zkVM-helpers.fixDeps commonArgs); + cargoArtifacts = zkvmLib.buildDepsOnly craneLib commonArgs; in - craneLib.buildPackage (zkVM-helpers.withCustomPhases (commonArgs + zkvmLib.buildPackage craneLib (commonArgs // { inherit cargoArtifacts; @@ -81,4 +79,4 @@ in ''; doCheck = false; - })) + }) diff --git a/zkvms/zkm/guest/Cargo.lock b/zkvms/zkm/guest/Cargo.lock new file mode 100644 index 0000000..848d2cc --- /dev/null +++ b/zkvms/zkm/guest/Cargo.lock @@ -0,0 +1,282 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "guest" +version = "0.1.0" +dependencies = [ + "wrapper_macro", + "zkm-runtime", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "ppv-lite86" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "serde" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "syn" +version = "2.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wrapper_macro" +version = "0.1.0" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zkm-precompiles" +version = "0.2.0" +dependencies = [ + "bincode", + "cfg-if", + "serde", + "sha2", +] + +[[package]] +name = "zkm-runtime" +version = "0.2.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "lazy_static", + "libm", + "rand", + "serde", + "sha2", + "zkm-precompiles", +] diff --git a/zkvms/zkm/guest/Cargo.toml b/zkvms/zkm/guest/Cargo.toml index 36b84ba..2b3a54e 100644 --- a/zkvms/zkm/guest/Cargo.toml +++ b/zkvms/zkm/guest/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" [workspace] [dependencies] -# THESE DEPENDENCIES NEED TO BE PRESENT IN THE HOST CARGO.TOML zkm-runtime = { path = "/nix/store/h9s6kmnx7iafllv10wqhjix5kpyfsh37-zkm-unstable-2025-01-05/runtime/entrypoint" } -zkp = { path = "./src/zkp" } wrapper_macro = { version = "0.1.0", path = "../wrapper_macro" } diff --git a/zkvms/zkm/guest/guests b/zkvms/zkm/guest/guests deleted file mode 120000 index 69bc8ed..0000000 --- a/zkvms/zkm/guest/guests +++ /dev/null @@ -1 +0,0 @@ -../../../guests
\ No newline at end of file diff --git a/zkvms/zkm/guest/guests_macro b/zkvms/zkm/guest/guests_macro deleted file mode 120000 index 143a0b5..0000000 --- a/zkvms/zkm/guest/guests_macro +++ /dev/null @@ -1 +0,0 @@ -../../../guests_macro
\ No newline at end of file diff --git a/zkvms/zkm/Cargo.lock b/zkvms/zkm/host/Cargo.lock index ac0adf6..f82c462 100644 --- a/zkvms/zkm/Cargo.lock +++ b/zkvms/zkm/host/Cargo.lock @@ -796,9 +796,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "byte-slice-cast" @@ -1070,12 +1070,32 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom", + "getrandom 0.2.15", "once_cell", "tiny-keccak", ] [[package]] +name = "const_format" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] name = "constant_time_eq" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2199,11 +2219,23 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] [[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", +] + +[[package]] name = "gimli" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2250,10 +2282,6 @@ dependencies = [ ] [[package]] -name = "guests_macro" -version = "0.1.0" - -[[package]] name = "h2" version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2376,7 +2404,6 @@ dependencies = [ "env_logger 0.10.2", "log", "tokio", - "zkm-runtime", "zkm-sdk", "zkvms_host_io", ] @@ -2439,9 +2466,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.5" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" [[package]] name = "httpdate" @@ -2941,12 +2968,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - -[[package]] name = "libredox" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3037,7 +3058,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -3302,28 +3323,30 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.12" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +checksum = "b91c2d9a6a6004e205b7e881856fb1a0f5022d382acc2c01b52185f7b6f65997" dependencies = [ "arrayvec", "bitvec", "byte-slice-cast", + "const_format", "impl-trait-for-tuples", "parity-scale-codec-derive", + "rustversion", "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "3.6.12" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +checksum = "77555fd9d578b6470470463fded832619a5fec5ad6cbc551fe4d7507ce50cd3a" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.96", ] [[package]] @@ -3539,7 +3562,7 @@ source = "git+https://github.com/zkMIPS/plonky2.git?branch=zkm_dev#f1e28a6d85422 dependencies = [ "ahash", "anyhow", - "getrandom", + "getrandom 0.2.15", "hashbrown 0.14.5", "itertools 0.11.0", "keccak-hash", @@ -3831,7 +3854,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.15", ] [[package]] @@ -3878,7 +3901,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom", + "getrandom 0.2.15", "libredox", "thiserror 1.0.69", ] @@ -4006,7 +4029,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -4318,9 +4341,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.137" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", "memchr", @@ -4719,13 +4742,13 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.15.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" +checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" dependencies = [ "cfg-if", "fastrand", - "getrandom", + "getrandom 0.3.1", "once_cell", "rustix", "windows-sys 0.59.0", @@ -5250,7 +5273,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom", + "getrandom 0.2.15", "serde", ] @@ -5260,7 +5283,7 @@ version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" dependencies = [ - "getrandom", + "getrandom 0.2.15", "rand", "serde", "uuid-macro-internal", @@ -5321,6 +5344,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] name = "wasm-bindgen" version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5637,6 +5669,15 @@ dependencies = [ ] [[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags 2.8.0", +] + +[[package]] name = "write16" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5819,16 +5860,6 @@ dependencies = [ ] [[package]] -name = "zkm-precompiles" -version = "0.2.0" -dependencies = [ - "bincode", - "cfg-if", - "serde", - "sha2", -] - -[[package]] name = "zkm-prover" version = "0.2.0" dependencies = [ @@ -5858,21 +5889,6 @@ dependencies = [ ] [[package]] -name = "zkm-runtime" -version = "0.2.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "lazy_static", - "libm", - "rand", - "serde", - "sha2", - "zkm-precompiles", -] - -[[package]] name = "zkm-sdk" version = "0.2.0" dependencies = [ @@ -5900,13 +5916,6 @@ dependencies = [ ] [[package]] -name = "zkp" -version = "0.1.0" -dependencies = [ - "guests_macro", -] - -[[package]] name = "zkvms_host_io" version = "0.1.0" dependencies = [ diff --git a/zkvms/zkm/host/Cargo.toml b/zkvms/zkm/host/Cargo.toml index 51c348e..e7df287 100644 --- a/zkvms/zkm/host/Cargo.toml +++ b/zkvms/zkm/host/Cargo.toml @@ -15,7 +15,3 @@ env_logger = "0.10.0" anyhow = "1.0.75" zkvms_host_io = { path = "../../../zkvms_host_io" } - -# THESE ARE A COPY OF THE GUEST DEPENDENCIES -# They're here as a hack, so crane.lib will fetch them -zkm-runtime = { path = "/nix/store/h9s6kmnx7iafllv10wqhjix5kpyfsh37-zkm-unstable-2025-01-05/runtime/entrypoint" } |
