diff --git a/parachain/primitives/src/identity.rs b/parachain/primitives/src/identity.rs index 136ebe3f3e..25e76c037d 100644 --- a/parachain/primitives/src/identity.rs +++ b/parachain/primitives/src/identity.rs @@ -81,6 +81,12 @@ impl IdentityString { } } +impl From<&str> for IdentityString { + fn from(value: &str) -> Self { + IdentityString::new(value.as_bytes().to_vec()) + } +} + impl Debug for IdentityString { fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { if_development_or!( @@ -624,43 +630,6 @@ impl Identity { pub fn hash(&self) -> H256 { self.using_encoded(blake2_256).into() } - - pub fn from_web2_account(handle: &str, identity_type: Web2IdentityType) -> Self { - match identity_type { - Web2IdentityType::Twitter => { - Identity::Twitter(IdentityString::new(handle.as_bytes().to_vec())) - }, - Web2IdentityType::Discord => { - Identity::Discord(IdentityString::new(handle.as_bytes().to_vec())) - }, - Web2IdentityType::Apple => { - Identity::Apple(IdentityString::new(handle.as_bytes().to_vec())) - }, - Web2IdentityType::Email => { - Identity::Email(IdentityString::new(handle.as_bytes().to_vec())) - }, - Web2IdentityType::Google => { - Identity::Google(IdentityString::new(handle.as_bytes().to_vec())) - }, - Web2IdentityType::Pumpx => { - Identity::Pumpx(IdentityString::new(handle.as_bytes().to_vec())) - }, - Web2IdentityType::Passkey => { - Identity::Passkey(IdentityString::new(handle.as_bytes().to_vec())) - }, - } - } -} - -#[derive(Clone, Debug, PartialEq, Eq)] -pub enum Web2IdentityType { - Twitter, - Discord, - Apple, - Email, - Google, - Pumpx, - Passkey, } impl From for Identity { diff --git a/tee-worker/identity/enclave-runtime/src/rpc/common_api.rs b/tee-worker/identity/enclave-runtime/src/rpc/common_api.rs index d388ec0456..b1d4a49641 100644 --- a/tee-worker/identity/enclave-runtime/src/rpc/common_api.rs +++ b/tee-worker/identity/enclave-runtime/src/rpc/common_api.rs @@ -33,7 +33,7 @@ use lc_identity_verification::{ }; use litentry_primitives::{ aes_decrypt, decode_hex, if_development, if_development_or, AesRequest, DecryptableRequest, - Identity, Web2IdentityType, + Identity, }; use log::debug; use sgx_crypto_helper::rsa3072::Rsa3072PubKey; @@ -468,8 +468,7 @@ pub fn add_common_api return Err(Error::LinkIdentityFailed(ErrorDetail::InvalidIdentity)), }; - let email_identity = - Identity::from_web2_account(&email, litentry_primitives::Web2IdentityType::Email); + let email_identity = Identity::Email(email.as_str().into()); let stored_verification_code = match VerificationCodeStore::get(&account_id, email_identity.hash()) { Ok(data) => data.ok_or_else(|| { diff --git a/tee-worker/identity/litentry/core/native-task/receiver/src/authentication_utils.rs b/tee-worker/identity/litentry/core/native-task/receiver/src/authentication_utils.rs index ffb4be5eda..6477382678 100644 --- a/tee-worker/identity/litentry/core/native-task/receiver/src/authentication_utils.rs +++ b/tee-worker/identity/litentry/core/native-task/receiver/src/authentication_utils.rs @@ -8,7 +8,7 @@ use lc_authentication::jwt; use lc_data_providers::{google::GoogleOAuth2Client, DataProviderConfig}; use lc_identity_verification::web2::{email::VerificationCodeStore, google}; use lc_omni_account::InMemoryStore as OmniAccountStore; -use litentry_primitives::{hex_encode, Identity, ShardIdentifier, Web2IdentityType}; +use litentry_primitives::{hex_encode, Identity, ShardIdentifier}; use sp_core::{blake2_256, crypto::AccountId32 as AccountId, H256}; #[derive(Encode, Decode, Clone, Debug, PartialEq, Eq)] @@ -134,7 +134,7 @@ fn verify_google_oauth2( })?; let claims = google::decode_jwt(&token) .map_err(|e| AuthenticationError::OAuth2Error(format!("Failed to decode JWT: {:?}", e)))?; - let google_identity = Identity::from_web2_account(&claims.email, Web2IdentityType::Google); + let google_identity = Identity::Google(claims.email.as_str().into()); let identity_omni_account = match OmniAccountStore::get_omni_account(google_identity.hash()) { Ok(Some(account_id)) => account_id, _ => google_identity.to_omni_account(DEFAULT_CLIENT_ID), diff --git a/tee-worker/omni-executor/Cargo.lock b/tee-worker/omni-executor/Cargo.lock index b2ef299461..214f58e2e8 100644 --- a/tee-worker/omni-executor/Cargo.lock +++ b/tee-worker/omni-executor/Cargo.lock @@ -19,6 +19,7 @@ dependencies = [ "alloy", "ciborium", "ethereum-rpc", + "executor-primitives", "heima-primitives", "mockall", "rand 0.8.5", @@ -162,9 +163,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "alloy" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae62e633fa48b4190af5e841eb05179841bb8b713945103291e2c0867037c0d1" +checksum = "e01db470290bb814e0485fa79aba6e36bb5d221c2e3cfeba5fba05a8a2ca8dad" dependencies = [ "alloy-consensus", "alloy-contract", @@ -187,9 +188,9 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f50c47cfcd3e788d87c6fc1166309794da0ebcbd2082cee50d9d072adc630f" +checksum = "6068f356948cd84b5ad9ac30c50478e433847f14a50714d2b68f15d052724049" dependencies = [ "alloy-primitives", "num_enum", @@ -198,9 +199,9 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b151e38e42f1586a01369ec52a6934702731d07e8509a7307331b09f6c46dc" +checksum = "90d103d3e440ad6f703dd71a5b58a6abd24834563bde8a5fabe706e00242f810" dependencies = [ "alloy-eips", "alloy-primitives", @@ -224,9 +225,9 @@ dependencies = [ [[package]] name = "alloy-consensus-any" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2d5e8668ef6215efdb7dcca6f22277b4e483a5650e05f5de22b2350971f4b8" +checksum = "48ead76c8c84ab3a50c31c56bc2c748c2d64357ad2131c32f9b10ab790a25e1a" dependencies = [ "alloy-consensus", "alloy-eips", @@ -238,9 +239,9 @@ dependencies = [ [[package]] name = "alloy-contract" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630288cf4f3a34a8c6bc75c03dce1dbd47833138f65f37d53a1661eafc96b83f" +checksum = "d5903097e4c131ad2dd80d87065f23c715ccb9cdb905fa169dffab8e1e798bae" dependencies = [ "alloy-consensus", "alloy-dyn-abi", @@ -302,32 +303,34 @@ dependencies = [ [[package]] name = "alloy-eip2930" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b82752a889170df67bbb36d42ca63c531eb16274f0d7299ae2a680facba17bd" +checksum = "9441120fa82df73e8959ae0e4ab8ade03de2aaae61be313fbf5746277847ce25" dependencies = [ "alloy-primitives", "alloy-rlp", + "borsh 1.5.7", "serde", ] [[package]] name = "alloy-eip7702" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d4769c6ffddca380b0070d71c8b7f30bed375543fe76bb2f74ec0acf4b7cd16" +checksum = "2919c5a56a1007492da313e7a3b6d45ef5edc5d33416fdec63c0d7a2702a0d20" dependencies = [ "alloy-primitives", "alloy-rlp", + "borsh 1.5.7", "serde", "thiserror 2.0.17", ] [[package]] name = "alloy-eips" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5434834adaf64fa20a6fb90877bc1d33214c41b055cc49f82189c98614368cc" +checksum = "7bdbec74583d0067798d77afa43d58f00d93035335d7ceaa5d3f93857d461bb9" dependencies = [ "alloy-eip2124", "alloy-eip2930", @@ -347,9 +350,9 @@ dependencies = [ [[package]] name = "alloy-genesis" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919a8471cfbed7bcd8cf1197a57dda583ce0e10c6385f6ff4e8b41304b223392" +checksum = "c25d5acb35706e683df1ea333c862bdb6b7c5548836607cd5bb56e501cca0b4f" dependencies = [ "alloy-eips", "alloy-primitives", @@ -386,9 +389,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c69f6c9c68a1287c9d5ff903d0010726934de0dac10989be37b75a29190d55" +checksum = "31b67c5a702121e618217f7a86f314918acb2622276d0273490e2d4534490bc0" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -401,9 +404,9 @@ dependencies = [ [[package]] name = "alloy-network" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf2ae05219e73e0979cb2cf55612aafbab191d130f203079805eaf881cca58" +checksum = "612296e6b723470bb1101420a73c63dfd535aa9bf738ce09951aedbd4ab7292e" dependencies = [ "alloy-consensus", "alloy-consensus-any", @@ -427,9 +430,9 @@ dependencies = [ [[package]] name = "alloy-network-primitives" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e58f4f345cef483eab7374f2b6056973c7419ffe8ad35e994b7a7f5d8e0c7ba4" +checksum = "a0e7918396eecd69d9c907046ec8a93fb09b89e2f325d5e7ea9c4e3929aa0dd2" dependencies = [ "alloy-consensus", "alloy-eips", @@ -440,9 +443,9 @@ dependencies = [ [[package]] name = "alloy-node-bindings" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61321a0dbc084c2c9f2b07aa34f10db7ac80065c01721e567e5426d882c73de6" +checksum = "0be31900cc96fede4dc888a100f3c28fa2d22093f8e09fb7992829ce886acc2f" dependencies = [ "alloy-genesis", "alloy-hardforks", @@ -488,9 +491,9 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de2597751539b1cc8fe4204e5325f9a9ed83fcacfb212018dfcfa7877e76de21" +checksum = "55c1313a527a2e464d067c031f3c2ec073754ef615cc0eabca702fd0fe35729c" dependencies = [ "alloy-chains", "alloy-consensus", @@ -546,14 +549,14 @@ checksum = "64b728d511962dda67c1bc7ea7c03736ec275ed2cf4c35d9585298ac9ccf3b73" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] name = "alloy-rpc-client" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edf8eb8be597cfa8c312934d2566ec4516f066d69164f9212d7a148979fdcfd8" +checksum = "45f802228273056528dfd6cc8845cc91a7c7e0c6fc1a66d19e8673743dacdc7e" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -574,9 +577,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339af7336571dd39ae3a15bde08ae6a647e62f75350bd415832640268af92c06" +checksum = "33ff3df608dcabd6bdd197827ff2b8faaa6cefe0c462f7dc5e74108666a01f56" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -586,9 +589,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-anvil" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83d98fb386a462e143f5efa64350860af39950c49e7c0cbdba419c16793116ef" +checksum = "ac2bc988d7455e02dfb53460e1caa61f932b3f8452e12424e68ba8dcf60bba90" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -598,9 +601,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-any" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbde0801a32d21c5f111f037bee7e22874836fba7add34ed4a6919932dd7cf23" +checksum = "cdbf6d1766ca41e90ac21c4bc5cbc5e9e965978a25873c3f90b3992d905db4cb" dependencies = [ "alloy-consensus-any", "alloy-rpc-types-eth", @@ -609,9 +612,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "361cd87ead4ba7659bda8127902eda92d17fa7ceb18aba1676f7be10f7222487" +checksum = "a15e4831b71eea9d20126a411c1c09facf1d01d5cac84fd51d532d3c429cfc26" dependencies = [ "alloy-consensus", "alloy-consensus-any", @@ -630,9 +633,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64600fc6c312b7e0ba76f73a381059af044f4f21f43e07f51f1fa76c868fe302" +checksum = "751d1887f7d202514a82c5b3caf28ee8bd4a2ad9549e4f498b6f0bff99b52add" dependencies = [ "alloy-primitives", "serde", @@ -641,9 +644,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5772858492b26f780468ae693405f895d6a27dea6e3eab2c36b6217de47c2647" +checksum = "9cf0b42ffbf558badfecf1dde0c3c5ed91f29bb7e97876d0bed008c3d5d67171" dependencies = [ "alloy-primitives", "async-trait", @@ -656,9 +659,9 @@ dependencies = [ [[package]] name = "alloy-signer-local" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4195b803d0a992d8dbaab2ca1986fc86533d4bc80967c0cce7668b26ad99ef9" +checksum = "3e7d555ee5f27be29af4ae312be014b57c6cff9acb23fe2cf008500be6ca7e33" dependencies = [ "alloy-consensus", "alloy-network", @@ -681,7 +684,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -698,7 +701,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", "syn-solidity", "tiny-keccak", ] @@ -717,7 +720,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.108", + "syn 2.0.110", "syn-solidity", ] @@ -745,12 +748,11 @@ dependencies = [ [[package]] name = "alloy-transport" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "025a940182bddaeb594c26fe3728525ae262d0806fe6a4befdf5d7bc13d54bce" +checksum = "71b3deee699d6f271eab587624a9fa84d02d0755db7a95a043d52a6488d16ebe" dependencies = [ "alloy-json-rpc", - "alloy-primitives", "auto_impl", "base64 0.22.1", "derive_more 2.0.1", @@ -769,9 +771,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5064d1e1e1aabc918b5954e7fb8154c39e77ec6903a581b973198b26628fa" +checksum = "1720bd2ba8fe7e65138aca43bb0f680e4e0bcbd3ca39bf9d3035c9d7d2757f24" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -800,15 +802,14 @@ dependencies = [ [[package]] name = "alloy-tx-macros" -version = "1.0.41" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8e52276fdb553d3c11563afad2898f4085165e4093604afe3d78b69afbf408f" +checksum = "cd7ce8ed34106acd6e21942022b6a15be6454c2c3ead4d76811d3bdcd63cf771" dependencies = [ - "alloy-primitives", "darling 0.21.3", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -1094,7 +1095,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -1233,7 +1234,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" dependencies = [ "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -1271,7 +1272,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -1450,9 +1451,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.32" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a89bce6054c720275ac2432fbba080a66a2106a44a1b804553930ca6909f4e0" +checksum = "93c1f86859c1af3d514fa19e8323147ff10ea98684e6c7b307912509f50e67b2" dependencies = [ "compression-codecs", "compression-core", @@ -1491,7 +1492,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -1502,7 +1503,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -1541,7 +1542,7 @@ checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -1705,7 +1706,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -1936,7 +1937,7 @@ dependencies = [ "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -2065,7 +2066,7 @@ checksum = "f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -2171,9 +2172,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.43" +version = "1.2.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "739eb0f94557554b3ca9a86d2d37bebd49c5e6d0c1d2bda35ba5bdac830befc2" +checksum = "35900b6c8d709fb1d854671ae27aeaa9eec2f8b01b364e1619a40da3e6fe2afe" dependencies = [ "find-msvc-tools", "jobserver", @@ -2225,7 +2226,7 @@ checksum = "45565fc9416b9896014f5732ac776f810ee53a66730c17e4020c3ec064a8f88f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -2292,9 +2293,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.50" +version = "4.5.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2cfd7bf8a6017ddaa4e32ffe7403d547790db06bd171c1c53926faab501623" +checksum = "4c26d721170e0295f191a69bd9a1f93efcdb0aff38684b61ab5750468972e5f5" dependencies = [ "clap_builder", "clap_derive", @@ -2302,9 +2303,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.50" +version = "4.5.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4c05b9e80c5ccd3a7ef080ad7b6ba7d6fc00a985b8b157197075677c82c7a0" +checksum = "75835f0c7bf681bfd05abe44e965760fea999a5286c6eb2d59883634fd02011a" dependencies = [ "anstream", "anstyle", @@ -2321,7 +2322,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -2428,9 +2429,9 @@ checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" [[package]] name = "compression-codecs" -version = "0.4.31" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8a506ec4b81c460798f572caead636d57d3d7e940f998160f52bd254bf2d23" +checksum = "680dc087785c5230f8e8843e2e57ac7c1c90488b6a91b88caa265410568f441b" dependencies = [ "brotli", "compression-core", @@ -2440,9 +2441,9 @@ dependencies = [ [[package]] name = "compression-core" -version = "0.4.29" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e47641d3deaf41fb1538ac1f54735925e275eaf3bf4d55c81b137fba797e5cbb" +checksum = "3a9b614a5787ef0c8802a55766480563cb3a93b435898c422ed2a359cf811582" [[package]] name = "concurrent-queue" @@ -2779,7 +2780,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -2813,7 +2814,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -2828,7 +2829,7 @@ dependencies = [ "quote", "serde", "strsim", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -2839,7 +2840,7 @@ checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ "darling_core 0.20.11", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -2850,7 +2851,7 @@ checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core 0.21.3", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -2921,7 +2922,7 @@ checksum = "8034092389675178f570469e6c3b0465d3d30b4505c294a6550db47f3c17ad18" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -2959,7 +2960,7 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -2988,7 +2989,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -2999,7 +3000,7 @@ checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", "unicode-xid", ] @@ -3074,7 +3075,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -3097,7 +3098,7 @@ checksum = "a6cbae11b3de8fce2a456e8ea3dada226b35fe791f0dc1d360c0941f0bb681f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -3121,7 +3122,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.108", + "syn 2.0.110", "termcolor", "toml 0.8.23", "walkdir", @@ -3157,7 +3158,7 @@ checksum = "7e8671d54058979a37a26f3511fbf8d198ba1aa35ffb202c42587d918d77213a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -3271,7 +3272,7 @@ dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -3372,7 +3373,7 @@ checksum = "685adfa4d6f3d765a26bc5dbc936577de9abf756c1feeb3089b01dd395034842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -3392,7 +3393,7 @@ checksum = "8ca9601fb2d62598ee17836250842873a413586e5d7ed88b356e38ddbb0ec631" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -3672,7 +3673,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.108", + "syn 2.0.110", "toml 0.8.23", "walkdir", ] @@ -3690,7 +3691,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -3716,7 +3717,7 @@ dependencies = [ "serde", "serde_json", "strum 0.26.3", - "syn 2.0.108", + "syn 2.0.110", "tempfile", "thiserror 1.0.69", "tiny-keccak", @@ -3993,6 +3994,7 @@ dependencies = [ "scale-info", "serde", "serde_json", + "sha2 0.10.9", "sp-core 35.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "tracing", ] @@ -4063,7 +4065,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -4382,7 +4384,7 @@ dependencies = [ "proc-macro2", "quote", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -4394,7 +4396,7 @@ dependencies = [ "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -4404,7 +4406,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#33663 dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -4525,7 +4527,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -4988,7 +4990,7 @@ dependencies = [ "cargo_toml", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -5229,13 +5231,13 @@ dependencies = [ "hyper 1.7.0", "hyper-util", "log", - "rustls 0.23.34", + "rustls 0.23.35", "rustls-native-certs", "rustls-pki-types", "tokio", "tokio-rustls 0.26.4", "tower-service", - "webpki-roots 1.0.3", + "webpki-roots 1.0.4", ] [[package]] @@ -5521,7 +5523,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -5655,9 +5657,9 @@ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iri-string" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397" dependencies = [ "memchr", "serde", @@ -5722,26 +5724,26 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jiff" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" +checksum = "49cce2b81f2098e7e3efc35bc2e0a6b7abec9d34128283d7a26fa8f32a6dbb35" dependencies = [ "jiff-static", "log", "portable-atomic", "portable-atomic-util", - "serde", + "serde_core", ] [[package]] name = "jiff-static" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" +checksum = "980af8b43c3ad5d8d349ace167ec8170839f753a42d233ba19e08afe1850fa69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -5830,7 +5832,7 @@ dependencies = [ "http 1.3.1", "jsonrpsee-core", "pin-project", - "rustls 0.23.34", + "rustls 0.23.35", "rustls-pki-types", "rustls-platform-verifier 0.5.3", "soketto", @@ -5883,7 +5885,7 @@ dependencies = [ "hyper-util", "jsonrpsee-core", "jsonrpsee-types", - "rustls 0.23.34", + "rustls 0.23.35", "rustls-platform-verifier 0.5.3", "serde", "serde_json", @@ -6282,7 +6284,7 @@ checksum = "1b27834086c65ec3f9387b096d66e99f221cf081c2b738042aa252bcd41204e3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -6294,7 +6296,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -6308,7 +6310,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -6319,7 +6321,7 @@ checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -6330,7 +6332,7 @@ checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -6536,7 +6538,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -6682,11 +6684,10 @@ dependencies = [ [[package]] name = "num-bigint-dig" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +checksum = "82c79c15c05d4bf82b6f5ef163104cc81a760d8e874d38ac50ab67c8877b647b" dependencies = [ - "byteorder", "lazy_static", "libm", "num-integer", @@ -6730,7 +6731,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -6825,7 +6826,7 @@ dependencies = [ "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -6942,9 +6943,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.74" +version = "0.10.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24ad14dd45412269e1a30f52ad8f0664f0f4f4a89ee8fe28c3b3527021ebb654" +checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" dependencies = [ "bitflags 2.10.0", "cfg-if", @@ -6963,7 +6964,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -6974,9 +6975,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" -version = "0.9.110" +version = "0.9.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a9f0075ba3c21b09f8e8b2026584b1d18d49388648f2fbbf3c97ea8deced8e2" +checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" dependencies = [ "cc", "libc", @@ -7064,7 +7065,7 @@ dependencies = [ "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -7262,7 +7263,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -7291,7 +7292,7 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -7372,7 +7373,7 @@ dependencies = [ "polkavm-common 0.9.0", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -7384,7 +7385,7 @@ dependencies = [ "polkavm-common 0.18.0", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -7394,7 +7395,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ "polkavm-derive-impl 0.9.0", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -7404,7 +7405,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c16669ddc7433e34c1007d31080b80901e3e8e523cb9d4b441c3910cf9294b" dependencies = [ "polkavm-derive-impl 0.18.1", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -7497,7 +7498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -7599,7 +7600,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -7610,7 +7611,7 @@ checksum = "75eea531cfcd120e0851a3f8aed42c4841f78c889eefafd96339c72677ae42c3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -7732,7 +7733,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.34", + "rustls 0.23.35", "socket2 0.6.1", "thiserror 2.0.17", "tokio", @@ -7753,7 +7754,7 @@ dependencies = [ "rand 0.9.2", "ring 0.17.14", "rustc-hash", - "rustls 0.23.34", + "rustls 0.23.35", "rustls-pki-types", "rustls-platform-verifier 0.6.2", "slab", @@ -7779,9 +7780,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.41" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce25767e7b499d1b604768e7cde645d14cc8584231ea6b295e9c9eb22c02e1d1" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" dependencies = [ "proc-macro2", ] @@ -7991,7 +7992,7 @@ checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -8101,7 +8102,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.34", + "rustls 0.23.35", "rustls-pki-types", "serde", "serde_json", @@ -8117,7 +8118,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 1.0.3", + "webpki-roots 1.0.4", ] [[package]] @@ -8253,7 +8254,7 @@ checksum = "652db34deaaa57929e10ca18e5454a32cb0efc351ae80d320334bbf907b908b3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -8485,9 +8486,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.34" +version = "0.23.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9586e9ee2b4f8fab52a0048ca7334d7024eef48e2cb9407e3497bb7cab7fa7" +checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" dependencies = [ "aws-lc-rs", "log", @@ -8541,7 +8542,7 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.34", + "rustls 0.23.35", "rustls-native-certs", "rustls-platform-verifier-android", "rustls-webpki 0.103.8", @@ -8562,13 +8563,13 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.34", + "rustls 0.23.35", "rustls-native-certs", "rustls-platform-verifier-android", "rustls-webpki 0.103.8", "security-framework 3.5.1", "security-framework-sys", - "webpki-root-certs 1.0.3", + "webpki-root-certs 1.0.4", "windows-sys 0.61.2", ] @@ -8686,7 +8687,7 @@ dependencies = [ "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -8712,7 +8713,7 @@ dependencies = [ "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -8747,9 +8748,9 @@ dependencies = [ [[package]] name = "schemars" -version = "1.0.4" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289" dependencies = [ "dyn-clone", "ref-cast", @@ -9037,7 +9038,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -9060,7 +9061,7 @@ checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -9096,7 +9097,7 @@ dependencies = [ "indexmap 1.9.3", "indexmap 2.12.0", "schemars 0.9.0", - "schemars 1.0.4", + "schemars 1.1.0", "serde", "serde_derive", "serde_json", @@ -9113,7 +9114,7 @@ dependencies = [ "darling 0.21.3", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -10605,7 +10606,7 @@ dependencies = [ "log", "quinn", "quinn-proto", - "rustls 0.23.34", + "rustls 0.23.35", "solana-connection-cache", "solana-keypair", "solana-measure", @@ -10901,7 +10902,7 @@ dependencies = [ "bs58", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -11141,7 +11142,7 @@ dependencies = [ "quinn", "quinn-proto", "rand 0.8.5", - "rustls 0.23.34", + "rustls 0.23.35", "smallvec", "socket2 0.5.10", "solana-keypair", @@ -11294,7 +11295,7 @@ version = "2.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec21c6c242ee93642aa50b829f5727470cdbdf6b461fb7323fe4bc31d1b54c08" dependencies = [ - "rustls 0.23.34", + "rustls 0.23.35", "solana-keypair", "solana-pubkey", "solana-signer", @@ -11585,7 +11586,7 @@ dependencies = [ "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -11768,7 +11769,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#33663 dependencies = [ "quote", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -11779,7 +11780,7 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -11789,7 +11790,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#33663 dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -11973,7 +11974,7 @@ dependencies = [ "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -11986,7 +11987,7 @@ dependencies = [ "proc-macro-crate 3.4.0", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -12141,7 +12142,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -12258,7 +12259,7 @@ checksum = "d9e8418ea6269dcfb01c712f0444d2c75542c04448b480e87de59d2865edc750" dependencies = [ "quote", "spl-discriminator-syn", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -12270,7 +12271,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.9", - "syn 2.0.108", + "syn 2.0.110", "thiserror 1.0.69", ] @@ -12343,7 +12344,7 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.9", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -12664,7 +12665,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -12676,7 +12677,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -12743,9 +12744,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.108" +version = "2.0.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da58917d35242480a05c2897064da0a80589a2a0476c9a3f2fdc83b53502e917" +checksum = "a99801b5bd34ede4cf3fc688c5919368fea4e4814a4664359503e6015b280aea" dependencies = [ "proc-macro2", "quote", @@ -12761,7 +12762,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -12799,7 +12800,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -12917,7 +12918,7 @@ checksum = "451b374529930d7601b1eef8d32bc79ae870b6079b069401709c2a8bf9e75f36" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -12946,7 +12947,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -12957,7 +12958,7 @@ checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -13061,7 +13062,7 @@ checksum = "2d2e76690929402faae40aebdda620a2c0e25dd6d3b9afe48867dfd95991f4bd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -13089,7 +13090,7 @@ checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -13118,7 +13119,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ - "rustls 0.23.34", + "rustls 0.23.35", "tokio", ] @@ -13165,9 +13166,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.16" +version = "0.7.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" +checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" dependencies = [ "bytes", "futures-core", @@ -13355,7 +13356,7 @@ checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -13550,9 +13551,9 @@ checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "462eeb75aeb73aea900253ce739c8e18a67423fadf006037cd3ff27e82748a06" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" [[package]] name = "unicode-normalization" @@ -13842,7 +13843,7 @@ dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", "wasm-bindgen-shared", ] @@ -13895,14 +13896,14 @@ version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75c7f0ef91146ebfb530314f5f1d24528d7f0767efbfd31dce919275413e393e" dependencies = [ - "webpki-root-certs 1.0.3", + "webpki-root-certs 1.0.4", ] [[package]] name = "webpki-root-certs" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d651ec480de84b762e7be71e6efa7461699c19d9e2c272c8d93455f567786e" +checksum = "ee3e3b5f5e80bc89f30ce8d0343bf4e5f12341c51f3e26cbeecbc7c85443e85b" dependencies = [ "rustls-pki-types", ] @@ -13924,9 +13925,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b130c0d2d49f8b6889abc456e795e82525204f27c42cf767cf0d7734e089b8" +checksum = "b2878ef029c47c6e8cf779119f20fcf52bde7ad42a731b2a304bc221df17571e" dependencies = [ "rustls-pki-types", ] @@ -14008,7 +14009,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -14019,7 +14020,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -14475,7 +14476,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -14503,7 +14504,7 @@ checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", "synstructure 0.13.2", ] @@ -14524,7 +14525,7 @@ checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -14544,7 +14545,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", "synstructure 0.13.2", ] @@ -14565,7 +14566,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] @@ -14598,7 +14599,7 @@ checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.108", + "syn 2.0.110", ] [[package]] diff --git a/tee-worker/omni-executor/Dockerfile b/tee-worker/omni-executor/Dockerfile index 4d3c785cc1..6dfdab9cf5 100644 --- a/tee-worker/omni-executor/Dockerfile +++ b/tee-worker/omni-executor/Dockerfile @@ -2,7 +2,7 @@ ### Builder Stage - Without Gramine ################################################## -FROM rust:1.87-bookworm AS plain-builder +FROM rust:1.89-bookworm AS plain-builder ARG CARGO_FEATURES="" diff --git a/tee-worker/omni-executor/aa-contracts-client/Cargo.toml b/tee-worker/omni-executor/aa-contracts-client/Cargo.toml index 647e6e3ae4..e09068746b 100644 --- a/tee-worker/omni-executor/aa-contracts-client/Cargo.toml +++ b/tee-worker/omni-executor/aa-contracts-client/Cargo.toml @@ -16,6 +16,7 @@ ethereum-rpc = { workspace = true } [dev-dependencies] heima-primitives = { workspace = true } +executor-primitives = { workspace = true } test-log = { workspace = true } ethereum-rpc = { workspace = true, features = ["mocks"] } mockall = { workspace = true } diff --git a/tee-worker/omni-executor/aa-contracts-client/src/entry_point_client.rs b/tee-worker/omni-executor/aa-contracts-client/src/entry_point_client.rs index eec3c70bca..d41b16f883 100644 --- a/tee-worker/omni-executor/aa-contracts-client/src/entry_point_client.rs +++ b/tee-worker/omni-executor/aa-contracts-client/src/entry_point_client.rs @@ -1131,7 +1131,7 @@ pub mod test { use alloy::sol_types::SolCall; use ethereum_rpc::mocks::MockRpcProvider; use ethereum_rpc::{AlloyRpcProvider, RpcProvider}; - use heima_primitives::{AccountId, Identity, Web2IdentityType}; + use executor_primitives::UserId; use std::str::FromStr; use std::sync::Arc; use test_log::test; @@ -1157,8 +1157,7 @@ pub mod test { let entrypoint_client = EntryPointClient::new(entrypoint_address, Arc::new(rpc_client)); - let oa: AccountId = - Identity::Evm(user_address.0.as_slice().try_into().unwrap()).to_omni_account(client_id); + let oa = UserId::Evm(user_address.to_string()).to_omni_account(client_id).unwrap(); let client_id_bytes = client_id.as_bytes(); let client_id_fixed_bytes = Bytes::from(client_id_bytes); let oa_bytes: FixedBytes<32> = FixedBytes::from_slice(oa.as_ref()); @@ -1214,8 +1213,7 @@ pub mod test { let rpc_client = Arc::new(AlloyRpcProvider::new("http://localhost:8545")); let entrypoint_client = EntryPointClient::new(entrypoint_address, rpc_client); // first 20 bytes factory address, then call data which should be oa + client_id + root_address encode packed - let oa: AccountId = - Identity::Evm(user_address.0.as_slice().try_into().unwrap()).to_omni_account(client_id); + let oa = UserId::Evm(user_address.to_string()).to_omni_account(client_id).unwrap(); let client_id_bytes = client_id.as_bytes(); let client_id_fixed_bytes = Bytes::from(client_id_bytes); let oa_bytes: FixedBytes<32> = FixedBytes::from_slice(oa.as_ref()); @@ -1251,8 +1249,7 @@ pub mod test { let entrypoint_client = EntryPointClient::new(entrypoint_address, rpc_client); // Create two user operations for batch simulation - let oa: AccountId = - Identity::Evm(user_address.0.as_slice().try_into().unwrap()).to_omni_account(client_id); + let oa = UserId::Evm(user_address.to_string()).to_omni_account(client_id).unwrap(); let client_id_bytes = client_id.as_bytes(); let oa_bytes: FixedBytes<32> = FixedBytes::from_slice(oa.as_ref()); @@ -1339,9 +1336,7 @@ pub mod test { Arc::new(AlloyRpcProvider::new_with_wallet("http://localhost:8545", wallet)); let entrypoint_client = EntryPointClient::new(entrypoint_address, rpc_client); // first 20 bytes factory address, then call data which should be oa + client_id + root_address encode packed - let oa: AccountId = - Identity::from_web2_account("user@example.com", Web2IdentityType::Email) - .to_omni_account(client_id); + let oa = UserId::Email("user@example.com".into()).to_omni_account(client_id).unwrap(); let client_id_bytes = client_id.as_bytes(); let client_id_fixed_bytes = Bytes::from(client_id_bytes); @@ -1427,8 +1422,7 @@ pub mod test { let entrypoint_client = EntryPointClient::new(entrypoint_address, rpc_client); // Create test parameters - let oa: AccountId = - Identity::Evm(user_address.0.as_slice().try_into().unwrap()).to_omni_account(client_id); + let oa = UserId::Evm(user_address.to_string()).to_omni_account(client_id).unwrap(); let client_id_bytes = client_id.as_bytes(); let oa_bytes: FixedBytes<32> = FixedBytes::from_slice(oa.as_ref()); diff --git a/tee-worker/omni-executor/binance-api/src/convert_api/mod.rs b/tee-worker/omni-executor/binance-api/src/convert_api/mod.rs index 157c60d929..90ec7cc0e2 100644 --- a/tee-worker/omni-executor/binance-api/src/convert_api/mod.rs +++ b/tee-worker/omni-executor/binance-api/src/convert_api/mod.rs @@ -19,7 +19,7 @@ pub struct ConvertApi<'a, BinanceClient: BinanceApi> { } impl<'a, BinanceClient: BinanceApi> ConvertApi<'a, BinanceClient> { - pub fn new(binance_api: &BinanceClient) -> ConvertApi { + pub fn new(binance_api: &BinanceClient) -> ConvertApi<'_, BinanceClient> { ConvertApi { base_api: binance_api } } diff --git a/tee-worker/omni-executor/binance-api/src/spot_trading_api/mod.rs b/tee-worker/omni-executor/binance-api/src/spot_trading_api/mod.rs index 14e758ec6e..6a4ca672d4 100644 --- a/tee-worker/omni-executor/binance-api/src/spot_trading_api/mod.rs +++ b/tee-worker/omni-executor/binance-api/src/spot_trading_api/mod.rs @@ -17,7 +17,7 @@ pub struct SpotTradingApi<'a, BinanceClient: BinanceApi> { } impl<'a, BinanceClient: BinanceApi> SpotTradingApi<'a, BinanceClient> { - pub fn new(binance_api: &BinanceClient) -> SpotTradingApi { + pub fn new(binance_api: &BinanceClient) -> SpotTradingApi<'_, BinanceClient> { SpotTradingApi { base_api: binance_api } } diff --git a/tee-worker/omni-executor/binance-api/src/wallet_api/mod.rs b/tee-worker/omni-executor/binance-api/src/wallet_api/mod.rs index ec61951098..7f0660ffdc 100644 --- a/tee-worker/omni-executor/binance-api/src/wallet_api/mod.rs +++ b/tee-worker/omni-executor/binance-api/src/wallet_api/mod.rs @@ -14,7 +14,7 @@ pub struct WalletApi<'a, BinanceClient: BinanceApi> { } impl<'a, BinanceClient: BinanceApi> WalletApi<'a, BinanceClient> { - pub fn new(binance_api: &BinanceClient) -> WalletApi { + pub fn new(binance_api: &BinanceClient) -> WalletApi<'_, BinanceClient> { WalletApi { base_api: binance_api } } diff --git a/tee-worker/omni-executor/executor-primitives/Cargo.toml b/tee-worker/omni-executor/executor-primitives/Cargo.toml index 1cd5784970..069313037c 100644 --- a/tee-worker/omni-executor/executor-primitives/Cargo.toml +++ b/tee-worker/omni-executor/executor-primitives/Cargo.toml @@ -13,6 +13,7 @@ parity-scale-codec = { workspace = true } scale-info = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } +sha2 = { workspace = true } tracing = { workspace = true } executor-crypto = { workspace = true } diff --git a/tee-worker/omni-executor/executor-primitives/src/auth.rs b/tee-worker/omni-executor/executor-primitives/src/auth.rs index d5a2b6cef6..9e5daee156 100644 --- a/tee-worker/omni-executor/executor-primitives/src/auth.rs +++ b/tee-worker/omni-executor/executor-primitives/src/auth.rs @@ -7,7 +7,7 @@ use crate::{ OmniAccountAuthType, }; use base58::{FromBase58, ToBase58}; -use heima_primitives::{Address20, Address32, Address33, Identity, IdentityString}; +use heima_primitives::{AccountId, Address20, Address32, Address33, Identity, IdentityString}; use parity_scale_codec::{Decode, Encode}; use serde::{Deserialize, Serialize}; @@ -139,6 +139,15 @@ impl TryFrom for UserId { } } +impl UserId { + /// derive an `OmniAccount` from `UserId` using SHA256 hash of client_id + user_id_type + user_id_value + /// This follows the same implementation as Identity::to_omni_account + pub fn to_omni_account(&self, client_id: &str) -> Result { + let identity = Identity::try_from(self.clone())?; + Ok(identity.to_omni_account(client_id)) + } +} + #[derive(Serialize, Deserialize, Debug, Clone)] #[serde(rename_all = "snake_case")] #[serde(tag = "type", content = "value")] @@ -320,4 +329,58 @@ mod tests { _ => panic!("Expected Email auth"), } } + + #[test] + fn test_user_id_to_omni_account_evm() { + let user_id = UserId::Evm("0x0000000000000000000000000000000000000000".to_string()); + let client_id = "test_client"; + + // Get the result from UserId::to_omni_account + let omni_account = user_id.to_omni_account(client_id).unwrap(); + + // Convert to Identity and get the result from Identity::to_omni_account + let identity = Identity::try_from(user_id).unwrap(); + let expected = identity.to_omni_account(client_id); + + assert_eq!(omni_account, expected); + } + + #[test] + fn test_user_id_to_omni_account_email() { + // Test with different case variations + let user_id1 = UserId::Email("test@test.com".to_string()); + let user_id2 = UserId::Email("TEST@TEST.COM".to_string()); + let user_id3 = UserId::Email("TeSt@TeSt.CoM".to_string()); + let client_id = "wildmeta"; + + // Get results from UserId::to_omni_account + let omni_account1 = user_id1.to_omni_account(client_id).unwrap(); + let omni_account2 = user_id2.to_omni_account(client_id).unwrap(); + let omni_account3 = user_id3.to_omni_account(client_id).unwrap(); + + // All should produce the same result + assert_eq!(omni_account1, omni_account2); + assert_eq!(omni_account1, omni_account3); + + // Convert to Identity and verify it matches + let identity1 = Identity::try_from(user_id1).unwrap(); + let expected = identity1.to_omni_account(client_id); + + assert_eq!(omni_account1, expected); + } + + #[test] + fn test_user_id_to_omni_account_apple() { + let user_id = UserId::Apple("apple.user.id".to_string()); + let client_id = "test_client"; + + // Get the result from UserId::to_omni_account + let omni_account = user_id.to_omni_account(client_id).unwrap(); + + // Convert to Identity and get the result from Identity::to_omni_account + let identity = Identity::try_from(user_id).unwrap(); + let expected = identity.to_omni_account(client_id); + + assert_eq!(omni_account, expected); + } } diff --git a/tee-worker/omni-executor/executor-primitives/src/lib.rs b/tee-worker/omni-executor/executor-primitives/src/lib.rs index d37b04149b..8de333fcbf 100644 --- a/tee-worker/omni-executor/executor-primitives/src/lib.rs +++ b/tee-worker/omni-executor/executor-primitives/src/lib.rs @@ -26,7 +26,7 @@ pub mod signature; pub mod utils; pub use heima_primitives::{ identity::Address32, omni::*, teebag::DcapQuote, AccountId, BlockNumber, ChainAsset, Hash, - Hashable, Identity, IntentId, MrEnclave, Nonce, ShardIdentifier, Web2IdentityType, + Hashable, Identity, IntentId, MrEnclave, Nonce, ShardIdentifier, }; use parity_scale_codec::{Decode, Encode}; use std::fmt::Debug; diff --git a/tee-worker/omni-executor/heima/authentication/src/auth_token.rs b/tee-worker/omni-executor/heima/authentication/src/auth_token.rs index 5d868b1093..a0488c2569 100644 --- a/tee-worker/omni-executor/heima/authentication/src/auth_token.rs +++ b/tee-worker/omni-executor/heima/authentication/src/auth_token.rs @@ -111,7 +111,7 @@ mod tests { use super::*; use chrono::{Days, Utc}; - use executor_primitives::{utils::hex::hex_encode, Identity, Web2IdentityType}; + use executor_primitives::{utils::hex::hex_encode, Identity}; use rsa::{pkcs1::EncodeRsaPrivateKey, RsaPrivateKey}; #[derive(PartialEq, Debug, Serialize, Deserialize)] @@ -138,8 +138,7 @@ mod tests { .expect("Failed to calculate expiration") .timestamp(); - let uid = Identity::from_web2_account("012345", Web2IdentityType::Pumpx); - let omni_account = uid.to_omni_account(CLIENT_ID_HEIMA); + let omni_account = Identity::Pumpx("012345".into()).to_omni_account(CLIENT_ID_HEIMA); let claims = AuthTokenClaims::new( hex_encode(omni_account.as_ref()), @@ -162,8 +161,7 @@ mod tests { RsaPrivateKey::new(&mut rng, 2048).expect("Failed to generate private key"); let private_key = rsa_private_key.to_pkcs1_der().unwrap(); - let uid = Identity::from_web2_account("012345", Web2IdentityType::Pumpx); - let omni_account = uid.to_omni_account(CLIENT_ID_HEIMA); + let omni_account = Identity::Pumpx("012345".into()).to_omni_account(CLIENT_ID_HEIMA); let claims = AuthTokenClaims::new( hex_encode(omni_account.as_ref()), @@ -238,8 +236,7 @@ mod tests { .expect("Failed to calculate expiration") .timestamp(); - let email_identity = Identity::from_web2_account("test@test.com", Web2IdentityType::Email); - let omni_account = email_identity.to_omni_account(CLIENT_ID_HEIMA); + let omni_account = Identity::Email("test@test.com".into()).to_omni_account(CLIENT_ID_HEIMA); let claims = AuthTokenClaims::new( hex_encode(omni_account.as_ref()), diff --git a/tee-worker/omni-executor/heima/identity-verification/src/web2/mod.rs b/tee-worker/omni-executor/heima/identity-verification/src/web2/mod.rs index e6f8d85bae..2929592372 100644 --- a/tee-worker/omni-executor/heima/identity-verification/src/web2/mod.rs +++ b/tee-worker/omni-executor/heima/identity-verification/src/web2/mod.rs @@ -3,7 +3,7 @@ pub mod email; pub mod google; pub mod oauth2_common; -use executor_primitives::{Identity, Web2IdentityType, Web2ValidationData}; +use executor_primitives::{Identity, Web2ValidationData}; use executor_storage::{Storage, StorageDB, VerificationCodeStorage}; use std::sync::Arc; use tracing::{error, warn}; @@ -27,7 +27,7 @@ pub fn verify_identity( let email = vec_to_string(email_validation_data.email.to_vec())?; let verification_code = vec_to_string(email_validation_data.verification_code.to_vec())?; - let email_identity = Identity::from_web2_account(&email, Web2IdentityType::Email); + let email_identity = Identity::Email(email.as_str().into()); let verification_code_storage = VerificationCodeStorage::new(storage_db); let Ok(Some(code)) = verification_code_storage.get(&email_identity.hash()) else { return Err(()); diff --git a/tee-worker/omni-executor/intent/executors/cross-chain/src/pumpx/cross_chain_swap_tests.rs b/tee-worker/omni-executor/intent/executors/cross-chain/src/pumpx/cross_chain_swap_tests.rs index d9677d70e3..b7762b29c8 100644 --- a/tee-worker/omni-executor/intent/executors/cross-chain/src/pumpx/cross_chain_swap_tests.rs +++ b/tee-worker/omni-executor/intent/executors/cross-chain/src/pumpx/cross_chain_swap_tests.rs @@ -37,7 +37,6 @@ use executor_storage::{HeimaJwtStorage, PumpxProfileStorage}; use heima_authentication::constants::AUTH_TOKEN_ACCESS_TYPE; use heima_authentication::constants::CLIENT_ID_PUMPX; use heima_primitives::BoundedVec; -use heima_primitives::IdentityString; use intent_asset_lock::precise::PreciseAssetsLock; use intent_asset_lock::AccountAssetLocks; use intent_asset_lock::AmountType; @@ -68,8 +67,7 @@ use test_log::test; #[test(tokio::test)] async fn simple_cross_chain_swap_sol_to_bsc() { - let account_id: AccountId = Identity::Pumpx(IdentityString::new("1".as_bytes().to_vec())) - .to_omni_account(CLIENT_ID_PUMPX); + let account_id = Identity::Pumpx("1".into()).to_omni_account(CLIENT_ID_PUMPX); // ************************ MOCKS SETUP ************************ let tmp_dir = tempdir().unwrap(); @@ -372,8 +370,7 @@ async fn simple_cross_chain_swap_sol_to_bsc() { #[test(tokio::test)] async fn simple_cross_chain_swap_bsc_to_sol() { - let account_id: AccountId = Identity::Pumpx(IdentityString::new("1".as_bytes().to_vec())) - .to_omni_account(CLIENT_ID_PUMPX); + let account_id = Identity::Pumpx("1".into()).to_omni_account(CLIENT_ID_PUMPX); // ************************ MOCKS SETUP ************************ let tmp_dir = tempdir().unwrap(); @@ -674,8 +671,7 @@ async fn simple_cross_chain_swap_bsc_to_sol() { #[test(tokio::test)] async fn instant_payout_cross_chain_swap() { - let account_id: AccountId = Identity::Pumpx(IdentityString::new("1".as_bytes().to_vec())) - .to_omni_account(CLIENT_ID_PUMPX); + let account_id = Identity::Pumpx("1".into()).to_omni_account(CLIENT_ID_PUMPX); // ************************ MOCKS SETUP ************************ let tmp_dir = tempdir().unwrap(); @@ -985,8 +981,7 @@ async fn instant_payout_cross_chain_swap() { #[test(tokio::test)] async fn no_instant_payout_if_exported_wallet() { - let account_id: AccountId = Identity::Pumpx(IdentityString::new("1".as_bytes().to_vec())) - .to_omni_account(CLIENT_ID_PUMPX); + let account_id = Identity::Pumpx("1".into()).to_omni_account(CLIENT_ID_PUMPX); // ************************ MOCKS SETUP ************************ let tmp_dir = tempdir().unwrap(); diff --git a/tee-worker/omni-executor/intent/executors/cross-chain/src/pumpx/single_chain_swap_tests.rs b/tee-worker/omni-executor/intent/executors/cross-chain/src/pumpx/single_chain_swap_tests.rs index da35364ce0..7eedfa381d 100644 --- a/tee-worker/omni-executor/intent/executors/cross-chain/src/pumpx/single_chain_swap_tests.rs +++ b/tee-worker/omni-executor/intent/executors/cross-chain/src/pumpx/single_chain_swap_tests.rs @@ -34,7 +34,6 @@ use executor_storage::StorageDB; use heima_authentication::constants::AUTH_TOKEN_ACCESS_TYPE; use heima_authentication::constants::CLIENT_ID_PUMPX; use heima_primitives::BoundedVec; -use heima_primitives::IdentityString; use intent_asset_lock::precise::PreciseAssetsLock; use intent_asset_lock::AccountAssetLocks; use intent_asset_lock::AmountType; @@ -56,8 +55,7 @@ use tempfile::tempdir; async fn simple_single_chain_swap() { let tmp_dir = tempdir().unwrap(); - let account_id: AccountId = Identity::Pumpx(IdentityString::new("1".as_bytes().to_vec())) - .to_omni_account(CLIENT_ID_PUMPX); + let account_id = Identity::Pumpx("1".into()).to_omni_account(CLIENT_ID_PUMPX); let intent_id = 0; let pumpx_wallet_omni_account: [u8; 32] = account_id.clone().into(); let solana_wallet_pub_key: [u8; 32] = diff --git a/tee-worker/omni-executor/omni-cli/src/main.rs b/tee-worker/omni-executor/omni-cli/src/main.rs index 9d3d1d0471..b7c8c8aa79 100644 --- a/tee-worker/omni-executor/omni-cli/src/main.rs +++ b/tee-worker/omni-executor/omni-cli/src/main.rs @@ -9,8 +9,7 @@ use anyhow::Result; use clap::{Parser, Subcommand, ValueEnum}; use ethereum_rpc::{AlloyRpcProvider, RpcProvider}; use executor_core::types::SerializablePackedUserOperation; -use executor_primitives::{ChainId, Web2IdentityType}; -use heima_primitives::Identity; +use executor_primitives::ChainId; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use tracing::{debug, info}; @@ -336,15 +335,6 @@ enum Commands { post_op_gas_limit: u64, }, - /// Get OmniAccount identifier from email/identity and client_id - GetOmniAccount { - #[arg(long)] - email: String, - - #[arg(long, default_value = "wildmeta")] - client_id: String, - }, - /// Pack two gas limits into accountGasLimits format for PackedUserOperation PackGasLimits { #[arg(long, help = "Gas limit for account verification (decimal)")] @@ -862,27 +852,6 @@ fn handle_generate_paymaster_data( Ok(()) } -fn handle_get_omni_account(email: String, client_id: String) -> Result<()> { - // Create Identity from email - let identity = Identity::from_web2_account(&email, Web2IdentityType::Email); - - // Generate OmniAccount - let omni_account = identity.to_omni_account(&client_id); - let oa_bytes: [u8; 32] = omni_account.into(); - - // Convert to hex string - let omni_account_hex = hex::encode(oa_bytes); - - info!( - "Generated OmniAccount for email '{}' with client_id '{}': 0x{}", - email, client_id, omni_account_hex - ); - - println!("OmniAccount: 0x{}", omni_account_hex); - - Ok(()) -} - fn handle_pack_gas_limits(verification_gas: u64, call_gas: u64) -> Result<()> { // Pack the gas limits into a 32-byte (256-bit) value // Higher 128 bits = verification_gas, lower 128 bits = call_gas @@ -1048,9 +1017,6 @@ async fn main() -> Result<()> { post_op_gas_limit, )?; }, - Commands::GetOmniAccount { email, client_id } => { - handle_get_omni_account(email, client_id)?; - }, Commands::PackGasLimits { verification_gas, call_gas } => { handle_pack_gas_limits(verification_gas, call_gas)?; }, diff --git a/tee-worker/omni-executor/rpc-server/src/methods/omni/attach_passkey.rs b/tee-worker/omni-executor/rpc-server/src/methods/omni/attach_passkey.rs index 149624fb15..ac21aa7369 100644 --- a/tee-worker/omni-executor/rpc-server/src/methods/omni/attach_passkey.rs +++ b/tee-worker/omni-executor/rpc-server/src/methods/omni/attach_passkey.rs @@ -7,7 +7,6 @@ use executor_core::intent_executor::IntentExecutor; use executor_crypto::passkey::{AttestationResult, PasskeyVerifier}; use executor_primitives::{to_omni_auth, utils::hex::hex_encode, UserAuth, UserId}; use executor_storage::{PasskeyChallengeError, PasskeyChallengeStorage, PasskeyStorage}; -use heima_primitives::Identity; use jsonrpsee::{types::ErrorObject, RpcModule}; use tracing::*; @@ -38,19 +37,11 @@ pub fn register_attach_passkey. - -use crate::server::RpcContext; -use crate::utils::validation::parse_rpc_params; -use executor_core::intent_executor::IntentExecutor; -use executor_primitives::{utils::hex::hex_encode, Web2IdentityType}; -use heima_primitives::Identity; -use jsonrpsee::{types::ErrorObject, RpcModule}; -use serde::{Deserialize, Serialize}; - -#[derive(Debug, Deserialize, Serialize)] -pub struct GetOmniAccountParams { - pub client_id: String, - pub user_email: String, -} - -// Directly converts Identity to OmniAccount using 1:1 mapping -pub fn register_get_omni_account< - CrossChainIntentExecutor: IntentExecutor + Send + Sync + 'static, ->( - module: &mut RpcModule>, -) { - module - .register_async_method("omni_getOmniAccount", |params, _, _| async move { - let params = parse_rpc_params::(params)?; - - let account = - Identity::from_web2_account(params.user_email.as_str(), Web2IdentityType::Email) - .to_omni_account(¶ms.client_id); - Ok::(hex_encode(account.as_ref())) - }) - .expect("Failed to register omni_getOmniAccount method"); -} diff --git a/tee-worker/omni-executor/rpc-server/src/methods/omni/list_passkey.rs b/tee-worker/omni-executor/rpc-server/src/methods/omni/list_passkey.rs index d5bc9cf3d2..96a31e8b1d 100644 --- a/tee-worker/omni-executor/rpc-server/src/methods/omni/list_passkey.rs +++ b/tee-worker/omni-executor/rpc-server/src/methods/omni/list_passkey.rs @@ -6,7 +6,6 @@ use crate::{ use executor_core::intent_executor::IntentExecutor; use executor_primitives::UserId; use executor_storage::PasskeyStorage; -use heima_primitives::Identity; use jsonrpsee::{types::ErrorObject, RpcModule}; #[derive(Debug, Deserialize, Serialize, Clone)] @@ -35,10 +34,11 @@ pub fn register_list_passkey(params)?; - let identity = Identity::try_from(params.user_id.clone()) - .map_err_parse("Invalid user ID format")?; + let omni_account = params + .user_id + .to_omni_account(¶ms.client_id) + .map_err_parse("Failed to convert to omni_account")?; - let omni_account = identity.to_omni_account(¶ms.client_id); let passkey_storage = PasskeyStorage::new(ctx.storage_db.clone()); let passkeys = passkey_storage diff --git a/tee-worker/omni-executor/rpc-server/src/methods/omni/mod.rs b/tee-worker/omni-executor/rpc-server/src/methods/omni/mod.rs index f1a98c5f8a..90b0fc79c9 100644 --- a/tee-worker/omni-executor/rpc-server/src/methods/omni/mod.rs +++ b/tee-worker/omni-executor/rpc-server/src/methods/omni/mod.rs @@ -49,9 +49,6 @@ use submit_swap_order::*; mod transfer_widthdraw; use transfer_widthdraw::*; -mod get_omni_account; -use get_omni_account::*; - mod get_smart_wallet_root_signer; use get_smart_wallet_root_signer::*; @@ -148,7 +145,6 @@ pub fn register_omni(params)?; validate_email(¶ms.user_email)?; - let email_identity = - Identity::from_web2_account(¶ms.user_email, Web2IdentityType::Email); - let omni_account = email_identity.to_omni_account(¶ms.client_id); + let omni_account = Identity::Email(params.user_email.as_str().into()).to_omni_account(¶ms.client_id); let verification_code_storage = VerificationCodeStorage::new(ctx.storage_db.clone()); let verification_code = generate_verification_code(); diff --git a/tee-worker/omni-executor/rpc-server/src/methods/omni/request_jwt.rs b/tee-worker/omni-executor/rpc-server/src/methods/omni/request_jwt.rs index 40191c8e81..c9420f0269 100644 --- a/tee-worker/omni-executor/rpc-server/src/methods/omni/request_jwt.rs +++ b/tee-worker/omni-executor/rpc-server/src/methods/omni/request_jwt.rs @@ -17,7 +17,7 @@ use heima_authentication::{ auth_token::*, constants::{AUTH_TOKEN_ACCESS_TYPE, AUTH_TOKEN_EXPIRATION_DAYS, AUTH_TOKEN_ID_TYPE}, }; -use heima_primitives::{Identity, Web2IdentityType}; +use heima_primitives::Identity; use jsonrpsee::RpcModule; use pumpx::methods::user_connect::UserConnectResponse; use serde::Serialize; @@ -93,8 +93,8 @@ pub fn register_request_jwt RpcResult { - if let UserId::Evm(user_address) = ¶ms.user_id { - if user_address.to_lowercase() != main_addr.to_lowercase() { - error!("Main address does not match user_id for EVM identity"); - return Err(DetailedError::new( - AUTH_VERIFICATION_FAILED_CODE, - "User address does not match authenticated main address for EVM identity", - ) - .with_field("user_address") - .with_received(user_address.to_string()) - .with_expected(main_addr.to_string()) - .with_suggestion("For EVM identity, the user_id must match the authenticated main address").to_rpc_error()); - } - } - }, - _ => { - let omni_account = identity.to_omni_account(¶ms.client_id); - let derived_address = ctx - .signer_client - .request_wallet( - ChainType::Evm, - params.wallet_index, - *omni_account.as_ref(), + if let UserId::Evm(user_address) = ¶ms.user_id { + if user_address.to_lowercase() != main_addr.to_lowercase() { + error!("Main address does not match user_id for EVM identity"); + return Err(DetailedError::new( + AUTH_VERIFICATION_FAILED_CODE, + "User address does not match authenticated main address for EVM identity", + ) + .with_field("user_address") + .with_received(user_address.to_string()) + .with_expected(main_addr.to_string()) + .with_suggestion("For EVM identity, the user_id must match the authenticated main address").to_rpc_error()); + } + } else { + let omni_account = params + .user_id + .to_omni_account(¶ms.client_id) + .map_err_parse("Failed to convert to omni_account")?; + + let derived_address = ctx + .signer_client + .request_wallet( + ChainType::Evm, + params.wallet_index, + *omni_account.as_ref(), + ) + .await + .map_err(|_| { + DetailedError::signer_service_error().to_rpc_error() + }) + .and_then(|pk| pubkey_to_address(ChainType::Evm, &pk).map_err_internal("Failed to convert pubkey to address"))?; + + if derived_address.to_lowercase() != main_addr.to_lowercase() { + error!("Main address does not match derived EVM address"); + return Err(DetailedError::new( + AUTH_VERIFICATION_FAILED_CODE, + "Derived address does not match authenticated address", ) - .await - .map_err(|_| { - DetailedError::signer_service_error().to_rpc_error() - }) - .and_then(|pk| pubkey_to_address(ChainType::Evm, &pk).map_err_internal("Failed to convert pubkey to address"))?; - - if derived_address.to_lowercase() != main_addr.to_lowercase() { - error!("Main address does not match derived EVM address"); - return Err(DetailedError::new( - AUTH_VERIFICATION_FAILED_CODE, - "Derived address does not match authenticated address", - ) - .with_field("derived_address") - .with_received(derived_address.to_string()) - .with_expected(main_addr.to_string()) - .with_suggestion("The derived EVM address must match the authenticated main address").to_rpc_error()); - } - }, + .with_field("derived_address") + .with_received(derived_address.to_string()) + .with_expected(main_addr.to_string()) + .with_suggestion("The derived EVM address must match the authenticated main address").to_rpc_error()); + } } } - let account_id = identity.to_omni_account(¶ms.client_id); + let account_id = params + .user_id + .to_omni_account(¶ms.client_id) + .map_err_parse("Failed to convert to omni_account")?; // Call the common submission logic let transaction_hash = submit_user_ops( diff --git a/tee-worker/omni-executor/rpc-server/src/methods/omni/test_protected_method.rs b/tee-worker/omni-executor/rpc-server/src/methods/omni/test_protected_method.rs index bb2876b299..5bcd5c41e3 100644 --- a/tee-worker/omni-executor/rpc-server/src/methods/omni/test_protected_method.rs +++ b/tee-worker/omni-executor/rpc-server/src/methods/omni/test_protected_method.rs @@ -29,13 +29,12 @@ mod test { use config_loader::ConfigLoader; use executor_core::intent_executor::MockedIntentExecutor; use executor_crypto::jwt; - use executor_primitives::utils::hex::hex_encode; + use executor_primitives::{utils::hex::hex_encode, UserId}; use executor_storage::{StorageDB, WildmetaTimestampStorage}; use heima_authentication::{ auth_token::{AuthOptions, AuthTokenClaims}, constants::{AUTH_TOKEN_EXPIRATION_DAYS, AUTH_TOKEN_ID_TYPE, CLIENT_ID_HEIMA}, }; - use heima_primitives::{Identity, Web2IdentityType}; use jsonrpsee::core::client::ClientT; use jsonrpsee::rpc_params; use jsonrpsee::ws_client::WsClientBuilder; @@ -102,8 +101,8 @@ mod test { .expect("Failed to calculate expiration") .timestamp(); let auth_options = AuthOptions { expires_at }; - let omni_account = Identity::from_web2_account("test@test.com", Web2IdentityType::Email) - .to_omni_account(CLIENT_ID_HEIMA); + let omni_account = + UserId::Email("test@test.com".into()).to_omni_account(CLIENT_ID_HEIMA).unwrap(); let access_token_claims = AuthTokenClaims::new( hex_encode(omni_account.as_ref()), diff --git a/tee-worker/omni-executor/rpc-server/src/methods/omni/user_login.rs b/tee-worker/omni-executor/rpc-server/src/methods/omni/user_login.rs index 090a400dba..cff333c236 100644 --- a/tee-worker/omni-executor/rpc-server/src/methods/omni/user_login.rs +++ b/tee-worker/omni-executor/rpc-server/src/methods/omni/user_login.rs @@ -1,8 +1,11 @@ use super::check_backend_response; use crate::{ - detailed_error::DetailedError, error_code::*, server::RpcContext, - utils::validation::parse_rpc_params, verify_auth::verify_auth, Deserialize, ErrorCode, - Serialize, + detailed_error::DetailedError, + error_code::*, + server::RpcContext, + utils::{types::RpcResultExt, validation::parse_rpc_params}, + verify_auth::verify_auth, + Deserialize, ErrorCode, Serialize, }; use chrono::{Days, Utc}; @@ -18,7 +21,6 @@ use heima_authentication::{ AUTH_TOKEN_ACCESS_TYPE, AUTH_TOKEN_EXPIRATION_DAYS, AUTH_TOKEN_ID_TYPE, CLIENT_ID_WILDMETA, }, }; -use heima_primitives::Identity; use jsonrpsee::{types::ErrorObject, RpcModule}; use pumpx::methods::post_heima_login::{PostHeimaLoginBody, PostHeimaLoginResponse}; use tracing::error; @@ -60,30 +62,14 @@ pub fn register_user_login Result { +) -> Result<(String, String), ()> { let expires_at = Utc::now() .checked_add_days(Days::new(AUTH_TOKEN_EXPIRATION_DAYS)) .expect("Failed to calculate expiration") .timestamp(); let auth_options = AuthOptions { expires_at }; - let omni_account = identity.to_omni_account(client_id); let token_claims = AuthTokenClaims::new( - hex_encode(omni_account.as_ref()), - token_type.to_string(), + hex_encode(omni_account), + AUTH_TOKEN_ID_TYPE.to_string(), client_id.to_string(), auth_options.clone(), ); - jwt::create(&token_claims, jwt_rsa_private_key).map_err(|e| { + let id_token = jwt::create(&token_claims, jwt_rsa_private_key).map_err(|e| { error!("Failed to create JWT token: {:?}", e); - }) + })?; + + let token_claims = AuthTokenClaims::new( + hex_encode(omni_account), + AUTH_TOKEN_ACCESS_TYPE.to_string(), + client_id.to_string(), + auth_options.clone(), + ); + + let access_token = jwt::create(&token_claims, jwt_rsa_private_key).map_err(|e| { + error!("Failed to create JWT token: {:?}", e); + })?; + + Ok((id_token, access_token)) } diff --git a/tee-worker/omni-executor/rpc-server/src/verify_auth.rs b/tee-worker/omni-executor/rpc-server/src/verify_auth.rs index 72ca7c26f9..0b8dd6f551 100644 --- a/tee-worker/omni-executor/rpc-server/src/verify_auth.rs +++ b/tee-worker/omni-executor/rpc-server/src/verify_auth.rs @@ -4,7 +4,7 @@ use executor_core::intent_executor::IntentExecutor; use executor_crypto::hashing::blake2_256; use executor_primitives::{ signature::HeimaMultiSignature, utils::hex::hex_encode, Hash, Hashable, Identity, OAuth2Data, - OAuth2Provider, OmniAuth, PasskeyData, VerificationCode, Web2IdentityType, + OAuth2Provider, OmniAuth, PasskeyData, VerificationCode, }; use executor_storage::{ OAuth2StateVerifierStorage, PasskeyChallengeStorage, Storage, StorageDB, @@ -134,8 +134,7 @@ pub fn verify_email_authentication< email: &str, verification_code: &VerificationCode, ) -> Result<(), AuthenticationError> { - let email_identity = Identity::from_web2_account(email, Web2IdentityType::Email); - let omni_account = email_identity.to_omni_account(client_id); + let omni_account = Identity::Email(email.into()).to_omni_account(client_id); let storage_key = omni_account.hash(); let verification_code_storage = VerificationCodeStorage::new(ctx.storage_db.clone()); let Ok(Some(code)) = verification_code_storage.get(&storage_key) else { @@ -167,16 +166,6 @@ pub async fn verify_oauth2_authentication< ctx: Arc>, client_id: &str, payload: &OAuth2Data, -) -> Result { - verify_oauth2_provider(ctx, client_id, payload).await -} - -async fn verify_oauth2_provider< - CrossChainIntentExecutor: IntentExecutor + Send + Sync + 'static, ->( - ctx: Arc>, - client_id: &str, - payload: &OAuth2Data, ) -> Result { let state_verifier_storage = OAuth2StateVerifierStorage::new(ctx.storage_db.clone()); let key: Hash = blake2_256((client_id, &payload.uid).encode().as_slice()).into(); @@ -288,13 +277,11 @@ async fn verify_oauth2_provider< return Err(AuthenticationError::OAuth2SubClaimMismatch); } - let identity_type = match payload.provider { - OAuth2Provider::Google => Web2IdentityType::Google, - OAuth2Provider::Apple => Web2IdentityType::Apple, + let identity = match payload.provider { + OAuth2Provider::Google => Identity::Google(provider_sub.as_str().into()), + OAuth2Provider::Apple => Identity::Apple(provider_sub.as_str().into()), }; - let identity = Identity::from_web2_account(&provider_sub, identity_type); - Ok(identity) } diff --git a/tee-worker/omni-executor/rust-toolchain.toml b/tee-worker/omni-executor/rust-toolchain.toml index 590d143a75..e51d2d99a7 100644 --- a/tee-worker/omni-executor/rust-toolchain.toml +++ b/tee-worker/omni-executor/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.87.0" +channel = "1.89.0" profile = "default" # include rustfmt, clippy diff --git a/tee-worker/omni-executor/ts-tests/jsonrpc-mock-tests/submitUserOp.test.ts b/tee-worker/omni-executor/ts-tests/jsonrpc-mock-tests/submitUserOp.test.ts index 12fc1a6ca6..02b36f564e 100644 --- a/tee-worker/omni-executor/ts-tests/jsonrpc-mock-tests/submitUserOp.test.ts +++ b/tee-worker/omni-executor/ts-tests/jsonrpc-mock-tests/submitUserOp.test.ts @@ -13,8 +13,7 @@ import { } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { anvil } from 'viem/chains'; -import { ClientId, omniApi, randomEvmWallet, calculateOmniAccount, UserLoginResponse } from './utils'; -import { signMessage } from 'viem/accounts'; +import { omniApi, randomEvmWallet, calculateOmniAccount, UserLoginResponse } from './utils'; import { TEST_CONFIG, validateTestEnvironment } from './config'; import { promises as fs } from 'fs'; import { @@ -26,11 +25,8 @@ import { generateInitCode, stringToBytes, createExecuteCalldata, - createAddSignerCalldata, createTokenTransferCalldata, toSerializablePackedUserOperation, - type UserOperation, - type SerializablePackedUserOperation, } from './utils/aa-utils'; // Function to wait for and load deployed contract addresses @@ -49,7 +45,7 @@ async function waitForContractDeployment(): Promise { const startTime = Date.now(); // Check if addresses are already set in environment variables - if (process.env.TEST_ENTRY_POINT_ADDRESS && + if (process.env.TEST_ENTRY_POINT_ADDRESS && process.env.TEST_FACTORY_ADDRESS && process.env.TEST_ENTRY_POINT_ADDRESS !== TEST_CONFIG.CONTRACTS.ENTRY_POINT && process.env.TEST_FACTORY_ADDRESS !== TEST_CONFIG.CONTRACTS.OMNI_ACCOUNT_FACTORY) { @@ -243,7 +239,7 @@ describe('OmniAccount Integration Tests', function () { it('Step 2: Should fund test wallet with ETH from deployer account', async function () { // Fund the test wallet for gas fees - + const fundingAmount = parseEther('0.5'); // 0.5 ETH for gas const hash = await deployerWalletClient.sendTransaction({ to: testWallet.address, @@ -368,7 +364,7 @@ describe('OmniAccount Integration Tests', function () { it('Step 5: Should add TEE Worker as authorized root signer', async function () { // Getting TEE Worker address - + // Try to get TEE Worker address (following aa-demo-app pattern) try { const workerAddress = await omniApi.getSmartWalletRootSigner( @@ -440,7 +436,7 @@ describe('OmniAccount Integration Tests', function () { }); // Wait for transaction - const receipt = await publicClient.waitForTransactionReceipt({ + const receipt = await publicClient.waitForTransactionReceipt({ hash, timeout: TEST_CONFIG.TIMEOUTS.TRANSACTION, }); @@ -479,7 +475,7 @@ describe('OmniAccount Integration Tests', function () { functionName: 'mint', args: [omniAccountAddress, mintAmount], }); - + await publicClient.waitForTransactionReceipt({ hash: mintHash, timeout: TEST_CONFIG.TIMEOUTS.TRANSACTION, @@ -495,7 +491,7 @@ describe('OmniAccount Integration Tests', function () { expect(balance).to.equal(mintAmount); // Step 6 completed - + } catch (error) { console.log('⚠️ Token minting failed, continuing with test'); console.log(` Error: ${error}`);