Skip to content

Commit

Permalink
Merge branch 'main' into document-resources-tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoletta authored Jan 17, 2024
2 parents 32545ae + 4ea224a commit 5221d82
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 23 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ jobs:
cairo_programs/**/*.memory
cairo_programs/**/*.trace
cairo_programs/**/*.air_public_input
cairo_programs/**/*.air_private_input
key: ${{ matrix.program-target }}-reference-trace-cache-${{ hashFiles('cairo_programs/**/*.cairo', 'examples/wasm-demo/src/array_sum.cairo') }}
restore-keys: ${{ matrix.program-target }}-reference-trace-cache-

Expand Down Expand Up @@ -360,7 +361,7 @@ jobs:
include:
- program-target: cairo_proof_programs
programs-dir: cairo_programs/proof_programs
extra-args: '--proof_mode --air_public_input {program}.rs.air_public_input '
extra-args: '--proof_mode --air_public_input {program}.rs.air_public_input --air_private_input {program}.rs.air_private_input '
- program-target: cairo_test_programs
programs-dir: cairo_programs
extra-args: ''
Expand Down Expand Up @@ -399,6 +400,7 @@ jobs:
cairo_programs/**/*.memory
cairo_programs/**/*.trace
cairo_programs/**/*.air_public_input
cairo_programs/**/*.air_private_input
key: ${{ matrix.program-target }}-release-trace-cache-${{ github.sha }}


Expand Down Expand Up @@ -498,6 +500,7 @@ jobs:
cairo_programs/**/*.memory
cairo_programs/**/*.trace
cairo_programs/**/*.air_public_input
cairo_programs/**/*.air_private_input
key: ${{ matrix.program-target }}-reference-trace-cache-${{ hashFiles('cairo_programs/**/*.cairo', 'examples/wasm-demo/src/array_sum.cairo') }}
fail-on-cache-miss: true

Expand All @@ -508,6 +511,7 @@ jobs:
cairo_programs/**/*.memory
cairo_programs/**/*.trace
cairo_programs/**/*.air_public_input
cairo_programs/**/*.air_private_input
key: ${{ matrix.program-target }}-release-trace-cache-${{ github.sha }}
fail-on-cache-miss: true

Expand All @@ -516,8 +520,9 @@ jobs:
if [ ${{ matrix.program-target }} = cairo_proof_programs ]; then
PROOF=proof_mode
AIR_PUBLIC_INPUT=air_public_input
AIR_PRIVATE_INPUT=air_private_input
fi
./vm/src/tests/compare_vm_state.sh trace memory $PROOF $AIR_PUBLIC_INPUT
./vm/src/tests/compare_vm_state.sh trace memory $PROOF $AIR_PUBLIC_INPUT $AIR_PRIVATE_INPUT
./vm/src/tests/compare_vm_state.sh trace memory $PROOF
wasm-demo:
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

* feat: Add doc + default impl for ResourceTracker trait [#1576] (https://github.com/lambdaclass/cairo-vm/pull/1576)

* feat: Add `args` flag to `cairo1-run` [#1551] (https://github.com/lambdaclass/cairo-vm/pull/1551)
* feat: Add `air_private_input` flag to `cairo1-run` [#1559] (https://github.com/lambdaclass/cairo-vm/pull/1559)

* feat: Add `args` flag to `cairo1-run` [#15551] (https://github.com/lambdaclass/cairo-vm/pull/15551)

* feat: Add `air_public_input` flag to `cairo1-run` [#1539] (https://github.com/lambdaclass/cairo-vm/pull/1539)

Expand Down
18 changes: 18 additions & 0 deletions cairo1-run/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,21 @@ To execute all the cairo 1 programs inside `../cairo_programs/cairo-1-programs/`
```bash
make run
```

## CLI argument list

The cairo1-run cli supports the following optional arguments:

* `--layout <LAYOUT>`: Sets the layout for the cairo_run. This will limit the available builtins. The deafult layout is `plain`, which has no builtins. For general purpose, the `all_cairo` layout contains all currently available builtins.

* `--args <ARGUMENTS>`: Receives the arguments to be passed to the program's main function. Receives whitespace-separated values which can be numbers or arrays, with arrays consisting of whitespace-separated numbers wrapped between brackets

* `--trace_file <TRACE_FILE>`: Receives the name of a file and outputs the relocated trace into it

* `--memory_file <MEMORY_FILE>`: Receives the name of a file and outputs the relocated memory into it

* `--proof_mode`: Runs the program in proof_mode

* `--air_public_input <AIR_PUBLIC_INPUT>`: Receives the name of a file and outputs the AIR public inputs into it. Can only be used if proof_mode is also enabled.

* `--air_private_input <AIR_PRIVATE_INPUT>`: Receives the name of a file and outputs the AIR private inputs into it. Can only be used if proof_mode, trace_file & memory_file are also enabled.
Loading

0 comments on commit 5221d82

Please sign in to comment.