From 5eac6d18af3921cc2f3c965ef37e55fba2e04249 Mon Sep 17 00:00:00 2001 From: Kariy Date: Fri, 9 Feb 2024 08:37:46 +0800 Subject: [PATCH] fix --- Cargo.lock | 6 +++--- Cargo.toml | 10 +++++----- crates/katana/primitives/src/conversion/rpc.rs | 10 ++++++---- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 07652c74cd..4125bbc871 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1110,7 +1110,7 @@ dependencies = [ [[package]] name = "blockifier" version = "0.5.0-dev.0" -source = "git+https://github.com/dojoengine/blockifier?rev=3c138d606a46c88ecd656808f14dfca78de1926b#3c138d606a46c88ecd656808f14dfca78de1926b" +source = "git+https://github.com/dojoengine/blockifier?rev=8860946#886094680ea5ead4ba1227f46172e02468901488" dependencies = [ "ark-ec", "ark-ff 0.4.2", @@ -1424,7 +1424,7 @@ dependencies = [ [[package]] name = "cairo-felt" version = "0.9.1" -source = "git+https://github.com/dojoengine/cairo-rs.git?rev=368c713f8545af435b1b0a8d3e56b616f66f955a#368c713f8545af435b1b0a8d3e56b616f66f955a" +source = "git+https://github.com/dojoengine/cairo-rs.git?rev=1031381#10313816b4ba7891e3c8ba90f6d0068a9149d682" dependencies = [ "lazy_static", "num-bigint", @@ -1982,7 +1982,7 @@ dependencies = [ [[package]] name = "cairo-vm" version = "0.9.2" -source = "git+https://github.com/dojoengine/cairo-rs.git?rev=368c713f8545af435b1b0a8d3e56b616f66f955a#368c713f8545af435b1b0a8d3e56b616f66f955a" +source = "git+https://github.com/dojoengine/cairo-rs.git?rev=1031381#10313816b4ba7891e3c8ba90f6d0068a9149d682" dependencies = [ "anyhow", "bincode 2.0.0-rc.3", diff --git a/Cargo.toml b/Cargo.toml index dbcc1de220..406a8409bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,12 +23,12 @@ members = [ "crates/katana/rpc/rpc-api", "crates/katana/rpc/rpc-types", "crates/katana/rpc/rpc-types-builder", + "crates/katana/runner", + "crates/katana/runner/runner-macro", "crates/katana/storage/codecs", "crates/katana/storage/codecs/derive", "crates/katana/storage/db", "crates/katana/storage/provider", - "crates/katana/runner", - "crates/katana/runner/runner-macro", "crates/metrics", "crates/saya/core", "crates/sozo/signers", @@ -180,8 +180,8 @@ wasm-tonic = { version = "0.9.2", default-features = false, features = [ "codege wasm-tonic-build = { version = "0.9.2", default-features = false, features = [ "prost" ], package = "tonic-build" } [patch."https://github.com/starkware-libs/blockifier"] -blockifier = { git = "https://github.com/dojoengine/blockifier", rev = "3c138d606a46c88ecd656808f14dfca78de1926b" } +blockifier = { git = "https://github.com/dojoengine/blockifier", rev = "8860946" } [patch.crates-io] -cairo-felt = { git = "https://github.com/dojoengine/cairo-rs.git", rev = "368c713f8545af435b1b0a8d3e56b616f66f955a" } -cairo-vm = { git = "https://github.com/dojoengine/cairo-rs.git", rev = "368c713f8545af435b1b0a8d3e56b616f66f955a" } +cairo-felt = { git = "https://github.com/dojoengine/cairo-rs.git", rev = "1031381" } +cairo-vm = { git = "https://github.com/dojoengine/cairo-rs.git", rev = "1031381" } diff --git a/crates/katana/primitives/src/conversion/rpc.rs b/crates/katana/primitives/src/conversion/rpc.rs index a953e382f1..fcb286d5e0 100644 --- a/crates/katana/primitives/src/conversion/rpc.rs +++ b/crates/katana/primitives/src/conversion/rpc.rs @@ -7,7 +7,9 @@ use anyhow::{anyhow, Result}; use blockifier::execution::contract_class::ContractClassV0; use cairo_lang_starknet::casm_contract_class::CasmContractClass; use cairo_vm::felt::Felt252; -use cairo_vm::serde::deserialize_program::{ApTracking, OffsetValue, ProgramJson, ValueAddress}; +use cairo_vm::serde::deserialize_program::{ + serialize_program_data, ApTracking, OffsetValue, ProgramJson, ValueAddress, +}; use cairo_vm::types::instruction::Register; use cairo_vm::types::program::Program; use serde::{Deserialize, Serialize, Serializer}; @@ -253,7 +255,7 @@ fn compress_legacy_program_data(legacy_program: Program) -> Result, io:: struct SerializableProgramJson { prime: String, builtins: Vec, - #[serde(deserialize_with = "deserialize_array_of_bigint_hex")] + #[serde(serialize_with = "serialize_program_data")] data: Vec, identifiers: HashMap, hints: BTreeMap>, @@ -270,9 +272,9 @@ fn compress_legacy_program_data(legacy_program: Program) -> Result, io:: let program: ProgramJson = ProgramJson::from(legacy_program); let program: SerializableProgramJson = unsafe { mem::transmute(program) }; - let buffer = serde_json::to_vec(&program)?; + let bytes = serde_json::to_vec(&program)?; let mut gzip_encoder = flate2::write::GzEncoder::new(Vec::new(), flate2::Compression::fast()); - Write::write_all(&mut gzip_encoder, &buffer)?; + Write::write_all(&mut gzip_encoder, &bytes)?; gzip_encoder.finish() }