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 7c9f5851f7..2e98e90110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,14 +2,26 @@ #### Upcoming Changes +* 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) + * 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. + * Fix prover input. + * Fix version reading when no version is supplied. + + * chore: bump `cairo-lang-` dependencies to 2.7.1 [#1823](https://github.com/lambdaclass/cairo-vm/pull/1823) * feat: Implement `SECP related` hints [#1829](https://github.com/lambdaclass/cairo-vm/pull/1829) #### [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 667a43f353..03c0cb9c47 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,17 +23,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - [[package]] name = "ahash" version = "0.8.11" @@ -243,19 +232,19 @@ dependencies = [ "memchr", "pin-project-lite", "tokio", - "zstd 0.13.2", - "zstd-safe 7.2.1", + "zstd", + "zstd-safe", ] [[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]] @@ -334,12 +323,6 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - [[package]] name = "bincode" version = "2.0.0-rc.3" @@ -452,32 +435,11 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - [[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", @@ -489,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", @@ -506,7 +468,8 @@ dependencies = [ "cairo-lang-syntax", "cairo-lang-utils", "indoc", - "salsa", + "rayon", + "rust-analyzer-salsa", "semver", "smol_str", "thiserror", @@ -514,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", @@ -534,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", @@ -552,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", @@ -562,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", @@ -577,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", @@ -590,7 +553,7 @@ dependencies = [ "diffy", "ignore", "itertools 0.12.1", - "salsa", + "rust-analyzer-salsa", "serde", "smol_str", "thiserror", @@ -598,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", @@ -616,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", @@ -636,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", @@ -656,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", @@ -687,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", @@ -706,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", @@ -729,9 +690,8 @@ dependencies = [ "num-bigint", "num-integer", "num-traits 0.2.19", - "once_cell", "regex", - "salsa", + "rust-analyzer-salsa", "serde", "serde_json", "sha3", @@ -742,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", @@ -758,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", @@ -774,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", @@ -790,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", @@ -799,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", @@ -820,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", @@ -830,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", @@ -851,7 +810,6 @@ dependencies = [ "indent", "indoc", "itertools 0.12.1", - "once_cell", "serde", "serde_json", "smol_str", @@ -861,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", @@ -874,7 +832,6 @@ dependencies = [ "num-bigint", "num-integer", "num-traits 0.2.19", - "once_cell", "serde", "serde_json", "sha3", @@ -885,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", @@ -911,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", @@ -924,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", @@ -1091,16 +1048,6 @@ dependencies = [ "half", ] -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - [[package]] name = "clap" version = "4.5.16" @@ -1132,7 +1079,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1193,12 +1140,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "convert_case" version = "0.6.0" @@ -1314,15 +1255,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] - [[package]] name = "derivative" version = "2.2.0" @@ -1342,7 +1274,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1528,7 +1460,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1586,7 +1518,7 @@ checksum = "553630feadf7b76442b0849fd25fdf89b860d933623aec9693fed19af0400c78" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1670,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" @@ -1868,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", @@ -1883,24 +1812,6 @@ version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", -] - -[[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" @@ -2266,12 +2177,6 @@ dependencies = [ "num-traits 0.2.19", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-integer" version = "0.1.46" @@ -2329,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", ] @@ -2380,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" @@ -2398,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]] @@ -2423,22 +2303,11 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall", "smallvec", "windows-targets 0.52.6", ] -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core", - "subtle", -] - [[package]] name = "paste" version = "1.0.15" @@ -2451,18 +2320,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest", - "hmac", - "password-hash", - "sha2", -] - [[package]] name = "percent-encoding" version = "2.3.1" @@ -2476,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]] @@ -2511,7 +2368,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2560,12 +2417,6 @@ dependencies = [ "plotters-backend", ] -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "ppv-lite86" version = "0.2.20" @@ -2593,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]] @@ -2715,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" @@ -2815,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" @@ -2839,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", @@ -2883,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" @@ -2943,7 +2785,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2984,7 +2826,7 @@ checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2995,7 +2837,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3041,17 +2883,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sha2" version = "0.10.8" @@ -3145,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" @@ -3173,7 +3010,7 @@ checksum = "bbc159a1934c7be9761c237333a57febe060ace2bc9e3b337a59a37af206d19f" dependencies = [ "starknet-curve", "starknet-ff", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3221,7 +3058,7 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.3", + "parking_lot", "phf_shared", "precomputed-hash", ] @@ -3251,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", @@ -3313,7 +3150,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3346,25 +3183,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "num-conv", - "powerfmt", - "serde", - "time-core", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - [[package]] name = "tiny-keccak" version = "2.0.2" @@ -3386,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", @@ -3408,7 +3226,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3433,7 +3251,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.20", + "toml_edit", ] [[package]] @@ -3445,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]] @@ -3547,7 +3354,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3585,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" @@ -3721,7 +3538,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "wasm-bindgen-shared", ] @@ -3755,7 +3572,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3788,7 +3605,7 @@ checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -3991,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" @@ -4057,7 +3865,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4077,7 +3885,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -4086,27 +3894,10 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ - "aes", "byteorder", - "bzip2", - "constant_time_eq", "crc32fast", "crossbeam-utils", "flate2", - "hmac", - "pbkdf2", - "sha1", - "time", - "zstd 0.11.2+zstd.1.5.2", -] - -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe 5.0.2+zstd.1.5.2", ] [[package]] @@ -4115,17 +3906,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" dependencies = [ - "zstd-safe 7.2.1", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", + "zstd-safe", ] [[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/docs/README.md b/docs/README.md index f25a1c762a..5d70a46fea 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,3 +5,4 @@ * [How to run a cairo program with custom hints](./hint_processor/builtin_hint_processor) * [References parsing](./references_parsing/) * [Tracer](./tracer/) +* [Debugging](./debugging.md) diff --git a/docs/debugging.md b/docs/debugging.md new file mode 100644 index 0000000000..246f873c04 --- /dev/null +++ b/docs/debugging.md @@ -0,0 +1,29 @@ +# Debugging + +## Comparing with Cairo-Lang + +If you executed a Cairo0 proof program with both Rust and Python VM, you can use the following scripts to compare their output. They all require `delta` (modern diff) to be installed. If you don't have you can locally change it. + +No output when running a differ script implies that there are no differences. + +To compare the public inputs, run: +```bash +scripts/air_public_inputs_differ.bash +``` + +To compare the private inputs, run: +```bash +scripts/air_private_inputs_differ.bash +``` + +If you just want to visualize the memory, run: +```bash +scripts/memory_viewer.bash +``` +It will output the memory in two columns: address and value + + +To compare the memory, run: +```bash +scripts/memory_differ.bash +``` diff --git a/requirements.txt b/requirements.txt index 41c32affe0..a47d1c9122 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ bitarray==2.7.3 fastecdsa==2.3.0 sympy==1.11.1 typeguard==2.13.3 -cairo-lang==0.13.1 +cairo-lang==0.13.2 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/scripts/air_private_inputs_differ.bash b/scripts/air_private_inputs_differ.bash new file mode 100755 index 0000000000..8ce3a0215c --- /dev/null +++ b/scripts/air_private_inputs_differ.bash @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +delta \ + <(jq -S 'del(.memory_path,.trace_path)' "$1") \ + <(jq -S 'del(.memory_path,.trace_path)' "$2") \ + -s diff --git a/scripts/air_public_inputs_differ.bash b/scripts/air_public_inputs_differ.bash new file mode 100755 index 0000000000..84637c350f --- /dev/null +++ b/scripts/air_public_inputs_differ.bash @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +delta \ + <(jq -S . "$1") \ + <(jq -S . "$2") \ + -s diff --git a/scripts/memory_differ.bash b/scripts/memory_differ.bash new file mode 100755 index 0000000000..b5c0f2649c --- /dev/null +++ b/scripts/memory_differ.bash @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +delta \ + <(hexdump -e '1/8 "%u " 4/8 "%x " "\n"' "$1" | sort -n) \ + <(hexdump -e '1/8 "%u " 4/8 "%x " "\n"' "$2" | sort -n) \ + -s diff --git a/scripts/memory_viewer.bash b/scripts/memory_viewer.bash new file mode 100755 index 0000000000..a6e74032f2 --- /dev/null +++ b/scripts/memory_viewer.bash @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +# +# outputs memory file in "ADDR VALUE" format, on cell per line + +hexdump -e '1/8 "%10u " 4/8 "%x " "\n"' "$1" | sort -n diff --git a/vm/Cargo.toml b/vm/Cargo.toml index 6311f1b562..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 } +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 fa05cc86d5..b76575eaff 100644 --- a/vm/src/air_private_input.rs +++ b/vm/src/air_private_input.rs @@ -19,6 +19,8 @@ pub struct AirPrivateInputSerializable { #[serde(skip_serializing_if = "Option::is_none")] range_check: Option>, #[serde(skip_serializing_if = "Option::is_none")] + range_check96: Option>, + #[serde(skip_serializing_if = "Option::is_none")] ecdsa: Option>, #[serde(skip_serializing_if = "Option::is_none")] bitwise: Option>, @@ -157,6 +159,7 @@ impl AirPrivateInput { memory_path, pedersen: self.0.get(&BuiltinName::pedersen).cloned(), range_check: self.0.get(&BuiltinName::range_check).cloned(), + range_check96: self.0.get(&BuiltinName::range_check96).cloned(), ecdsa: self.0.get(&BuiltinName::ecdsa).cloned(), bitwise: self.0.get(&BuiltinName::bitwise).cloned(), ec_op: self.0.get(&BuiltinName::ec_op).cloned(), @@ -212,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")] @@ -230,6 +233,10 @@ mod tests { index: 10000, value: Felt252::from(8000), })]), + range_check96: Some(vec![PrivateInput::Value(PrivateInputValue { + index: 10000, + value: Felt252::from(8000), + })]), ecdsa: Some(vec![PrivateInput::Signature(PrivateInputSignature { index: 0, pubkey: Felt252::from(123), diff --git a/vm/src/cairo_run.rs b/vm/src/cairo_run.rs index b7d5d005e3..de2540fb2e 100644 --- a/vm/src/cairo_run.rs +++ b/vm/src/cairo_run.rs @@ -173,7 +173,8 @@ pub fn cairo_run_pie( } } // Load previous execution memory - let n_extra_segments = pie.metadata.extra_segments.len(); + let has_zero_segment = cairo_runner.vm.segments.has_zero_segment() as usize; + let n_extra_segments = pie.metadata.extra_segments.len() - has_zero_segment; cairo_runner .vm .segments 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..3b68d5d150 100644 --- a/vm/src/hint_processor/builtin_hint_processor/math_utils.rs +++ b/vm/src/hint_processor/builtin_hint_processor/math_utils.rs @@ -37,6 +37,8 @@ use super::{ }; const ADDR_BOUND: &str = "starkware.starknet.common.storage.ADDR_BOUND"; +const MAX_HIGH: &str = "starkware.cairo.common.math.split_felt.MAX_HIGH"; +const MAX_LOW: &str = "starkware.cairo.common.math.split_felt.MAX_LOW"; //Implements hint: memory[ap] = 0 if 0 <= (ids.a % PRIME) < range_check_builtin.bound else 1 pub fn is_nn( @@ -386,13 +388,21 @@ pub fn split_felt( ap_tracking: &ApTracking, constants: &HashMap, ) -> Result<(), HintError> { + let max_high_local = + &Felt252::from_dec_str("10633823966279327296825105735305134080").map_err(|_| { + HintError::CustomHint( + String::from("pointer_size must be a positive integer").into_boxed_str(), + ) + })?; + let max_low_local = &Felt252::ZERO; + let assert = |b: bool, msg: &str| { b.then_some(()) .ok_or_else(|| HintError::AssertionFailed(msg.to_string().into_boxed_str())) }; let bound = pow2_const(128); - let max_high = get_constant_from_var_name("MAX_HIGH", constants)?; - let max_low = get_constant_from_var_name("MAX_LOW", constants)?; + let max_high = constants.get(MAX_HIGH).unwrap_or(max_high_local); + let max_low = constants.get(MAX_LOW).unwrap_or(max_low_local); assert( max_high < &bound && max_low < &bound, "assert ids.MAX_HIGH < 2**128 and ids.MAX_LOW < 2**128", @@ -743,10 +753,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(()) @@ -2067,9 +2074,9 @@ mod tests { hint_code, exec_scopes_ref!(), &HashMap::from([ - ("MAX_LOW".to_string(), Felt252::ZERO), + (MAX_LOW, Felt252::ZERO), ( - "MAX_HIGH".to_string(), + MAX_HIGH, felt_str!("10633823966279327296825105735305134080") ) ]) @@ -2107,9 +2114,9 @@ mod tests { hint_code, exec_scopes_ref!(), &HashMap::from([ - ("MAX_LOW".to_string(), Felt252::ZERO), + (MAX_LOW, Felt252::ZERO), ( - "MAX_HIGH".to_string(), + MAX_HIGH, felt_str!("10633823966279327296825105735305134080") ) ]) @@ -2146,9 +2153,9 @@ mod tests { hint_code, exec_scopes_ref!(), &HashMap::from([ - ("MAX_LOW".to_string(), Felt252::ZERO), + (MAX_LOW, Felt252::ZERO), ( - "MAX_HIGH".to_string(), + MAX_HIGH, felt_str!("10633823966279327296825105735305134080") ) ]) @@ -2189,9 +2196,9 @@ mod tests { hint_code, exec_scopes_ref!(), &HashMap::from([ - ("MAX_LOW".to_string(), Felt252::ZERO), + (MAX_LOW, Felt252::ZERO), ( - "MAX_HIGH".to_string(), + MAX_HIGH, felt_str!("10633823966279327296825105735305134080") ) ]) @@ -2227,9 +2234,9 @@ mod tests { hint_code, exec_scopes_ref!(), &HashMap::from([ - ("MAX_LOW".to_string(), Felt252::ZERO), + (MAX_LOW, Felt252::ZERO), ( - "MAX_HIGH".to_string(), + MAX_HIGH, felt_str!("10633823966279327296825105735305134080") ) ]) @@ -2260,7 +2267,7 @@ mod tests { //Execute the hint assert_matches!( run_hint!(vm, ids_data, hint_code), - Err(HintError::MissingConstant(x)) if (*x) == "MAX_HIGH" + Err(HintError::MissingConstant(x)) if (*x) == MAX_HIGH ); } @@ -2291,9 +2298,9 @@ mod tests { hint_code, exec_scopes_ref!(), &HashMap::from([ - ("MAX_LOW".to_string(), Felt252::from(-1)), + (MAX_LOW, Felt252::from(-1)), ( - "MAX_HIGH".to_string(), + MAX_HIGH, Felt252::from(-1), ) ]) @@ -2329,9 +2336,9 @@ mod tests { hint_code, exec_scopes_ref!(), &HashMap::from([ - ("MAX_LOW".to_string(), Felt252::ZERO), + (MAX_LOW, Felt252::ZERO), ( - "MAX_HIGH".to_string(), + MAX_HIGH, Felt252::ZERO, ) ]) diff --git a/vm/src/hint_processor/cairo_1_hint_processor/dict_manager.rs b/vm/src/hint_processor/cairo_1_hint_processor/dict_manager.rs index b95c0b5232..b3a493ef53 100644 --- a/vm/src/hint_processor/cairo_1_hint_processor/dict_manager.rs +++ b/vm/src/hint_processor/cairo_1_hint_processor/dict_manager.rs @@ -54,7 +54,7 @@ impl DictManagerExecScope { /// Allocates a new segment for a new dictionary and return the start of the segment. pub fn new_default_dict(&mut self, vm: &mut VirtualMachine) -> Result { - let dict_segment = if self.use_temporary_segments { + let dict_segment = if self.use_temporary_segments && self.trackers.len() > 0 { vm.add_temporary_segment() } else { vm.add_memory_segment() 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/builtin_runner/modulo.rs b/vm/src/vm/runners/builtin_runner/modulo.rs index c5d2dc56b5..b4aa0b7fa6 100644 --- a/vm/src/vm/runners/builtin_runner/modulo.rs +++ b/vm/src/vm/runners/builtin_runner/modulo.rs @@ -118,7 +118,10 @@ impl ModBuiltinRunner { pub fn initialize_segments(&mut self, segments: &mut MemorySegmentManager) { self.base = segments.add().segment_index as usize; // segments.add() always returns a positive index - self.zero_segment_index = segments.add_zero_segment(self.zero_segment_size) + } + + pub fn initialize_zero_segment(&mut self, segments: &mut MemorySegmentManager) { + self.zero_segment_index = segments.add_zero_segment(self.zero_segment_size); } pub fn initial_stack(&self) -> Vec { @@ -677,17 +680,16 @@ fn apply_op(lhs: &BigUint, rhs: &BigUint, op: &Operation) -> Result Result { use std::io::Read; - let reader = std::io::BufReader::new(zip_reader.by_name("version.json")?); - let version: CairoPieVersion = serde_json::from_reader(reader)?; + let version = match zip_reader.by_name("version.json") { + Ok(version_buffer) => { + let reader = std::io::BufReader::new(version_buffer); + serde_json::from_reader(reader)? + } + Err(_) => CairoPieVersion { cairo_pie: () }, + }; let reader = std::io::BufReader::new(zip_reader.by_name("metadata.json")?); let metadata: CairoPieMetadata = serde_json::from_reader(reader)?; @@ -373,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/runners/cairo_runner.rs b/vm/src/vm/runners/cairo_runner.rs index 4c42ad463d..ecf47892b0 100644 --- a/vm/src/vm/runners/cairo_runner.rs +++ b/vm/src/vm/runners/cairo_runner.rs @@ -234,6 +234,11 @@ impl CairoRunner { self.initialize_builtins(allow_missing_builtins)?; self.initialize_segments(None); let end = self.initialize_main_entrypoint()?; + for builtin_runner in self.vm.builtin_runners.iter_mut() { + if let BuiltinRunner::Mod(runner) = builtin_runner { + runner.initialize_zero_segment(&mut self.vm.segments); + } + } self.initialize_vm()?; Ok(end) } 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; diff --git a/vm/src/vm/vm_memory/memory_segments.rs b/vm/src/vm/vm_memory/memory_segments.rs index 04a0a58f18..b6d7379786 100644 --- a/vm/src/vm/vm_memory/memory_segments.rs +++ b/vm/src/vm/vm_memory/memory_segments.rs @@ -217,7 +217,7 @@ impl MemorySegmentManager { } let accessed_amount = // Instead of marking the values in the zero segment until zero_segment_size as accessed we use zero_segment_size as accessed_amount - if !self.zero_segment_index.is_zero() && i == self.zero_segment_index { + if self.has_zero_segment() && i == self.zero_segment_index { self.zero_segment_size } else { match self.memory.get_amount_of_accessed_addresses_for_segment(i) { @@ -278,11 +278,15 @@ impl MemorySegmentManager { .insert(segment_index, public_memory.cloned().unwrap_or_default()); } + pub fn has_zero_segment(&self) -> bool { + !self.zero_segment_index.is_zero() + } + // Creates the zero segment if it wasn't previously created // Fills the segment with the value 0 until size is reached // Returns the index of the zero segment pub(crate) fn add_zero_segment(&mut self, size: usize) -> usize { - if self.zero_segment_index.is_zero() { + if !self.has_zero_segment() { self.zero_segment_index = self.add().segment_index as usize; } @@ -298,7 +302,7 @@ impl MemorySegmentManager { // Finalizes the zero segment and clears it's tracking data from the manager pub(crate) fn finalize_zero_segment(&mut self) { - if !self.zero_segment_index.is_zero() { + if self.has_zero_segment() { self.finalize(Some(self.zero_segment_size), self.zero_segment_index, None); self.zero_segment_index = 0; self.zero_segment_size = 0;