diff --git a/Cargo.lock b/Cargo.lock index e87f87862e..1fd5db7912 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,24 +14,27 @@ dependencies = [ [[package]] name = "ac-compose-macros" -version = "0.4.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42#9bfdbdec280944a6f9cabf71113b4f880fa292c4" +version = "0.2.3" +source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.10.0#686b7ef0aa8da255d3864a3fc703e32193813700" dependencies = [ "ac-primitives", "log 0.4.17", - "maybe-async", + "parity-scale-codec", + "sp-application-crypto", + "sp-core", + "sp-runtime", ] [[package]] name = "ac-node-api" -version = "0.4.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42#9bfdbdec280944a6f9cabf71113b4f880fa292c4" +version = "0.2.3" +source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.10.0#686b7ef0aa8da255d3864a3fc703e32193813700" dependencies = [ "ac-primitives", "bitvec", "derive_more", "either", - "frame-metadata 15.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "frame-metadata 15.1.0 (git+https://github.com/paritytech/frame-metadata)", "hex", "log 0.4.17", "parity-scale-codec", @@ -46,23 +49,23 @@ dependencies = [ [[package]] name = "ac-primitives" -version = "0.7.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42#9bfdbdec280944a6f9cabf71113b4f880fa292c4" +version = "0.5.0" +source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.10.0#686b7ef0aa8da255d3864a3fc703e32193813700" dependencies = [ "frame-system", + "hex", "impl-serde", "pallet-assets", "pallet-balances", + "pallet-contracts", + "pallet-staking", "parity-scale-codec", "primitive-types", "scale-info", "serde 1.0.163", "serde_json 1.0.96", - "sp-application-crypto", "sp-core", - "sp-core-hashing", "sp-runtime", - "sp-runtime-interface", "sp-staking", "sp-version", "sp-weights", @@ -1731,6 +1734,34 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "frame-election-provider-solution-type" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.16", +] + +[[package]] +name = "frame-election-provider-support" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-election-provider-solution-type", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-npos-elections", + "sp-runtime", + "sp-std", +] + [[package]] name = "frame-executive" version = "4.0.0-dev" @@ -2662,6 +2693,12 @@ dependencies = [ "serde 1.0.163", ] +[[package]] +name = "indexmap-nostd" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" + [[package]] name = "instant" version = "0.1.12" @@ -4548,17 +4585,6 @@ dependencies = [ "rawpointer", ] -[[package]] -name = "maybe-async" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1b8c13cb1f814b634a96b2c725449fe7ed464a7b8781de8688be5ffbd3f305" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "memchr" version = "2.2.1" @@ -5329,6 +5355,58 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-contracts" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "bitflags", + "environmental 1.1.4", + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log 0.4.17", + "pallet-contracts-primitives", + "pallet-contracts-proc-macro", + "parity-scale-codec", + "rand 0.8.5", + "scale-info", + "serde 1.0.163", + "smallvec 1.10.0", + "sp-api", + "sp-core", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", + "sp-runtime", + "sp-std", + "wasm-instrument", + "wasmi 0.28.0", + "wasmparser-nostd", +] + +[[package]] +name = "pallet-contracts-primitives" +version = "7.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "bitflags", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", + "sp-weights", +] + +[[package]] +name = "pallet-contracts-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.16", +] + [[package]] name = "pallet-evm" version = "6.0.0-dev" @@ -5512,6 +5590,28 @@ dependencies = [ "teerex-primitives", ] +[[package]] +name = "pallet-staking" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log 0.4.17", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "scale-info", + "serde 1.0.163", + "sp-application-crypto", + "sp-io 7.0.0 (git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42)", + "sp-runtime", + "sp-staking", + "sp-std", +] + [[package]] name = "pallet-sudo" version = "4.0.0-dev" @@ -7759,6 +7859,20 @@ dependencies = [ "sp-std", ] +[[package]] +name = "sp-npos-elections" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.42#569aae5341ea0c1d10426fa1ec13a36c0b64393b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde 1.0.163", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "sp-offchain" version = "4.0.0-dev" @@ -7993,7 +8107,7 @@ dependencies = [ "log 0.4.17", "parity-scale-codec", "sp-std", - "wasmi", + "wasmi 0.13.2", "wasmtime", ] @@ -8107,19 +8221,17 @@ dependencies = [ [[package]] name = "substrate-api-client" -version = "0.12.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42#9bfdbdec280944a6f9cabf71113b4f880fa292c4" +version = "0.10.0" +source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.10.0#686b7ef0aa8da255d3864a3fc703e32193813700" dependencies = [ "ac-compose-macros", "ac-node-api", "ac-primitives", - "async-trait", "derive_more", - "frame-metadata 15.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "frame-metadata 15.1.0 (git+https://github.com/paritytech/frame-metadata)", "frame-support", "hex", "log 0.4.17", - "maybe-async", "parity-scale-codec", "serde 1.0.163", "serde_json 1.0.96", @@ -8145,8 +8257,8 @@ dependencies = [ [[package]] name = "substrate-client-keystore" -version = "0.9.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42#9bfdbdec280944a6f9cabf71113b4f880fa292c4" +version = "0.7.0" +source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v0.9.42-tag-v0.10.0#686b7ef0aa8da255d3864a3fc703e32193813700" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -9061,6 +9173,15 @@ version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" +[[package]] +name = "wasm-instrument" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a47ecb37b9734d1085eaa5ae1a81e60801fd8c28d4cabdd8aedb982021918bc" +dependencies = [ + "parity-wasm", +] + [[package]] name = "wasm-opt" version = "0.111.0" @@ -9110,7 +9231,19 @@ checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" dependencies = [ "parity-wasm", "wasmi-validation", - "wasmi_core", + "wasmi_core 0.2.1", +] + +[[package]] +name = "wasmi" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e61a7006b0fdf24f6bbe8dcfdad5ca1b350de80061fb2827f31c82fbbb9565a" +dependencies = [ + "spin 0.9.8", + "wasmi_arena", + "wasmi_core 0.12.0", + "wasmparser-nostd", ] [[package]] @@ -9122,6 +9255,12 @@ dependencies = [ "parity-wasm", ] +[[package]] +name = "wasmi_arena" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "401c1f35e413fac1846d4843745589d9ec678977ab35a384db8ae7830525d468" + [[package]] name = "wasmi_core" version = "0.2.1" @@ -9135,6 +9274,18 @@ dependencies = [ "num-traits 0.2.15", ] +[[package]] +name = "wasmi_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624e6333e861ef49095d2d678b76ebf30b06bf37effca845be7e5b87c90071b7" +dependencies = [ + "downcast-rs", + "libm", + "num-traits 0.2.15", + "paste", +] + [[package]] name = "wasmparser" version = "0.100.0" @@ -9145,6 +9296,15 @@ dependencies = [ "url 2.3.1", ] +[[package]] +name = "wasmparser-nostd" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724" +dependencies = [ + "indexmap-nostd", +] + [[package]] name = "wasmtime" version = "6.0.2" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 3d18015773..2eb4979129 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -29,8 +29,8 @@ my-node-runtime = { package = "integritee-node-runtime", git = "https://github.c pallet-evm = { optional = true, git = "https://github.com/integritee-network/frontier.git", branch = "bar/polkadot-v0.9.42" } pallet-teerex = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } # `default-features = false` to remove the jsonrpsee dependency. -substrate-api-client = { default-features = false, features = ["std", "ws-client", "sync-api"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42" } -substrate-client-keystore = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42" } +substrate-api-client = { default-features = false, features = ["std", "ws-client"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } +substrate-client-keystore = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } # substrate dependencies diff --git a/core-primitives/extrinsics-factory/Cargo.toml b/core-primitives/extrinsics-factory/Cargo.toml index 9dc7dad14a..e36a6f6f40 100644 --- a/core-primitives/extrinsics-factory/Cargo.toml +++ b/core-primitives/extrinsics-factory/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" # sgx dependencies sgx_tstd = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git", optional = true } sgx_types = { branch = "master", git = "https://github.com/apache/teaclave-sgx-sdk.git" } -substrate-api-client = { default-features = false, features = ["sync-api"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42" } +substrate-api-client = { default-features = false, git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } # local dependencies itp-node-api = { path = "../node-api", default-features = false } diff --git a/core-primitives/node-api/api-client-extensions/Cargo.toml b/core-primitives/node-api/api-client-extensions/Cargo.toml index 0572552cd2..1eb2c24722 100644 --- a/core-primitives/node-api/api-client-extensions/Cargo.toml +++ b/core-primitives/node-api/api-client-extensions/Cargo.toml @@ -16,7 +16,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "po # scs # `default-features = false` to remove the jsonrpsee dependency. -substrate-api-client = { default-features = false, features = ["std", "sync-api"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42" } +substrate-api-client = { default-features = false, features = ["std"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } # local deps itp-api-client-types = { path = "../api-client-types" } diff --git a/core-primitives/node-api/api-client-types/Cargo.toml b/core-primitives/node-api/api-client-types/Cargo.toml index 6e8019e58c..05d0a8be18 100644 --- a/core-primitives/node-api/api-client-types/Cargo.toml +++ b/core-primitives/node-api/api-client-types/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" my-node-runtime = { package = "integritee-node-runtime", optional = true, git = "https://github.com/integritee-network/integritee-node.git", branch = "szp/polkadot-v0.9.42" } # scs -substrate-api-client = { default-features = false, features = ["sync-api"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42" } +substrate-api-client = { default-features = false, git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } # substrate sp-core = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" } diff --git a/core-primitives/node-api/api-client-types/src/lib.rs b/core-primitives/node-api/api-client-types/src/lib.rs index 06c6405a08..829f528566 100644 --- a/core-primitives/node-api/api-client-types/src/lib.rs +++ b/core-primitives/node-api/api-client-types/src/lib.rs @@ -100,6 +100,10 @@ mod api { pub fn as_api(&self) -> &Api { &self.0 } + + pub fn as_mut_api(&mut self) -> &Api { + &self.0 + } } impl From> for Api diff --git a/core-primitives/node-api/factory/src/lib.rs b/core-primitives/node-api/factory/src/lib.rs index 75e7894242..62ce720698 100644 --- a/core-primitives/node-api/factory/src/lib.rs +++ b/core-primitives/node-api/factory/src/lib.rs @@ -82,7 +82,7 @@ where .map_err(NodeApiFactoryError::FailedToCreateRpcClient)?; let mut api: ParentchainApi = ParentchainApi::new(rpc_client).map_err(NodeApiFactoryError::FailedToCreateNodeApi)?; - api.set_signer(self.signer.clone()); + api.as_api().set_signer(self.signer.clone()); Ok(api) } } diff --git a/core/rpc-client/src/direct_client.rs b/core/rpc-client/src/direct_client.rs index c473a0cdfb..07df77d866 100644 --- a/core/rpc-client/src/direct_client.rs +++ b/core/rpc-client/src/direct_client.rs @@ -27,6 +27,7 @@ use itp_utils::FromHexPrefixed; use log::*; use sgx_crypto_helper::rsa3072::Rsa3072PubKey; use std::{ + convert::TryFrom, sync::{ mpsc::{channel, Sender as MpscSender}, Arc, @@ -152,7 +153,12 @@ impl DirectApi for DirectClient { // Decode Metadata. let metadata = RuntimeMetadataPrefixed::decode(&mut rpc_return_value.value.as_slice())?; println!("[+] Got metadata of enclave runtime"); - Metadata::try_from(metadata).map_err(|e| e.into()) + //Metadata::try_from(metadata).map_err(|e| e.into()) + >::try_from(metadata) + .map_err(|e| e.into()) + //itp_api_client_types::Metadata::try_from(metadata).map_err(|e| e.into()) + //itp_api_client_types::Metadata::try_from(metadata.try_into()).map_err(|e| e.into()) + //metadata.try_into().map_err(|e| crate::error::Error::InvalidMetadata(e)) } fn send(&self, request: &str) -> Result<()> { diff --git a/service/Cargo.toml b/service/Cargo.toml index 2dce6f43ea..04ea1d7159 100644 --- a/service/Cargo.toml +++ b/service/Cargo.toml @@ -63,7 +63,7 @@ its-storage = { path = "../sidechain/storage" } my-node-runtime = { package = "integritee-node-runtime", git = "https://github.com/integritee-network/integritee-node.git", branch = "szp/polkadot-v0.9.42" } sgx-verify = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } # `default-features = false` to remove the jsonrpsee dependency. -substrate-api-client = { default-features = false, features = ["std", "ws-client", "sync-api"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42" } +substrate-api-client = { default-features = false, features = ["std", "ws-client"], git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42-tag-v0.10.0" } teerex-primitives = { git = "https://github.com/integritee-network/pallets.git", branch = "polkadot-v0.9.42" } # Substrate dependencies