diff --git a/Cargo.lock b/Cargo.lock index 4f6e6bda02..bc123b3f74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15,14 +15,14 @@ dependencies = [ [[package]] name = "account_sdk" version = "0.1.0" -source = "git+https://github.com/cartridge-gg/controller?rev=146048fc#146048fcd911749b8ce1f0ea51b2e6b2512fcc9f" +source = "git+https://github.com/cartridge-gg/controller?rev=0b5c318#0b5c318f233c6a1af4f4e781c060c46dab97334e" dependencies = [ "anyhow", "async-trait", "auto_impl", "base64 0.22.1", "base64urlsafedata", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?rev=fb91215)", + "cainome", "coset", "ecdsa", "futures", @@ -2172,31 +2172,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" -[[package]] -name = "cainome" -version = "0.2.3" -source = "git+https://github.com/cartridge-gg/cainome?branch=main#fb9121566c6b4ba864984fbac2819725d17b3f74" -dependencies = [ - "anyhow", - "async-trait", - "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?branch=main)", - "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?branch=main)", - "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?branch=main)", - "cainome-rs-macro 0.1.0 (git+https://github.com/cartridge-gg/cainome?branch=main)", - "camino", - "clap", - "clap_complete", - "convert_case 0.6.0", - "serde", - "serde_json", - "starknet 0.11.0", - "starknet-types-core", - "thiserror", - "tracing", - "tracing-subscriber", - "url", -] - [[package]] name = "cainome" version = "0.2.3" @@ -2204,10 +2179,10 @@ source = "git+https://github.com/cartridge-gg/cainome?rev=fb91215#fb9121566c6b4b dependencies = [ "anyhow", "async-trait", - "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=fb91215)", - "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=fb91215)", - "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=fb91215)", - "cainome-rs-macro 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=fb91215)", + "cainome-cairo-serde", + "cainome-parser", + "cainome-rs", + "cainome-rs-macro", "camino", "clap", "clap_complete", @@ -2222,16 +2197,6 @@ dependencies = [ "url", ] -[[package]] -name = "cainome-cairo-serde" -version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?branch=main#fb9121566c6b4ba864984fbac2819725d17b3f74" -dependencies = [ - "serde", - "starknet 0.11.0", - "thiserror", -] - [[package]] name = "cainome-cairo-serde" version = "0.1.0" @@ -2242,19 +2207,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "cainome-parser" -version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?branch=main#fb9121566c6b4ba864984fbac2819725d17b3f74" -dependencies = [ - "convert_case 0.6.0", - "quote", - "serde_json", - "starknet 0.11.0", - "syn 2.0.71", - "thiserror", -] - [[package]] name = "cainome-parser" version = "0.1.0" @@ -2268,32 +2220,14 @@ dependencies = [ "thiserror", ] -[[package]] -name = "cainome-rs" -version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?branch=main#fb9121566c6b4ba864984fbac2819725d17b3f74" -dependencies = [ - "anyhow", - "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?branch=main)", - "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?branch=main)", - "camino", - "prettyplease 0.2.20", - "proc-macro2", - "quote", - "serde_json", - "starknet 0.11.0", - "syn 2.0.71", - "thiserror", -] - [[package]] name = "cainome-rs" version = "0.1.0" source = "git+https://github.com/cartridge-gg/cainome?rev=fb91215#fb9121566c6b4ba864984fbac2819725d17b3f74" dependencies = [ "anyhow", - "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=fb91215)", - "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=fb91215)", + "cainome-cairo-serde", + "cainome-parser", "camino", "prettyplease 0.2.20", "proc-macro2", @@ -2304,32 +2238,15 @@ dependencies = [ "thiserror", ] -[[package]] -name = "cainome-rs-macro" -version = "0.1.0" -source = "git+https://github.com/cartridge-gg/cainome?branch=main#fb9121566c6b4ba864984fbac2819725d17b3f74" -dependencies = [ - "anyhow", - "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?branch=main)", - "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?branch=main)", - "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?branch=main)", - "proc-macro2", - "quote", - "serde_json", - "starknet 0.11.0", - "syn 2.0.71", - "thiserror", -] - [[package]] name = "cainome-rs-macro" version = "0.1.0" source = "git+https://github.com/cartridge-gg/cainome?rev=fb91215#fb9121566c6b4ba864984fbac2819725d17b3f74" dependencies = [ "anyhow", - "cainome-cairo-serde 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=fb91215)", - "cainome-parser 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=fb91215)", - "cainome-rs 0.1.0 (git+https://github.com/cartridge-gg/cainome?rev=fb91215)", + "cainome-cairo-serde", + "cainome-parser", + "cainome-rs", "proc-macro2", "quote", "serde_json", @@ -4365,7 +4282,7 @@ version = "1.0.0-alpha.5" dependencies = [ "assert_matches", "async-trait", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?branch=main)", + "cainome", "camino", "chrono", "convert_case 0.6.0", @@ -4393,7 +4310,7 @@ version = "1.0.0-alpha.5" dependencies = [ "anyhow", "assert_fs", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?branch=main)", + "cainome", "cairo-lang-compiler", "cairo-lang-debug", "cairo-lang-defs", @@ -4510,7 +4427,7 @@ dependencies = [ name = "dojo-types" version = "1.0.0-alpha.5" dependencies = [ - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?branch=main)", + "cainome", "crypto-bigint", "hex", "itertools 0.12.1", @@ -4531,7 +4448,7 @@ dependencies = [ "assert_fs", "assert_matches", "async-trait", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?branch=main)", + "cainome", "cairo-lang-filesystem", "cairo-lang-project", "cairo-lang-starknet", @@ -8008,7 +7925,7 @@ dependencies = [ "alloy-primitives", "anyhow", "assert_matches", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?branch=main)", + "cainome", "dojo-metrics", "dojo-test-utils", "dojo-world", @@ -12747,7 +12664,7 @@ dependencies = [ [[package]] name = "slot" version = "0.8.0" -source = "git+https://github.com/cartridge-gg/slot?rev=84602647#8460264748a9b6f698660915d351a682b2f5cef8" +source = "git+https://github.com/cartridge-gg/slot?rev=a95f01e75f20a7902e23859614992e306c06a18b#a95f01e75f20a7902e23859614992e306c06a18b" dependencies = [ "account_sdk", "anyhow", @@ -12869,7 +12786,7 @@ dependencies = [ "assert_fs", "async-trait", "bigdecimal 0.4.5", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?branch=main)", + "cainome", "cairo-lang-compiler", "cairo-lang-defs", "cairo-lang-filesystem", @@ -12931,7 +12848,7 @@ dependencies = [ "assert_fs", "async-trait", "bigdecimal 0.4.5", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?branch=main)", + "cainome", "cairo-lang-compiler", "cairo-lang-defs", "cairo-lang-filesystem", @@ -14548,7 +14465,7 @@ dependencies = [ "anyhow", "async-trait", "base64 0.21.7", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?branch=main)", + "cainome", "camino", "chrono", "crypto-bigint", @@ -14590,7 +14507,7 @@ dependencies = [ "async-recursion", "async-trait", "base64 0.21.7", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?branch=main)", + "cainome", "camino", "chrono", "convert_case 0.6.0", @@ -14627,7 +14544,7 @@ name = "torii-grpc" version = "1.0.0-alpha.5" dependencies = [ "bytes", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?branch=main)", + "cainome", "camino", "crypto-bigint", "dojo-test-utils", @@ -14675,7 +14592,7 @@ version = "1.0.0-alpha.5" dependencies = [ "anyhow", "async-trait", - "cainome 0.2.3 (git+https://github.com/cartridge-gg/cainome?branch=main)", + "cainome", "chrono", "crypto-bigint", "dojo-test-utils", diff --git a/Cargo.toml b/Cargo.toml index 9daa68aae6..40c014e758 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,8 +60,7 @@ inherits = "release" lto = "fat" [workspace.dependencies] -# cainome = { git = "https://github.com/cartridge-gg/cainome", tag = "v0.3.2", features = [ "abigen-rs" ] } -cainome = { git = "https://github.com/cartridge-gg/cainome", branch = "main", features = [ "abigen-rs" ] } +cainome = { git = "https://github.com/cartridge-gg/cainome", rev = "fb91215", features = [ "abigen-rs" ] } common = { path = "crates/common" } # metrics @@ -224,10 +223,15 @@ alloy-sol-types = { version = "0.7.6", default-features = false } criterion = "0.5.1" # Controller integration -account_sdk = { git = "https://github.com/cartridge-gg/controller", rev = "146048fc" } -slot = { git = "https://github.com/cartridge-gg/slot", rev = "84602647" } -# account_sdk = { path = "../../cartridge/controller/packages/account_sdk" } -# slot = { path = "../../cartridge/slot/slot" } +# +# IMPORTANT: +# +# Maintainer must ensure that the Controller (account_sdk) revision is the same across Dojo, +# and Slot because of the dependency chain and also because account_sdk is not being versioned +# yet atm. Dojo depends on Slot and Slot depends on Controller, the version of Controller (account_sdk) +# must be the same across all stack as their API are being used against each other. +account_sdk = { git = "https://github.com/cartridge-gg/controller", rev = "0b5c318" } +slot = { git = "https://github.com/cartridge-gg/slot", rev = "a95f01e75f20a7902e23859614992e306c06a18b" } alloy-contract = { version = "0.2", default-features = false } alloy-json-rpc = { version = "0.2", default-features = false } diff --git a/bin/sozo/src/commands/options/account/controller.rs b/bin/sozo/src/commands/options/account/controller.rs index e139481a49..75779f0e1f 100644 --- a/bin/sozo/src/commands/options/account/controller.rs +++ b/bin/sozo/src/commands/options/account/controller.rs @@ -75,7 +75,7 @@ where let policies = collect_policies(world_addr_or_name, contract_address, config)?; // check if the policies have changed - let is_equal = is_equal_to_existing(&policies, rpc_url.clone(), chain_id, session); + let is_equal = is_equal_to_existing(&policies, &session); if is_equal { session @@ -86,7 +86,7 @@ where "Policies have changed. Creating new session." ); - let session = slot::session::create(rpc_url, &policies).await?; + let session = slot::session::create(rpc_url.clone(), &policies).await?; slot::session::store(chain_id, &session)?; session } @@ -125,12 +125,7 @@ where } // Check if the new policies are equal to the ones in the existing session -async fn is_equal_to_existing( - new_policies: &[Policy], - rpc_url: Url, - chain_id: Felt, - session: SessionMetadata, -) -> bool { +fn is_equal_to_existing(new_policies: &[Policy], session: &SessionMetadata) -> bool { let allowed_methods = new_policies .iter() .map(|p| AllowedMethod::new(p.target, get_selector_from_name(&p.method).unwrap())) diff --git a/bin/sozo/src/commands/options/account/type.rs b/bin/sozo/src/commands/options/account/type.rs index 153baa2969..d9db48243d 100644 --- a/bin/sozo/src/commands/options/account/type.rs +++ b/bin/sozo/src/commands/options/account/type.rs @@ -33,7 +33,7 @@ pub enum SozoAccountSignError { #[allow(missing_debug_implementations)] pub enum SozoAccount

where - P: Provider, + P: Provider + Send + Sync, { Standard(SingleOwnerAccount), diff --git a/crates/katana/core/src/service/messaging/starknet.rs b/crates/katana/core/src/service/messaging/starknet.rs index d99406058b..cf98b58a5f 100644 --- a/crates/katana/core/src/service/messaging/starknet.rs +++ b/crates/katana/core/src/service/messaging/starknet.rs @@ -7,8 +7,8 @@ use katana_primitives::chain::ChainId; use katana_primitives::receipt::MessageToL1; use katana_primitives::transaction::L1HandlerTx; use katana_primitives::utils::transaction::compute_l2_to_l1_message_hash; -use starknet::accounts::{Account, Call, ExecutionEncoding, SingleOwnerAccount}; -use starknet::core::types::{BlockId, BlockTag, EmittedEvent, EventFilter, Felt}; +use starknet::accounts::{Account, ExecutionEncoding, SingleOwnerAccount}; +use starknet::core::types::{BlockId, BlockTag, Call, EmittedEvent, EventFilter, Felt}; use starknet::core::utils::starknet_keccak; use starknet::macros::{felt, selector}; use starknet::providers::jsonrpc::HttpTransport;