diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 13513a576..853051e48 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -96,7 +96,7 @@ jobs: cache: "pip" - name: Install cairo-lang toolchain and dependencies - run: pip install -r requirements.txt + run: pip install -r provers/cairo/requirements.txt - name: Install testing tools uses: taiki-e/install-action@v2 diff --git a/provers/cairo/Makefile b/provers/cairo/Makefile index 2fa939bb7..37bcb4484 100644 --- a/provers/cairo/Makefile +++ b/provers/cairo/Makefile @@ -2,7 +2,7 @@ ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) -CAIRO0_PROGRAMS_DIR=cairo_prover/cairo_programs/cairo0 +CAIRO0_PROGRAMS_DIR=cairo_programs/cairo0 CAIRO0_PROGRAMS:=$(wildcard $(CAIRO0_PROGRAMS_DIR)/*.cairo) COMPILED_CAIRO0_PROGRAMS:=$(patsubst $(CAIRO0_PROGRAMS_DIR)/%.cairo, $(CAIRO0_PROGRAMS_DIR)/%.json, $(CAIRO0_PROGRAMS)) diff --git a/provers/cairo/cairo_compile.Dockerfile b/provers/cairo/cairo_compile.Dockerfile new file mode 100644 index 000000000..369f6db84 --- /dev/null +++ b/provers/cairo/cairo_compile.Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.9-slim + +WORKDIR /app + +RUN apt-get update && apt-get install -y --no-install-recommends g++ libgmp3-dev + +COPY requirements.txt / + +RUN pip install -r /requirements.txt + +ENTRYPOINT ["cairo-compile"] diff --git a/requirements.txt b/provers/cairo/requirements.txt similarity index 100% rename from requirements.txt rename to provers/cairo/requirements.txt diff --git a/provers/cairo/src/main.rs b/provers/cairo/src/main.rs index 1bd5b8bc8..6d6584265 100644 --- a/provers/cairo/src/main.rs +++ b/provers/cairo/src/main.rs @@ -87,6 +87,11 @@ fn main() { let input_path = &args[2]; let output_path = &args[3]; + if input_path.contains(".cairo") { + println!("\nYou are trying to prove a non compiled Cairo program. Please compile it before sending it to the prover.\n"); + return; + } + let Some((proof, pub_inputs)) = generate_proof(input_path, &proof_options) else { return; };