Skip to content

Commit

Permalink
Merge branch 'main' into notlesh/segment-arena-relocation-fix-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
notlesh committed Jan 8, 2025
2 parents d5930f2 + 259487e commit 0178087
Show file tree
Hide file tree
Showing 95 changed files with 4,702 additions and 904 deletions.
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.80.0
uses: dtolnay/rust-toolchain@1.81.0
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.80.0
uses: dtolnay/rust-toolchain@1.81.0
- name: Set up Cargo cache
uses: Swatinem/rust-cache@v2
- name: Checkout
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/fresh_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Checkout
uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@1.80.0
uses: dtolnay/rust-toolchain@1.81.0

- 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.80.0
uses: dtolnay/rust-toolchain@1.81.0
- name: Set up Cargo cache
uses: Swatinem/rust-cache@v2
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/hyper_threading_benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
sudo apt-get install -y hyperfine
- name: Install Rust
uses: dtolnay/rust-toolchain@1.80.0
uses: dtolnay/rust-toolchain@1.81.0
with:
components: rustfmt, clippy

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hyperfine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ jobs:
steps:
- name: Populate cache
uses: actions/cache@v3
id: cache
id: cache
with:
path: bin/cairo-vm-cli-${{ matrix.branch }}
key: binary-${{ github.event.pull_request[matrix.branch].sha }}

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

- 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.80.0
uses: dtolnay/rust-toolchain@1.81.0
- 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.80.0
uses: dtolnay/rust-toolchain@1.81.0
- 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.80.0
uses: dtolnay/rust-toolchain@1.81.0
- 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.80.0
uses: dtolnay/rust-toolchain@1.81.0
- name: Publish crate cairo-vm
env:
CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Expand Down
98 changes: 89 additions & 9 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@1.80.0
uses: dtolnay/rust-toolchain@1.81.0
with:
components: rustfmt, clippy
- name: Set up cargo cache
Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@1.80.0
uses: dtolnay/rust-toolchain@1.81.0
with:
targets: wasm32-unknown-unknown

Expand Down Expand Up @@ -247,7 +247,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@1.80.0
uses: dtolnay/rust-toolchain@1.81.0
with:
targets: wasm32-unknown-unknown

Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@1.80.0
uses: dtolnay/rust-toolchain@1.81.0
with:
targets: wasm32-unknown-unknown

Expand Down Expand Up @@ -323,13 +323,13 @@ jobs:
strategy:
fail-fast: false
matrix:
special_features: ["", "extensive_hints", "mod_builtin"]
special_features: ["", "extensive_hints", "mod_builtin", "cairo-0-secp-hints", "cairo-0-data-availability-hints"]
target: [ test#1, test#2, test#3, test#4, test-no_std#1, test-no_std#2, test-no_std#3, test-no_std#4, test-wasm ]
name: Run tests
runs-on: ubuntu-22.04
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@1.80.0
uses: dtolnay/rust-toolchain@1.81.0
with:
components: llvm-tools-preview
- name: Set up cargo cache
Expand Down Expand Up @@ -370,7 +370,7 @@ jobs:
'test')
cargo llvm-cov nextest --lcov --output-path lcov-${{ matrix.target }}-${{ matrix.special_features }}.info \
--partition count:${PARTITION}/4 \
--workspace --features "cairo-1-hints, test_utils, ${{ matrix.special_features }}"
--workspace --features "cairo-1-hints, test_utils, ${{ matrix.special_features }}"
;;
'test-no_std')
cargo llvm-cov nextest --lcov --output-path lcov-${{ matrix.target }}-${{ matrix.special_features }}.info \
Expand All @@ -395,7 +395,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@1.80.0
uses: dtolnay/rust-toolchain@1.81.0
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
- name: Checkout
Expand Down Expand Up @@ -600,6 +600,36 @@ jobs:
key: codecov-cache-test-no_std-extensive_hints-${{ github.sha }}
fail-on-cache-miss: true

- name: Fetch results for tests with stdlib (w/mod_builtin; part. 1)
uses: actions/cache/restore@v3
with:
path: lcov-test#1-mod_builtin.info
key: codecov-cache-test#1-mod_builtin-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests with stdlib (w/mod_builtin; part. 2)
uses: actions/cache/restore@v3
with:
path: lcov-test#2-mod_builtin.info
key: codecov-cache-test#2-mod_builtin-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests with stdlib (w/mod_builtin; part. 3)
uses: actions/cache/restore@v3
with:
path: lcov-test#3-mod_builtin.info
key: codecov-cache-test#3-mod_builtin-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests with stdlib (w/mod_builtin; part. 4)
uses: actions/cache/restore@v3
with:
path: lcov-test#4-mod_builtin.info
key: codecov-cache-test#4-mod_builtin-${{ github.sha }}
fail-on-cache-miss: true
- name: Fetch results for tests without stdlib (w/mod_builtin)
uses: actions/cache/restore@v3
with:
path: lcov-no_std-mod_builtin.info
key: codecov-cache-test-no_std-mod_builtin-${{ github.sha }}
fail-on-cache-miss: true

- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v3
Expand Down Expand Up @@ -725,6 +755,57 @@ jobs:
- name: Run script
run: ./vm/src/tests/compare_factorial_outputs_all_layouts.sh

compare-outputs-dynamic-layouts:
name: Compare outputs with dynamic layouts
needs: [ build-programs, build-release, run-cairo-release ]
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Python3 Build
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'

- name: Install cairo-lang and deps
run: pip install -r requirements.txt

- name: Fetch release binary
uses: actions/cache/restore@v3
with:
key: cli-bin-rel-${{ github.sha }}
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:
path: ${{ env.CAIRO_PROGRAMS_PATH }}
key: cairo_proof_programs-cache-${{ hashFiles('cairo_programs/**/*.cairo', 'examples/wasm-demo/src/array_sum.cairo') }}
fail-on-cache-miss: true

- name: Fetch pie
uses: actions/cache/restore@v3
with:
path: |
cairo_programs/**/*.memory
cairo_programs/**/*.trace
cairo_programs/**/*.air_public_input
cairo_programs/**/*.air_private_input
cairo_programs/**/*.pie.zip
key: cairo_test_programs-release-trace-cache-${{ github.sha }}
fail-on-cache-miss: true

- name: Run script
run: ./vm/src/tests/compare_outputs_dynamic_layouts.sh

compare-run-from-cairo-pie-all-outputs:
name: Compare all outputs from running Cairo PIEs
needs: [ build-programs, build-release, run-cairo-release ]
Expand Down Expand Up @@ -763,4 +844,3 @@ jobs:

- name: Run comparison
run: ./vm/src/tests/compare_all_pie_outputs.sh

2 changes: 1 addition & 1 deletion .github/workflows/test_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: "Install on ${{ matrix.os }}"
strategy:
matrix:
os: [ubuntu-22.04, macos-12]
os: [ubuntu-22.04, macos-13]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ cairo-vm-cli/air_input.pub
ensure-no_std/Cargo.lock
cairo_programs/proof_programs/*.cairo

!cairo_layout_params_file.json
!vm/src/tests/cairo_pie_test_output.json
66 changes: 66 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,72 @@

* fix: Always use a normal segment in first SegmentArena segment [#1845](https://github.com/lambdaclass/cairo-vm/pull/1845)

* feat: implement `kzg` data availability hints [#1887](https://github.com/lambdaclass/cairo-vm/pull/1887)

#### [2.0.0-rc3] - 2024-12-26

* chore: update cairo-lang dependencies to 2.10.0-rc.0 #[1901](https://github.com/lambdaclass/cairo-vm/pull/1901)

#### [2.0.0-rc2] - 2024-12-12

* feat: Add support for subtractions containing references as right hand side operands [#1898](https://github.com/lambdaclass/cairo-vm/pull/1898)

* fix: Change wildcard getrandom dependency.

* Update starknet-crypto to 0.7.3, removing the old FieldElement completly in favour of the new Felt (that is Copy).

* chore: update the cairo-vm version used in the readme

* chore: update cairo-lang dependencies to 2.9.2

* fix: replace `div_rem` with `div_mod_floor` in `verify_zero` hints [#1881](https://github.com/lambdaclass/cairo-vm/pull/1881)

* feat: Implement `SECP related` hints [#1829](https://github.com/lambdaclass/cairo-vm/pull/1829)

* chore: bump pip `cairo-lang` 0.13.3 [#1884](https://github.com/lambdaclass/cairo-vm/pull/1884)

* fix: [#1862](https://github.com/lambdaclass/cairo-vm/pull/1862):
* Use MaybeRelocatable for relocation table

* chore: bump pip `cairo-lang` 0.13.3 [#1884](https://github.com/lambdaclass/cairo-vm/pull/1884)

* chore: [#1880](https://github.com/lambdaclass/cairo-vm/pull/1880):
* Refactor vm crate to make it possible to use hint extension feature for nested programs with hints.

#### [2.0.0-rc1] - 2024-11-20

* feat: add `EvalCircuit` and `TestLessThanOrEqualAddress` hints [#1843](https://github.com/lambdaclass/cairo-vm/pull/1843)

* fix: [#1873](https://github.com/lambdaclass/cairo-vm/pull/1873)
* Fix broken num-prime `is_prime` call
* fix: [#1868](https://github.com/lambdaclass/cairo-vm/pull/1855):
* Adds logic to include the 3 new builtins in `builtin_segments` when serializing the output cairo pie's metadata.

* fix: [#1855](https://github.com/lambdaclass/cairo-vm/pull/1855):
* Adds logic to skip pedersen additional data comparison when checking pie compatibility.

* serde: add `size` field to `Identifier` [#1861]https://github.com/lambdaclass/cairo-vm/pull/1861

#### [2.0.0-rc0] - 2024-10-22

* fix: [#1864](https://github.com/lambdaclass/cairo-vm/pull/1864):
* Runner: include data from constants segment to the bytecode when assembling program

* chore: bump `cairo-lang-` dependencies to 2.9.0-dev.0 [#1858](https://github.com/lambdaclass/cairo-vm/pull/1858/files)

* chore: update Rust required version to 1.81.0 [#1857](https://github.com/lambdaclass/cairo-vm/pull/1857)

* fix: [#1851](https://github.com/lambdaclass/cairo-vm/pull/1851):
* Fix unsorted signature and mod builtin outputs in air_private_input.

* feat(BREAKING): [#1824](https://github.com/lambdaclass/cairo-vm/pull/1824)[#1838](https://github.com/lambdaclass/cairo-vm/pull/1838):
* Add support for dynamic layout
* CLI change(BREAKING): The flag `cairo_layout_params_file` must be specified when using dynamic layout.
* Signature change(BREAKING): Both `CairoRunner::new` and `CairoRunner::new_v2` now receive an `Option<CairoLayoutParams>`, used only with dynamic layout.

* fix: [#1841](https://github.com/lambdaclass/cairo-vm/pull/1841):
* Fix modulo builtin to comply with prover constraints

* chore: bump pip `cairo-lang` 0.13.2 [#1827](https://github.com/lambdaclass/cairo-vm/pull/1827)

* chore: bump `cairo-lang-` dependencies to 2.8.0 [#1833](https://github.com/lambdaclass/cairo-vm/pull/1833/files)
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @igaray @Oppen @fmoletta @juanbono @pefontana
* @igaray @Oppen @fmoletta @juanbono @pefontana @gabrielbosio
Loading

0 comments on commit 0178087

Please sign in to comment.