diff --git a/CHANGELOG.md b/CHANGELOG.md index a0f217250f..a7fa59f552 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ #### Upcoming Changes +* fix: Fix compilation of cairo-1-run and cairo-vm on wasm32 [#1792](https://github.com/lambdaclass/cairo-vm/pull/1792) + * fix: Remove validation of CairoPie memory values [#1783](https://github.com/lambdaclass/cairo-vm/pull/1783) * fix: Handle `GasBuiltin` in cairo1-run crate [#1789](https://github.com/lambdaclass/cairo-vm/pull/1789) diff --git a/cairo1-run/src/cairo_run.rs b/cairo1-run/src/cairo_run.rs index 52a5ea2676..de1bfcdbc8 100644 --- a/cairo1-run/src/cairo_run.rs +++ b/cairo1-run/src/cairo_run.rs @@ -141,7 +141,7 @@ pub fn cairo_run_program( let main_func = find_function(sierra_program, "::main")?; - let initial_gas = 9999999999999_usize; + let initial_gas = 9999999999999_u64; // Fetch return type data let return_type_id = match main_func.signature.ret_types.last() { @@ -453,7 +453,7 @@ fn load_arguments( runner: &mut CairoRunner, cairo_run_config: &Cairo1RunConfig, main_func: &Function, - initial_gas: usize, + initial_gas: u64, ) -> Result<(), Error> { let got_gas_builtin = main_func .signature diff --git a/vm/Cargo.toml b/vm/Cargo.toml index b5ee76dc53..eb487e9631 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 } @@ -67,8 +67,6 @@ bitvec = { workspace = true } cairo-lang-starknet = { workspace = true, optional = true } cairo-lang-starknet-classes = { workspace = true, optional = true } cairo-lang-casm = { workspace = true, optional = true } - -# TODO: check these dependencies for wasm compatibility ark-ff = { workspace = true, optional = true } ark-std = { workspace = true, optional = true } diff --git a/vm/src/lib.rs b/vm/src/lib.rs index 5d78058f13..8ab07dbd86 100644 --- a/vm/src/lib.rs +++ b/vm/src/lib.rs @@ -12,7 +12,7 @@ #![cfg_attr(docsrs, feature(doc_cfg))] #![deny(warnings)] #![forbid(unsafe_code)] -#![cfg_attr(any(target_arch = "wasm32", not(feature = "std")), no_std)] +#![cfg_attr(any(not(feature = "std")), no_std)] #[cfg(feature = "std")] include!("./with_std.rs"); diff --git a/vm/src/vm/runners/cairo_pie.rs b/vm/src/vm/runners/cairo_pie.rs index 371b6de82f..317cd406f3 100644 --- a/vm/src/vm/runners/cairo_pie.rs +++ b/vm/src/vm/runners/cairo_pie.rs @@ -373,7 +373,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(no_std, not(feature = "std")))] use crate::alloc::string::ToString; use crate::stdlib::prelude::{String, Vec}; use crate::{