Skip to content

Commit

Permalink
Create proof_programs symbolic links in deps target (#1556)
Browse files Browse the repository at this point in the history
* Replace symlinks with script

* Add target to deps

* Create symlimks in workflow

* Remove script

* Simplify

* Debug

* Try

* Reorder targets

* Try fix

* Use gitkeep to push proof_programs directory

* restore command

* Change target name

* Restore

* Update workflow

* Always build symlinks

* Create symlinks before fetching from cache

* Create symlinks before fetching from cache before computing traces

* Create symlinks before fetching from cache before running comparisons

* Remove new symlinks

* Create symlinks before fetching from cache clippy

* Use artifacts to ensure ther eis no hash mismatch when retrieving files

* Fix
  • Loading branch information
fmoletta authored Feb 19, 2024
1 parent 2382700 commit 9fb1b83
Show file tree
Hide file tree
Showing 150 changed files with 64 additions and 149 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,23 @@ env:
PROPTEST_CASES: 100

jobs:

# We need to use the same files across all jobs or else hashing will fail
upload_proof_programs_symlinks:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Create proof_programs symlinks
run: make create-proof-programs-symlinks
- uses: actions/upload-artifact@master
with:
name: proof_programs
path: cairo_programs/proof_programs/*.cairo

build-programs:
needs: upload_proof_programs_symlinks
strategy:
matrix:
# NOTE: we build cairo_bench_programs so clippy can check the benchmarks too
Expand All @@ -41,6 +57,11 @@ jobs:
with:
fetch-depth: 0

- uses: actions/download-artifact@master
with:
name: proof_programs
path: cairo_programs/proof_programs/

- name: Fetch from cache
uses: actions/cache@v3
id: cache-programs
Expand Down Expand Up @@ -91,6 +112,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/download-artifact@master
with:
name: proof_programs
path: cairo_programs/proof_programs/

- name: Fetch test programs
uses: actions/cache/restore@v3
Expand Down Expand Up @@ -143,9 +169,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/download-artifact@master
with:
name: proof_programs
path: cairo_programs/proof_programs/

- name: Format
run: make check-fmt


- name: Fetch programs
uses: actions/cache/restore@v3
with:
Expand Down Expand Up @@ -181,6 +213,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/download-artifact@master
with:
name: proof_programs
path: cairo_programs/proof_programs/

- name: Fetch programs
uses: actions/cache/restore@v3
with:
Expand Down Expand Up @@ -228,6 +265,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/download-artifact@master
with:
name: proof_programs
path: cairo_programs/proof_programs/

- name: Fetch programs
uses: actions/cache/restore@v3
with:
Expand Down Expand Up @@ -314,6 +356,11 @@ jobs:
with:
fetch-depth: 0

- uses: actions/download-artifact@master
with:
name: proof_programs
path: cairo_programs/proof_programs/

- name: Check cache
uses: actions/cache@v3
id: trace-cache
Expand Down Expand Up @@ -381,6 +428,11 @@ jobs:
path: target/release/cairo-vm-cli
fail-on-cache-miss: true

- uses: actions/download-artifact@master
with:
name: proof_programs
path: cairo_programs/proof_programs/

- name: Fetch programs
uses: actions/cache/restore@v3
with:
Expand Down Expand Up @@ -496,6 +548,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/download-artifact@master
with:
name: proof_programs
path: cairo_programs/proof_programs/

- name: Fetch traces for cairo-lang
uses: actions/cache/restore@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ cairo-vm-pypy-env/*
cairo1-run/corelib/
cairo-vm-cli/air_input.pub
ensure-no_std/Cargo.lock
cairo_programs/proof_programs/*.cairo

!vm/src/tests/cairo_pie_test_output.json
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ endif
compare_trace_memory_proof compare_all_proof compare_trace_proof compare_memory_proof compare_air_public_input compare_air_private_input\
cairo_bench_programs cairo_proof_programs cairo_test_programs cairo_1_test_contracts cairo_2_test_contracts \
cairo_trace cairo-vm_trace cairo_proof_trace cairo-vm_proof_trace \
fuzzer-deps fuzzer-run-cairo-compiled fuzzer-run-hint-diff build-cairo-lang hint-accountant \
fuzzer-deps fuzzer-run-cairo-compiled fuzzer-run-hint-diff build-cairo-lang hint-accountant \ create-proof-programs-symlinks \
$(RELBIN) $(DBGBIN)

# Proof mode consumes too much memory with cairo-lang to execute
Expand Down Expand Up @@ -196,7 +196,7 @@ cargo-deps:
cairo1-run-deps:
cd cairo1-run; make deps

deps: cargo-deps build-cairo-1-compiler build-cairo-2-compiler cairo1-run-deps
deps: create-proof-programs-symlinks cargo-deps build-cairo-1-compiler build-cairo-2-compiler cairo1-run-deps
pyenv install -s pypy3.9-7.3.9
PYENV_VERSION=pypy3.9-7.3.9 python -m venv cairo-vm-pypy-env
. cairo-vm-pypy-env/bin/activate ; \
Expand All @@ -206,7 +206,7 @@ deps: cargo-deps build-cairo-1-compiler build-cairo-2-compiler cairo1-run-deps
. cairo-vm-env/bin/activate ; \
pip install -r requirements.txt ; \

deps-macos: cargo-deps build-cairo-1-compiler-macos build-cairo-2-compiler-macos cairo1-run-deps
deps-macos: create-proof-programs-symlinks cargo-deps build-cairo-1-compiler-macos build-cairo-2-compiler-macos cairo1-run-deps
arch -x86_64 pyenv install -s pypy3.9-7.3.9
PYENV_VERSION=pypy3.9-7.3.9 python -m venv cairo-vm-pypy-env
. cairo-vm-pypy-env/bin/activate ; \
Expand Down Expand Up @@ -331,6 +331,7 @@ clean:
rm -f $(PRINT_TEST_DIR)/*.json
rm -f $(CAIRO_1_CONTRACTS_TEST_DIR)/*.sierra
rm -f $(CAIRO_1_CONTRACTS_TEST_DIR)/*.casm
rm -f $(TEST_PROOF_DIR)/*.cairo
rm -f $(CAIRO_2_CONTRACTS_TEST_DIR)/*.sierra
rm -f $(CAIRO_2_CONTRACTS_TEST_DIR)/*.casm
rm -f $(TEST_PROOF_DIR)/*.json
Expand Down Expand Up @@ -372,3 +373,5 @@ build-cairo-lang: | $(CAIRO_LANG_REPO_DIR)
hint-accountant: build-cairo-lang
cargo r -p hint_accountant

create-proof-programs-symlinks:
cd cairo_programs/proof_programs; ln -s ../*.cairo .
Empty file.
1 change: 0 additions & 1 deletion cairo_programs/proof_programs/abs_value_array.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/array_sum.cairo

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/assert_le_felt_hint.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/assert_le_felt_old.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/assert_lt_felt.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/assert_nn.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/assert_not_zero.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/big_struct.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/bigint.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/bitand_hint.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/bitwise_builtin_test.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/bitwise_output.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/bitwise_recursion.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/blake2s_felts.cairo

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/cairo_finalize_keccak.cairo

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/chained_ec_op.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/common_signature.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/compare_arrays.cairo

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/compare_greater_array.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/compare_lesser_array.cairo

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/compute_slope_v2.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/dict.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/dict_integration_tests.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/dict_squash.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/dict_store_cast_ptr.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/dict_update.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/div_mod_n.cairo

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/ec_double_slope.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/ec_double_v4.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/ec_negate.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/ec_op.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/ec_recover.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/ed25519_ec.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/ed25519_field.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/efficient_secp256r1_ec.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/example_blake2s.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/example_program.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/factorial.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/fast_ec_add_v2.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/fast_ec_add_v3.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/fibonacci.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/field_arithmetic.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/finalize_blake2s.cairo

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/find_element.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/fq.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/fq_test.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/function_return.cairo

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/garaga.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/highest_bitlen.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/if_and_prime.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/if_in_function.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/if_list.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/if_reloc_equal.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/integration.cairo

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/inv_mod_p_uint512.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/is_quad_residue_test.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/is_zero.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/is_zero_pack.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/jmp.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/jmp_if_condition.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/keccak.cairo

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/keccak_add_uint256.cairo

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion cairo_programs/proof_programs/keccak_builtin.cairo

This file was deleted.

Loading

0 comments on commit 9fb1b83

Please sign in to comment.