From 1f1190b5c079c777c41e35c348eaa0b5447063e8 Mon Sep 17 00:00:00 2001 From: Franco Giachetta Date: Tue, 10 Sep 2024 20:30:37 +0000 Subject: [PATCH] Cairo-lang2.8.0 (#1833) * update cairo-lang to 2.8.0 * working * format * typo * fix lints * update rusttoolchain * remove duplicated imports * remove unused imports * remove zip unused dependencies * uncomment * undo dependecy upgrade * update readme --------- Co-authored-by: Pedro Fontana --- .github/workflows/bench.yml | 2 +- .github/workflows/cairo_1_programs.yml | 2 +- .github/workflows/fresh_run.yml | 2 +- .github/workflows/hint_accountant.yml | 2 +- .../workflows/hyper_threading_benchmarks.yml | 2 +- .github/workflows/hyperfine.yml | 2 +- .github/workflows/iai_main.yml | 2 +- .github/workflows/iai_pr.yml | 4 +- .github/workflows/publish.yml | 2 +- .github/workflows/rust.yml | 12 +- CHANGELOG.md | 9 +- Cargo.lock | 365 ++++++++---------- Cargo.toml | 24 +- Makefile | 2 +- README.md | 2 +- cairo-vm-tracer/src/tracer_data.rs | 2 +- cairo1-run/Cargo.toml | 8 +- cairo1-run/Makefile | 2 +- cairo1-run/src/cairo_run.rs | 6 +- cairo1-run/src/main.rs | 2 +- rust-toolchain | 2 +- vm/Cargo.toml | 2 +- vm/src/air_private_input.rs | 2 +- .../builtin_hint_processor/dict_manager.rs | 6 +- .../builtin_hint_processor/math_utils.rs | 5 +- vm/src/tests/cairo_pie_test.rs | 12 - vm/src/tests/mod.rs | 4 +- vm/src/types/relocatable.rs | 1 - vm/src/vm/runners/cairo_pie.rs | 2 +- vm/src/vm/vm_memory/memory.rs | 16 +- 30 files changed, 215 insertions(+), 291 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 5c53a840bf..280f3b79ba 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Install Rust - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 with: components: rustfmt, clippy - uses: actions/checkout@v3 diff --git a/.github/workflows/cairo_1_programs.yml b/.github/workflows/cairo_1_programs.yml index fec819d458..aa7957cc58 100644 --- a/.github/workflows/cairo_1_programs.yml +++ b/.github/workflows/cairo_1_programs.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 - name: Set up Cargo cache uses: Swatinem/rust-cache@v2 - name: Checkout diff --git a/.github/workflows/fresh_run.yml b/.github/workflows/fresh_run.yml index 510701012b..a09ffb4747 100644 --- a/.github/workflows/fresh_run.yml +++ b/.github/workflows/fresh_run.yml @@ -38,7 +38,7 @@ jobs: uses: actions/checkout@v3 - name: Install Rust - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 - name: Install Pyenv uses: "gabrielfalcao/pyenv-action@v13" diff --git a/.github/workflows/hint_accountant.yml b/.github/workflows/hint_accountant.yml index fde516d43b..9d015e41d5 100644 --- a/.github/workflows/hint_accountant.yml +++ b/.github/workflows/hint_accountant.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Install Rust toolchain - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 - name: Set up Cargo cache uses: Swatinem/rust-cache@v2 - name: Checkout diff --git a/.github/workflows/hyper_threading_benchmarks.yml b/.github/workflows/hyper_threading_benchmarks.yml index 30e668ed7d..d772a0a6e5 100644 --- a/.github/workflows/hyper_threading_benchmarks.yml +++ b/.github/workflows/hyper_threading_benchmarks.yml @@ -26,7 +26,7 @@ jobs: sudo apt-get install -y hyperfine - name: Install Rust - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 with: components: rustfmt, clippy diff --git a/.github/workflows/hyperfine.yml b/.github/workflows/hyperfine.yml index 51912147bd..f2fd0f8405 100644 --- a/.github/workflows/hyperfine.yml +++ b/.github/workflows/hyperfine.yml @@ -74,7 +74,7 @@ jobs: - name: Install Rust if: ${{ steps.cache.outputs.cache-hit != 'true' }} - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 - name: Checkout if: ${{ steps.cache.outputs.cache-hit != 'true' }} diff --git a/.github/workflows/iai_main.yml b/.github/workflows/iai_main.yml index 41df9d4dee..6177590fff 100644 --- a/.github/workflows/iai_main.yml +++ b/.github/workflows/iai_main.yml @@ -11,7 +11,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Install Rust - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 - name: Set up cargo cache uses: Swatinem/rust-cache@v2 - name: Python3 Build diff --git a/.github/workflows/iai_pr.yml b/.github/workflows/iai_pr.yml index 0db3c0e05f..875643ea72 100644 --- a/.github/workflows/iai_pr.yml +++ b/.github/workflows/iai_pr.yml @@ -23,7 +23,7 @@ jobs: - name: Install Rust if: ${{ steps.cache-iai-results.outputs.cache-hit != 'true' }} - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 - name: Set up cargo cache if: ${{ steps.cache-iai-results.outputs.cache-hit != 'true' }} uses: Swatinem/rust-cache@v2 @@ -51,7 +51,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Install Rust - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 - name: Set up cargo cache uses: Swatinem/rust-cache@v2 - name: Python3 Build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 46deef477b..792a7535f2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,7 +13,7 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - name: Install stable toolchain - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 - name: Publish crate cairo-vm env: CRATES_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7f2b270f01..0efa960359 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -161,7 +161,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Install Rust - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 with: components: rustfmt, clippy - name: Set up cargo cache @@ -201,7 +201,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Install Rust - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 with: targets: wasm32-unknown-unknown @@ -247,7 +247,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Install Rust - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 with: targets: wasm32-unknown-unknown @@ -287,7 +287,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Install Rust - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 with: targets: wasm32-unknown-unknown @@ -329,7 +329,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Install Rust - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 with: components: llvm-tools-preview - name: Set up cargo cache @@ -395,7 +395,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Install Rust - uses: dtolnay/rust-toolchain@1.76.0 + uses: dtolnay/rust-toolchain@1.80.0 - name: Set up cargo cache uses: Swatinem/rust-cache@v2 - name: Checkout diff --git a/CHANGELOG.md b/CHANGELOG.md index c8d91f7617..33844f3486 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ #### Upcoming Changes +* chore: bump `cairo-lang-` dependencies to 2.8.0 [#1833](https://github.com/lambdaclass/cairo-vm/pull/1833/files) + * chore: update Rust required version to 1.80.0 + * fix: Added the following VM fixes: [#1820](https://github.com/lambdaclass/cairo-vm/pull/1820) * Fix zero segment location. * Fix has_zero_segment naming. @@ -12,9 +15,9 @@ #### [1.0.1] - 2024-08-12 -* fix(BREAKING): [#1818](https://github.com/lambdaclass/cairo-vm/pull/1818): - * Fix `MemorySegmentManager::add_zero_segment` function when resizing a segment - * Signature change(BREAKING): `MemorySegmentManager::get_memory_holes` now receives `builtin_segment_indexes: HashSet` +* fix(BREAKING): [#1818](https://github.com/lambdaclass/cairo-vm/pull/1818): + * Fix `MemorySegmentManager::add_zero_segment` function when resizing a segment + * Signature change(BREAKING): `MemorySegmentManager::get_memory_holes` now receives `builtin_segment_indexes: HashSet` * fix(BREAKING): Replace `CairoRunner` method `initialize_all_builtins` with `initialize_program_builtins`. Now it only initializes program builtins instead of all of them diff --git a/Cargo.lock b/Cargo.lock index 538f234805..03c0cb9c47 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,13 +238,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -437,9 +437,9 @@ checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cairo-lang-casm" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4425280959f189d8a5ebf1f5363c10663bc9f843a4819253e6be87d183b583e" +checksum = "ad9e8fe95ee2add1537d00467b98bb8928334633eb01dcba7f33fb64769af259" dependencies = [ "cairo-lang-utils", "indoc", @@ -451,9 +451,9 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2698e2ca73db964e6d496a648fcbb2ace5559941b5179ab3310c9a0b6872b348" +checksum = "0db1ae47b4918a894b60160fac42e6fbcb5a8c0023dd6c290ba03a1bcdf5a554" dependencies = [ "anyhow", "cairo-lang-defs", @@ -468,7 +468,8 @@ dependencies = [ "cairo-lang-syntax", "cairo-lang-utils", "indoc", - "salsa", + "rayon", + "rust-analyzer-salsa", "semver", "smol_str", "thiserror", @@ -476,18 +477,18 @@ dependencies = [ [[package]] name = "cairo-lang-debug" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac7332f2b041ca28b24b0311a0b4a35f426bb52836a2d268a8374ea262e9e6b" +checksum = "b1c87b905b74516c33fc7e6d61b5243363ce65133054c30bd9531f47e30ca201" dependencies = [ "cairo-lang-utils", ] [[package]] name = "cairo-lang-defs" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "079a34b560a82b463cd12ae62022d70981e8ab56b6505f9499348ebeaf460de8" +checksum = "611996d85ec608bfec75d546a5c2ec44f664f4bd2514840a5b369d30a1a8bfdb" dependencies = [ "cairo-lang-debug", "cairo-lang-diagnostics", @@ -496,15 +497,15 @@ dependencies = [ "cairo-lang-syntax", "cairo-lang-utils", "itertools 0.12.1", - "salsa", + "rust-analyzer-salsa", "smol_str", ] [[package]] name = "cairo-lang-diagnostics" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c29625349297ad791942377763f5b04c779ea694f436488dc6ad194720b89487" +checksum = "d015a0790b1f5de8b22b4b4b60d392c35bed07b7aa9dd22361af2793835cee51" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -514,9 +515,9 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cb26cd75126db6eaf94d5dffe0ce750d030ac879a88de5a621551969e9b59e3" +checksum = "54c580e56e5857d51b6bf2ec5ed5fdd33fd3b74dad7e3cb6d7398396174a6c85" dependencies = [ "cairo-lang-utils", "good_lp", @@ -524,14 +525,14 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "651012f2956bea884c7a3ab9df21dc76112d7edd3f403b37ca5be62fc3f41b09" +checksum = "5368e66a742b8532d656171525bfea599490280ceee10bdac93ad60775fc4e59" dependencies = [ "cairo-lang-debug", "cairo-lang-utils", "path-clean", - "salsa", + "rust-analyzer-salsa", "semver", "serde", "smol_str", @@ -539,9 +540,9 @@ dependencies = [ [[package]] name = "cairo-lang-formatter" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d09ffb9498368cf4e95d0b28662596331aef1677e4f759ab5e609d27dfcb587" +checksum = "c1200324728e7f4c4acedceee427d9b3ffce221af57e469a454f007cbc248255" dependencies = [ "anyhow", "cairo-lang-diagnostics", @@ -552,7 +553,7 @@ dependencies = [ "diffy", "ignore", "itertools 0.12.1", - "salsa", + "rust-analyzer-salsa", "serde", "smol_str", "thiserror", @@ -560,9 +561,9 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da4ffe6c197c35dec665029fcf695422f02c55b5118b4da1142e182b9fe77f87" +checksum = "2a7a3069c75e1aca7cf15f20d03baf71f5c86e5be26988f6c25656549aa8b54a" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -578,16 +579,15 @@ dependencies = [ "log", "num-bigint", "num-traits 0.2.19", - "once_cell", - "salsa", + "rust-analyzer-salsa", "smol_str", ] [[package]] name = "cairo-lang-parser" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f262ad5f1110ff70c93deb81cce024cf160f4a4518762e7deb2047fe73846789" +checksum = "c13b245ddc740ebfed8b05e1bdb7805a06d267cf89d46486c9609306f92d45ce" dependencies = [ "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -598,16 +598,16 @@ dependencies = [ "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", - "salsa", + "rust-analyzer-salsa", "smol_str", "unescaper", ] [[package]] name = "cairo-lang-plugins" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18024b44b5edbc1f378ba85c1a4ff04e880ea465a33251053aec507f08250668" +checksum = "3b656552d0ab4a69be223e42c4e1c4028e512f506a237d04bbe4ccab9a1e13c5" dependencies = [ "cairo-lang-defs", "cairo-lang-diagnostics", @@ -618,26 +618,26 @@ dependencies = [ "indent", "indoc", "itertools 0.12.1", - "salsa", + "rust-analyzer-salsa", "smol_str", ] [[package]] name = "cairo-lang-proc-macros" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "124402d8fad2a033bb36910dd7d0651f3100845c63dce679c58797a8cb0448c2" +checksum = "05cc6adb49faa42ea825e041dff0496c2e72e4ddaf50734062a62383c0c8adbf" dependencies = [ "cairo-lang-debug", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] name = "cairo-lang-project" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f37dba9653eabf4dcb43a5e1436cd6bc093b5ad6f28ff42eaaef12549014213" +checksum = "ad123ba0e0dd5e1ea80977c0244ff4b0b6d8bf050d42ecb5ff0cf7f885e871f9" dependencies = [ "cairo-lang-filesystem", "cairo-lang-utils", @@ -649,9 +649,9 @@ dependencies = [ [[package]] name = "cairo-lang-semantic" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1612476b548e9ab8ae89ee38a73d9875339f62f2f59d9ce8a719bc1761c54c3" +checksum = "0d528c79e4ff3e1364569c07e22660ddf60c0d1989705b8f0feed9949962b28a" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -668,17 +668,16 @@ dependencies = [ "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", - "once_cell", - "salsa", + "rust-analyzer-salsa", "smol_str", "toml", ] [[package]] name = "cairo-lang-sierra" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8209be8cf22263bf8a55df334a642b74fe563beecbbbefa55cda39fa4b131a61" +checksum = "1bdb0c2cc419f45ab7e413322502ca02c2a2c56aeabdd0885e3740f378d8b269" dependencies = [ "anyhow", "cairo-lang-utils", @@ -691,9 +690,8 @@ dependencies = [ "num-bigint", "num-integer", "num-traits 0.2.19", - "once_cell", "regex", - "salsa", + "rust-analyzer-salsa", "serde", "serde_json", "sha3", @@ -704,9 +702,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c9d1350366c23e4a9f6e18ea95939f18df52df455f06c0e3d7889f80ce18a94" +checksum = "7224cd827ccf69e742c90a60278876865a96b545a101248d9472d2e02f9190b3" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -720,9 +718,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fe1ff15052b173537360b7dca5f9b2ccb10392b2a1c11af99add35d42632115" +checksum = "7e379e3010827fe983e66aa38a0d25fe24cfc11eaf8cadf4dc7bcb31fff031de" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -736,9 +734,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-generator" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3802e7b6722fabc9cc0a61c86e7ad53138f6f41880aca80a60f889739fbf55" +checksum = "d6b353930676c06bb885a16ec3b120109aa15539c49f41b3370a5a6314dc29dc" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -752,8 +750,7 @@ dependencies = [ "cairo-lang-utils", "itertools 0.12.1", "num-traits 0.2.19", - "once_cell", - "salsa", + "rust-analyzer-salsa", "serde", "serde_json", "smol_str", @@ -761,9 +758,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355bde3b0a835bac2457af133a9042a7d039c934e678905b843bb6b420884428" +checksum = "83873751d489aae4674f3d755a4897429a664bdc4b0847283e13889f0b0c2a44" dependencies = [ "assert_matches", "cairo-lang-casm", @@ -782,9 +779,9 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-type-size" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ddddaacc814e0ffda9f176c913fb2a9cd74fe6594dea789e8281eef10cac201" +checksum = "5bd84b445715326e44832836732b6bda76a119116b296ac9b6b87e2a4177634a" dependencies = [ "cairo-lang-sierra", "cairo-lang-utils", @@ -792,9 +789,9 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10be5fd5fe78db232b032e25e4be786f8061606be4ab26371c869c5ab267699c" +checksum = "d8df3086f909d27a49d6706be835725df4e21fb50efe699cd763d1f782a31dea" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -813,7 +810,6 @@ dependencies = [ "indent", "indoc", "itertools 0.12.1", - "once_cell", "serde", "serde_json", "smol_str", @@ -823,9 +819,9 @@ dependencies = [ [[package]] name = "cairo-lang-starknet-classes" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7bf919d0919fce727c6d53ee5cb37459c9db35c258521284523c53f5f907c07" +checksum = "41bcab650779b3431389dc52f1e643a7c9690a1aa2b072c8f01955503d094007" dependencies = [ "cairo-lang-casm", "cairo-lang-sierra", @@ -836,7 +832,6 @@ dependencies = [ "num-bigint", "num-integer", "num-traits 0.2.19", - "once_cell", "serde", "serde_json", "sha3", @@ -847,25 +842,25 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a376f88d815b63505be54a6afa93d75b67cfd65835922ec648cfcbb0a5e4b4" +checksum = "7e2dc876ec02a197b8d13dbfc0b2cf7a7e31dcfc6446761cbb85f5b42d589cdc" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", "cairo-lang-utils", "num-bigint", "num-traits 0.2.19", - "salsa", + "rust-analyzer-salsa", "smol_str", "unescaper", ] [[package]] name = "cairo-lang-syntax-codegen" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01f276bc28f6302fc63032046a12b60d18498906e65f646acb963244eed97f7c" +checksum = "a8727fe3f24ec0834ec6656c70a59f85233439f0a09ca53cf5e27fbdb1b40193" dependencies = [ "genco", "xshell", @@ -873,9 +868,9 @@ dependencies = [ [[package]] name = "cairo-lang-test-utils" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e90b6236439e19077ec913351a17a33c7be199dcafdacd8389c4c5199400d6" +checksum = "7a7681562268173d74b1c8d2438a1d9ec3218c89a8e39a8be3f10e044fa46ebe" dependencies = [ "cairo-lang-formatter", "cairo-lang-utils", @@ -886,12 +881,12 @@ dependencies = [ [[package]] name = "cairo-lang-utils" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55a394e545f1500bea093d01be40895d3234faaa24d9585d08a509c514cabd88" +checksum = "37e6004780c42bf28ce5afd048cc628b3de34aaf24fd2c228ae73217c58999f9" dependencies = [ "hashbrown 0.14.5", - "indexmap 2.4.0", + "indexmap 2.5.0", "itertools 0.12.1", "num-bigint", "num-traits 0.2.19", @@ -1084,7 +1079,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1279,7 +1274,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1465,7 +1460,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1523,7 +1518,7 @@ checksum = "553630feadf7b76442b0849fd25fdf89b860d933623aec9693fed19af0400c78" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1607,12 +1602,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "heck" @@ -1805,9 +1797,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -1820,15 +1812,6 @@ version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - [[package]] name = "iri-string" version = "0.7.2" @@ -2251,9 +2234,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.3" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -2302,17 +2285,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -2320,21 +2292,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", - "parking_lot_core 0.9.10", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -2345,7 +2303,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall", "smallvec", "windows-targets 0.52.6", ] @@ -2375,7 +2333,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.4.0", + "indexmap 2.5.0", ] [[package]] @@ -2410,7 +2368,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2486,11 +2444,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.21.1", + "toml_edit", ] [[package]] @@ -2608,15 +2566,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.5.3" @@ -2708,6 +2657,35 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "rust-analyzer-salsa" +version = "0.17.0-pre.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719825638c59fd26a55412a24561c7c5bcf54364c88b9a7a04ba08a6eafaba8d" +dependencies = [ + "indexmap 2.5.0", + "lock_api", + "oorandom", + "parking_lot", + "rust-analyzer-salsa-macros", + "rustc-hash", + "smallvec", + "tracing", + "triomphe", +] + +[[package]] +name = "rust-analyzer-salsa-macros" +version = "0.17.0-pre.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d96498e9684848c6676c399032ebc37c52da95ecbefa83d71ccc53b9f8a4a8e" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "rust_decimal" version = "1.36.0" @@ -2732,18 +2710,18 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ "bitflags 2.6.0", "errno", @@ -2776,35 +2754,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "salsa" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b84d9f96071f3f3be0dc818eae3327625d8ebc95b58da37d6850724f31d3403" -dependencies = [ - "crossbeam-utils", - "indexmap 1.9.3", - "lock_api", - "log", - "oorandom", - "parking_lot 0.11.2", - "rustc-hash", - "salsa-macros", - "smallvec", -] - -[[package]] -name = "salsa-macros" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3904a4ba0a9d0211816177fd34b04c7095443f8cdacd11175064fe541c8fe2" -dependencies = [ - "heck 0.3.3", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "same-file" version = "1.0.6" @@ -2836,7 +2785,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2877,7 +2826,7 @@ checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2888,7 +2837,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3027,6 +2976,12 @@ dependencies = [ "num-traits 0.1.43", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "starknet-crypto" version = "0.6.2" @@ -3055,7 +3010,7 @@ checksum = "bbc159a1934c7be9761c237333a57febe060ace2bc9e3b337a59a37af206d19f" dependencies = [ "starknet-curve", "starknet-ff", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3103,7 +3058,7 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.3", + "parking_lot", "phf_shared", "precomputed-hash", ] @@ -3133,9 +3088,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.76" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -3195,7 +3150,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3249,9 +3204,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.39.3" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -3271,7 +3226,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3296,7 +3251,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.20", + "toml_edit", ] [[package]] @@ -3308,28 +3263,17 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.4.0", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.18", + "winnow", ] [[package]] @@ -3410,7 +3354,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3448,6 +3392,16 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "triomphe" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" +dependencies = [ + "serde", + "stable_deref_trait", +] + [[package]] name = "try-lock" version = "0.2.5" @@ -3584,7 +3538,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "wasm-bindgen-shared", ] @@ -3618,7 +3572,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3651,7 +3605,7 @@ checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3854,15 +3808,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.6.18" @@ -3920,7 +3865,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3940,7 +3885,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index f5f2d34118..64a4af3e09 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,13 +6,9 @@ members = [ "examples/wasm-demo", "cairo1-run", "cairo-vm-tracer", - "examples/hyper_threading" -] -default-members = [ - "cairo-vm-cli", - "vm", - "cairo1-run", + "examples/hyper_threading", ] +default-members = ["cairo-vm-cli", "vm", "cairo1-run"] exclude = ["ensure-no_std"] # Explicitly set the resolver to the default for edition >= 2021 @@ -66,15 +62,15 @@ thiserror-no-std = { version = "2.0.2", default-features = false } bitvec = { version = "1", default-features = false, features = ["alloc"] } # Dependencies for cairo-1-hints feature -cairo-lang-starknet = { version = "2.7.1", default-features = false } -cairo-lang-casm = { version = "2.7.1", default-features = false } +cairo-lang-starknet = { version = "2.8.0", default-features = false } +cairo-lang-casm = { version = "2.8.0", default-features = false } -cairo-lang-starknet-classes = { version = "2.7.1", default-features = false } -cairo-lang-compiler = { version = "=2.7.1", default-features = false } -cairo-lang-sierra-to-casm = { version = "2.7.1", default-features = false } -cairo-lang-sierra = { version = "2.7.1", default-features = false } -cairo-lang-runner = { version = "2.7.1", default-features = false } -cairo-lang-utils = { version = "=2.7.1", default-features = false } +cairo-lang-starknet-classes = { version = "2.8.0", default-features = false } +cairo-lang-compiler = { version = "=2.8.0", default-features = false } +cairo-lang-sierra-to-casm = { version = "2.8.0", default-features = false } +cairo-lang-sierra = { version = "2.8.0", default-features = false } +cairo-lang-runner = { version = "2.8.0", default-features = false } +cairo-lang-utils = { version = "=2.8.0", default-features = false } # TODO: check these dependencies for wasm compatibility ark-ff = { version = "0.4.2", default-features = false } diff --git a/Makefile b/Makefile index f96e41a1ea..06cba4b0f1 100644 --- a/Makefile +++ b/Makefile @@ -180,7 +180,7 @@ $(CAIRO_2_CONTRACTS_TEST_DIR)/%.casm: $(CAIRO_2_CONTRACTS_TEST_DIR)/%.sierra # ====================== CAIRO_2_REPO_DIR = cairo2 -CAIRO_2_VERSION = 2.7.1 +CAIRO_2_VERSION = 2.8.0 build-cairo-2-compiler-macos: @if [ ! -d "$(CAIRO_2_REPO_DIR)" ]; then \ diff --git a/README.md b/README.md index f077a403f6..0618a0fcea 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ It's Turing-complete and it was created by [Starkware](https://starkware.co/) as These are needed in order to compile and use the project. -- [Rust 1.76.0 or newer](https://www.rust-lang.org/tools/install) +- [Rust 1.80.0 or newer](https://www.rust-lang.org/tools/install) - Cargo #### Optional diff --git a/cairo-vm-tracer/src/tracer_data.rs b/cairo-vm-tracer/src/tracer_data.rs index 7c5268152e..e2b02cfb23 100644 --- a/cairo-vm-tracer/src/tracer_data.rs +++ b/cairo-vm-tracer/src/tracer_data.rs @@ -67,7 +67,7 @@ impl InputCodeFile { format!("", classes.join(" ")), )); self.tags - .push((offset_end, -std::isize::MAX, "".to_string())); + .push((offset_end, -isize::MAX, "".to_string())); } pub fn to_html(&self) -> String { diff --git a/cairo1-run/Cargo.toml b/cairo1-run/Cargo.toml index b5022d994b..500d410d28 100644 --- a/cairo1-run/Cargo.toml +++ b/cairo1-run/Cargo.toml @@ -9,12 +9,12 @@ keywords.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -cairo-vm = {workspace = true, features = ["std", "cairo-1-hints", "clap"]} +cairo-vm = { workspace = true, features = ["std", "cairo-1-hints", "clap"] } serde_json = { workspace = true } -cairo-lang-sierra-type-size = { version = "2.7.1", default-features = false } -cairo-lang-sierra-ap-change = { version = "2.7.1", default-features = false } -cairo-lang-sierra-gas = { version = "2.7.1", default-features = false } +cairo-lang-sierra-type-size = { version = "2.8.0", default-features = false } +cairo-lang-sierra-ap-change = { version = "2.8.0", default-features = false } +cairo-lang-sierra-gas = { version = "2.8.0", default-features = false } cairo-lang-starknet-classes.workspace = true cairo-lang-sierra-to-casm.workspace = true cairo-lang-compiler.workspace = true diff --git a/cairo1-run/Makefile b/cairo1-run/Makefile index 16244e05d9..a00f9dfe3f 100644 --- a/cairo1-run/Makefile +++ b/cairo1-run/Makefile @@ -13,7 +13,7 @@ TRACES:=$(patsubst $(CAIRO_1_FOLDER)/%.cairo, $(CAIRO_1_FOLDER)/%.trace, $(CAIRO MEMORY:=$(patsubst $(CAIRO_1_FOLDER)/%.cairo, $(CAIRO_1_FOLDER)/%.memory, $(CAIRO_1_PROGRAMS)) deps: - git clone --depth=1 -b v2.7.1 https://github.com/starkware-libs/cairo.git \ + git clone --depth=1 -b v2.8.0 https://github.com/starkware-libs/cairo.git \ && mv cairo/corelib/ . \ && rm -rf cairo/ diff --git a/cairo1-run/src/cairo_run.rs b/cairo1-run/src/cairo_run.rs index 700225b880..3f8095e160 100644 --- a/cairo1-run/src/cairo_run.rs +++ b/cairo1-run/src/cairo_run.rs @@ -1447,7 +1447,7 @@ fn serialize_output_inner<'a>( output_string.push(':'); // Serialize the value // We create a peekable array here in order to use the serialize_output_inner as the value could be a span - let value_vec = vec![value.clone()]; + let value_vec = [value.clone()]; let mut value_iter = value_vec.iter().peekable(); serialize_output_inner( &mut value_iter, @@ -1493,7 +1493,7 @@ fn serialize_output_inner<'a>( output_string.push(':'); // Serialize the value // We create a peekable array here in order to use the serialize_output_inner as the value could be a span - let value_vec = vec![value.clone()]; + let value_vec = [value.clone()]; let mut value_iter = value_vec.iter().peekable(); serialize_output_inner( &mut value_iter, @@ -1553,7 +1553,7 @@ mod tests { .build() .unwrap(); let main_crate_ids = setup_project(&mut db, Path::new(filename)).unwrap(); - compile_prepared_db(&mut db, main_crate_ids, compiler_config) + compile_prepared_db(&db, main_crate_ids, compiler_config) .unwrap() .program } diff --git a/cairo1-run/src/main.rs b/cairo1-run/src/main.rs index 8a4a5058bb..47c9abfbca 100644 --- a/cairo1-run/src/main.rs +++ b/cairo1-run/src/main.rs @@ -181,7 +181,7 @@ fn run(args: impl Iterator) -> Result, Error> { .unwrap(); let main_crate_ids = setup_project(&mut db, &args.filename).unwrap(); let sierra_program_with_dbg = - compile_prepared_db(&mut db, main_crate_ids, compiler_config).unwrap(); + compile_prepared_db(&db, main_crate_ids, compiler_config).unwrap(); sierra_program_with_dbg.program } diff --git a/rust-toolchain b/rust-toolchain index 907951458e..ff6d7a9a85 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,4 +1,4 @@ [toolchain] -channel = "1.76.0" +channel = "1.80.0" components = ["rustfmt", "clippy"] profile = "minimal" diff --git a/vm/Cargo.toml b/vm/Cargo.toml index 2c3aefe3b3..07bcde08cd 100644 --- a/vm/Cargo.toml +++ b/vm/Cargo.toml @@ -37,7 +37,7 @@ test_utils = ["std", "dep:arbitrary", "starknet-types-core/arbitrary", "starknet extensive_hints = [] [dependencies] -zip = {version = "0.6.6", optional = true, default-features = false, features = ["deflate"]} +zip = { version = "0.6.6", optional = true, default-features = false, features = ["deflate"] } num-bigint = { workspace = true } rand = { workspace = true } num-traits = { workspace = true } diff --git a/vm/src/air_private_input.rs b/vm/src/air_private_input.rs index 6275ebd6a1..b76575eaff 100644 --- a/vm/src/air_private_input.rs +++ b/vm/src/air_private_input.rs @@ -215,7 +215,7 @@ mod tests { assert_matches::assert_matches, }; - #[cfg(any(target_arch = "wasm32", no_std, not(feature = "std")))] + #[cfg(any(target_arch = "wasm32", not(feature = "std")))] use crate::alloc::string::ToString; #[cfg(feature = "std")] diff --git a/vm/src/hint_processor/builtin_hint_processor/dict_manager.rs b/vm/src/hint_processor/builtin_hint_processor/dict_manager.rs index 230ac85d2e..63d1097510 100644 --- a/vm/src/hint_processor/builtin_hint_processor/dict_manager.rs +++ b/vm/src/hint_processor/builtin_hint_processor/dict_manager.rs @@ -159,11 +159,7 @@ impl DictTracker { ) -> Self { DictTracker { data: Dictionary::DefaultDictionary { - dict: if let Some(dict) = initial_dict { - dict - } else { - HashMap::new() - }, + dict: initial_dict.unwrap_or_default(), default_value: default_value.clone(), }, current_ptr: base, diff --git a/vm/src/hint_processor/builtin_hint_processor/math_utils.rs b/vm/src/hint_processor/builtin_hint_processor/math_utils.rs index ad2c5e0767..e10467b6ee 100644 --- a/vm/src/hint_processor/builtin_hint_processor/math_utils.rs +++ b/vm/src/hint_processor/builtin_hint_processor/math_utils.rs @@ -743,10 +743,7 @@ pub fn split_xx( x = &*SPLIT_XX_PRIME - x; } - vm.insert_value( - x_addr, - Felt252::from(&(&x & &BigUint::from(u128::max_value()))), - )?; + vm.insert_value(x_addr, Felt252::from(&(&x & &BigUint::from(u128::MAX))))?; vm.insert_value((x_addr + 1)?, Felt252::from(&(x >> 128_u32)))?; Ok(()) diff --git a/vm/src/tests/cairo_pie_test.rs b/vm/src/tests/cairo_pie_test.rs index 7701d66057..e6de72ea28 100644 --- a/vm/src/tests/cairo_pie_test.rs +++ b/vm/src/tests/cairo_pie_test.rs @@ -6,12 +6,6 @@ use crate::{ #[cfg(target_arch = "wasm32")] use wasm_bindgen_test::*; -#[cfg(all(not(feature = "std"), feature = "alloc"))] -use alloc::{ - string::{String, ToString}, - vec::Vec, -}; - use crate::{ cairo_run::{cairo_run, CairoRunConfig}, hint_processor::builtin_hint_processor::builtin_hint_processor_definition::BuiltinHintProcessor, @@ -25,12 +19,6 @@ use crate::{ }, }; -#[cfg(all(not(feature = "std"), feature = "alloc"))] -use alloc::{ - string::{String, ToString}, - vec::Vec, -}; - #[test] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)] fn pedersen_test() { diff --git a/vm/src/tests/mod.rs b/vm/src/tests/mod.rs index 11026af5ad..6df6e743fe 100644 --- a/vm/src/tests/mod.rs +++ b/vm/src/tests/mod.rs @@ -25,8 +25,8 @@ use crate::{ #[cfg(target_arch = "wasm32")] use wasm_bindgen_test::*; -#[cfg(all(not(feature = "std"), feature = "alloc"))] -use alloc::{string::String, vec::Vec}; +#[cfg(not(feature = "std"))] +use alloc::vec::Vec; mod bitwise_test; #[cfg(test)] diff --git a/vm/src/types/relocatable.rs b/vm/src/types/relocatable.rs index 0614b6ae8d..7ca52eb45d 100644 --- a/vm/src/types/relocatable.rs +++ b/vm/src/types/relocatable.rs @@ -401,7 +401,6 @@ mod tests { #[cfg(target_arch = "wasm32")] use wasm_bindgen_test::*; - #[cfg(feature = "std")] #[cfg(feature = "std")] use proptest::prelude::*; diff --git a/vm/src/vm/runners/cairo_pie.rs b/vm/src/vm/runners/cairo_pie.rs index 83f215b02f..d86b1840c8 100644 --- a/vm/src/vm/runners/cairo_pie.rs +++ b/vm/src/vm/runners/cairo_pie.rs @@ -378,7 +378,7 @@ pub(super) mod serde_impl { use super::CAIRO_PIE_VERSION; use super::{CairoPieMemory, Pages, PublicMemoryPage, SegmentInfo}; - #[cfg(any(target_arch = "wasm32", no_std, not(feature = "std")))] + #[cfg(any(target_arch = "wasm32", not(feature = "std")))] use crate::alloc::string::ToString; use crate::stdlib::prelude::{String, Vec}; use crate::{ diff --git a/vm/src/vm/vm_memory/memory.rs b/vm/src/vm/vm_memory/memory.rs index caf1684932..9dbfc9a790 100644 --- a/vm/src/vm/vm_memory/memory.rs +++ b/vm/src/vm/vm_memory/memory.rs @@ -32,10 +32,10 @@ pub struct ValidationRule( /// - BIT63: NONE flag, 1 when the cell is actually empty. /// - BIT62: ACCESS flag, 1 when the cell has been accessed in a way observable to Cairo. /// - BIT61: RELOCATABLE flag, 1 when the contained value is a `Relocatable`, 0 when it is a -/// `Felt252`. -/// `Felt252` values are stored in big-endian order to keep the flag bits free. -/// `Relocatable` values are stored as native endian, with the 3rd word storing the segment index -/// and the 4th word storing the offset. +/// `Felt252`. +/// `Felt252` values are stored in big-endian order to keep the flag bits free. +/// `Relocatable` values are stored as native endian, with the 3rd word storing the segment index +/// and the 4th word storing the offset. #[derive(Copy, Clone, Eq, Ord, PartialEq, PartialOrd, Debug)] #[repr(align(32))] pub(crate) struct MemoryCell([u64; 4]); @@ -435,8 +435,8 @@ impl Memory { /// - `lhs` exists in memory but `rhs` doesn't -> (Ordering::Greater, 0) /// - `rhs` exists in memory but `lhs` doesn't -> (Ordering::Less, 0) /// - None of `lhs` or `rhs` exist in memory -> (Ordering::Equal, 0) - /// Everything else behaves much like `memcmp` in C. - /// This is meant as an optimization for hints to avoid allocations. + /// Everything else behaves much like `memcmp` in C. + /// This is meant as an optimization for hints to avoid allocations. pub(crate) fn memcmp( &self, lhs: Relocatable, @@ -487,8 +487,8 @@ impl Memory { /// - `lhs` exists in memory but `rhs` doesn't -> (Ordering::Greater, 0) /// - `rhs` exists in memory but `lhs` doesn't -> (Ordering::Less, 0) /// - None of `lhs` or `rhs` exist in memory -> (Ordering::Equal, 0) - /// Everything else behaves much like `memcmp` in C. - /// This is meant as an optimization for hints to avoid allocations. + /// Everything else behaves much like `memcmp` in C. + /// This is meant as an optimization for hints to avoid allocations. pub(crate) fn mem_eq(&self, lhs: Relocatable, rhs: Relocatable, len: usize) -> bool { if lhs == rhs { return true;