Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add air_private_input flag to cairo1-run #1559

Merged
merged 82 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
e0aa3f7
Add proof_mode flag to cairo1-run
fmoletta Jan 3, 2024
2357010
Add Changelog entry
fmoletta Jan 3, 2024
7e3b34c
Clippy
fmoletta Jan 3, 2024
07c112f
clippy
fmoletta Jan 3, 2024
43dd6ed
Add `air_public_input` flag
fmoletta Jan 3, 2024
b3c4cbd
Progress
fmoletta Jan 4, 2024
e41994b
Update builtins stop ptrs when running cairo 1
fmoletta Jan 4, 2024
378a0fe
Change visibility
fmoletta Jan 4, 2024
f633fc4
Change visibility
fmoletta Jan 4, 2024
20776b4
Fix
fmoletta Jan 4, 2024
9fbb0c6
Fix trace not enables
fmoletta Jan 4, 2024
c1779db
Build execution public memory
fmoletta Jan 4, 2024
02df22e
Handle EcOp case
fmoletta Jan 8, 2024
efda66e
Fix typo
fmoletta Jan 8, 2024
b3f71d0
Use cleaner solution
fmoletta Jan 8, 2024
a9c67d5
Fix
fmoletta Jan 8, 2024
d821708
Improve comments
fmoletta Jan 8, 2024
b3bd50c
Add changelog entry
fmoletta Jan 8, 2024
4ee531a
Add args flag
fmoletta Jan 9, 2024
ab2d47f
Handle arguments
fmoletta Jan 9, 2024
169ed18
Handle arg size & add tests
fmoletta Jan 9, 2024
482ead4
Parse array arguments
fmoletta Jan 9, 2024
3b81dd3
Fix language
fmoletta Jan 9, 2024
a73b023
reorder
fmoletta Jan 9, 2024
fd93a34
Add changelog entry
fmoletta Jan 9, 2024
38070d8
Move programs with args to an inner folder
fmoletta Jan 9, 2024
fe145e8
Implement get_air_private_input for RangeCheck;
fmoletta Jan 9, 2024
dff4d39
Implement air_private_input for Bitwise;
fmoletta Jan 10, 2024
c6b85fd
Implement air_private_input for Hash
fmoletta Jan 10, 2024
5ee533a
Update proof_programs symlinks
fmoletta Jan 10, 2024
b32f9dc
Add EcOp priv input variant
fmoletta Jan 10, 2024
aa1d4f1
Implement air_private_input for EcOp
fmoletta Jan 10, 2024
548bbaa
Implement air_private_input for Poseidon & Signature
fmoletta Jan 10, 2024
cca1f55
Implement air_private_input for Keccak
fmoletta Jan 10, 2024
df18495
Add AirPrivateInput serialization
fmoletta Jan 10, 2024
fd26554
Remove unwrap
fmoletta Jan 10, 2024
8efc27b
Add targets to compare private inputs against python vm
fmoletta Jan 10, 2024
b6228c4
Add separate script to compare private inputs
fmoletta Jan 11, 2024
4a32062
Ignore & Clean output files
fmoletta Jan 11, 2024
b2ba10b
Fix target
fmoletta Jan 11, 2024
fce43d2
Fix README example
fmoletta Jan 11, 2024
e91b523
Fix + fmt
fmoletta Jan 11, 2024
93ee579
Fetch absolute paths in cli and remove feature-gate
fmoletta Jan 11, 2024
a0f2eb7
Fix ecdsa private input
fmoletta Jan 11, 2024
c92928f
Add no-std import
fmoletta Jan 11, 2024
9770597
Add Chaneglog entry
fmoletta Jan 11, 2024
f2b19a1
Update README
fmoletta Jan 11, 2024
ff44b02
Add cli tests
fmoletta Jan 11, 2024
912bda9
Add case to cli test
fmoletta Jan 11, 2024
ebc249e
Fix conditional
fmoletta Jan 11, 2024
1c77bd4
Add no-std import
fmoletta Jan 11, 2024
4bcc3e3
fmt
fmoletta Jan 11, 2024
54250d2
Merge branch 'cairo-1-input-args' into cairo-1-air-private-input
fmoletta Jan 11, 2024
37434aa
fix
fmoletta Jan 11, 2024
c8b31ff
Merge branch 'air_private_input' into cairo-1-air-private-input
fmoletta Jan 11, 2024
11f6b2a
Add air_private_input flag
fmoletta Jan 11, 2024
b6b18fe
Remove unwraps
fmoletta Jan 11, 2024
9b48ee8
Merge branch 'air_private_input' into cairo-1-air-private-input
fmoletta Jan 11, 2024
731d5f8
fix
fmoletta Jan 11, 2024
1a9566d
Add new flag to tests
fmoletta Jan 11, 2024
9ab5e8e
Add Cli argument list to README
fmoletta Jan 11, 2024
e621d31
Add Chaneglog entry
fmoletta Jan 11, 2024
8c4a18d
Fix changelog
fmoletta Jan 11, 2024
cb2ec41
Add tests so coverage doesnt sink
fmoletta Jan 11, 2024
602d76a
Fix test
fmoletta Jan 11, 2024
0afdec8
Fix test
fmoletta Jan 11, 2024
873e276
Fix test
fmoletta Jan 11, 2024
783b333
Add tests so coverage doesnt sink
fmoletta Jan 11, 2024
2a5bed1
Fix test
fmoletta Jan 11, 2024
95ec39f
Fix test
fmoletta Jan 11, 2024
614938f
Fix test
fmoletta Jan 11, 2024
fe33a2b
Fix symlink
fmoletta Jan 11, 2024
471725c
Merge branch 'air_private_input' into cairo-1-air-private-input
fmoletta Jan 11, 2024
4a71f3c
Remove broken file
fmoletta Jan 11, 2024
b6bdabb
Merge branch 'update-symlinks' into air_private_input
fmoletta Jan 11, 2024
72b3e29
Merge branch 'air_private_input' into cairo-1-air-private-input
fmoletta Jan 11, 2024
b888efb
Add air_private_input check to CI
fmoletta Jan 16, 2024
2ac84b1
Merge branch 'main' of github.com:lambdaclass/cairo-vm into cairo-1-a…
fmoletta Jan 16, 2024
2d30dc6
Fix changelog
fmoletta Jan 16, 2024
3b143f4
Fix changelog
fmoletta Jan 16, 2024
c8c0b59
Fix changelog
fmoletta Jan 16, 2024
00eb72a
Fix changelog
fmoletta Jan 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#### Upcoming Changes

* 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
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice doc!


## 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
Loading