From 6e24c8f23185a0fb0249edd8d3c4ac104bb2a439 Mon Sep 17 00:00:00 2001 From: han0110 Date: Wed, 25 Mar 2026 13:27:40 +0000 Subject: [PATCH 1/2] fix: bump all `v0.16.0` to `v0.16.1` and rebuild `ziskemu` --- README.md | 2 +- docker/zisk/Dockerfile.cluster | 2 +- scripts/sdk_installers/install_zisk_sdk.sh | 9 +++++++-- tests/zisk/stock_nightly_no_std/src/memcpy.s | 8 ++++---- tests/zisk/stock_nightly_no_std/src/memmove.s | 8 ++++---- tests/zisk/stock_nightly_no_std/src/zisk.rs | 4 ++-- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index ce164f2a..cfca7f3d 100644 --- a/README.md +++ b/README.md @@ -156,7 +156,7 @@ OutputHashedPlatform::::write_whole_output(&large_output | OpenVM | [`1.4.3`](https://github.com/openvm-org/openvm/tree/v1.4.3) | `RV32IMA` | V | | | | Risc0 | [`3.0.4`](https://github.com/risc0/risc0/tree/v3.0.4) | `RV32IMA` | V | V | | | SP1 | [`6.0.1`](https://github.com/succinctlabs/sp1/tree/v6.0.1) | `RV64IMA` | V | | | -| Zisk | [`0.16.0`](https://github.com/0xPolygonHermez/zisk/tree/v0.16.0) | `RV64IMA` | V | V | V | +| Zisk | [`0.16.1`](https://github.com/0xPolygonHermez/zisk/tree/v0.16.1) | `RV64IMA` | V | V | V | ## Examples diff --git a/docker/zisk/Dockerfile.cluster b/docker/zisk/Dockerfile.cluster index 6ec262cf..db57f0a2 100644 --- a/docker/zisk/Dockerfile.cluster +++ b/docker/zisk/Dockerfile.cluster @@ -49,7 +49,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --de # Clone repo WORKDIR /app -RUN git clone https://github.com/han0110/zisk.git --depth 1 --branch patch/v0.16.0 /app +RUN git clone https://github.com/han0110/zisk.git --depth 1 --branch patch/v0.16.1 /app # Whether to enable CUDA feature or not. ARG CUDA diff --git a/scripts/sdk_installers/install_zisk_sdk.sh b/scripts/sdk_installers/install_zisk_sdk.sh index aea29397..2eaaaebd 100755 --- a/scripts/sdk_installers/install_zisk_sdk.sh +++ b/scripts/sdk_installers/install_zisk_sdk.sh @@ -32,7 +32,7 @@ ensure_tool_installed "cargo" "to pre-build lib-c" # Step 1: Download and run the script that installs the ziskup binary itself. # Export SETUP_KEY=proving-no-consttree to download proving key without doing setup. -export ZISK_VERSION="0.16.0" +export ZISK_VERSION="0.16.1" export SETUP_KEY=${SETUP_KEY:=proving-no-consttree} curl "https://raw.githubusercontent.com/0xPolygonHermez/zisk/main/ziskup/install.sh" | bash unset SETUP_KEY @@ -47,6 +47,11 @@ unset SETUP_KEY # re-used as long as the `ziskos` has the same version. WORKSPACE=$(mktemp -d) cargo init "$WORKSPACE" --name build-lib-c -cargo add lib-c --git https://github.com/0xPolygonHermez/zisk.git --tag "v$ZISK_VERSION" --manifest-path "$WORKSPACE/Cargo.toml" +cargo add lib-c --git https://github.com/han0110/zisk.git --branch "patch/v$ZISK_VERSION" --manifest-path "$WORKSPACE/Cargo.toml" cargo build --manifest-path "$WORKSPACE/Cargo.toml" rm -rf "$WORKSPACE" + +# FIXME: Remove this step when upgrading to `v0.17.0` +# Step 3: Rebuild `ziskemu` using the patched repo +cargo install --git https://github.com/han0110/zisk.git --branch "patch/v$ZISK_VERSION" --locked ziskemu +mv $HOME/.cargo/bin/ziskemu $HOME/.zisk/bin/ziskemu diff --git a/tests/zisk/stock_nightly_no_std/src/memcpy.s b/tests/zisk/stock_nightly_no_std/src/memcpy.s index fed5c7a6..662ea6de 100644 --- a/tests/zisk/stock_nightly_no_std/src/memcpy.s +++ b/tests/zisk/stock_nightly_no_std/src/memcpy.s @@ -1,4 +1,4 @@ -# Copied from https://github.com/0xPolygonHermez/zisk/blob/v0.16.0/ziskos/entrypoint/src/dma/memcpy.s +# Copied from https://github.com/0xPolygonHermez/zisk/blob/v0.16.1/ziskos/entrypoint/src/dma/memcpy.s .section ".note.GNU-stack","",@progbits .text @@ -8,9 +8,9 @@ .p2align 4 .type memcpy,@function memcpy: - csrs 0x813, a2 # Marker: Write count (a2) to CSR 0x813 - add x0,a0,a1 + csrs 0x813, a1 # Marker: Write count (a2) to CSR 0x813 + add x0,a0,a2 ret .size memcpy, .-memcpy - .section .text.hot,"ax",@progbits \ No newline at end of file + .section .text.hot,"ax",@progbits diff --git a/tests/zisk/stock_nightly_no_std/src/memmove.s b/tests/zisk/stock_nightly_no_std/src/memmove.s index 1bb34d21..e14adae2 100644 --- a/tests/zisk/stock_nightly_no_std/src/memmove.s +++ b/tests/zisk/stock_nightly_no_std/src/memmove.s @@ -1,4 +1,4 @@ -# Copied from https://github.com/0xPolygonHermez/zisk/blob/v0.16.0/ziskos/entrypoint/src/dma/memmove.s +# Copied from https://github.com/0xPolygonHermez/zisk/blob/v0.16.1/ziskos/entrypoint/src/dma/memmove.s .section ".note.GNU-stack","",@progbits .text @@ -8,8 +8,8 @@ .p2align 4 .type memmove,@function memmove: - csrs 0x813, a2 # Marker: Write count (a2) to CSR 0x813 - add x0,a0,a1 + csrs 0x813, a1 # Marker: Write count (a2) to CSR 0x813 + add x0,a0,a2 ret .size memmove, .-memmove - .section .text.hot,"ax",@progbits \ No newline at end of file + .section .text.hot,"ax",@progbits diff --git a/tests/zisk/stock_nightly_no_std/src/zisk.rs b/tests/zisk/stock_nightly_no_std/src/zisk.rs index b5a5fe53..6c620359 100644 --- a/tests/zisk/stock_nightly_no_std/src/zisk.rs +++ b/tests/zisk/stock_nightly_no_std/src/zisk.rs @@ -5,7 +5,7 @@ unsafe extern "C" fn _zisk_main() { crate::main(); } -// According to https://github.com/0xPolygonHermez/zisk/blob/v0.16.0/ziskos/entrypoint/src/lib.rs#L116 +// According to https://github.com/0xPolygonHermez/zisk/blob/v0.16.1/ziskos/entrypoint/src/lib.rs#L232 core::arch::global_asm!( r#" .section .text.init @@ -46,7 +46,7 @@ unsafe impl GlobalAlloc for SimpleAlloc { #[global_allocator] static HEAP: SimpleAlloc = SimpleAlloc; -// According to https://github.com/0xPolygonHermez/zisk/blob/v0.16.0/ziskos/entrypoint/src/lib.rs#L241 +// According to https://github.com/0xPolygonHermez/zisk/blob/v0.16.1/ziskos/entrypoint/src/lib.rs#L241 #[no_mangle] pub unsafe extern "C" fn sys_alloc_aligned(bytes: usize, align: usize) -> *mut u8 { use core::arch::asm; From 3e8e41b2822cb50bae00c3bfb20080bf847148ae Mon Sep 17 00:00:00 2001 From: han0110 Date: Wed, 25 Mar 2026 13:48:44 +0000 Subject: [PATCH 2/2] fix --- scripts/sdk_installers/install_zisk_sdk.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/sdk_installers/install_zisk_sdk.sh b/scripts/sdk_installers/install_zisk_sdk.sh index 2eaaaebd..cb894262 100755 --- a/scripts/sdk_installers/install_zisk_sdk.sh +++ b/scripts/sdk_installers/install_zisk_sdk.sh @@ -54,4 +54,5 @@ rm -rf "$WORKSPACE" # FIXME: Remove this step when upgrading to `v0.17.0` # Step 3: Rebuild `ziskemu` using the patched repo cargo install --git https://github.com/han0110/zisk.git --branch "patch/v$ZISK_VERSION" --locked ziskemu -mv $HOME/.cargo/bin/ziskemu $HOME/.zisk/bin/ziskemu +CARGO_BIN="${CARGO_HOME:-$HOME/.cargo}/bin" +mv $CARGO_BIN/ziskemu $HOME/.zisk/bin/ziskemu