diff --git a/.cargo/config.toml b/.cargo/config.toml index d392db9f43..8c731b6746 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -11,3 +11,6 @@ TABLEGEN_190_PREFIX = "/usr/lib/llvm-19/" # https://github.com/rust-lang/rust/issues/39915#issuecomment-618726211 [target.'cfg(all(target_os = "linux"))'] rustflags = ["-Clink-arg=-fuse-ld=lld"] + +[unstable] +bindeps = true diff --git a/.github/workflows/replay.yml b/.github/workflows/replay.yml index 21e0ad9ad5..6de40c0c75 100644 --- a/.github/workflows/replay.yml +++ b/.github/workflows/replay.yml @@ -18,7 +18,7 @@ jobs: with: # required to clone native as a git submodule submodules: recursive - - uses: dtolnay/rust-toolchain@1.82.0 + - uses: dtolnay/rust-toolchain@nightly with: components: clippy - uses: Swatinem/rust-cache@v2 @@ -35,7 +35,7 @@ jobs: - name: Run cargo clippy run: | cd crates/blockifier - cargo clippy --all-targets --all-features --no-deps + cargo +nightly clippy --all-targets --all-features --no-deps format: runs-on: ubuntu-latest diff --git a/.gitmodules b/.gitmodules index b7d50bab86..afa65774fc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "crates/blockifier/cairo_native"] path = crates/blockifier/cairo_native url = https://github.com/lambdaclass/cairo_native - rev = 6a4efafa26d6a0424dee593d2091206c6e9f428d + branch = runtime_artifact_dependency diff --git a/Cargo.lock b/Cargo.lock index 5538766a78..ac3104d0d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -93,9 +93,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "alloy-chains" -version = "0.1.53" +version = "0.1.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da226340862e036ab26336dc99ca85311c6b662267c1440e1733890fd688802c" +checksum = "d38fdd69239714d7625cda1e3730773a3c1a8719d506370eb17bb0103b7c2e15" dependencies = [ "alloy-primitives", "num_enum", @@ -2423,7 +2423,7 @@ dependencies = [ [[package]] name = "cairo-native" version = "0.2.6" -source = "git+https://github.com/lambdaclass/cairo_native.git?rev=6a4efafa26d6a0424dee593d2091206c6e9f428d#6a4efafa26d6a0424dee593d2091206c6e9f428d" +source = "git+https://github.com/lambdaclass/cairo_native.git?branch=runtime_artifact_dependency#3f100997317b2367682b1aeada4541c262313275" dependencies = [ "anyhow", "aquamarine", @@ -2467,7 +2467,7 @@ dependencies = [ "starknet-types-core", "stats_alloc", "tempfile", - "thiserror 2.0.9", + "thiserror 2.0.10", "tracing", "tracing-subscriber", "utf8_iter", @@ -2476,7 +2476,7 @@ dependencies = [ [[package]] name = "cairo-native-runtime" version = "0.2.6" -source = "git+https://github.com/lambdaclass/cairo_native.git?rev=6a4efafa26d6a0424dee593d2091206c6e9f428d#6a4efafa26d6a0424dee593d2091206c6e9f428d" +source = "git+https://github.com/lambdaclass/cairo_native.git?branch=runtime_artifact_dependency#3f100997317b2367682b1aeada4541c262313275" dependencies = [ "cairo-lang-sierra-gas", "itertools 0.13.0", @@ -8251,7 +8251,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 2.0.9", + "thiserror 2.0.10", "ucd-trie", ] @@ -8960,7 +8960,7 @@ dependencies = [ "rustc-hash 2.1.0", "rustls 0.23.20", "socket2 0.5.8", - "thiserror 2.0.9", + "thiserror 2.0.10", "tokio", "tracing", ] @@ -8979,7 +8979,7 @@ dependencies = [ "rustls 0.23.20", "rustls-pki-types", "slab", - "thiserror 2.0.9", + "thiserror 2.0.10", "tinyvec", "tracing", "web-time", @@ -10238,7 +10238,7 @@ dependencies = [ "starknet-curve 0.5.1", "starknet-types-core", "tempfile", - "thiserror 2.0.9", + "thiserror 2.0.10", "tracing", "tracing-subscriber", ] @@ -11508,11 +11508,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +checksum = "a3ac7f54ca534db81081ef1c1e7f6ea8a3ef428d2fc069097c079443d24124d3" dependencies = [ - "thiserror-impl 2.0.9", + "thiserror-impl 2.0.10", ] [[package]] @@ -11528,9 +11528,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" +checksum = "9e9465d30713b56a37ede7185763c3492a91be2f5fa68d958c44e41ab9248beb" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 70fe7665d0..c5dced561d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -102,7 +102,7 @@ cairo-lang-sierra-to-casm = "2.10.0-rc.0" cairo-lang-starknet-classes = "2.10.0-rc.0" cairo-lang-utils = "2.10.0-rc.0" # Important: when updated, make sure to update the cairo-native submodule as well. -cairo-native = { git = "https://github.com/lambdaclass/cairo_native.git", rev = "6a4efafa26d6a0424dee593d2091206c6e9f428d" } +cairo-native = { git = "https://github.com/lambdaclass/cairo_native.git", branch = "runtime_artifact_dependency" } sierra-emu = { git = "https://github.com/lambdaclass/sierra-emu.git", rev = "b3c9d6bd193b2da881fab3dce57fe12c363aed86" } cairo-vm = "=1.0.1" camelpaste = "0.1.0" diff --git a/crates/bin/starknet-native-compile/Cargo.toml b/crates/bin/starknet-native-compile/Cargo.toml index 697ba48a92..c2c73aef39 100644 --- a/crates/bin/starknet-native-compile/Cargo.toml +++ b/crates/bin/starknet-native-compile/Cargo.toml @@ -8,8 +8,8 @@ license = "Apache-2.0" [dependencies] # TODO(Avi, 01/02/2025): Check consistency with the blockifier. -cairo-lang-sierra = "2.9.2" -cairo-lang-starknet-classes = "2.9.2" +cairo-lang-sierra = "2.10.0-rc.0" +cairo-lang-starknet-classes = "2.10.0-rc.0" cairo-native = "0.2.4" clap = { version = "4.5.4", features = ["derive"] } serde_json = "1.0.116" diff --git a/crates/blockifier/build.rs b/crates/blockifier/build.rs index 552782168d..927c949c97 100644 --- a/crates/blockifier/build.rs +++ b/crates/blockifier/build.rs @@ -16,49 +16,6 @@ fn compile_cairo_native_aot_runtime() { cairo_native_dir.to_str().unwrap() ); } - - let runtime_target_dir = cairo_native_dir.join(PathBuf::from("target")); - let status = Command::new("cargo") - .args([ - "build", - "--release", - "-p", - "cairo-native-runtime", - "--message-format=json", - "--target-dir", - runtime_target_dir.to_str().unwrap(), - ]) - .current_dir(cairo_native_dir) - .status() - .expect("Failed to execute cargo"); - if !status.success() { - panic!("Building cairo native runtime failed: {status}") - } - - let runtime_target_path = - runtime_target_dir.join(PathBuf::from("release/libcairo_native_runtime.a")); - - const RUNTIME_LIBRARY: &str = "CAIRO_NATIVE_RUNTIME_LIBRARY"; - let runtime_expected_path = { - let expected_path_env = - std::env::var(RUNTIME_LIBRARY).expect("Cairo Native runtime path variable is not set"); - let expected_path = PathBuf::from(&expected_path_env); - - if expected_path.is_absolute() { - expected_path - } else { - current_dir().expect("Failed to get current directory").join(expected_path) - } - }; - - std::fs::copy(&runtime_target_path, &runtime_expected_path) - .expect("Failed to copy native runtime"); - - println!("cargo::rerun-if-changed=./cairo_native/runtime/"); - // todo(rodrigo): this directive seems to cause the build script to trigger everytime on - // Linux based machines. Investigate the issue further. - println!("cargo::rerun-if-changed={}", runtime_expected_path.to_str().unwrap()); - println!("cargo::rerun-if-env-changed={RUNTIME_LIBRARY}"); } fn main() { diff --git a/crates/blockifier/cairo_native b/crates/blockifier/cairo_native index 6a4efafa26..3f10099731 160000 --- a/crates/blockifier/cairo_native +++ b/crates/blockifier/cairo_native @@ -1 +1 @@ -Subproject commit 6a4efafa26d6a0424dee593d2091206c6e9f428d +Subproject commit 3f100997317b2367682b1aeada4541c262313275