From 0453c8afa4a6996ca7053d9b129de2e4c1522388 Mon Sep 17 00:00:00 2001 From: Ohad Agadi Date: Wed, 18 Dec 2024 18:46:02 +0200 Subject: [PATCH] updated toolchain --- stwo_cairo_prover/Cargo.lock | 27 +++++++------------ stwo_cairo_prover/Cargo.toml | 4 +-- .../src/components/generic_opcode/prover.rs | 1 - .../crates/prover/src/input/plain.rs | 2 +- .../crates/prover/src/input/vm_import/mod.rs | 4 +-- stwo_cairo_prover/crates/prover/src/lib.rs | 2 +- .../crates/prover_types/src/lib.rs | 2 +- .../crates/prover_types/src/simd.rs | 6 ++--- stwo_cairo_prover/rust-toolchain.toml | 2 +- stwo_cairo_prover/scripts/clippy.sh | 2 +- stwo_cairo_prover/scripts/rust_fmt.sh | 2 +- 11 files changed, 23 insertions(+), 31 deletions(-) diff --git a/stwo_cairo_prover/Cargo.lock b/stwo_cairo_prover/Cargo.lock index 6ffe5b82..c022f076 100644 --- a/stwo_cairo_prover/Cargo.lock +++ b/stwo_cairo_prover/Cargo.lock @@ -610,12 +610,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "downcast-rs" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" - [[package]] name = "educe" version = "0.5.11" @@ -978,9 +972,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] @@ -1134,7 +1128,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 2.0.7", + "thiserror 2.0.8", "ucd-trie", ] @@ -1600,7 +1594,7 @@ dependencies = [ "simdutf8", "sonic-number", "sonic-simd", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1719,13 +1713,12 @@ dependencies = [ [[package]] name = "stwo-prover" version = "0.1.1" -source = "git+https://github.com/starkware-libs/stwo?rev=060f0e4#060f0e4e2b2d32bfad8eabc17ef66292d883e220" +source = "git+https://github.com/starkware-libs/stwo?rev=172cd35#172cd35bf86de4312b74a429d5fa12383aee5372" dependencies = [ "blake2", "blake3", "bytemuck", "cfg-if", - "downcast-rs", "educe", "hex", "itertools 0.12.1", @@ -1837,11 +1830,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" +checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" dependencies = [ - "thiserror-impl 2.0.7", + "thiserror-impl 2.0.8", ] [[package]] @@ -1857,9 +1850,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" +checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" dependencies = [ "proc-macro2", "quote", diff --git a/stwo_cairo_prover/Cargo.toml b/stwo_cairo_prover/Cargo.toml index 8cdd3691..755a9677 100644 --- a/stwo_cairo_prover/Cargo.toml +++ b/stwo_cairo_prover/Cargo.toml @@ -16,7 +16,7 @@ version = "0.1.1" edition = "2021" [workspace.dependencies] -bytemuck = { version = "1.16.3", features = ["derive"] } +bytemuck = { version = "1.20.0", features = ["derive"] } cairo-lang-casm = "2.7.1" # TODO(yuval): Use an official version, not a specific commit. cairo-vm = { git = "https://github.com/lambdaclass/cairo-vm", rev = "3fb0344c", features = [ @@ -33,7 +33,7 @@ serde = "1.0.207" serde_json = "1.0.1" sonic-rs = "0.3.10" # TODO(ShaharS): take stwo version from the source repository. -stwo-prover = { git = "https://github.com/starkware-libs/stwo", rev = "060f0e4", features = [ +stwo-prover = { git = "https://github.com/starkware-libs/stwo", rev = "172cd35", features = [ "parallel", ] } thiserror = "1.0.63" diff --git a/stwo_cairo_prover/crates/prover/src/components/generic_opcode/prover.rs b/stwo_cairo_prover/crates/prover/src/components/generic_opcode/prover.rs index e617d491..1b64fc96 100644 --- a/stwo_cairo_prover/crates/prover/src/components/generic_opcode/prover.rs +++ b/stwo_cairo_prover/crates/prover/src/components/generic_opcode/prover.rs @@ -116,7 +116,6 @@ pub struct SubComponentInputs {pub memory_address_to_id_inputs: [Vec; 3],pub memory_id_to_big_inputs: [Vec; 3],pub range_check_19_inputs: [Vec; 28],pub range_check_9_9_inputs: [Vec; 28],pub verify_instruction_inputs: [Vec; 1],} #[allow(clippy::useless_conversion)] - #[allow(unused_variables)] #[allow(clippy::double_parens)] #[allow(non_snake_case)] diff --git a/stwo_cairo_prover/crates/prover/src/input/plain.rs b/stwo_cairo_prover/crates/prover/src/input/plain.rs index 8788f0ab..8eadffbc 100644 --- a/stwo_cairo_prover/crates/prover/src/input/plain.rs +++ b/stwo_cairo_prover/crates/prover/src/input/plain.rs @@ -67,7 +67,7 @@ pub fn input_from_finished_runner(runner: CairoRunner, dev_mode: bool) -> CairoI .filter_map(|(i, v)| { v.map(|v| MemEntry { addr: i as u64, - val: bytemuck::cast_slice(&v.to_bytes_le()).try_into().unwrap(), + val: bytemuck::cast(v.to_bytes_le()), }) }); let trace = runner.relocated_trace.unwrap(); diff --git a/stwo_cairo_prover/crates/prover/src/input/vm_import/mod.rs b/stwo_cairo_prover/crates/prover/src/input/vm_import/mod.rs index 08f61600..9d2ae347 100644 --- a/stwo_cairo_prover/crates/prover/src/input/vm_import/mod.rs +++ b/stwo_cairo_prover/crates/prover/src/input/vm_import/mod.rs @@ -88,7 +88,7 @@ impl From for TraceEntry { } pub struct TraceIter<'a, R: Read>(pub &'a mut R); -impl<'a, R: Read> Iterator for TraceIter<'a, R> { +impl Iterator for TraceIter<'_, R> { type Item = TraceEntry; fn next(&mut self) -> Option { @@ -110,7 +110,7 @@ pub struct MemEntry { } pub struct MemEntryIter<'a, R: Read>(pub &'a mut R); -impl<'a, R: Read> Iterator for MemEntryIter<'a, R> { +impl Iterator for MemEntryIter<'_, R> { type Item = MemEntry; fn next(&mut self) -> Option { diff --git a/stwo_cairo_prover/crates/prover/src/lib.rs b/stwo_cairo_prover/crates/prover/src/lib.rs index 9bacfca7..0c1ffe9b 100644 --- a/stwo_cairo_prover/crates/prover/src/lib.rs +++ b/stwo_cairo_prover/crates/prover/src/lib.rs @@ -1,4 +1,4 @@ -#![feature(array_methods, portable_simd, iter_array_chunks, array_chunks)] +#![feature(trait_upcasting, portable_simd, iter_array_chunks, array_chunks)] // TODO(Ohad): remove. #![allow(clippy::too_many_arguments)] diff --git a/stwo_cairo_prover/crates/prover_types/src/lib.rs b/stwo_cairo_prover/crates/prover_types/src/lib.rs index 13b10159..619b965d 100644 --- a/stwo_cairo_prover/crates/prover_types/src/lib.rs +++ b/stwo_cairo_prover/crates/prover_types/src/lib.rs @@ -1,3 +1,3 @@ -#![feature(portable_simd, array_methods)] +#![feature(portable_simd)] pub mod cpu; pub mod simd; diff --git a/stwo_cairo_prover/crates/prover_types/src/simd.rs b/stwo_cairo_prover/crates/prover_types/src/simd.rs index 54fe1936..5c548252 100644 --- a/stwo_cairo_prover/crates/prover_types/src/simd.rs +++ b/stwo_cairo_prover/crates/prover_types/src/simd.rs @@ -49,7 +49,7 @@ impl PackedUInt16 { // Safe because UInt16 is u16. unsafe { Self { - value: Simd::from_array(transmute(arr)), + value: Simd::from_array(transmute::<[UInt16; 16], [u16; 16]>(arr)), } } } @@ -151,7 +151,7 @@ impl PackedUInt32 { // Safe because UInt32 is u32. unsafe { Self { - simd: Simd::from_array(transmute(arr)), + simd: Simd::from_array(transmute::<[UInt32; 16], [u32; 16]>(arr)), } } } @@ -279,7 +279,7 @@ impl PackedUInt64 { // Safe because UInt64is u64. unsafe { Self { - value: Simd::from_array(transmute(arr)), + value: Simd::from_array(transmute::<[UInt64; 16], [u64; 16]>(arr)), } } } diff --git a/stwo_cairo_prover/rust-toolchain.toml b/stwo_cairo_prover/rust-toolchain.toml index a0f1a930..d39ac9e3 100644 --- a/stwo_cairo_prover/rust-toolchain.toml +++ b/stwo_cairo_prover/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly-2024-01-04" +channel = "nightly-2024-12-16" diff --git a/stwo_cairo_prover/scripts/clippy.sh b/stwo_cairo_prover/scripts/clippy.sh index 14a78448..e07a192c 100755 --- a/stwo_cairo_prover/scripts/clippy.sh +++ b/stwo_cairo_prover/scripts/clippy.sh @@ -1,4 +1,4 @@ #!/bin/bash -cargo +nightly-2024-01-04 clippy "$@" --all-targets --all-features -- -D warnings \ +cargo clippy "$@" --all-targets --all-features -- -D warnings \ -D future-incompatible -D nonstandard-style -D rust-2018-idioms -D unused diff --git a/stwo_cairo_prover/scripts/rust_fmt.sh b/stwo_cairo_prover/scripts/rust_fmt.sh index e4223f99..f30a5181 100755 --- a/stwo_cairo_prover/scripts/rust_fmt.sh +++ b/stwo_cairo_prover/scripts/rust_fmt.sh @@ -1,3 +1,3 @@ #!/bin/bash -cargo +nightly-2024-01-04 fmt --all -- "$@" +cargo fmt --all -- "$@"