diff --git a/Cargo.lock b/Cargo.lock index b199f66070..e60518192f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3717,28 +3717,6 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD -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]] -||||||| 73c3821e -======= name = "tikv-jemalloc-sys" version = "0.5.4+5.3.0-patched" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3759,7 +3737,25 @@ dependencies = [ ] [[package]] ->>>>>>> origin/main +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" source = "registry+https://github.com/rust-lang/crates.io-index" diff --git a/crates/blockifier/Cargo.toml b/crates/blockifier/Cargo.toml index dcccf4e104..bf35900c7f 100644 --- a/crates/blockifier/Cargo.toml +++ b/crates/blockifier/Cargo.toml @@ -11,13 +11,8 @@ workspace = true [features] concurrency = [] -<<<<<<< HEAD -testing = ["rand", "rstest"] -||||||| 73c3821e -======= jemalloc = ["dep:tikv-jemallocator"] testing = ["rand", "rstest"] ->>>>>>> origin/main # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -49,15 +44,8 @@ rstest = { workspace = true, optional = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true, features = ["arbitrary_precision"] } sha2.workspace = true -<<<<<<< HEAD sha3.workspace = true starknet-types-core.workspace = true -||||||| 73c3821e -starknet-crypto.workspace = true -======= -sha3.workspace = true -starknet-crypto.workspace = true ->>>>>>> origin/main starknet_api = { workspace = true, features = ["testing"] } strum.workspace = true strum_macros.workspace = true @@ -76,16 +64,5 @@ test-case.workspace = true [[bench]] harness = false -<<<<<<< HEAD -name = "blockifier_bench" -path = "bench/blockifier_bench.rs" -required-features = ["testing"] - -[[test]] -name = "feature_contracts_compatibility_test" -required-features = ["testing"] -||||||| 73c3821e -======= name = "blockifier_bench" path = "bench/blockifier_bench.rs" ->>>>>>> origin/main diff --git a/crates/blockifier/src/execution/call_info.rs b/crates/blockifier/src/execution/call_info.rs index ca7e1b27c2..1efef68115 100644 --- a/crates/blockifier/src/execution/call_info.rs +++ b/crates/blockifier/src/execution/call_info.rs @@ -1,10 +1,9 @@ -use std::collections::{HashMap, HashSet}; +use std::collections::HashSet; use std::iter::Sum; use std::ops::Add; -use cairo_vm::types::builtin_name::BuiltinName; use cairo_vm::vm::runners::cairo_runner::ExecutionResources; -use serde::{Deserialize, Serialize}; +use serde::Serialize; use starknet_api::core::{ClassHash, ContractAddress, EthAddress, PatriciaKey}; use starknet_api::state::StorageKey; use starknet_api::transaction::{EventContent, L2ToL1Payload}; @@ -84,54 +83,6 @@ pub struct CallExecution { pub gas_consumed: u64, } -// TODO(Dori, 1/1/2025): If and when cairo_vm::types::builtin_name::serde_generic_map_impl is -// public, remove this inline-module and use the cairo_vm's implementation. -pub(crate) mod serialize_builtin_map { - use std::collections::HashMap; - - use cairo_vm::types::builtin_name::BuiltinName; - use serde::de::Error; - use serde::ser::SerializeMap; - use serde::{Deserialize, Deserializer, Serialize, Serializer}; - - pub fn serialize( - values: &HashMap, - serializer: S, - ) -> Result - where - S: Serializer, - V: Serialize, - { - let mut map_serializer = serializer.serialize_map(Some(values.len()))?; - for (key, val) in values { - map_serializer.serialize_entry(key.to_str_with_suffix(), val)? - } - map_serializer.end() - } - - pub fn deserialize<'de, D: Deserializer<'de>, V: Deserialize<'de>>( - d: D, - ) -> Result, D::Error> { - // First deserialize keys into String - let map = HashMap::::deserialize(d)?; - // Then match keys to BuiltinName and handle invalid names - map.into_iter() - .map(|(k, v)| BuiltinName::from_str_with_suffix(&k).map(|k| (k, v))) - .collect::>>() - .ok_or(D::Error::custom("Invalid builtin name")) - } -} - -// This struct is used to implement `serde` functionality in a remote `ExecutionResources` Struct. -#[derive(Debug, Default, Deserialize, derive_more::From, Eq, PartialEq, Serialize)] -#[serde(remote = "ExecutionResources")] -struct ExecutionResourcesDef { - n_steps: usize, - n_memory_holes: usize, - #[serde(with = "serialize_builtin_map")] - builtin_instance_counter: HashMap, -} - #[derive(Default)] pub struct ExecutionSummary { pub executed_class_hashes: HashSet, @@ -215,7 +166,6 @@ impl TestExecutionSummary { pub struct CallInfo { pub call: CallEntryPoint, pub execution: CallExecution, - #[serde(with = "ExecutionResourcesDef")] pub resources: ExecutionResources, pub inner_calls: Vec, diff --git a/crates/blockifier/src/execution/entry_point_test.rs b/crates/blockifier/src/execution/entry_point_test.rs index 9cc132788d..468be488c7 100644 --- a/crates/blockifier/src/execution/entry_point_test.rs +++ b/crates/blockifier/src/execution/entry_point_test.rs @@ -384,9 +384,7 @@ fn test_syscall_execution_security_failures() { run_security_test( state, security_contract, - "Requested contract address ContractAddress(PatriciaKey(Felt(FieldElement { value: \ - UnsignedInteger { limbs: [576460752303410992, 18446744073709551615, \ - 18446744073709551615, 18446744073709550881] } }))) is not deployed", + "Requested contract address 0x17 is not deployed", "test_bad_call_address", calldata![], );