feat: Add ere-zisk with only compile and execute utility. (#27)

* feat: add `ere-zisk` and `compile` functionality

* fix: use `FixintEncoding` for `Input::as_bytes` to make it deterministic

* feat: implement `zkVM::execute`

* fix: make `install_zisk_sdk.sh` work with docker

* chore: add comment why use `#[should_panic]`

* feat: use command `cargo-zisk ...` for `compile`, `execute`, `prove` and `verify`

* ci

* fix: invalid proof
This commit is contained in:
Han
2025-05-28 15:49:04 +01:00
committed by GitHub
parent d106f8d65c
commit 5b5a012e26
16 changed files with 777 additions and 68 deletions

View File

@@ -31,32 +31,14 @@ ensure_tool_installed "rustup" "for managing Rust toolchains (ZisK installs its
ensure_tool_installed "cargo" "as cargo-zisk is a cargo subcommand"
# Step 1: Download and run the script that installs the ziskup binary itself.
ZISKUP_INSTALLER_DOWNLOAD_PATH="/tmp/ziskup_install.sh"
echo "Downloading the script that installs the 'ziskup' binary to ${ZISKUP_INSTALLER_DOWNLOAD_PATH}..."
curl -L https://raw.githubusercontent.com/0xPolygonHermez/zisk/main/ziskup/install.sh -o "${ZISKUP_INSTALLER_DOWNLOAD_PATH}"
chmod +x "${ZISKUP_INSTALLER_DOWNLOAD_PATH}"
echo "Running the 'ziskup' binary installer script..."
"${ZISKUP_INSTALLER_DOWNLOAD_PATH}" # This script installs $HOME/.zisk/bin/ziskup
rm "${ZISKUP_INSTALLER_DOWNLOAD_PATH}" # Clean up the downloaded installer script
# Step 2: Ensure the installed ziskup binary is in PATH for this script session.
ZISK_BIN_DIR="${HOME}/.zisk/bin"
if [ -d "${ZISK_BIN_DIR}" ] && [[ ":$PATH:" != *":${ZISK_BIN_DIR}:"* ]]; then
echo "Adding ${ZISK_BIN_DIR} to PATH for current script session."
export PATH="${ZISK_BIN_DIR}:$PATH"
fi
# Ensure the ziskup binary itself is now installed and executable
ensure_tool_installed "ziskup" "ZisK SDK manager tool"
# Step 3: Now run the installed ziskup binary with non-interactive flags.
echo "Running 'ziskup --provingkey' to install ZisK components..."
# Export GH_RUNNER=true to ensure ziskup uses default non-interactive options.
export GH_RUNNER=true
ziskup --provingkey # This is the actual ziskup tool that processes --provingkey
curl https://raw.githubusercontent.com/0xPolygonHermez/zisk/main/ziskup/install.sh | bash
unset GH_RUNNER
# Step 2: Ensure the installed cargo-zisk binary is in PATH for this script session.
export PATH="${PATH}:${HOME}/.zisk/bin"
# Verify ZisK installation
echo "Verifying ZisK installation..."
@@ -76,16 +58,16 @@ else
fi
echo "Checking for cargo-zisk CLI tool (using +zisk toolchain)..."
# cargo-zisk should be callable via `cargo +zisk zisk ...`
if cargo +zisk zisk --version; then
# cargo-zisk should be callable via `cargo-zisk ...`
if cargo-zisk --version; then
echo "cargo-zisk CLI tool verified successfully."
else
echo "Error: 'cargo +zisk zisk --version' failed." >&2
echo "Error: 'cargo-zisk --version' failed." >&2
echo " Attempting verification with cargo-zisk directly (if in PATH from ${ZISK_BIN_DIR})..."
if command -v cargo-zisk &> /dev/null && cargo-zisk --version; then
echo "cargo-zisk found directly in PATH and verified."
else
echo "Error: cargo-zisk also not found directly or 'cargo +zisk zisk --version' failed." >&2
echo "Error: cargo-zisk also not found directly or 'cargo-zisk --version' failed." >&2
echo " Ensure ${ZISK_BIN_DIR} is effectively in PATH for new shells and check ziskup output." >&2
exit 1
fi