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 args flag to cairo1-run #1551

Merged
merged 31 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 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
fce43d2
Fix README example
fmoletta Jan 11, 2024
27d5490
Apply input arguments fix from cairo_lang
fmoletta Jan 15, 2024
d21137f
Add test
fmoletta Jan 15, 2024
3db5d72
Fix tests
fmoletta Jan 15, 2024
ff482e7
Merge branch 'main' into cairo-1-input-args
fmoletta Jan 15, 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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

#### Upcoming Changes

* 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)

* feat: Add `proof_mode` flag to `cairo1-run` [#1537] (https://github.com/lambdaclass/cairo-vm/pull/1537)
* The cairo1-run crate no longer compiles and executes in proof_mode by default
* Add flag `proof_mode` to cairo1-run crate. Activating this flag will enable proof_mode compilation and execution

* feat(BREAKING): Replace `cairo-felt` crate with `starknet-types-core` (0.0.5) [#1408](https://github.com/lambdaclass/cairo-vm/pull/1408)

* feat(BREAKING): Add Cairo 1 proof mode compilation and execution [#1517] (https://github.com/lambdaclass/cairo-vm/pull/1517)
Expand Down
21 changes: 19 additions & 2 deletions cairo1-run/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ A cairo-vm crate to run Cairo 1 Programs
Once you are inside the `./cairo1-run` folder, use the CLI with the following commands

To install the required dependencies(cairo corelib) run

```bash
make deps
```
```

Now that you have the dependencies necessary to run the tests, you can run:

Expand All @@ -16,16 +17,32 @@ make test
```

To execute a cairo 1 program

```bash
cargo run ../cairo_programs/cairo-1-programs/fibonacci.cairo
```

Arguments to generate the trace and memory files

```bash
cargo run ../cairo_programs/cairo-1-programs/fibonacci.cairo --trace_file ../cairo_programs/cairo-1-programs/fibonacci.trace --memory_file ../cairo_programs/cairo-1-programs/fibonacci.memory
```

To pass arguments to `main`

* Separate arguments with a whitespace inbetween
* In order to pass arrays, wrap array values between brackets

Example:

```bash

cargo run ../cairo_programs/cairo-1-programs/with_input/array_input_sum.cairo --layout all_cairo --args '2 [1 2 3 4] 0 [9 8]'

```

To execute all the cairo 1 programs inside `../cairo_programs/cairo-1-programs/` and generate the corresponding trace and the memory files

```bash
make run
```
```
Loading
Loading