Skip to content

Commit

Permalink
Add cairo_pie_output flag to cairo_vm_cli (#1578)
Browse files Browse the repository at this point in the history
* First draft

* Add special serialization for ecdsa builtin additional data

* Start comparison script

* Add compare_all_no_proof target

* Update file permissions

* Fix makefile

* Add special serialization for pedersen builtin additional data

* Fix prev commit

* Serialize ecdsa additional data as sequence

* Expand comparison script

* Skip bugged case + Reduce amount of prints in comparison script

* Improve skip

* Add comparison to CI

* Fix

* Fix pie memory serialization

* Fix constant value

* Save temp changes

* Revert "Fix constant value"

This reverts commit 08e037e.

* Use to_bytes instead of serialize impl + simplify scripts

* Cleanup

* Fix test

* Clean interface + remove unwraps

* Fixes

* clippy

* Move arg validation to a separate func

* Move mutually exclusive argument validation to clap

* rename var

* Add Chaneglog entry

* Make zip dep optional

* Fix wasm imports

* Add file extension

* Add file extension

* Remove unwrap + improve coverage

* quick fix

* Clean solution

* Update README

* Update makefile targets

---------

Co-authored-by: Pedro Fontana <fontana.pedro93@gmail.com>
Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>
  • Loading branch information
3 people committed Jan 22, 2024
1 parent 3dc01e2 commit 2f715c4
Show file tree
Hide file tree
Showing 12 changed files with 491 additions and 102 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ jobs:
cairo_programs/**/*.trace
cairo_programs/**/*.air_public_input
cairo_programs/**/*.air_private_input
cairo_programs/**/*.pie.zip
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 @@ -365,7 +366,7 @@ jobs:
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: ''
extra-args: '--cairo_pie_output {program}.rs.pie.zip'
name: Compute memory and execution traces with cairo-vm
needs: [ build-programs, build-release ]
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -402,6 +403,7 @@ jobs:
cairo_programs/**/*.trace
cairo_programs/**/*.air_public_input
cairo_programs/**/*.air_private_input
cairo_programs/**/*.pie.zip
key: ${{ matrix.program-target }}-release-trace-cache-${{ github.sha }}


Expand Down Expand Up @@ -502,6 +504,7 @@ jobs:
cairo_programs/**/*.trace
cairo_programs/**/*.air_public_input
cairo_programs/**/*.air_private_input
cairo_programs/**/*.pie.zip
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 @@ -513,6 +516,7 @@ jobs:
cairo_programs/**/*.trace
cairo_programs/**/*.air_public_input
cairo_programs/**/*.air_private_input
cairo_programs/**/*.pie.zip
key: ${{ matrix.program-target }}-release-trace-cache-${{ github.sha }}
fail-on-cache-miss: true

Expand All @@ -522,9 +526,10 @@ jobs:
PROOF=proof_mode
AIR_PUBLIC_INPUT=air_public_input
AIR_PRIVATE_INPUT=air_private_input
else
PIE=pie
fi
./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
./vm/src/tests/compare_vm_state.sh trace memory $PROOF $AIR_PUBLIC_INPUT $AIR_PRIVATE_INPUT $PIE
wasm-demo:
name: Build the wasm demo
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

#### Upcoming Changes

* feat: Add `cairo_pie_output` flag to `cairo_vm_cli` [#1578] (https://github.com/lambdaclass/cairo-vm/pull/1578)
* Fix serialization of CairoPie to be fully compatible with the python version
* Add `CairoPie::write_zip_file`
* Move handling of required and exclusive arguments in `cairo-vm-cli` to struct definition using clap derives

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

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

0 comments on commit 2f715c4

Please sign in to comment.