Skip to content

Commit

Permalink
Multiple small fixes for the prover CLI (#579)
Browse files Browse the repository at this point in the history
* Add fixes

* Move requirements

* Update ci
  • Loading branch information
MauroToscano authored Sep 27, 2023
1 parent 8e0438a commit 9825074
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion provers/cairo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
11 changes: 11 additions & 0 deletions provers/cairo/cairo_compile.Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
File renamed without changes.
5 changes: 5 additions & 0 deletions provers/cairo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit 9825074

Please sign in to comment.