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

CI tests: CairoPie deserialization #39

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
aeb6d19
[Cairo1] Append return values to the output segment when running in p…
fmoletta Feb 6, 2024
64a1e97
Add `allow_missing_builtins` flag (#1600)
fmoletta Feb 6, 2024
7abbb39
Refactor cairo1-run crate (#1601)
fmoletta Feb 7, 2024
39e8b08
[Cairo1] Add a test to check that the output segment contains the ret…
fmoletta Feb 8, 2024
28e055e
Remove mentions of lambdaworks-felt feature (#1610)
fmoletta Feb 8, 2024
2b171c7
Restore `flamegraph` target (#1615)
fmoletta Feb 9, 2024
b28f22d
Use locked dependencies to install `cargo-nextest` & `wasm-pack` (#1614)
fmoletta Feb 9, 2024
f2ddc90
Update Rust version to 1.74.1 (#1605)
pefontana Feb 9, 2024
1f98fef
Update cairo-lang version to 2.5.3 (#1596)
pefontana Feb 10, 2024
8f2ddf8
Fix cairo1 Felt252DictEntryUpdate hint (#1624)
juanbono Feb 15, 2024
6101b05
Update README.md (#1618)
avilagaston9 Feb 19, 2024
f1d2ec7
Add `documentation` label to `changelog` workflow skiplist (#1619)
fmoletta Feb 19, 2024
2382700
Update hint_processor docs (#1611)
fmoletta Feb 19, 2024
9fb1b83
Create proof_programs symbolic links in `deps` target (#1556)
fmoletta Feb 19, 2024
beede16
Add labels section to contributing (#1620)
fmoletta Feb 20, 2024
0e6a235
Implement `Display` for `MemorySegmentManager` (#1606)
fmoletta Feb 21, 2024
0274759
Feature: deserialize CairoPie from ZIP archives
odesenfans Dec 20, 2023
eb55e79
Feature: deserialize Cairo PIE from bytes
odesenfans Jan 23, 2024
bf17743
fix clippy + revert Cargo.toml
odesenfans Jan 23, 2024
c8d1823
changelog
odesenfans Jan 25, 2024
612384d
improve test coverage
odesenfans Jan 29, 2024
cd9e9c5
fail deserialization if prime is not Cairo prime
odesenfans Jan 29, 2024
fd1ffc7
Fix: deserialize PIE additional data as struct instead of hashmap
odesenfans Jan 11, 2024
237ad8e
Fix: deserialize ECDSA builtin data from Python VM format
odesenfans Jan 14, 2024
5d569c6
newline
odesenfans Feb 21, 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
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.74.1
with:
components: rustfmt, clippy
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cairo_1_programs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.74.1
- name: Set up Cargo cache
uses: Swatinem/rust-cache@v2
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
steps:
- uses: dangoslen/changelog-enforcer@v3
with:
skipLabels: pipelines,coverage
skipLabels: pipelines,tests,documentation
2 changes: 1 addition & 1 deletion .github/workflows/fresh_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.74.1

- name: Install Pyenv
uses: "gabrielfalcao/pyenv-action@v13"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hint_accountant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.74.1
- name: Set up Cargo cache
uses: Swatinem/rust-cache@v2
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hyperfine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:

- name: Install Rust
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.74.1

- name: Checkout
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/iai_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.74.1
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
- name: Python3 Build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/iai_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Install Rust
if: ${{ steps.cache-iai-results.outputs.cache-hit != 'true' }}
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.74.1
- name: Set up cargo cache
if: ${{ steps.cache-iai-results.outputs.cache-hit != 'true' }}
uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.74.1
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
- name: Python3 Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.74.1
- name: Publish crate cairo-vm
env:
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Expand Down
65 changes: 61 additions & 4 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 @@ -135,17 +161,23 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.74.1
with:
components: rustfmt, clippy
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
- 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 All @@ -165,7 +197,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.74.1
with:
targets: wasm32-unknown-unknown

Expand All @@ -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 @@ -220,14 +257,19 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.74.1
with:
components: llvm-tools-preview
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
- 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 @@ -281,7 +323,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@1.70.0
uses: dtolnay/rust-toolchain@1.74.1
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
- name: Checkout
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
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,37 @@

#### Upcoming Changes

* feat: Implement `Display` for `MemorySegmentManager`[#1606](https://github.com/lambdaclass/cairo-vm/pull/1606)

* fix: make Felt252DictEntryUpdate work with MaybeRelocatable instead of only Felt [#1624](https://github.com/lambdaclass/cairo-vm/pull/1624).

* chore: bump `cairo-lang-` dependencies to 2.5.3 [#1596](https://github.com/lambdaclass/cairo-vm/pull/1596)

* refactor: Refactor `cairo1-run` crate [#1601](https://github.com/lambdaclass/cairo-vm/pull/1601)
* Add function `cairo_run_program` & struct `Cairo1RunConfig` in `cairo1-run::cairo_run` module.
* Function `serialize_output` & structs `FuncArg` and `Error` in crate `cairo1-run` are now public.

* feat(BREAKING): Add `allow_missing_builtins` flag [#1600](https://github.com/lambdaclass/cairo-vm/pull/1600)

This new flag will skip the check that all builtins used by the program need to be present in the selected layout if enabled. It will also be enabled by default when running in proof_mode.

* Add `allow_missing_builtins` flag to `cairo-vm-cli` crate
* Add `allow_missing_builtins` field to `CairoRunConfig` struct
* Add `allow_missing_builtins` boolean argument to `CairoRunner` methods `initialize` & `initialize_builtins`

* feat: Append return values to the output segment when running cairo1-run in proof_mode [#1597](https://github.com/lambdaclass/cairo-vm/pull/1597)
* Add instructions to the proof_mode header to copy return values to the output segment before initiating the infinite loop
* Output builtin is now always included when running cairo 1 programs in proof_mode

* feat(BREAKING): Remove unecessary conversion functions between `Felt` & `BigUint`/`BigInt` [#1562](https://github.com/lambdaclass/cairo-vm/pull/1562)
* Remove the following functions:
* felt_from_biguint
* felt_from_bigint
* felt_to_biguint
* felt_to_bigint

* feat: deserialize CairoPie from ZIP archives [#1533] (https://github.com/lambdaclass/cairo-vm/pull/1533)

* perf: optimize instruction cache allocations by using `VirtualMachine::load_data` [#1441](https://github.com/lambdaclass/cairo-vm/pull/1441)

* feat: Add `print_output` flag to `cairo-1` crate [#1575] (https://github.com/lambdaclass/cairo-vm/pull/1575)
Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/lambda
- `merge`
- `wip`

### Labels

We recommend using the corresponding labels for each PR's purpose, the most commonly used labels include:

- `documentation`: Improvements or additions to documentation
- `tests`: Implementation of tests
- `pipelines`: Improving CI/CD workflows
- `enhancement`: Implementation of new features
- `performance`: Performance-related improvements

## Attribution
This guide is based on the **contributing.md**. [Make your own](https://contributing.md/)!
Loading
Loading