diff --git a/.github/workflows/release-bindings.yml b/.github/workflows/release-bindings.yml index 2e1d4fa0..0f9435bf 100644 --- a/.github/workflows/release-bindings.yml +++ b/.github/workflows/release-bindings.yml @@ -32,9 +32,6 @@ jobs: - os: ubuntu-latest target: aarch64-unknown-linux-gnu archive: libere_verifier_c.linux-arm64.tar.gz - - os: macos-latest - target: x86_64-apple-darwin - archive: libere_verifier_c.darwin-amd64.tar.gz - os: macos-latest target: aarch64-apple-darwin archive: libere_verifier_c.darwin-arm64.tar.gz @@ -42,6 +39,14 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 + # Needed to build `proofman-starks-lib-c`, which is pulled by + # `proofman-fields` unconditionally on x86_64. + - name: Install build dependencies + if: matrix.target == 'x86_64-unknown-linux-gnu' + run: | + sudo apt-get update + sudo apt-get install -y nasm nlohmann-json3-dev libgmp-dev libsodium-dev libomp-dev libopenmpi-dev libssl-dev + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/test-bindings.yml b/.github/workflows/test-bindings.yml index 13da0578..bab4bd90 100644 --- a/.github/workflows/test-bindings.yml +++ b/.github/workflows/test-bindings.yml @@ -27,12 +27,18 @@ jobs: target: aarch64-unknown-linux-gnu - os: macos-latest target: aarch64-apple-darwin - - os: macos-13 - target: x86_64-apple-darwin steps: - name: Checkout repository uses: actions/checkout@v6 + # Needed to build `proofman-starks-lib-c`, which is pulled by + # `proofman-fields` unconditionally on x86_64. + - name: Install build dependencies + if: matrix.target == 'x86_64-unknown-linux-gnu' + run: | + sudo apt-get update + sudo apt-get install -y nasm nlohmann-json3-dev libgmp-dev libsodium-dev libomp-dev libopenmpi-dev libssl-dev + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/test-common.yml b/.github/workflows/test-common.yml index 95cca347..9d2c4f01 100644 --- a/.github/workflows/test-common.yml +++ b/.github/workflows/test-common.yml @@ -36,11 +36,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - # Needed to run test of ere-server-api (proto generation test) - - name: Install protoc + # protoc is needed to run test of ere-server-api (proto generation test). + # The rest are needed to build `proofman-starks-lib-c`, which is pulled by + # `proofman-fields` unconditionally on x86_64. + - name: Install build dependencies run: | sudo apt-get update - sudo apt-get install -y protobuf-compiler + sudo apt-get install -y protobuf-compiler nasm nlohmann-json3-dev libgmp-dev libsodium-dev libomp-dev libopenmpi-dev libssl-dev - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/test-verifier.yml b/.github/workflows/test-verifier.yml index f28d788a..94f95771 100644 --- a/.github/workflows/test-verifier.yml +++ b/.github/workflows/test-verifier.yml @@ -34,11 +34,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - # Needed for crate `sp1-prover-types` (transitive dep of the verifier bench). - - name: Install protoc + # protoc is needed for crate `sp1-prover-types` (transitive dep of the + # verifier bench). The rest are needed to build `proofman-starks-lib-c`, + # which is pulled by `proofman-fields` unconditionally on x86_64. + - name: Install build dependencies run: | sudo apt-get update - sudo apt-get install -y protobuf-compiler + sudo apt-get install -y protobuf-compiler nasm nlohmann-json3-dev libgmp-dev libsodium-dev libomp-dev libopenmpi-dev libssl-dev - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable @@ -70,11 +72,13 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - # Needed for crate `sp1-prover-types` - - name: Install protoc + # protoc is needed for crate `sp1-prover-types`. The rest are needed to + # build `proofman-starks-lib-c`, which is pulled by `proofman-fields` + # unconditionally on x86_64. + - name: Install build dependencies run: | sudo apt-get update - sudo apt-get install -y protobuf-compiler + sudo apt-get install -y protobuf-compiler nasm nlohmann-json3-dev libgmp-dev libsodium-dev libomp-dev libopenmpi-dev libssl-dev - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable diff --git a/Cargo.lock b/Cargo.lock index f4032b1c..07de6bee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -989,24 +989,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" -[[package]] -name = "asm-runner" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "anyhow", - "libc", - "mem-common", - "mem-planner-cpp", - "named-sem", - "proofman-util", - "rayon", - "thiserror 2.0.18", - "tracing", - "zisk-common", - "zisk-core", -] - [[package]] name = "asn1-rs" version = "0.7.1" @@ -1622,6 +1604,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "az" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be5eb007b7cacc6c660343e96f650fedf4b5a77512399eb952ca6642cf8d13f7" + [[package]] name = "backoff" version = "0.4.0" @@ -1705,26 +1693,6 @@ dependencies = [ "unty", ] -[[package]] -name = "bindgen" -version = "0.69.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "itertools 0.12.1", - "lazy_static", - "lazycell", - "proc-macro2", - "quote", - "regex", - "rustc-hash 1.1.0", - "shlex", - "syn 2.0.117", -] - [[package]] name = "bindgen" version = "0.72.1" @@ -1741,7 +1709,7 @@ dependencies = [ "quote", "regex", "rustc-hash 2.1.1", - "shlex", + "shlex 1.3.0", "syn 2.0.117", ] @@ -1975,11 +1943,21 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "bstr" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb31b46c14244e20ee9984b11bf5c992b91fb6939fea616e3512c8baecdbe5f" +dependencies = [ + "memchr", + "serde_core", +] + [[package]] name = "build-probe-mpi" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78ace2bb02fc18ad937f1599a853fcf3da2327bc1eb3c8e62b1f2fe4573bfd6" +checksum = "abee715b93fb80cbca8602265e0c2acd40b60df81fab1f3fd29a734babd697e7" dependencies = [ "pkg-config", "shell-words", @@ -2136,14 +2114,14 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.57" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" +checksum = "509591b7bcd67f4ef775afad7662703b4935daaa6ec0e5605cfb1090b32a2b6d" dependencies = [ "find-msvc-tools", "jobserver", "libc", - "shlex", + "shlex 2.0.1", ] [[package]] @@ -2187,6 +2165,28 @@ dependencies = [ "windows-link 0.2.1", ] +[[package]] +name = "chrono-tz" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93698b29de5e97ad0ae26447b344c482a7284c737d9ddc5f9e52b74a336671bb" +dependencies = [ + "chrono", + "chrono-tz-build", + "phf", +] + +[[package]] +name = "chrono-tz-build" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c088aee841df9c3041febbb73934cfc39708749bf96dc827e3359cd39ef11b1" +dependencies = [ + "parse-zoneinfo", + "phf", + "phf_codegen", +] + [[package]] name = "ciborium" version = "0.2.2" @@ -2214,11 +2214,6 @@ dependencies = [ "half", ] -[[package]] -name = "circuit" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" - [[package]] name = "clang-sys" version = "1.8.1" @@ -2657,16 +2652,6 @@ version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2931af7e13dc045d8e9d26afccc6fa115d64e115c9c84b1166288b46f6782c2" -[[package]] -name = "curves" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v1.0.0-alpha#4f2a34ac686c788ad66a1a8ea0a17a016319e65b" -dependencies = [ - "fields", - "num-bigint 0.4.6", - "num-traits", -] - [[package]] name = "custom_derive" version = "0.1.7" @@ -2871,14 +2856,6 @@ dependencies = [ "rustversion", ] -[[package]] -name = "data-bus" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "zisk-common", -] - [[package]] name = "data-encoding" version = "2.10.0" @@ -3069,6 +3046,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "deunicode" +version = "1.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abd57806937c9cc163efc8ea3910e00a62e2aeb0b8119f1793a978088f8f6b04" + [[package]] name = "digest" version = "0.9.0" @@ -3531,7 +3514,7 @@ dependencies = [ "openvm-sha2", "p256 0.13.2 (git+https://github.com/openvm-org/openvm.git?tag=v2.1.0-preview)", "ripemd 0.2.0", - "zkvm-interface 0.1.0", + "zkvm-interface", ] [[package]] @@ -3624,19 +3607,20 @@ dependencies = [ "ere-util-test", "ere-util-tokio", "ere-verifier-zisk", - "fields", "once_cell", "parking_lot", + "proofman-fields", "proofman-starks-lib-c", "proofman-util", - "rom-setup", - "sm-rom", "tempfile", "thiserror 2.0.18", "tokio", "zisk-common", "zisk-core", "zisk-prover-backend", + "zisk-rom-setup", + "zisk-sm-rom", + "zisk-transpiler-riscv", "ziskemu", ] @@ -3833,49 +3817,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "executor" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "anyhow", - "arc-swap", - "asm-runner", - "crossbeam", - "data-bus", - "fields", - "mem-common", - "named-sem", - "paste", - "pil-std-lib", - "precomp-arith-eq", - "precomp-arith-eq-384", - "precomp-big-int", - "precomp-blake2", - "precomp-dma", - "precomp-keccakf", - "precomp-poseidon", - "precomp-sha256f", - "precompiles-common", - "precompiles-hints", - "proofman", - "proofman-common", - "proofman-util", - "rayon", - "sm-arith", - "sm-binary", - "sm-main", - "sm-mem", - "sm-rom", - "thiserror 2.0.18", - "tracing", - "witness", - "zisk-common", - "zisk-core", - "zisk-pil", - "ziskemu", -] - [[package]] name = "eyre" version = "0.6.12" @@ -3965,22 +3906,11 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "fields" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v1.0.0-alpha#4f2a34ac686c788ad66a1a8ea0a17a016319e65b" -dependencies = [ - "cfg-if", - "num-bigint 0.4.6", - "paste", - "serde", -] - [[package]] name = "find-msvc-tools" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" +checksum = "d45db016d36b838f563236e9193d0ee6ce38f3f68b6c94e914b4929c96bbb890" [[package]] name = "fixed-hash" @@ -4253,6 +4183,40 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" +[[package]] +name = "globset" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e47d37d2ae4464254884b60ab7071be2b876a9c35b696bd018ddcc76847309cd" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "globwalk" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf760ebf69878d9fd8f110c89703d90ce35095324d1f1edcb595c63945ee757" +dependencies = [ + "bitflags", + "ignore", + "walkdir", +] + +[[package]] +name = "gmp-mpfr-sys" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7db155b537cb791b133341f99f68371d86ee7fa4c79aacfbc376d72d23c70531" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + [[package]] name = "group" version = "0.12.1" @@ -4605,6 +4569,15 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "humansize" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" +dependencies = [ + "libm", +] + [[package]] name = "hybrid-array" version = "0.4.10" @@ -4829,6 +4802,22 @@ dependencies = [ "icu_properties", ] +[[package]] +name = "ignore" +version = "0.4.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b17771570a2b94107741a7b033f19132c2eee21d59d21b24d2ced26500bd66e" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata", + "same-file", + "walkdir", + "winapi-util", +] + [[package]] name = "impl-codec" version = "0.6.0" @@ -5116,23 +5105,12 @@ dependencies = [ "spin 0.9.8", ] -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "leb128fmt" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" -[[package]] -name = "lib-c" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" - [[package]] name = "libc" version = "0.2.183" @@ -5141,9 +5119,9 @@ checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" [[package]] name = "libffi" -version = "5.1.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0498fe5655f857803e156523e644dcdcdc3b3c7edda42ea2afdae2e09b2db87b" +checksum = "7a8d526bc07aa02e6826944ec446ecd8d228bd97b1cbd21e5bc5e3407a09a585" dependencies = [ "libc", "libffi-sys", @@ -5151,9 +5129,9 @@ dependencies = [ [[package]] name = "libffi-sys" -version = "4.1.0" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d4f1d4ce15091955144350b75db16a96d4a63728500122706fb4d29a26afbb" +checksum = "54d39d034f5ea2662814789448722078d01cc9431a2a09ff15e55f0df7120bae" dependencies = [ "cc", ] @@ -5230,6 +5208,12 @@ version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -5349,33 +5333,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "mem-common" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "clap", - "fields", - "rayon", - "static_assertions", - "zisk-common", - "zisk-core", - "zisk-pil", -] - -[[package]] -name = "mem-planner-cpp" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "mem-common", - "proofman-common", - "proofman-util", - "tracing", - "zisk-common", - "zisk-pil", -] - [[package]] name = "memchr" version = "2.8.0" @@ -5388,7 +5345,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad38eb12aea514a0466ea40a80fd8cc83637065948eb4a426e4aa46261175227" dependencies = [ - "rustix", + "rustix 1.1.4", ] [[package]] @@ -5527,9 +5484,9 @@ dependencies = [ [[package]] name = "mpi" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41457b69d35846af2fec1877a4f3b866a72b6ab2c9500218f115e65e10993b21" +checksum = "302522157fd9f0ae43eb9792db89932045a29ae57b15a525724c2b3d0981c338" dependencies = [ "build-probe-mpi", "conv", @@ -5542,11 +5499,11 @@ dependencies = [ [[package]] name = "mpi-sys" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f655543f54b263cbc3d2456bf714bd807d66a33eff8f70136687f0776d34f76" +checksum = "9b828192ea0f41740b6c2a40beaa140c63e8ae51aef58b6edf5d23c0340c4f2b" dependencies = [ - "bindgen 0.69.5", + "bindgen", "build-probe-mpi", "cc", ] @@ -8045,6 +8002,15 @@ dependencies = [ "windows-link 0.2.1", ] +[[package]] +name = "parse-zoneinfo" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" +dependencies = [ + "regex", +] + [[package]] name = "pasta_curves" version = "0.4.1" @@ -8122,6 +8088,39 @@ dependencies = [ "ucd-trie", ] +[[package]] +name = "pest_derive" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11f486f1ea21e6c10ed15d5a7c77165d0ee443402f0780849d1768e7d9d6fe77" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8040c4647b13b210a963c1ed407c1ff4fdfa01c31d6d2a098218702e6664f94f" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "pest_meta" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89815c69d36021a140146f26659a81d6c2afa33d216d736dd4be5381a7362220" +dependencies = [ + "pest", + "sha2 0.10.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "petgraph" version = "0.7.1" @@ -8144,62 +8143,156 @@ dependencies = [ ] [[package]] -name = "pil-std-lib" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v1.0.0-alpha#4f2a34ac686c788ad66a1a8ea0a17a016319e65b" +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ - "colored", - "fields", - "num-bigint 0.4.6", - "num-traits", - "proofman-common", - "proofman-hints", - "proofman-util", - "rayon", - "rustc-hash 2.1.1", - "serde", - "serde_json", - "tracing", - "witness", + "phf_shared", ] [[package]] -name = "pin-project" -version = "1.1.11" +name = "phf_codegen" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" dependencies = [ - "pin-project-internal", + "phf_generator", + "phf_shared", ] [[package]] -name = "pin-project-internal" -version = "1.1.11" +name = "phf_generator" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.117", + "phf_shared", + "rand 0.8.6", ] [[package]] -name = "pin-project-lite" -version = "0.2.17" +name = "phf_shared" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher", +] [[package]] -name = "pin-utils" -version = "0.1.0" +name = "pil2-pilout" +version = "1.1.0-alpha" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "5fa5dfc3cbe4673b8d85156e7f04a3fba9df9cd2dc1556c2b01f1db8cd40f326" +dependencies = [ + "bytes", + "prost 0.13.5", + "prost-build 0.13.5", + "tracing", +] [[package]] -name = "pkcs8" -version = "0.10.2" +name = "pil2-stark-recurser" +version = "1.1.0-alpha" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +checksum = "7043b7668ef89b09176d7204f1a5f5778bd6db78e0e12b12bd44c6c6f8457da7" +dependencies = [ + "anyhow", + "num-bigint 0.4.6", + "num-traits", + "proofman-common", + "proofman-fields", + "serde", + "serde_json", + "tera", + "tracing", +] + +[[package]] +name = "pil2-stark-setup" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d02d960521b5c1826a4f47ff340c1679c16c3d2332fc29381a8cbbc1049e9b1" +dependencies = [ + "anyhow", + "clap", + "indexmap 2.13.0", + "mpi", + "pil2-pilout", + "pil2-stark-recurser", + "proofman-common", + "proofman-exps-codegen", + "proofman-fields", + "proofman-starks-lib-c", + "proofman-util", + "prost 0.13.5", + "rayon", + "rug", + "serde", + "serde_json", + "tempfile", + "tracing", + "tracing-subscriber", + "which", +] + +[[package]] +name = "pil2-std-lib" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a23fd44cb042e372163e1b3a381e0f1e0acb4aa501b21db20a97de0c50b402c0" +dependencies = [ + "colored", + "proofman-common", + "proofman-fields", + "proofman-hints", + "proofman-util", + "proofman-witness", + "rayon", + "rustc-hash 2.1.1", + "serde", + "serde_json", + "tracing", +] + +[[package]] +name = "pin-project" +version = "1.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der", "spki", @@ -8207,9 +8300,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" [[package]] name = "plotters" @@ -8305,216 +8398,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "precomp-arith-eq" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "ark-bn254", - "ark-ff 0.5.0", - "ark-secp256k1", - "ark-secp256r1", - "ark-std 0.5.0", - "fields", - "lazy_static", - "lib-c", - "num-bigint 0.4.6", - "num-traits", - "path-clean", - "pil-std-lib", - "precompiles-common", - "precompiles-helpers", - "proofman-common", - "proofman-util", - "rayon", - "regex", - "rustfmt-wrapper", - "tracing", - "zisk-common", - "zisk-core", - "zisk-pil", - "ziskemu", -] - -[[package]] -name = "precomp-arith-eq-384" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "ark-bls12-381 0.5.0", - "ark-ff 0.5.0", - "fields", - "lazy_static", - "num-bigint 0.4.6", - "num-traits", - "path-clean", - "pil-std-lib", - "precomp-arith-eq", - "precompiles-common", - "precompiles-helpers", - "proofman-common", - "proofman-util", - "rayon", - "rustfmt-wrapper", - "tracing", - "zisk-common", - "zisk-core", - "zisk-pil", -] - -[[package]] -name = "precomp-big-int" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "fields", - "lib-c", - "pil-std-lib", - "precompiles-common", - "proofman-common", - "proofman-util", - "rayon", - "tracing", - "zisk-common", - "zisk-core", - "zisk-pil", -] - -[[package]] -name = "precomp-blake2" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "fields", - "pil-std-lib", - "precompiles-common", - "proofman-common", - "proofman-util", - "rayon", - "tracing", - "zisk-common", - "zisk-core", - "zisk-pil", -] - -[[package]] -name = "precomp-dma" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "fields", - "pil-std-lib", - "precompiles-common", - "precompiles-helpers", - "proofman-common", - "proofman-util", - "rayon", - "tracing", - "zisk-common", - "zisk-core", - "zisk-pil", -] - -[[package]] -name = "precomp-keccakf" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "circuit", - "fields", - "path-clean", - "pil-std-lib", - "precompiles-common", - "precompiles-helpers", - "proofman-common", - "proofman-util", - "rayon", - "tiny-keccak 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing", - "zisk-common", - "zisk-core", - "zisk-pil", -] - -[[package]] -name = "precomp-poseidon" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "fields", - "pil-std-lib", - "precompiles-common", - "proofman-common", - "proofman-util", - "rayon", - "tracing", - "zisk-common", - "zisk-core", - "zisk-pil", -] - -[[package]] -name = "precomp-sha256f" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "fields", - "pil-std-lib", - "precompiles-common", - "proofman-common", - "proofman-util", - "rayon", - "tracing", - "zisk-common", - "zisk-core", - "zisk-pil", -] - -[[package]] -name = "precompiles-common" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "fields", - "mem-common", - "sm-mem", - "zisk-common", - "zisk-core", -] - -[[package]] -name = "precompiles-helpers" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "ark-bls12-381 0.5.0", - "ark-bn254", - "ark-ff 0.5.0", - "ark-secp256k1", - "ark-secp256r1", - "cfg-if", - "circuit", - "crunchy", - "lib-c", - "num-bigint 0.4.6", - "num-traits", -] - -[[package]] -name = "precompiles-hints" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "anyhow", - "borsh", - "rayon", - "rustls", - "tracing", - "zisk-cluster-common", - "zisk-common", - "ziskos-hints", -] - [[package]] name = "prettyplease" version = "0.2.37" @@ -8605,8 +8488,9 @@ dependencies = [ [[package]] name = "proofman" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v1.0.0-alpha#4f2a34ac686c788ad66a1a8ea0a17a016319e65b" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cab85a1104fd239afd530cc77de5d3c015af404eee7eacc575c7672ab646d2c" dependencies = [ "bincode 2.0.1", "blake3", @@ -8615,46 +8499,43 @@ dependencies = [ "colored", "crossbeam-channel", "csv", - "curves", - "fields", "libloading", "mpi", - "num-bigint 0.4.6", "num-traits", - "pil-std-lib", + "pil2-std-lib", "proofman-common", + "proofman-curves", + "proofman-fields", "proofman-hints", "proofman-macros", "proofman-starks-lib-c", "proofman-util", "proofman-verifier", + "proofman-witness", "rayon", "serde", "serde_json", - "tokio", "tokio-util", "tracing", - "witness", ] [[package]] name = "proofman-common" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v1.0.0-alpha#4f2a34ac686c788ad66a1a8ea0a17a016319e65b" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b61276fcba26ad5bf5f58d389cf84f086a4b7c58b235bbff18bcfe90d90737b4" dependencies = [ - "bincode 2.0.1", "borsh", "colored", "crossbeam-channel", "crossbeam-queue", "csv", "env", - "fields", - "lazy_static", "libc", "libloading", "mpi", "num_cpus", + "proofman-fields", "proofman-macros", "proofman-starks-lib-c", "proofman-util", @@ -8668,23 +8549,60 @@ dependencies = [ "yansi", ] +[[package]] +name = "proofman-curves" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3432a192e4dc4bfe59212a3eb0b86c1a049502bc24f8e9d8fc3ab9c2ae6ba5c5" +dependencies = [ + "proofman-fields", +] + +[[package]] +name = "proofman-exps-codegen" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd7266c367ddea81f3e72060a477d6ebaa888d7fb01a50c5e73f38983fe05333" +dependencies = [ + "anyhow", + "rayon", + "regex", + "serde", + "serde_json", + "tracing", +] + +[[package]] +name = "proofman-fields" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea663e7b8fbeaba6a3d0e6046fd7d85250186cdc2fac56ce102bfe8bfcfdf0d" +dependencies = [ + "cfg-if", + "num-bigint 0.4.6", + "paste", + "proofman-starks-lib-c", + "serde", +] + [[package]] name = "proofman-hints" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v1.0.0-alpha#4f2a34ac686c788ad66a1a8ea0a17a016319e65b" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c6deef99f421d48677668c4cecdded8c93496969adb6d98f0e0e2a32031ca0" dependencies = [ - "fields", "itoa", "proofman-common", + "proofman-fields", "proofman-starks-lib-c", - "proofman-util", "tracing", ] [[package]] name = "proofman-macros" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v1.0.0-alpha#4f2a34ac686c788ad66a1a8ea0a17a016319e65b" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e255105a885b6ac3000610133321ece2c1414359319b76eb2ad144ee8ee43360" dependencies = [ "proc-macro2", "quote", @@ -8693,37 +8611,55 @@ dependencies = [ [[package]] name = "proofman-starks-lib-c" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v1.0.0-alpha#4f2a34ac686c788ad66a1a8ea0a17a016319e65b" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eebeb94ceceb5009296fa5603ea710861ca262af8dcdcd43c243707aec9d6726" dependencies = [ "crossbeam-channel", - "tracing", + "proofman-starks-src", ] +[[package]] +name = "proofman-starks-src" +version = "1.1.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f652a3899833633da4829ee714b7d8ecdece399929bfd6673a471ecf0ce3227" + [[package]] name = "proofman-util" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v1.0.0-alpha#4f2a34ac686c788ad66a1a8ea0a17a016319e65b" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b92b63b2d9350e38618b1117867a3a2630cae57798baddd63ffde89e280c34d" dependencies = [ - "bincode 2.0.1", "colored", - "serde", "sysinfo 0.35.2", ] [[package]] name = "proofman-verifier" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v1.0.0-alpha#4f2a34ac686c788ad66a1a8ea0a17a016319e65b" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e578aca4212b4e4d083d62c54c74cbf2aa01926e15a76d6b0c9c70a4b98e2719" dependencies = [ "bincode 2.0.1", - "fields", "num-traits", + "proofman-fields", "rayon", "serde", "tracing", ] +[[package]] +name = "proofman-witness" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c38e73f49163bb83d89a343b08a73de35b94756d4f31add7c2d924042c6c73" +dependencies = [ + "libloading", + "proofman-common", + "proofman-fields", +] + [[package]] name = "proptest" version = "1.10.0" @@ -9345,11 +9281,6 @@ dependencies = [ "digest 0.11.3", ] -[[package]] -name = "riscv" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" - [[package]] name = "rlp" version = "0.5.2" @@ -9373,22 +9304,6 @@ dependencies = [ "svgbobdoc", ] -[[package]] -name = "rom-setup" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "anyhow", - "blake3", - "fields", - "proofman-common", - "sm-rom", - "tracing", - "zisk-common", - "zisk-core", - "zisk-pil", -] - [[package]] name = "rrs-lib" version = "0.1.0" @@ -9410,6 +9325,18 @@ dependencies = [ "paste", ] +[[package]] +name = "rug" +version = "1.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07a8857882aec59d27254b02481c709327c13de6fad1da60bfc4f9783eaaa61e" +dependencies = [ + "az", + "gmp-mpfr-sys", + "libc", + "libm", +] + [[package]] name = "ruint" version = "1.17.2" @@ -9508,6 +9435,19 @@ dependencies = [ "nom", ] +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + [[package]] name = "rustix" version = "1.1.4" @@ -9517,7 +9457,7 @@ dependencies = [ "bitflags", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.12.1", "windows-sys 0.61.2", ] @@ -10271,6 +10211,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + [[package]] name = "signal-hook-registry" version = "1.4.8" @@ -10809,109 +10755,20 @@ dependencies = [ ] [[package]] -name = "sm-arith" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "fields", - "pil-std-lib", - "proofman-common", - "rayon", - "sm-binary", - "sm-frequent-ops", - "tracing", - "zisk-common", - "zisk-core", - "zisk-pil", -] - -[[package]] -name = "sm-binary" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "fields", - "pil-std-lib", - "proofman-common", - "rayon", - "sm-frequent-ops", - "static_assertions", - "tracing", - "zisk-common", - "zisk-core", - "zisk-pil", -] - -[[package]] -name = "sm-frequent-ops" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "clap", - "fields", - "proofman-common", - "static_assertions", - "zisk-core", -] - -[[package]] -name = "sm-main" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "fields", - "mem-common", - "pil-std-lib", - "proofman-common", - "rayon", - "thiserror 2.0.18", - "tracing", - "zisk-common", - "zisk-core", - "zisk-pil", - "ziskemu", -] - -[[package]] -name = "sm-mem" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "env", - "fields", - "mem-common", - "pil-std-lib", - "proofman-common", - "proofman-util", - "rayon", - "tracing", - "zisk-common", - "zisk-core", - "zisk-pil", -] - -[[package]] -name = "sm-rom" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" +name = "slug" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "882a80f72ee45de3cc9a5afeb2da0331d58df69e4e7d8eeb5d3c7784ae67e724" dependencies = [ - "asm-runner", - "fields", - "mem-common", - "proofman-common", - "rayon", - "thiserror 2.0.18", - "tracing", - "zisk-common", - "zisk-core", - "zisk-pil", + "deunicode", + "wasm-bindgen", ] [[package]] name = "smallvec" -version = "1.15.1" +version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" dependencies = [ "serde", ] @@ -11896,10 +11753,32 @@ dependencies = [ "fastrand", "getrandom 0.4.2", "once_cell", - "rustix", + "rustix 1.1.4", "windows-sys 0.61.2", ] +[[package]] +name = "tera" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8004bca281f2d32df3bacd59bc67b312cb4c70cea46cbd79dbe8ac5ed206722" +dependencies = [ + "chrono", + "chrono-tz", + "globwalk", + "humansize", + "lazy_static", + "percent-encoding", + "pest", + "pest_derive", + "rand 0.8.6", + "regex", + "serde", + "serde_json", + "slug", + "unicode-segmentation", +] + [[package]] name = "thiserror" version = "1.0.69" @@ -13071,6 +12950,18 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "which" +version = "6.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" +dependencies = [ + "either", + "home", + "rustix 0.38.44", + "winsafe", +] + [[package]] name = "winapi" version = "0.3.9" @@ -13570,6 +13461,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "winsafe" +version = "0.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" + [[package]] name = "wit-bindgen" version = "0.51.0" @@ -13658,20 +13555,6 @@ dependencies = [ "wasmparser", ] -[[package]] -name = "witness" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/pil2-proofman.git?tag=v1.0.0-alpha#4f2a34ac686c788ad66a1a8ea0a17a016319e65b" -dependencies = [ - "colored", - "fields", - "libloading", - "proofman-common", - "proofman-util", - "serde_json", - "tracing", -] - [[package]] name = "writeable" version = "0.6.2" @@ -13843,13 +13726,41 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "zisk-asm-runner" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4da0cb50009dda38e94873aa1dbb3c3c8686d804b96412d3b07883525e5ade" +dependencies = [ + "anyhow", + "libc", + "named-sem", + "proofman-starks-lib-c", + "proofman-util", + "rayon", + "thiserror 2.0.18", + "tracing", + "zisk-common", + "zisk-core", + "zisk-sm-mem-common", + "zisk-sm-mem-planner", +] + +[[package]] +name = "zisk-circuit" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28185dd7ca65e2ffebc9a19992239aa6e379ac95dab73ec90d34344f59719355" + [[package]] name = "zisk-cluster-common" -version = "0.1.0" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cba1dce7b799b911959fc5f4713c2d626b741fba27f7a1629542ea9612b36c4" dependencies = [ "anyhow", "borsh", + "bytes", "chrono", "proofman", "proofman-common", @@ -13863,22 +13774,26 @@ dependencies = [ [[package]] name = "zisk-common" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a063ccfc08c23204d00926605b14208296e79df152b2479c0dc4b61b0fbe9b" dependencies = [ "alloy-sol-types", "bincode 2.0.1", "clap", + "crossbeam-queue", "dirs 6.0.0", - "fields", + "num-bigint 0.4.6", "paste", "proofman", "proofman-common", + "proofman-fields", "proofman-verifier", "serde", "serde_json", "sha2 0.10.9 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 2.0.18", + "tikv-jemallocator", "tracing", "zisk-core", "zisk-definitions", @@ -13888,135 +13803,644 @@ dependencies = [ [[package]] name = "zisk-core" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6cdf9ba4675975318306c9c69d1e24cfdb4ea1d341462829f6bb79e93bac3e" dependencies = [ - "elf", - "fields", - "lib-c", "paste", - "precompiles-helpers", + "proofman-fields", "rayon", - "riscv", "sha2 0.10.9 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "zisk-definitions", + "zisk-precomp-helpers", "ziskos", ] [[package]] name = "zisk-definitions" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" - -[[package]] -name = "zisk-pil" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "fields", - "proofman-common", - "proofman-macros", - "serde", - "serde_arrays 0.2.0", -] - -[[package]] -name = "zisk-program-macros" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "blake3", - "proc-macro-crate 3.5.0", - "proc-macro2", - "quote", - "syn 2.0.117", -] +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc7078fc25f294bfcdf4f9089f113b60f1efc6c8a55518d6ea24093aa7c59c2a" [[package]] -name = "zisk-prover-backend" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" +name = "zisk-executor" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feece3eb5086d5b5f621c20e48593fa60677f448e2ae0983ae3b3c06e94da537" dependencies = [ - "alloy-sol-types", "anyhow", - "asm-runner", - "blake3", - "borsh", - "colored", - "executor", - "fields", - "precompiles-hints", + "arc-swap", + "crossbeam", + "named-sem", + "paste", + "pil2-std-lib", "proofman", "proofman-common", + "proofman-fields", "proofman-util", - "proofman-verifier", - "rom-setup", - "serde", + "proofman-witness", + "rayon", + "thiserror 2.0.18", "tracing", - "zisk-cluster-common", + "zisk-asm-runner", "zisk-common", "zisk-core", "zisk-pil", - "zisk-program-macros", + "zisk-precomp-arith-eq", + "zisk-precomp-arith-eq-384", + "zisk-precomp-big-int", + "zisk-precomp-blake2", + "zisk-precomp-common", + "zisk-precomp-dma", + "zisk-precomp-evm", + "zisk-precomp-hints", + "zisk-precomp-keccakf", + "zisk-precomp-poseidon", + "zisk-precomp-sha256f", + "zisk-sm-arith", + "zisk-sm-binary", + "zisk-sm-main", + "zisk-sm-mem", + "zisk-sm-mem-common", + "zisk-sm-rom", "ziskemu", ] [[package]] -name = "zisk-stream" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "libc", - "quinn", - "rcgen", - "rustls", - "thiserror 2.0.18", - "tokio", - "tracing", -] +name = "zisk-lib-c" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc8968509c571acf9334322c06301b2bf9443054982a82893af957a65143b8ba" [[package]] -name = "zisk-verifier" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" +name = "zisk-pil" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53151f6a90702b333ff2f77af1338413f2aa0dfeaea8edb175c668ee442e10c2" dependencies = [ - "proofman-verifier", + "proofman-common", + "proofman-fields", + "proofman-macros", + "serde", + "serde_arrays 0.2.0", ] [[package]] -name = "ziskemu" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" +name = "zisk-precomp-arith-eq" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058533c969715c5eef7c25c52503a2138cb031cea7769352cb2e9f581ac739f1" dependencies = [ - "clap", - "data-bus", - "fields", - "flate2", - "mem-common", - "memmap2", - "num-format", - "object", + "ark-bn254", + "ark-ff 0.5.0", + "ark-secp256k1", + "ark-secp256r1", + "ark-std 0.5.0", + "lazy_static", + "num-bigint 0.4.6", + "num-traits", + "path-clean", + "pil2-std-lib", + "proofman-common", + "proofman-fields", + "proofman-util", "rayon", "regex", - "riscv", - "serde_json", - "sm-arith", - "sm-binary", - "symbolic-demangle", - "sysinfo 0.38.4", - "time", - "vergen-git2", + "rustfmt-wrapper", + "tracing", "zisk-common", "zisk-core", - "zisk-definitions", + "zisk-lib-c", "zisk-pil", + "zisk-precomp-common", + "zisk-precomp-helpers", +] + +[[package]] +name = "zisk-precomp-arith-eq-384" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e101d6a98dcc5b6f0715032d163a822e43c6b6db6a6520803648f9cd0fd5613" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ff 0.5.0", + "lazy_static", + "num-bigint 0.4.6", + "num-traits", + "path-clean", + "pil2-std-lib", + "proofman-common", + "proofman-fields", + "proofman-util", + "rayon", + "rustfmt-wrapper", + "tracing", + "zisk-common", + "zisk-core", + "zisk-pil", + "zisk-precomp-arith-eq", + "zisk-precomp-common", + "zisk-precomp-helpers", +] + +[[package]] +name = "zisk-precomp-big-int" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beb605011680e135b64d11c27664f9871a0e0b7189de57136ae778a05a728c2a" +dependencies = [ + "pil2-std-lib", + "proofman-common", + "proofman-fields", + "proofman-util", + "rayon", + "tracing", + "zisk-common", + "zisk-core", + "zisk-lib-c", + "zisk-pil", + "zisk-precomp-common", +] + +[[package]] +name = "zisk-precomp-blake2" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7ad6411ef5cb1f5e441f7cda26422c63fe438e982133f6762d54ec9a8effd96" +dependencies = [ + "pil2-std-lib", + "proofman-common", + "proofman-fields", + "proofman-util", + "rayon", + "tracing", + "zisk-common", + "zisk-core", + "zisk-pil", + "zisk-precomp-common", +] + +[[package]] +name = "zisk-precomp-common" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e1504f76c7821a4972b8390096ba14de5a0b28f445b5c45b35e30f7943fcf2" +dependencies = [ + "proofman-fields", + "zisk-common", + "zisk-core", + "zisk-sm-mem", + "zisk-sm-mem-common", +] + +[[package]] +name = "zisk-precomp-dma" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2618c10fdbada0c935b635476b6a86f0ce2edeac5e9dcd89c3ea1b11523b5f08" +dependencies = [ + "pil2-std-lib", + "proofman-common", + "proofman-fields", + "proofman-util", + "rayon", + "tracing", + "zisk-common", + "zisk-core", + "zisk-pil", + "zisk-precomp-common", + "zisk-precomp-helpers", +] + +[[package]] +name = "zisk-precomp-evm" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20af6c08d68c2cdab6c87512cebec8e091d791e6b097d126bb4cd0e244279dc0" +dependencies = [ + "clap", + "pil2-std-lib", + "proofman-common", + "proofman-fields", + "zisk-common", + "zisk-core", + "zisk-pil", + "zisk-precomp-common", + "zisk-precomp-helpers", +] + +[[package]] +name = "zisk-precomp-helpers" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3416ae98910aacd8b615e04088f25f00181f1765dae7b24e0a66ebad78b8e8b8" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-bn254", + "ark-ff 0.5.0", + "ark-secp256k1", + "ark-secp256r1", + "cfg-if", + "crunchy", + "num-bigint 0.4.6", + "num-traits", + "zisk-circuit", + "zisk-lib-c", +] + +[[package]] +name = "zisk-precomp-hints" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8736b92c05a357169be296dfea69bf9bd1c9b1b088d3cfbf52536228b17541cf" +dependencies = [ + "anyhow", + "borsh", + "rayon", + "rustls", + "tracing", + "zisk-cluster-common", + "zisk-common", + "ziskos-hints", +] + +[[package]] +name = "zisk-precomp-keccakf" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e67f5995fd93a2fe9ce7760f5d675c555695a5d9b3a9aa9035a76838328478" +dependencies = [ + "path-clean", + "pil2-std-lib", + "proofman-common", + "proofman-fields", + "proofman-util", + "rayon", + "tiny-keccak 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing", + "zisk-circuit", + "zisk-common", + "zisk-core", + "zisk-pil", + "zisk-precomp-common", + "zisk-precomp-helpers", +] + +[[package]] +name = "zisk-precomp-poseidon" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30714fa205a9c19aa079f55a292fd09fc48f2163cbac69855460acab3402e4ba" +dependencies = [ + "pil2-std-lib", + "proofman-common", + "proofman-fields", + "proofman-util", + "rayon", + "tracing", + "zisk-common", + "zisk-core", + "zisk-pil", + "zisk-precomp-common", +] + +[[package]] +name = "zisk-precomp-sha256f" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d738e279a947e961963261a0eab5afb0b65bcd43847fe24435e2d919c403e3" +dependencies = [ + "pil2-std-lib", + "proofman-common", + "proofman-fields", + "proofman-util", + "rayon", + "tracing", + "zisk-common", + "zisk-core", + "zisk-pil", + "zisk-precomp-common", +] + +[[package]] +name = "zisk-program-macros" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e603cd5c14d6861797ed6d582d19018f2ed27fa631914a28f3b8ec37e4e126c7" +dependencies = [ + "blake3", + "proc-macro-crate 3.5.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "zisk-prover-backend" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "001e86ee48512bfef74d52875b475fc85d72a17ae533f8c17031764f1606899a" +dependencies = [ + "alloy-sol-types", + "anyhow", + "blake3", + "borsh", + "colored", + "proofman", + "proofman-common", + "proofman-fields", + "proofman-util", + "proofman-verifier", + "serde", + "tracing", + "zisk-asm-runner", + "zisk-cluster-common", + "zisk-common", + "zisk-core", + "zisk-executor", + "zisk-pil", + "zisk-precomp-hints", + "zisk-program-macros", + "zisk-recurser", + "zisk-rom-setup", + "zisk-transpiler-riscv", + "ziskemu", +] + +[[package]] +name = "zisk-recurser" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99459a2da369896599c812e64826570cb26c71ad86f7a0c44bb3a650f7f1494e" +dependencies = [ + "anyhow", + "blake3", + "pil2-pilout", + "pil2-stark-recurser", + "pil2-stark-setup", + "proofman", + "proofman-fields", + "proofman-verifier", + "serde", + "serde_json", + "tera", + "thiserror 2.0.18", + "tracing", + "zisk-verifier", +] + +[[package]] +name = "zisk-riscv" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c00e44d717fe72c6bb29cc7bdbd399e4520ab623b7fda51deecffcdef1fac83" +dependencies = [ + "zisk-core", + "zisk-definitions", +] + +[[package]] +name = "zisk-rom-setup" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9293815015d86fd9dcd49f46b2706db7ee5e1452ea174460c094c76fc027e51f" +dependencies = [ + "anyhow", + "blake3", + "proofman-common", + "proofman-fields", + "tracing", + "zisk-common", + "zisk-core", + "zisk-pil", + "zisk-sm-rom", + "zisk-transpiler-riscv", +] + +[[package]] +name = "zisk-sm-arith" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc6acfaf70fa51adcbdd504b60eb1586e1d5b813ba0ba31f93320c66ea6be55e" +dependencies = [ + "pil2-std-lib", + "proofman-common", + "proofman-fields", + "rayon", + "tracing", + "zisk-common", + "zisk-core", + "zisk-pil", + "zisk-sm-binary", + "zisk-sm-frequent-ops", +] + +[[package]] +name = "zisk-sm-binary" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6787257428bd62b700a8ab0d11df9330ddef1ab2e079d50cd08f8b9f4120e8c" +dependencies = [ + "pil2-std-lib", + "proofman-common", + "proofman-fields", + "rayon", + "static_assertions", + "tracing", + "zisk-common", + "zisk-core", + "zisk-pil", + "zisk-sm-frequent-ops", +] + +[[package]] +name = "zisk-sm-frequent-ops" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69f6594453c6a869a7701ce113aa8e011c4e499e657ba0b3c676f99eb00b5902" +dependencies = [ + "clap", + "proofman-common", + "proofman-fields", + "static_assertions", + "zisk-core", +] + +[[package]] +name = "zisk-sm-main" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60763c1ff73570fea7d8fb55e8bb878e3b90f13e0e4009877678fc262ea9f5" +dependencies = [ + "pil2-std-lib", + "proofman-common", + "proofman-fields", + "rayon", + "thiserror 2.0.18", + "tracing", + "zisk-common", + "zisk-core", + "zisk-pil", + "zisk-sm-mem-common", + "ziskemu", +] + +[[package]] +name = "zisk-sm-mem" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4131f292ce363c13570e0690ed8fe7da9150cbce5dbb90a18fd11430982962cf" +dependencies = [ + "env", + "pil2-std-lib", + "proofman-common", + "proofman-fields", + "proofman-util", + "rayon", + "tracing", + "zisk-common", + "zisk-core", + "zisk-pil", + "zisk-sm-mem-common", +] + +[[package]] +name = "zisk-sm-mem-common" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0a112c18850852feba69ca55e1b3d305562f61dd3bd0bb55e7ef3f0cafebae" +dependencies = [ + "clap", + "proofman-fields", + "rayon", + "static_assertions", + "zisk-common", + "zisk-core", + "zisk-pil", +] + +[[package]] +name = "zisk-sm-mem-planner" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d0d1b9770dc8919d6ca8dab309305a938d40925ccb9c1da573d3635638e3eda" +dependencies = [ + "proofman-util", + "tracing", + "zisk-common", + "zisk-pil", + "zisk-sm-mem-common", +] + +[[package]] +name = "zisk-sm-rom" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2192a3ee0050c54e958151767f21b94ed9fb5cd38892b78da6dbea156bf5e9d8" +dependencies = [ + "proofman-common", + "proofman-fields", + "rayon", + "thiserror 2.0.18", + "tracing", + "zisk-asm-runner", + "zisk-common", + "zisk-core", + "zisk-pil", + "zisk-sm-mem-common", + "zisk-transpiler-riscv", +] + +[[package]] +name = "zisk-stream" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4116206152be416550f9fd4f11dccc6301bb0575f292ed31714829896d0f160" +dependencies = [ + "libc", + "quinn", + "rcgen", + "rustls", + "thiserror 2.0.18", + "tokio", + "tracing", +] + +[[package]] +name = "zisk-transpiler-common" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3546ba3aeeb097ccdd2e555d26fbe1e6964233979adb7a3881a06ac8fb6441aa" +dependencies = [ + "elf", + "zisk-core", + "zisk-riscv", +] + +[[package]] +name = "zisk-transpiler-riscv" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1e194334c578703cdb64ea934aeffbef026e99c84bf7184ed992810b37a11e8" +dependencies = [ + "zisk-core", + "zisk-transpiler-common", +] + +[[package]] +name = "zisk-verifier" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ffde99de17184da25de7823ad37f57d8d5aaa75bc89335fc8e13ed8dc521627" +dependencies = [ + "proofman-verifier", +] + +[[package]] +name = "zisk-zkvm-interface" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c5d7999bdac04dd84053c34946d18a1cc7b452b860d46f2025defe48a06c42d" +dependencies = [ + "bindgen", +] + +[[package]] +name = "ziskemu" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "998f58403784fc94576df4e74ab97f4a17da0a424635e37ef9b41a011fed487a" +dependencies = [ + "clap", + "flate2", + "memmap2", + "num-format", + "object", + "proofman-fields", + "rayon", + "regex", + "serde_json", + "symbolic-demangle", + "sysinfo 0.38.4", + "time", + "vergen-git2", + "zisk-common", + "zisk-core", + "zisk-definitions", + "zisk-pil", + "zisk-riscv", + "zisk-sm-arith", + "zisk-sm-binary", + "zisk-sm-mem-common", + "zisk-transpiler-riscv", ] [[package]] name = "ziskos" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2edae833e0d199eca7145fabe0bcdf1fc9d380f68833f280d9b45d6307b1f14e" dependencies = [ "anyhow", "ark-bn254", @@ -14032,17 +14456,15 @@ dependencies = [ "ctor 0.2.9", "dlmalloc", "embedded-alloc", - "fields", "getrandom 0.2.17", "lazy_static", - "lib-c", "libc", "num-bigint 0.4.6", "num-integer", "num-traits", "once_cell", "paste", - "precompiles-helpers", + "proofman-fields", "rand 0.8.6", "ripemd 0.1.3", "secp256k1 0.31.1", @@ -14052,35 +14474,39 @@ dependencies = [ "tiny-keccak 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "tokio", "zisk-definitions", + "zisk-lib-c", + "zisk-precomp-helpers", "zisk-stream", "zisk-verifier", - "zkvm-interface 1.0.0-alpha", + "zisk-zkvm-interface", ] [[package]] name = "ziskos-hints" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" +version = "1.1.0-alpha" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a52e0c247c511a08f25d272d98f0fe5c729db845ed7ba1ce97fc9dba423a287b" dependencies = [ "anyhow", "bincode 2.0.1", "cfg-if", - "fields", "getrandom 0.2.17", "lazy_static", - "lib-c", "num-bigint 0.4.6", "num-integer", "num-traits", "paste", - "precompiles-helpers", + "proofman-fields", "rand 0.8.6", "ripemd 0.1.3", "serde", "sha2 0.10.9 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "zisk-definitions", + "zisk-lib-c", + "zisk-precomp-helpers", "zisk-verifier", - "zkvm-interface 1.0.0-alpha", + "zisk-zkvm-interface", ] [[package]] @@ -14115,15 +14541,7 @@ name = "zkvm-interface" version = "0.1.0" source = "git+https://github.com/eth-act/zkvm-standards?rev=282cd356c3a0498416bb0619f9c8a347ce9933fb#282cd356c3a0498416bb0619f9c8a347ce9933fb" dependencies = [ - "bindgen 0.72.1", -] - -[[package]] -name = "zkvm-interface" -version = "1.0.0-alpha" -source = "git+https://github.com/0xPolygonHermez/zisk.git?tag=v1.0.0-alpha#4b9f758fabc4955cac20af837019ccc31b803a46" -dependencies = [ - "bindgen 0.72.1", + "bindgen", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index e8d2b60a..7901e51e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -151,18 +151,19 @@ sp1-zkvm = { git = "https://github.com/succinctlabs/sp1", tag = "v6.3.1", defaul sp1-libzkevm = { git = "https://github.com/succinctlabs/sp1", tag = "v6.3.1", package = "libzkevm" } # ZisK dependencies -proofman-fields = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", tag = "v1.0.0-alpha", package = "fields" } -proofman-starks-lib-c = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", tag = "v1.0.0-alpha" } -proofman-util = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", tag = "v1.0.0-alpha" } -proofman-verifier = { git = "https://github.com/0xPolygonHermez/pil2-proofman.git", tag = "v1.0.0-alpha" } -zisk-common = { git = "https://github.com/0xPolygonHermez/zisk.git", tag = "v1.0.0-alpha" } -zisk-core = { git = "https://github.com/0xPolygonHermez/zisk.git", tag = "v1.0.0-alpha" } -zisk-prover-backend = { git = "https://github.com/0xPolygonHermez/zisk.git", tag = "v1.0.0-alpha" } -zisk-rom-setup = { git = "https://github.com/0xPolygonHermez/zisk.git", tag = "v1.0.0-alpha", package = "rom-setup" } -zisk-sm-rom = { git = "https://github.com/0xPolygonHermez/zisk.git", tag = "v1.0.0-alpha", package = "sm-rom" } -zisk-verifier = { git = "https://github.com/0xPolygonHermez/zisk.git", tag = "v1.0.0-alpha" } -ziskemu = { git = "https://github.com/0xPolygonHermez/zisk.git", tag = "v1.0.0-alpha" } -ziskos = { git = "https://github.com/0xPolygonHermez/zisk.git", tag = "v1.0.0-alpha", default-features = false } +proofman-fields = "1.1.0-alpha" +proofman-starks-lib-c = "1.1.0-alpha" +proofman-util = "1.1.0-alpha" +proofman-verifier = "1.1.0-alpha" +zisk-common = "1.1.0-alpha" +zisk-core = "1.1.0-alpha" +zisk-prover-backend = "1.1.0-alpha" +zisk-rom-setup = "1.1.0-alpha" +zisk-sm-rom = "1.1.0-alpha" +zisk-transpiler-riscv = "1.1.0-alpha" +zisk-verifier = "1.1.0-alpha" +ziskemu = "1.1.0-alpha" +ziskos = { version = "1.1.0-alpha", default-features = false } # Local dependencies ere-compiler = { path = "crates/compiler/cli" } diff --git a/README.md b/README.md index 88135c0d..733497b4 100644 --- a/README.md +++ b/README.md @@ -160,7 +160,7 @@ Different zkVMs handles public values in different approaches: | ------ | -------------------------------------------------------------------------- | --------- | :---: | :-------: | :-----: | | OpenVM | [`2.1.0-preview`](https://github.com/openvm-org/openvm/tree/v2.1.0-preview) | `RV64IMA` | V | | | | SP1 | [`6.3.1`](https://github.com/succinctlabs/sp1/tree/v6.3.1) | `RV64IMA` | V | | | -| ZisK | [`1.0.0-alpha`](https://github.com/0xPolygonHermez/zisk/tree/v1.0.0-alpha) | `RV64IMA` | V | V | V | +| ZisK | [`1.1.0-alpha`](https://github.com/0xPolygonHermez/zisk/tree/v1.1.0-alpha) | `RV64IMA` | V | V | V | ## Examples diff --git a/crates/cluster-client/zisk/proto/zisk_coordinator_api.proto b/crates/cluster-client/zisk/proto/zisk_coordinator_api.proto index 9c844556..e03b2622 100644 --- a/crates/cluster-client/zisk/proto/zisk_coordinator_api.proto +++ b/crates/cluster-client/zisk/proto/zisk_coordinator_api.proto @@ -1,4 +1,4 @@ -// Copied from https://github.com/0xPolygonHermez/zisk/blob/v1.0.0-alpha/distributed/crates/coordinator-api/proto/zisk_coordinator_api.proto. +// Copied from https://github.com/0xPolygonHermez/zisk/blob/v1.1.0-alpha/distributed/crates/coordinator-api/proto/zisk_coordinator_api.proto. syntax = "proto3"; @@ -21,7 +21,12 @@ service ZiskCoordinatorApi { rpc RegisterGuestProgram(RegisterGuestProgramRequest) returns (RegisterGuestProgramResponse); - // Submit a new job (setup, prove, wrap, or execute). + // Register a recurser spec. Idempotent: the same spec always + // returns the same recurser_id (a content hash of the inputs). + rpc RegisterAggregationProgram(RegisterAggregationProgramRequest) + returns (RegisterAggregationProgramResponse); + + // Submit a new job (setup, prove, wrap, execute, setup_aggregation_program, aggregate_proofs). rpc JobRequest(JobRequestMessage) returns (JobResponse); @@ -106,7 +111,7 @@ enum JobPhase { JOB_PHASE_UNSPECIFIED = 0; JOB_PHASE_CONTRIBUTIONS = 1; // witness generation and partial contributions JOB_PHASE_PROVE = 2; // proof generation - JOB_PHASE_AGGREGATE = 3; // proof aggregation + JOB_PHASE_RECURSE = 3; // recurser prove phase } message InputChunk { @@ -180,6 +185,39 @@ message RegisterGuestProgramResponse { string hash_id = 1; // blake3 content hash of zisk_elf } +message NormalizeCircuit { + string body = 1; +} + +// A single 4-limb (Goldilocks) program verification key. +message ProgramVk { + repeated string limbs = 1; // exactly 4 decimal limbs +} + +message AggregationProgramSpec { + NormalizeCircuit normalize = 1; + string aggregate_publics_body = 2; + uint64 n_free = 3; + // Optional leaf allow-list (empty = VK-agnostic). Order is significant. + repeated ProgramVk program_vks = 4; + // Publics slots the aggregation populates; the rest are generator-zero-filled. + uint64 n_publics_agg = 5; +} + +message RegisterAggregationProgramRequest { + // SDK-computed content hash. The coordinator stores the spec under this + // id and echoes it back. Re-registering an already-known id is idempotent. + // Computed by both SDK and worker from the same `RecurserManifestInputs`, + // so a misaligned zisk_vk surfaces here as a "recurser_id not found" at + // dispatch time rather than a silent divergence. + string recurser_id = 1; + AggregationProgramSpec spec = 2; +} + +message RegisterAggregationProgramResponse { + string recurser_id = 1; // echo of the request's recurser_id +} + // ============================================================================ // Job submission // ============================================================================ @@ -194,11 +232,12 @@ message JobResponse { message JobKind { oneof kind { - SetupRequest setup = 1; - ProveRequest prove = 2; - WrapRequest wrap = 3; - // AggregateRequest aggregate = 4; // TODO: not yet defined - ExecuteRequest execute = 5; + SetupRequest setup = 1; + ProveRequest prove = 2; + WrapRequest wrap = 3; + AggregateProofsRequest aggregate_proofs = 4; + ExecuteRequest execute = 5; + SetupAggregationProgramRequest setup_aggregation_program = 6; } } @@ -241,9 +280,27 @@ message WrapResponse { Proof proof = 1; } -// TODO: AggregateRequest / AggregateResponse — to be defined -// message AggregateRequest { … } -// message AggregateResponse { … } +message SetupAggregationProgramRequest { + string recurser_id = 1; +} + +message SetupAggregationProgramResponse { + bytes vk = 1; // 32 bytes — 4 u64 little-endian limbs + string hash_mode = 2; +} + +message AggregateProofsRequest { + string recurser_id = 1; + bytes proof_a = 2; // bincode-serialized VadcopFinalProof + bytes proof_b = 3; + repeated uint64 free_inputs_a = 4; // proof_a's normalization side inputs + repeated uint64 free_inputs_b = 5; // proof_b's normalization side inputs + repeated uint64 root_c_recurser_agg = 6; // optional override; len 0 or 4 +} + +message AggregateProofsResponse { + Proof proof = 1; +} message ExecuteRequest { string hash_id = 1; @@ -259,10 +316,12 @@ message ExecuteResponse { message JobKindResponse { oneof kind { - SetupResponse setup = 1; - ProveResponse prove = 2; - WrapResponse wrap = 3; - ExecuteResponse execute = 4; + SetupResponse setup = 1; + ProveResponse prove = 2; + WrapResponse wrap = 3; + AggregateProofsResponse aggregate_proofs = 4; + ExecuteResponse execute = 5; + SetupAggregationProgramResponse setup_aggregation_program = 6; } } @@ -387,4 +446,3 @@ message CancelJobResponse { string job_id = 1; bool cancelled = 2; // true if cancelled; false if already terminal } - diff --git a/crates/cluster-client/zisk/src/api.rs b/crates/cluster-client/zisk/src/api.rs index 6f22842b..1f65716d 100644 --- a/crates/cluster-client/zisk/src/api.rs +++ b/crates/cluster-client/zisk/src/api.rs @@ -173,6 +173,51 @@ pub struct RegisterGuestProgramResponse { pub hash_id: ::prost::alloc::string::String, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct NormalizeCircuit { + #[prost(string, tag = "1")] + pub body: ::prost::alloc::string::String, +} +/// A single 4-limb (Goldilocks) program verification key. +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct ProgramVk { + /// exactly 4 decimal limbs + #[prost(string, repeated, tag = "1")] + pub limbs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AggregationProgramSpec { + #[prost(message, optional, tag = "1")] + pub normalize: ::core::option::Option, + #[prost(string, tag = "2")] + pub aggregate_publics_body: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub n_free: u64, + /// Optional leaf allow-list (empty = VK-agnostic). Order is significant. + #[prost(message, repeated, tag = "4")] + pub program_vks: ::prost::alloc::vec::Vec, + /// Publics slots the aggregation populates; the rest are generator-zero-filled. + #[prost(uint64, tag = "5")] + pub n_publics_agg: u64, +} +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RegisterAggregationProgramRequest { + /// SDK-computed content hash. The coordinator stores the spec under this + /// id and echoes it back. Re-registering an already-known id is idempotent. + /// Computed by both SDK and worker from the same `RecurserManifestInputs`, + /// so a misaligned zisk_vk surfaces here as a "recurser_id not found" at + /// dispatch time rather than a silent divergence. + #[prost(string, tag = "1")] + pub recurser_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub spec: ::core::option::Option, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct RegisterAggregationProgramResponse { + /// echo of the request's recurser_id + #[prost(string, tag = "1")] + pub recurser_id: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct JobRequestMessage { #[prost(message, optional, tag = "1")] pub job_kind: ::core::option::Option, @@ -185,7 +230,7 @@ pub struct JobResponse { } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct JobKind { - #[prost(oneof = "job_kind::Kind", tags = "1, 2, 3, 5")] + #[prost(oneof = "job_kind::Kind", tags = "1, 2, 3, 4, 5, 6")] pub kind: ::core::option::Option, } /// Nested message and enum types in `JobKind`. @@ -198,9 +243,12 @@ pub mod job_kind { Prove(super::ProveRequest), #[prost(message, tag = "3")] Wrap(super::WrapRequest), - /// AggregateRequest aggregate = 4; // TODO: not yet defined + #[prost(message, tag = "4")] + AggregateProofs(super::AggregateProofsRequest), #[prost(message, tag = "5")] Execute(super::ExecuteRequest), + #[prost(message, tag = "6")] + SetupAggregationProgram(super::SetupAggregationProgramRequest), } } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] @@ -256,6 +304,43 @@ pub struct WrapResponse { pub proof: ::core::option::Option, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct SetupAggregationProgramRequest { + #[prost(string, tag = "1")] + pub recurser_id: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct SetupAggregationProgramResponse { + /// 32 bytes — 4 u64 little-endian limbs + #[prost(bytes = "vec", tag = "1")] + pub vk: ::prost::alloc::vec::Vec, + #[prost(string, tag = "2")] + pub hash_mode: ::prost::alloc::string::String, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct AggregateProofsRequest { + #[prost(string, tag = "1")] + pub recurser_id: ::prost::alloc::string::String, + /// bincode-serialized VadcopFinalProof + #[prost(bytes = "vec", tag = "2")] + pub proof_a: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + pub proof_b: ::prost::alloc::vec::Vec, + /// proof_a's normalization side inputs + #[prost(uint64, repeated, tag = "4")] + pub free_inputs_a: ::prost::alloc::vec::Vec, + /// proof_b's normalization side inputs + #[prost(uint64, repeated, tag = "5")] + pub free_inputs_b: ::prost::alloc::vec::Vec, + /// optional override; len 0 or 4 + #[prost(uint64, repeated, tag = "6")] + pub root_c_recurser_agg: ::prost::alloc::vec::Vec, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct AggregateProofsResponse { + #[prost(message, optional, tag = "1")] + pub proof: ::core::option::Option, +} +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] pub struct ExecuteRequest { #[prost(string, tag = "1")] pub hash_id: ::prost::alloc::string::String, @@ -275,7 +360,7 @@ pub struct ExecuteResponse { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct JobKindResponse { - #[prost(oneof = "job_kind_response::Kind", tags = "1, 2, 3, 4")] + #[prost(oneof = "job_kind_response::Kind", tags = "1, 2, 3, 4, 5, 6")] pub kind: ::core::option::Option, } /// Nested message and enum types in `JobKindResponse`. @@ -289,7 +374,11 @@ pub mod job_kind_response { #[prost(message, tag = "3")] Wrap(super::WrapResponse), #[prost(message, tag = "4")] + AggregateProofs(super::AggregateProofsResponse), + #[prost(message, tag = "5")] Execute(super::ExecuteResponse), + #[prost(message, tag = "6")] + SetupAggregationProgram(super::SetupAggregationProgramResponse), } } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] @@ -503,8 +592,8 @@ pub enum JobPhase { Contributions = 1, /// proof generation Prove = 2, - /// proof aggregation - Aggregate = 3, + /// recurser prove phase + Recurse = 3, } impl JobPhase { /// String value of the enum field names used in the ProtoBuf definition. @@ -516,7 +605,7 @@ impl JobPhase { Self::Unspecified => "JOB_PHASE_UNSPECIFIED", Self::Contributions => "JOB_PHASE_CONTRIBUTIONS", Self::Prove => "JOB_PHASE_PROVE", - Self::Aggregate => "JOB_PHASE_AGGREGATE", + Self::Recurse => "JOB_PHASE_RECURSE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -525,7 +614,7 @@ impl JobPhase { "JOB_PHASE_UNSPECIFIED" => Some(Self::Unspecified), "JOB_PHASE_CONTRIBUTIONS" => Some(Self::Contributions), "JOB_PHASE_PROVE" => Some(Self::Prove), - "JOB_PHASE_AGGREGATE" => Some(Self::Aggregate), + "JOB_PHASE_RECURSE" => Some(Self::Recurse), _ => None, } } @@ -652,7 +741,38 @@ pub mod zisk_coordinator_api_client { ); self.inner.unary(req, path, codec).await } - /// Submit a new job (setup, prove, wrap, or execute). + /// Register a recurser spec. Idempotent: the same spec always + /// returns the same recurser_id (a content hash of the inputs). + pub async fn register_aggregation_program( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic_prost::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/zisk.coordinator.v1.ZiskCoordinatorApi/RegisterAggregationProgram", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "zisk.coordinator.v1.ZiskCoordinatorApi", + "RegisterAggregationProgram", + ), + ); + self.inner.unary(req, path, codec).await + } + /// Submit a new job (setup, prove, wrap, execute, setup_aggregation_program, aggregate_proofs). pub async fn job_request( &mut self, request: impl tonic::IntoRequest, diff --git a/crates/cluster-client/zisk/src/client.rs b/crates/cluster-client/zisk/src/client.rs index 0a04605a..f898d02f 100644 --- a/crates/cluster-client/zisk/src/client.rs +++ b/crates/cluster-client/zisk/src/client.rs @@ -1,11 +1,11 @@ //! Remote ZisK cluster proving. -use core::{iter, time::Duration}; +use core::time::Duration; use ere_compiler_core::Elf; use ere_prover_core::{Input, RemoteProverConfig, zkVMVerifier}; use ere_verifier_zisk::{ - PROGRAM_VK_WORDS, PUBLIC_VALUES_BYTES, VADCOP_FINAL_HASH_FAMILY, VadcopFinalProof, + PROGRAM_VK_WORDS, PUBLIC_VALUES_WORDS, VADCOP_FINAL_HASH_FAMILY, VadcopFinalProof, ZiskProgramVk, ZiskProof, ZiskVerifier, }; use serde::Deserialize; @@ -266,22 +266,34 @@ fn framed_stdin(data: &[u8]) -> Vec { } fn parse_proof(bytes: &[u8]) -> Result { + /// Mirrors `zisk_common::VadcopKind`, whose discriminant order fixes the + /// encoding. Only `Minimal` is accepted below. + #[derive(Deserialize, PartialEq)] + enum VadcopKind { + Final, + Recurser, + Minimal, + } + #[derive(Deserialize)] enum ProofBody { Vadcop { proof: Vec, _zisk_vk: Vec, - minimal: bool, + kind: VadcopKind, hash: String, + /// Canonical flag-free `[program_vk(4) | inputs(64)]` at full u64 + /// width. A minimal proof carries no `is_vadcop_final_proof` flag, + /// so this is already the vector the verifier commits to. + publics_full: Vec, }, Plonk, } - #[derive(Deserialize)] - struct PublicValues { - data: Vec, - } - + /// Mirrors `zisk_common::ProgramVK` up to its trailing `hash_mode`, which is + /// dropped because the hash family is already checked through `ProofBody`. + /// Bincode is positional, so omitting it is only sound while it stays last + /// in a `ProgramVK` that stays last in `Proof`. #[derive(Deserialize)] struct ProgramVK { vk: Vec, @@ -290,7 +302,6 @@ fn parse_proof(bytes: &[u8]) -> Result { #[derive(Deserialize)] struct Proof { body: ProofBody, - publics: PublicValues, program_vk: ProgramVK, } @@ -303,37 +314,29 @@ fn parse_proof(bytes: &[u8]) -> Result { got: proof.program_vk.vk.len() * 8, })?; }; - if proof.publics.data.len() != PUBLIC_VALUES_BYTES { - Err(ere_verifier_zisk::Error::InvalidPublicValueLength { - expected: PUBLIC_VALUES_BYTES, - got: proof.publics.data.len(), - })?; - }; - - let public_values = { - let to_u64 = |bytes: &[u8; 4]| u32::from_le_bytes(*bytes) as u64; - iter::empty() - .chain(proof.program_vk.vk) - .chain(proof.publics.data.as_chunks::<4>().0.iter().map(to_u64)) - .collect() - }; - - let proof = if let ProofBody::Vadcop { + let ProofBody::Vadcop { proof, - minimal: true, + kind, hash, + publics_full, .. } = proof.body - && hash == VADCOP_FINAL_HASH_FAMILY - { - proof - } else { + else { return Err(ere_verifier_zisk::Error::InvalidVadcopFinalProofKind)?; }; + if kind != VadcopKind::Minimal || hash != VADCOP_FINAL_HASH_FAMILY { + Err(ere_verifier_zisk::Error::InvalidVadcopFinalProofKind)?; + } + if publics_full.len() != PROGRAM_VK_WORDS + PUBLIC_VALUES_WORDS { + Err(ere_verifier_zisk::Error::InvalidPublicValueLength { + expected: PROGRAM_VK_WORDS + PUBLIC_VALUES_WORDS, + got: publics_full.len(), + })?; + }; Ok(ZiskProof(VadcopFinalProof::new( proof, - public_values, + publics_full, true, VADCOP_FINAL_HASH_FAMILY.to_string(), ))) diff --git a/crates/compiler/zisk/src/rust_rv64ima.rs b/crates/compiler/zisk/src/rust_rv64ima.rs index 69d20f1d..31b2fa2c 100644 --- a/crates/compiler/zisk/src/rust_rv64ima.rs +++ b/crates/compiler/zisk/src/rust_rv64ima.rs @@ -35,8 +35,11 @@ const CARGO_BUILD_OPTIONS: &[&str] = &[ "-Zjson-target-spec", ]; -/// Copied from https://github.com/0xPolygonHermez/rust/blob/c03068e/compiler/rustc_target/src/spec/targets/riscv64ima_zisk_zkvm_elf_linker_script.ld. -const LINKER_SCRIPT: &str = include_str!("rust_rv64ima/link.x"); +/// Copied from https://github.com/0xPolygonHermez/zisk/blob/v1.1.0-alpha/ziskbuild/zisk_linker_script.ld. +/// +/// The ZisK target carries no built-in link script, so both compilers pass this one explicitly, +/// matching what `zisk-build` injects for its own guest builds. +pub(crate) const LINKER_SCRIPT: &str = include_str!("rust_rv64ima/link.x"); /// Compiler for Rust guest program to RV64IMA architecture, using a stock /// nightly Rust toolchain with ZisK's target specification. diff --git a/crates/compiler/zisk/src/rust_rv64ima/link.x b/crates/compiler/zisk/src/rust_rv64ima/link.x index 228facff..2462c7e5 100644 --- a/crates/compiler/zisk/src/rust_rv64ima/link.x +++ b/crates/compiler/zisk/src/rust_rv64ima/link.x @@ -1,50 +1,69 @@ -/* Copied from https://github.com/0xPolygonHermez/rust/blob/c03068e/compiler/rustc_target/src/spec/targets/riscv64ima_zisk_zkvm_elf_linker_script.ld */ +/* Copied from https://github.com/0xPolygonHermez/zisk/blob/v1.1.0-alpha/ziskbuild/zisk_linker_script.ld */ OUTPUT_FORMAT("elf64-littleriscv") OUTPUT_ARCH("riscv") ENTRY(_start) MEMORY { - rom (xa) : ORIGIN = 0x80000000, LENGTH = 0x10000000 - ram (wxa) : ORIGIN = 0xa0020000, LENGTH = 0x1FFE0000 + rom (xa) : ORIGIN = 0x80000000, LENGTH = 0x08000000 + ram (wxa) : ORIGIN = 0xa0000000, LENGTH = 0x20000000 } PHDRS { - text PT_LOAD FLAGS(5); + text PT_LOAD FLAGS(1); rodata PT_LOAD FLAGS(4); data PT_LOAD FLAGS(6); bss PT_LOAD FLAGS(6); output_data PT_LOAD FLAGS(6); + general_registers_data PT_LOAD FLAGS(6); + float_registers_data PT_LOAD FLAGS(6); + stack_data PT_LOAD FLAGS(6); } -_stack_size = 0x400000; /* 4 MB reserved */ -_output_data_size = 0x10000; /* 64 KB reserved */ -_float_ram_data_size = 0x10000; /* 64 KB reserved */ +_stack_size = 0x400000; /* 4 MB reserved */ +_general_registers_data_size = 0x8000; /* 32 kB */ +_float_registers_data_size = 0x8000; /* 32 kB */ +_output_data_size = 0x20000; /* 128 KB reserved */ +_float_ram_data_size = 0x10000; /* 64 KB reserved */ /* -0xA0000000 ┌────────────────────┐ - │ .general_registers │ 64 KB reserved (NOLOAD) - │ 0x10000 bytes │ _general_registers_start / _end -0xA0010000 ├────────────────────┤ - │ .float_registers │ 64 KB reserved (NOLOAD) - │ 0x10000 bytes │ _float_registers_start / _end -0xA001FFFF └────────────────────┘ ← _kernel_heap_top -0xA0020000 ┌────────────────────┐ - │ .output_data │ 64 KB reserved (NOLOAD) - │ 0x10000 bytes │ _output_data_start / _end -0xA0030000 ├────────────────────┤ - │ .data │ - │ .bss │ - ├────────────────────┤ ← _bss_end - │ stack ↑ 4MB │ - ├────────────────────┤ ← _init_stack_top = _kernel_heap_bottom - │ heap ↓ │ - │ │ -0xBFFEFFFF │ │ -0xBFFF0000 ├────────────────────┤ ← _kernel_heap_top - │ float ram │ -0xC0000000 └────────────────────┘ +0x4000_0000 ┌────────────────────┐← free input entry + │ input data │ + │ (1GB) │ +0x7FFF_FFFF └────────────────────┘ +0x8000_0000 ┌────────────────────┐ + │ ROM data │ + │ (128MB) │ +0x87FF_FFFF └────────────────────┘ + ↑ + 384 MB + ↓ +0xA000_0000 ┌────────────────────┐← _init_stack_bottom + │ │ + │ stack ↑ 4MB │ + │ │ +0xA040_0000 ├────────────────────┤← _init_stack_top + │ .general_registers │ 32 KB reserved (NOLOAD) + │ 0x8000 bytes │ _general_registers_data_start / _end +0xA040_8000 ├────────────────────┤ + │ .float_registers │ 32 KB reserved (NOLOAD) + │ 0x8000 bytes │ _float_registers_data_start / _end +0xA041_0000 ├────────────────────┤ + │ .output_data │ 128 KB reserved (NOLOAD) + │ 0x20000 bytes │ _output_data_start / _end +0xA043_0000 ├────────────────────┤ + │ .data │ + │ .bss │ + ├────────────────────┤ ← _bss_end, _heap_bottom + │ heap ↓ │ + │ │ + │ │ + │ │ + │ │ +0xBFFF_0000 ├────────────────────┤ ← _heap_top + │ float ram │ +0xC000_0000 └────────────────────┘ */ @@ -56,6 +75,54 @@ SECTIONS PROVIDE(_global_pointer = .); .rodata : { *(.rodata .rodata.*)} >rom AT>rom :rodata + /* C++ static constructors / destructors (run by _start before/after main), + placed in ROM: the entries are link-time-constant function pointers, never + written. KEEP prevents --gc-sections from dropping them. The init/fini array + bound symbols are referenced (strongly) by the runtime, so this section MUST + be present when linking against libziskos. Empty when the program has no + static initializers (start == end), so it costs nothing. */ + . = ALIGN(8); + .init_array : { + PROVIDE(__init_array_start = .); + KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } >rom AT>rom :rodata + + .fini_array : { + PROVIDE(__fini_array_start = .); + KEEP(*(SORT_BY_INIT_PRIORITY(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE(__fini_array_end = .); + } >rom AT>rom :rodata + + /* reserve stack at the beginning of RAM */ + . = ORIGIN(ram); + + /* reserved space for stack data */ + .stack_data (NOLOAD): { + PROVIDE(_stack_start = .); + PROVIDE(_init_stack_bottom = .); /* alias for the start of the reserved stack region */ + . = . + _stack_size; + PROVIDE(_init_stack_top = .); /* reserve 4M bytes for the initialisation stack */ + } >ram AT>ram :stack_data + + /* reserved space for general registers */ + + .general_registers_data (NOLOAD) : { + PROVIDE(_general_registers_data_start = .); + . = . + _general_registers_data_size; + PROVIDE(_general_registers_data_end = .); + } >ram AT>ram :general_registers_data + + /* reserved space for float registers */ + + .float_registers_data (NOLOAD) : { + PROVIDE(_float_registers_data_start = .); + . = . + _float_registers_data_size; + PROVIDE(_float_registers_data_end = .); + } >ram AT>ram :float_registers_data + /* reserved space for output data */ .output_data (NOLOAD) : { @@ -68,16 +135,13 @@ SECTIONS .bss : { PROVIDE(_bss_start = .); - *(.bss .bss.*); - PROVIDE(_bss_end = .); # ... and one at the end + *(.bss .bss.* .sbss .sbss.*); + PROVIDE(_bss_end = .); /* ... and one at the end */ } >ram AT>ram :bss - . = ALIGN(8); - PROVIDE(_init_stack_top = . + _stack_size); # reserve 4M bytes for the initialisation stack - - PROVIDE(_kernel_heap_bottom = _init_stack_top); - PROVIDE(_kernel_heap_top = ORIGIN(ram) + LENGTH(ram) - _float_ram_data_size); - PROVIDE(_kernel_heap_size = _kernel_heap_top - _kernel_heap_bottom); + PROVIDE(_heap_bottom = .); + PROVIDE(_heap_top = ORIGIN(ram) + LENGTH(ram) - _float_ram_data_size); + PROVIDE(_heap_size = _heap_top - _heap_bottom); _end = .; } diff --git a/crates/compiler/zisk/src/rust_rv64ima_customized.rs b/crates/compiler/zisk/src/rust_rv64ima_customized.rs index 71fdb3ba..4ae36bdf 100644 --- a/crates/compiler/zisk/src/rust_rv64ima_customized.rs +++ b/crates/compiler/zisk/src/rust_rv64ima_customized.rs @@ -3,7 +3,7 @@ use std::path::Path; use ere_compiler_core::{Compiler, Elf}; use ere_util_compile::{CargoBuildCmd, parse_cargo_build_options}; -use crate::Error; +use crate::{Error, rust_rv64ima::LINKER_SCRIPT}; const ZISK_TOOLCHAIN: &str = "zisk"; const ZISK_TARGET: &str = "riscv64ima-zisk-zkvm-elf"; @@ -82,6 +82,7 @@ impl Compiler for ZiskRustRv64imaCustomized { let flags: Vec<&str> = [profile_flags(), RUSTFLAGS].concat(); let options = parse_cargo_build_options(args)?; let elf = CargoBuildCmd::new() + .linker_script(Some(LINKER_SCRIPT)) .toolchain(ZISK_TOOLCHAIN) .rustflags(&flags) .features(&options.features) diff --git a/crates/dockerized/src/prover.rs b/crates/dockerized/src/prover.rs index d865daae..e373e114 100644 --- a/crates/dockerized/src/prover.rs +++ b/crates/dockerized/src/prover.rs @@ -217,7 +217,10 @@ impl ServerContainer { .inherit_env("ERE_ZISK_SETUP_ON_INIT") .inherit_env("ERE_ZISK_UNLOCK_MAPPED_MEMORY") .inherit_env("ERE_ZISK_MINIMAL_MEMORY") + .inherit_env("ERE_ZISK_CPU_MOPS") + .inherit_env("ERE_ZISK_PACKED") .inherit_env("ERE_ZISK_MAX_STREAMS") + .inherit_env("ERE_ZISK_MAX_RECURSIVE_STREAMS") .inherit_env("ERE_ZISK_NUMBER_THREADS_WITNESS") .inherit_env("ERE_ZISK_MAX_WITNESS_STORED") .inherit_env("ERE_ZISK_CLUSTER_PROVE_TIMEOUT_SECS"), diff --git a/crates/prover/zisk/Cargo.toml b/crates/prover/zisk/Cargo.toml index 9218daf0..7db85db4 100644 --- a/crates/prover/zisk/Cargo.toml +++ b/crates/prover/zisk/Cargo.toml @@ -21,6 +21,7 @@ zisk-core.workspace = true zisk-prover-backend.workspace = true zisk-rom-setup.workspace = true zisk-sm-rom.workspace = true +zisk-transpiler-riscv.workspace = true ziskemu.workspace = true # Local dependencies diff --git a/crates/prover/zisk/src/sdk.rs b/crates/prover/zisk/src/sdk.rs index 6f8f2e7e..b6f1c092 100644 --- a/crates/prover/zisk/src/sdk.rs +++ b/crates/prover/zisk/src/sdk.rs @@ -11,7 +11,8 @@ use ere_prover_core::{CommonError, Input, ProverResource, ProverResourceKind, Pu use ere_util_tokio::block_on; use ere_verifier_zisk::{ZiskProgramVk, ZiskProof, ensure_program_vk_matches}; use tokio::time::Instant; -use zisk_core::{Riscv2zisk, ZiskRom}; +use zisk_core::ZiskRom; +use zisk_transpiler_riscv::Riscv2zisk; use ziskemu::{Emu, EmuOptions}; use crate::{error::Error, sdk::local::LocalProver}; diff --git a/crates/prover/zisk/src/sdk/local.rs b/crates/prover/zisk/src/sdk/local.rs index 313207f2..d7225f52 100644 --- a/crates/prover/zisk/src/sdk/local.rs +++ b/crates/prover/zisk/src/sdk/local.rs @@ -28,7 +28,10 @@ struct Config { setup_on_init: bool, unlock_mapped_memory: bool, minimal_memory: bool, + cpu_mops: bool, + packed: bool, max_streams: Option, + max_recursive_streams: Option, number_threads_witness: Option, max_witness_stored: Option, } @@ -49,7 +52,10 @@ impl Config { setup_on_init: env::var_os("ERE_ZISK_SETUP_ON_INIT").is_some(), unlock_mapped_memory: env::var_os("ERE_ZISK_UNLOCK_MAPPED_MEMORY").is_some(), minimal_memory: env::var_os("ERE_ZISK_MINIMAL_MEMORY").is_some(), + cpu_mops: env::var_os("ERE_ZISK_CPU_MOPS").is_some(), + packed: env::var_os("ERE_ZISK_PACKED").is_some(), max_streams: parse_usize("ERE_ZISK_MAX_STREAMS")?, + max_recursive_streams: parse_usize("ERE_ZISK_MAX_RECURSIVE_STREAMS")?, number_threads_witness: parse_usize("ERE_ZISK_NUMBER_THREADS_WITNESS")?, max_witness_stored: parse_usize("ERE_ZISK_MAX_WITNESS_STORED")?, }) @@ -121,17 +127,22 @@ fn build_prover(config: &Config, resource: &ProverResource) -> Result *mut u8 { use core::arch::asm; @@ -55,7 +55,7 @@ pub unsafe extern "C" fn sys_alloc_aligned(bytes: usize, align: usize) -> *mut u unsafe { // using inline assembly is easier to access linker constants asm!( - "la {heap_bottom}, _kernel_heap_bottom", + "la {heap_bottom}, _heap_bottom", heap_bottom = out(reg) heap_bottom, options(nomem) )