diff --git a/Cargo.lock b/Cargo.lock index 0491c040..9c763340 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3859,7 +3859,7 @@ dependencies = [ [[package]] name = "papyrus_common" version = "0.4.0-dev.2" -source = "git+https://github.com/starkware-libs/papyrus.git?rev=050e470f#050e470f44b336292c4edea148622f165c3128fa" +source = "git+https://github.com/starkware-libs/papyrus.git?rev=56c6fdc2#56c6fdc2851ab1c60663a679f8b75a28cd0f954e" dependencies = [ "bitvec", "cairo-lang-starknet-classes", @@ -3876,7 +3876,7 @@ dependencies = [ [[package]] name = "papyrus_config" version = "0.4.0-dev.2" -source = "git+https://github.com/starkware-libs/papyrus.git?rev=050e470f#050e470f44b336292c4edea148622f165c3128fa" +source = "git+https://github.com/starkware-libs/papyrus.git?rev=56c6fdc2#56c6fdc2851ab1c60663a679f8b75a28cd0f954e" dependencies = [ "clap", "itertools 0.10.5", @@ -3890,7 +3890,7 @@ dependencies = [ [[package]] name = "papyrus_execution" version = "0.4.0-dev.2" -source = "git+https://github.com/starkware-libs/papyrus.git?rev=050e470f#050e470f44b336292c4edea148622f165c3128fa" +source = "git+https://github.com/starkware-libs/papyrus.git?rev=56c6fdc2#56c6fdc2851ab1c60663a679f8b75a28cd0f954e" dependencies = [ "anyhow", "blockifier 0.7.0-dev.1 (git+https://github.com/starkware-libs/blockifier.git?rev=6babc28a)", @@ -3913,7 +3913,7 @@ dependencies = [ [[package]] name = "papyrus_proc_macros" version = "0.4.0-dev.2" -source = "git+https://github.com/starkware-libs/papyrus.git?rev=050e470f#050e470f44b336292c4edea148622f165c3128fa" +source = "git+https://github.com/starkware-libs/papyrus.git?rev=56c6fdc2#56c6fdc2851ab1c60663a679f8b75a28cd0f954e" dependencies = [ "quote", "syn 2.0.66", @@ -3922,7 +3922,7 @@ dependencies = [ [[package]] name = "papyrus_rpc" version = "0.4.0-dev.2" -source = "git+https://github.com/starkware-libs/papyrus.git?rev=050e470f#050e470f44b336292c4edea148622f165c3128fa" +source = "git+https://github.com/starkware-libs/papyrus.git?rev=56c6fdc2#56c6fdc2851ab1c60663a679f8b75a28cd0f954e" dependencies = [ "anyhow", "async-trait", @@ -3959,7 +3959,7 @@ dependencies = [ [[package]] name = "papyrus_storage" version = "0.4.0-dev.2" -source = "git+https://github.com/starkware-libs/papyrus.git?rev=050e470f#050e470f44b336292c4edea148622f165c3128fa" +source = "git+https://github.com/starkware-libs/papyrus.git?rev=56c6fdc2#56c6fdc2851ab1c60663a679f8b75a28cd0f954e" dependencies = [ "byteorder", "cairo-lang-casm", @@ -5461,7 +5461,7 @@ dependencies = [ [[package]] name = "starknet_client" version = "0.4.0-dev.2" -source = "git+https://github.com/starkware-libs/papyrus.git?rev=050e470f#050e470f44b336292c4edea148622f165c3128fa" +source = "git+https://github.com/starkware-libs/papyrus.git?rev=56c6fdc2#56c6fdc2851ab1c60663a679f8b75a28cd0f954e" dependencies = [ "async-trait", "cairo-lang-starknet-classes", @@ -5495,6 +5495,7 @@ dependencies = [ "cairo-vm", "hyper", "papyrus_config", + "papyrus_rpc", "pretty_assertions", "reqwest", "rstest", diff --git a/Cargo.toml b/Cargo.toml index 63e2a21d..12cf0061 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,10 +56,10 @@ lazy_static = "1.4.0" num-bigint = { version = "0.4.5", default-features = false } # TODO(YaelD, 28/5/2024): The special Papyrus version is needed in order to be aligned with the # starknet-api version. This should be removed once we have a mono-repo. -papyrus_common = { git = "https://github.com/starkware-libs/papyrus.git", rev = "050e470f" } -papyrus_config = { git = "https://github.com/starkware-libs/papyrus.git", rev = "050e470f" } -papyrus_rpc = { git = "https://github.com/starkware-libs/papyrus.git", rev = "050e470f" } -papyrus_storage = { git = "https://github.com/starkware-libs/papyrus.git", rev = "050e470f" } +papyrus_common = { git = "https://github.com/starkware-libs/papyrus.git", rev = "56c6fdc2" } +papyrus_config = { git = "https://github.com/starkware-libs/papyrus.git", rev = "56c6fdc2" } +papyrus_rpc = { git = "https://github.com/starkware-libs/papyrus.git", rev = "56c6fdc2" } +papyrus_storage = { git = "https://github.com/starkware-libs/papyrus.git", rev = "56c6fdc2" } pretty_assertions = "1.4.0" prost = "0.12.6" reqwest = { version = "0.11", features = ["blocking", "json"] } @@ -70,7 +70,7 @@ serde_json = "1.0" starknet_api = { git = "https://github.com/starkware-libs/starknet-api.git", branch = "main-mempool" } # TODO(YaelD, 28/5/2024): The special Papyrus version is needed in order to be aligned with the # starknet-api version. This should be removed once we have a mono-repo. -starknet_client = { git = "https://github.com/starkware-libs/papyrus.git", rev = "050e470f" } +starknet_client = { git = "https://github.com/starkware-libs/papyrus.git", rev = "56c6fdc2" } strum = "0.24.1" tempfile = "3.3.0" thiserror = "1.0" diff --git a/crates/gateway/Cargo.toml b/crates/gateway/Cargo.toml index c9514273..6bd13311 100644 --- a/crates/gateway/Cargo.toml +++ b/crates/gateway/Cargo.toml @@ -19,6 +19,7 @@ cairo-lang-starknet-classes.workspace = true cairo-vm.workspace = true hyper.workspace = true papyrus_config.workspace = true +papyrus_rpc.workspace = true reqwest.workspace = true serde.workspace = true serde_json.workspace = true diff --git a/crates/gateway/src/rpc_state_reader.rs b/crates/gateway/src/rpc_state_reader.rs index 5ddcc74b..53ee2caa 100644 --- a/crates/gateway/src/rpc_state_reader.rs +++ b/crates/gateway/src/rpc_state_reader.rs @@ -2,13 +2,12 @@ use blockifier::blockifier::block::BlockInfo; use blockifier::execution::contract_class::{ContractClass, ContractClassV0, ContractClassV1}; use blockifier::state::errors::StateError; use blockifier::state::state_api::{StateReader as BlockifierStateReader, StateResult}; -use cairo_lang_starknet_classes::casm_contract_class::CasmContractClass; +use papyrus_rpc::CompiledContractClass; use reqwest::blocking::Client as BlockingClient; -use serde::{Deserialize, Serialize}; +use serde::Serialize; use serde_json::{json, Value}; use starknet_api::block::BlockNumber; use starknet_api::core::{ClassHash, CompiledClassHash, ContractAddress, Nonce}; -use starknet_api::deprecated_contract_class::ContractClass as StarknetApiDeprecatedContractClass; use starknet_api::hash::StarkFelt; use starknet_api::state::StorageKey; @@ -157,13 +156,6 @@ impl BlockifierStateReader for RpcStateReader { } } -// TODO(yael 19/6/2024): make this object public in papyrus and remove it from here. -#[derive(Debug, Clone, Deserialize, Serialize, Eq, PartialEq)] -pub enum CompiledContractClass { - V0(StarknetApiDeprecatedContractClass), - V1(CasmContractClass), -} - pub struct RpcStateReaderFactory { pub config: RpcStateReaderConfig, }