From 7e01f1dbae5f320110bb3eecb96c577de7482444 Mon Sep 17 00:00:00 2001 From: clearloop <26088946+clearloop@users.noreply.github.com> Date: Fri, 15 Dec 2023 08:05:21 +0800 Subject: [PATCH 01/37] chore(workspace): prepare for testing publishing gtest --- Cargo.toml | 2 +- utils/crates-io/src/lib.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3b0ba9fda32..ef5214f6bf8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "1.0.3" +version = "1.0.2" authors = ["Gear Technologies"] edition = "2021" license = "GPL-3.0" diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 454b60615c0..6c978b319f7 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -46,7 +46,8 @@ pub const STACKED_DEPENDENCIES: [&str; 5] = ["gcore", "gmeta", "gear-core", "gear-utils", "gear-common"]; /// Packages need to be published. -pub const PACKAGES: [&str; 5] = ["gear-wasm-builder", "gstd", "gsdk", "gclient", "gcli"]; +// pub const PACKAGES: [&str; 5] = ["gear-wasm-builder", "gstd", "gsdk", "gclient", "gcli"]; +pub const PACKAGES: [&str; 1] = ["gtest"]; /// Check the input package pub fn check(manifest: &str) -> Result { From fee60abd0a148c4a922be4d31bf4d25b070320ef Mon Sep 17 00:00:00 2001 From: clearloop <26088946+clearloop@users.noreply.github.com> Date: Fri, 15 Dec 2023 08:17:58 +0800 Subject: [PATCH 02/37] chore(crates-io): prepare dependencies for lazy-pages --- Cargo.toml | 2 +- utils/crates-io/src/lib.rs | 21 ++++++++++++++++++--- utils/crates-io/src/version.rs | 9 ++++++--- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ef5214f6bf8..3b0ba9fda32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "1.0.2" +version = "1.0.3" authors = ["Gear Technologies"] edition = "2021" license = "GPL-3.0" diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 6c978b319f7..074dc9cff8c 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -42,12 +42,27 @@ pub const SAFE_DEPENDENCIES: [&str; 10] = [ ]; /// Required packages with local dependencies. -pub const STACKED_DEPENDENCIES: [&str; 5] = - ["gcore", "gmeta", "gear-core", "gear-utils", "gear-common"]; +/// +/// NOTE: DO NOT change the order of this array. +pub const STACKED_DEPENDENCIES: [&str; 10] = [ + "gcore", + "gmeta", + "gear-core", + "gear-utils", + "gear-common", + "gear-sandbox-env", + "gear-sandbox-host", + "gear-lazy-pages-common", + "gear-lazy-pages", + "gear-runtime-interface", + // "gear-core-backend", +]; /// Packages need to be published. +/// +/// NOTE: DO NOT change the order of this array. // pub const PACKAGES: [&str; 5] = ["gear-wasm-builder", "gstd", "gsdk", "gclient", "gcli"]; -pub const PACKAGES: [&str; 1] = ["gtest"]; +pub const PACKAGES: [&str; 0] = []; /// Check the input package pub fn check(manifest: &str) -> Result { diff --git a/utils/crates-io/src/version.rs b/utils/crates-io/src/version.rs index 4986ef927fc..7436ff8d3c7 100644 --- a/utils/crates-io/src/version.rs +++ b/utils/crates-io/src/version.rs @@ -38,12 +38,15 @@ pub fn verify(name: &str, version: &str) -> Result { .user_agent("gear-crates-io-manager") .build()?; - let resp = client + if let Ok(resp) = client .get(format!("https://crates.io/api/v1/crates/{name}/versions")) .send()? - .json::()?; + .json::() + { + return Ok(resp.versions.into_iter().any(|v| v.num == version)); + } - Ok(resp.versions.into_iter().any(|v| v.num == version)) + Ok(false) } /// Get the short hash of the current commit. From 96238f1b26e8c32470927120e4082721219cb23d Mon Sep 17 00:00:00 2001 From: clearloop <26088946+clearloop@users.noreply.github.com> Date: Fri, 15 Dec 2023 08:26:24 +0800 Subject: [PATCH 03/37] chore(sandbox-host): specify version of wasmi --- sandbox/host/Cargo.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sandbox/host/Cargo.toml b/sandbox/host/Cargo.toml index 99b8c0770a0..1267c4c44f4 100644 --- a/sandbox/host/Cargo.toml +++ b/sandbox/host/Cargo.toml @@ -19,12 +19,20 @@ thiserror.workspace = true log = { workspace = true, features = ["std"] } sandbox-wasmer.workspace = true sandbox-wasmer-types.workspace = true -wasmi = { git = "https://github.com/gear-tech/wasmi", branch = "v0.13.2-sign-ext", features = ["virtual_memory"] } sp-allocator = { workspace = true, features = ["std"] } sp-wasm-interface = { workspace = true, features = ["std"] } gear-sandbox-env = { workspace = true, features = ["std"] } wasmer-cache = { workspace = true, optional = true } tempfile.workspace = true +# TODO: update wasmi (#3017) +[dependencies.wasmi] +git = "https://github.com/gear-tech/wasmi" +branch = "v0.13.2-sign-ext" +features = ["virtual_memory"] +# The specified version here is required for publishing +# this package on crates.io. +version = "0.13.2" + [features] default = ["wasmer-cache"] From b74b2be6362585902131b9baf0657f906a0f59ac Mon Sep 17 00:00:00 2001 From: clearloop <26088946+clearloop@users.noreply.github.com> Date: Fri, 15 Dec 2023 08:52:42 +0800 Subject: [PATCH 04/37] chore(crates-io): use published gp-allocator --- utils/crates-io/src/manifest.rs | 74 +++++++++++++++++++++----------- utils/crates-io/src/publisher.rs | 3 +- 2 files changed, 49 insertions(+), 28 deletions(-) diff --git a/utils/crates-io/src/manifest.rs b/utils/crates-io/src/manifest.rs index 942a43118cc..341b89bf154 100644 --- a/utils/crates-io/src/manifest.rs +++ b/utils/crates-io/src/manifest.rs @@ -21,7 +21,7 @@ use anyhow::{anyhow, Result}; use cargo_metadata::Package; use std::{fs, path::PathBuf}; -use toml_edit::Document; +use toml_edit::{Document, InlineTable}; use crate::version; @@ -97,7 +97,7 @@ impl Manifest { dep["version"] = toml_edit::value(version.clone()); } - self.rename_deps()?; + self.rename_workspace()?; Ok(()) } @@ -136,8 +136,8 @@ impl Manifest { fs::write(&self.path, self.manifest.to_string()).map_err(Into::into) } - /// Rename dependencies - fn rename_deps(&mut self) -> Result<()> { + /// Rename worskapce manifest. + fn rename_workspace(&mut self) -> Result<()> { self.ensure_workspace()?; let Some(deps) = self.manifest["workspace"]["dependencies"].as_table_like_mut() else { @@ -146,33 +146,55 @@ impl Manifest { for (name, dep) in deps.iter_mut() { let name = name.get(); - if !name.starts_with("sp-") { - continue; - } - - // Format dotted values into inline table. - if let Some(table) = dep.as_table_mut() { - table.remove("branch"); - table.remove("git"); - table.remove("workspace"); - - if name == "sp-arithmetic" { - // NOTE: the required version of sp-arithmetic is 6.0.0 in - // git repo, but 7.0.0 in crates.io, so we need to fix it. - table.insert("version", toml_edit::value("7.0.0")); - } - - // Force the dep to be inline table in case of losing - // documentation. - let mut inline = table.clone().into_inline_table(); - inline.fmt(); - *dep = toml_edit::value(inline); - }; + name.starts_with("sp-").then(|| { + dep.as_inline_table_mut() + .map(|table| Self::rename_sp(name, table)); + }); } Ok(()) } + /// Rename substrate primitive dependency. + fn rename_sp(name: &str, table: &mut InlineTable) { + table.remove("branch"); + table.remove("git"); + table.remove("workspace"); + + match name { + // NOTE: use sp-arithmetic-7.0.0 on crates.io + // + // The required version of sp-arithmetic is 6.0.0 in the + // git repo, but 7.0.0 on crates.io. + "sp-arithmetic" => { + table.insert("version", "7.0.0".into()); + } + // NOTE: use gear-sp-allocator on crates.io + // + // sp-allocator is outdated on crates.io, aka, last 3.0.0 + // forever, here we use gear-sp-allocator instead. + // + // TODO: add the branch name. + "sp-allocator" => { + table.insert("version", "4.1.0".into()); + table.insert("package", "gp-allocator".into()); + } + // NOTE: use forked sp-wasm-interface. + // + // sp-wasm-interface is not compatible with sandbox-host. + "sp-wasm-interface" => { + table.insert("package", "gp-wasm-interface".into()); + } + // NOTE: use forked sp-wasm-interface-common. + // + // In case of we have replaced sp-wasm-interface. + "sp-wasm-interface-common" => { + table.insert("package", "gp-wasm-interface-common".into()); + } + _ => {} + } + } + /// Ensure the current function is called on the workspace manifest /// /// TODO: remove this interface after #3565 diff --git a/utils/crates-io/src/publisher.rs b/utils/crates-io/src/publisher.rs index 0155eea94c8..4d4623dd6bb 100644 --- a/utils/crates-io/src/publisher.rs +++ b/utils/crates-io/src/publisher.rs @@ -81,8 +81,7 @@ impl Publisher { // Flush new manifests to disk workspace.complete_versions(&index)?; - let mut manifests = self.graph.values().collect::>(); - manifests.push(&workspace); + let manifests = [self.graph.values().collect::>(), vec![&workspace]].concat(); manifests .iter() .map(|m| m.write()) From 3719ecdb1e8b463a1519e2b81d5c57d40430a0fe Mon Sep 17 00:00:00 2001 From: clearloop <26088946+clearloop@users.noreply.github.com> Date: Fri, 15 Dec 2023 10:43:00 +0800 Subject: [PATCH 05/37] chore(sandbox-host): trim dependencies --- Cargo.lock | 4 ++-- Cargo.toml | 2 ++ sandbox/env/Cargo.toml | 8 ++++---- sandbox/env/src/lib.rs | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 25cf17816a9..3e14bc25fac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4395,9 +4395,9 @@ name = "gear-sandbox-env" version = "1.0.3" dependencies = [ "parity-scale-codec", - "sp-core", + "sp-debug-derive", "sp-std 5.0.0", - "sp-wasm-interface", + "sp-wasm-interface-common", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 3b0ba9fda32..fbd7a6a7359 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -349,6 +349,8 @@ sp-transaction-storage-proof = { version = "4.0.0-dev", git = "https://github.co sp-trie = { version = "7.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-polkadot-v0.9.41-canary-no-sandbox-revert-oom-changes", default-features = false } sp-version = { version = "5.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-polkadot-v0.9.41-canary-no-sandbox-revert-oom-changes", default-features = false } sp-wasm-interface = { version = "7.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-polkadot-v0.9.41-canary-no-sandbox-revert-oom-changes", default-features = false } +sp-wasm-interface-common = { version = "7.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-polkadot-v0.9.41-canary-no-sandbox-revert-oom-changes", default-features = false } +sp-debug-derive = { version = "5.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-polkadot-v0.9.41-canary-no-sandbox-revert-oom-changes", default-features = false } substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/gear-tech/substrate.git", branch = "gear-polkadot-v0.9.41-canary-no-sandbox-revert-oom-changes" } substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/gear-tech/substrate.git", branch = "gear-polkadot-v0.9.41-canary-no-sandbox-revert-oom-changes" } substrate-rpc-client = { version = "0.10.0-dev", git = "https://github.com/gear-tech/substrate.git", branch = "gear-polkadot-v0.9.41-canary-no-sandbox-revert-oom-changes" } diff --git a/sandbox/env/Cargo.toml b/sandbox/env/Cargo.toml index 9c4a8891467..9b9000c07b2 100644 --- a/sandbox/env/Cargo.toml +++ b/sandbox/env/Cargo.toml @@ -13,15 +13,15 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec.workspace = true -sp-core.workspace = true +sp-debug-derive.workspace = true sp-std.workspace = true -sp-wasm-interface = { workspace = true, default-features = false } +sp-wasm-interface-common = { workspace = true, default-features = false } [features] default = ["std"] std = [ "codec/std", - "sp-core/std", + "sp-debug-derive/std", "sp-std/std", - "sp-wasm-interface/std", + "sp-wasm-interface-common/std", ] diff --git a/sandbox/env/src/lib.rs b/sandbox/env/src/lib.rs index 9b1e93fd43f..1217c9dba09 100644 --- a/sandbox/env/src/lib.rs +++ b/sandbox/env/src/lib.rs @@ -24,9 +24,9 @@ extern crate alloc; use alloc::string::String; use codec::{Decode, Encode}; -use sp_core::RuntimeDebug; +use sp_debug_derive::RuntimeDebug; use sp_std::vec::Vec; -use sp_wasm_interface::ReturnValue; +use sp_wasm_interface_common::ReturnValue; #[derive(Clone, Copy, Debug)] pub enum Instantiate { From 2b938eb517354c4d45ce68796e0467ebc9a5b9e3 Mon Sep 17 00:00:00 2001 From: clearloop Date: Mon, 25 Dec 2023 08:21:33 +0800 Subject: [PATCH 06/37] chore(deps): use sp-wasm-interface@7.0.1 --- utils/crates-io/src/lib.rs | 42 ++++++++++++++++----------------- utils/crates-io/src/manifest.rs | 8 +------ 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 074dc9cff8c..aa1698f5bab 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -28,33 +28,33 @@ use anyhow::Result; use std::process::{Command, ExitStatus}; /// Required Packages without local dependencies. -pub const SAFE_DEPENDENCIES: [&str; 10] = [ - "actor-system-error", - "galloc", - "gear-stack-buffer", - "gear-core-errors", - "gear-common-codegen", - "gear-wasm-instrument", - "gmeta-codegen", - "gsdk-codegen", - "gstd-codegen", - "gsys", +pub const SAFE_DEPENDENCIES: [&str; 1] = [ + // "actor-system-error", + // "galloc", + // "gear-stack-buffer", + // "gear-core-errors", + // "gear-common-codegen", + "gear-sandbox-env", + // "gear-wasm-instrument", + // "gmeta-codegen", + // "gsdk-codegen", + // "gstd-codegen", + // "gsys", ]; /// Required packages with local dependencies. /// /// NOTE: DO NOT change the order of this array. -pub const STACKED_DEPENDENCIES: [&str; 10] = [ - "gcore", - "gmeta", - "gear-core", - "gear-utils", - "gear-common", - "gear-sandbox-env", +pub const STACKED_DEPENDENCIES: [&str; 1] = [ + // "gcore", + // "gmeta", + // "gear-core", + // "gear-utils", + // "gear-common", "gear-sandbox-host", - "gear-lazy-pages-common", - "gear-lazy-pages", - "gear-runtime-interface", + // "gear-lazy-pages-common", + // "gear-lazy-pages", + // "gear-runtime-interface", // "gear-core-backend", ]; diff --git a/utils/crates-io/src/manifest.rs b/utils/crates-io/src/manifest.rs index d2ab73a7359..2ed93e6f5a1 100644 --- a/utils/crates-io/src/manifest.rs +++ b/utils/crates-io/src/manifest.rs @@ -180,17 +180,11 @@ impl Manifest { table.insert("version", "4.1.0".into()); table.insert("package", "gp-allocator".into()); } - // NOTE: use forked sp-wasm-interface. - // - // sp-wasm-interface is not compatible with sandbox-host. - "sp-wasm-interface" => { - table.insert("package", "gp-wasm-interface".into()); - } // NOTE: use forked sp-wasm-interface-common. // // In case of we have replaced sp-wasm-interface. "sp-wasm-interface-common" => { - table.insert("package", "gp-wasm-interface-common".into()); + table.insert("version", "7.0.1".into()); } _ => {} } From c0a620fffe72dc127b932c4dd896139ffeb10a9f Mon Sep 17 00:00:00 2001 From: clearloop Date: Tue, 26 Dec 2023 05:01:25 +0800 Subject: [PATCH 07/37] feat(crates-io): publsh lazy-pages and sandbox --- Cargo.lock | 5 ++--- core/Cargo.toml | 8 +++++--- lazy-pages/Cargo.toml | 2 +- lazy-pages/src/globals.rs | 2 +- sandbox/sandbox/Cargo.toml | 4 ++-- sandbox/sandbox/src/embedded_executor.rs | 2 +- sandbox/sandbox/src/host_executor.rs | 2 +- sandbox/sandbox/src/lib.rs | 4 ++-- utils/crates-io/src/lib.rs | 16 ++++++++-------- utils/wasm-instrument/Cargo.toml | 1 - 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e19926792f7..279553ea361 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4191,7 +4191,7 @@ dependencies = [ "mach", "nix 0.26.4", "region", - "sp-wasm-interface", + "sp-wasm-interface-common", "winapi", ] @@ -4386,7 +4386,7 @@ dependencies = [ "parity-scale-codec", "sp-core", "sp-std 5.0.0", - "sp-wasm-interface", + "sp-wasm-interface-common", "wasmi 0.30.0 (git+https://github.com/gear-tech/wasmi?branch=gear-v0.30.0)", "wat", ] @@ -4586,7 +4586,6 @@ name = "gear-wasm-instrument" version = "1.0.4" dependencies = [ "enum-iterator 1.4.1", - "gear-core", "gwasm-instrument", "wasmparser-nostd 0.100.1", "wat", diff --git a/core/Cargo.toml b/core/Cargo.toml index 70bf12eb509..7ce41ebc620 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -11,14 +11,11 @@ homepage.workspace = true repository.workspace = true [dependencies] -gear-core-errors = { workspace = true, features = ["codec"] } -gsys.workspace = true blake2-rfc.workspace = true parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } scale-info = { workspace = true, features = ["derive"] } derive_more.workspace = true log.workspace = true -gear-wasm-instrument.workspace = true wasmparser.workspace = true hex = { workspace = true, features = ["alloc"] } hashbrown.workspace = true @@ -28,6 +25,11 @@ enum-iterator.workspace = true byteorder.workspace = true num-traits.workspace = true +# local dependencies +gear-core-errors = { workspace = true, features = ["codec"] } +gear-wasm-instrument.workspace = true +gsys.workspace = true + # Optional dependencies serde = { workspace = true, features = ["derive"], optional = true } diff --git a/lazy-pages/Cargo.toml b/lazy-pages/Cargo.toml index 2a29d357a81..76bd720b8f4 100644 --- a/lazy-pages/Cargo.toml +++ b/lazy-pages/Cargo.toml @@ -10,7 +10,7 @@ repository.workspace = true [dependencies] log = { workspace = true, features = ["std"] } -sp-wasm-interface = { workspace = true, features = ["std"] } +sp-wasm-interface-common = { workspace = true, features = ["std"] } cfg-if.workspace = true region.workspace = true derive_more.workspace = true diff --git a/lazy-pages/src/globals.rs b/lazy-pages/src/globals.rs index 6418a13bec9..e9bfc41323a 100644 --- a/lazy-pages/src/globals.rs +++ b/lazy-pages/src/globals.rs @@ -23,7 +23,7 @@ use core::any::Any; use gear_core::{memory::HostPointer, str::LimitedStr}; use gear_lazy_pages_common::{GlobalsAccessError, GlobalsAccessMod, GlobalsAccessor}; use gear_sandbox_host::sandbox::SandboxInstance; -use sp_wasm_interface::Value; +use sp_wasm_interface_common::Value; #[derive(Debug, Clone, Copy)] pub(crate) enum GlobalNo { diff --git a/sandbox/sandbox/Cargo.toml b/sandbox/sandbox/Cargo.toml index 1e986b8051c..daef0ab3997 100644 --- a/sandbox/sandbox/Cargo.toml +++ b/sandbox/sandbox/Cargo.toml @@ -18,7 +18,7 @@ log.workspace = true wasmi = { git = "https://github.com/gear-tech/wasmi", branch = "gear-v0.30.0", default-features = false } sp-core.workspace = true sp-std.workspace = true -sp-wasm-interface.workspace = true +sp-wasm-interface-common.workspace = true gear-runtime-interface.workspace = true gear-sandbox-env.workspace = true @@ -33,7 +33,7 @@ std = [ "log/std", "sp-core/std", "sp-std/std", - "sp-wasm-interface/std", + "sp-wasm-interface-common/std", "gear-runtime-interface/std", "gear-sandbox-env/std", "wasmi/std", diff --git a/sandbox/sandbox/src/embedded_executor.rs b/sandbox/sandbox/src/embedded_executor.rs index eec58de33e1..9bbfd46ad22 100644 --- a/sandbox/sandbox/src/embedded_executor.rs +++ b/sandbox/sandbox/src/embedded_executor.rs @@ -25,7 +25,7 @@ use crate::{ use alloc::string::String; use gear_sandbox_env::GLOBAL_NAME_GAS; use sp_std::{collections::btree_map::BTreeMap, marker::PhantomData, prelude::*}; -use sp_wasm_interface::HostPointer; +use sp_wasm_interface_common::HostPointer; use wasmi::{ core::{Pages, Trap}, Engine, ExternType, Linker, MemoryType, Module, StoreContext, StoreContextMut, diff --git a/sandbox/sandbox/src/host_executor.rs b/sandbox/sandbox/src/host_executor.rs index 0ba488ef61b..0b5057df362 100644 --- a/sandbox/sandbox/src/host_executor.rs +++ b/sandbox/sandbox/src/host_executor.rs @@ -27,7 +27,7 @@ use alloc::string::String; use gear_runtime_interface::sandbox; use gear_sandbox_env::WasmReturnValue; use sp_std::{marker, mem, prelude::*, rc::Rc, slice, vec}; -use sp_wasm_interface::HostPointer; +use sp_wasm_interface_common::HostPointer; mod ffi { use super::HostFuncType; diff --git a/sandbox/sandbox/src/lib.rs b/sandbox/sandbox/src/lib.rs index aaf0b9e88b8..16cbea17ddc 100644 --- a/sandbox/sandbox/src/lib.rs +++ b/sandbox/sandbox/src/lib.rs @@ -50,9 +50,9 @@ pub mod host_executor; use alloc::string::String; use sp_core::RuntimeDebug; use sp_std::prelude::*; -use sp_wasm_interface::HostPointer; +use sp_wasm_interface_common::HostPointer; -pub use sp_wasm_interface::{IntoValue, ReturnValue, Value}; +pub use sp_wasm_interface_common::{IntoValue, ReturnValue, Value}; #[cfg(feature = "std")] pub use self::embedded_executor as default_executor; diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index aa1698f5bab..199a0319195 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -28,32 +28,32 @@ use anyhow::Result; use std::process::{Command, ExitStatus}; /// Required Packages without local dependencies. -pub const SAFE_DEPENDENCIES: [&str; 1] = [ +pub const SAFE_DEPENDENCIES: [&str; 4] = [ // "actor-system-error", // "galloc", // "gear-stack-buffer", - // "gear-core-errors", + "gear-core-errors", // "gear-common-codegen", "gear-sandbox-env", - // "gear-wasm-instrument", + "gear-wasm-instrument", // "gmeta-codegen", // "gsdk-codegen", // "gstd-codegen", - // "gsys", + "gsys", ]; /// Required packages with local dependencies. /// /// NOTE: DO NOT change the order of this array. -pub const STACKED_DEPENDENCIES: [&str; 1] = [ +pub const STACKED_DEPENDENCIES: [&str; 4] = [ // "gcore", // "gmeta", - // "gear-core", + "gear-core", // "gear-utils", // "gear-common", "gear-sandbox-host", - // "gear-lazy-pages-common", - // "gear-lazy-pages", + "gear-lazy-pages-common", + "gear-lazy-pages", // "gear-runtime-interface", // "gear-core-backend", ]; diff --git a/utils/wasm-instrument/Cargo.toml b/utils/wasm-instrument/Cargo.toml index e6a304b5a8b..4b608d3902a 100644 --- a/utils/wasm-instrument/Cargo.toml +++ b/utils/wasm-instrument/Cargo.toml @@ -17,7 +17,6 @@ enum-iterator.workspace = true [dev-dependencies] wasmparser.workspace = true wat.workspace = true -gear-core.workspace = true [features] default = ["std"] From 79479e462ad426b967d17cd3f0c3121becb453dd Mon Sep 17 00:00:00 2001 From: clearloop Date: Tue, 26 Dec 2023 05:34:54 +0800 Subject: [PATCH 08/37] feat(crates-io): publish gear-core-backend --- Cargo.lock | 67 ++++++++++++++++----------------- runtime-interface/Cargo.toml | 1 + sandbox/sandbox/Cargo.toml | 23 +++++++---- utils/crates-io/src/lib.rs | 11 +++--- utils/crates-io/src/manifest.rs | 13 ++++++- 5 files changed, 66 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 558dc5a7d8a..4cddfec1200 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3891,7 +3891,7 @@ dependencies = [ "sp-io", "thiserror", "tokio", - "wasmi 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmi 0.30.0", "which", "whoami", ] @@ -4384,12 +4384,12 @@ dependencies = [ "assert_matches", "gear-runtime-interface", "gear-sandbox-env", + "gwasmi", "log", "parity-scale-codec", "sp-core", "sp-std 5.0.0", "sp-wasm-interface-common", - "wasmi 0.30.0 (git+https://github.com/gear-tech/wasmi?branch=gear-v0.30.0)", "wat", ] @@ -4919,6 +4919,33 @@ dependencies = [ "gear-wasm", ] +[[package]] +name = "gwasmi" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "540bef71ad072d770140dc3f47f6bcc2b2b0492aa6a3ff236a13a7cd9427c58b" +dependencies = [ + "gwasmi_core", + "intx", + "smallvec", + "spin 0.9.8", + "wasmi_arena", + "wasmparser-nostd 0.100.1", +] + +[[package]] +name = "gwasmi_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47443d9a0eaa456c80525cebb42178fc47690fee77f9729eeece6ff70906fdcf" +dependencies = [ + "downcast-rs", + "libm", + "num-traits", + "paste", + "region", +] + [[package]] name = "h2" version = "0.3.21" @@ -11624,7 +11651,7 @@ dependencies = [ "soketto", "tiny-keccak", "twox-hash", - "wasmi 0.30.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmi 0.30.0", ] [[package]] @@ -14396,21 +14423,8 @@ dependencies = [ "intx", "smallvec", "spin 0.9.8", - "wasmi_arena 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmi_core 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmparser-nostd 0.100.1", -] - -[[package]] -name = "wasmi" -version = "0.30.0" -source = "git+https://github.com/gear-tech/wasmi?branch=gear-v0.30.0#c8b0be9c2012e0478959a59074fd953a942782bc" -dependencies = [ - "intx", - "smallvec", - "spin 0.9.8", - "wasmi_arena 0.4.0 (git+https://github.com/gear-tech/wasmi?branch=gear-v0.30.0)", - "wasmi_core 0.12.0 (git+https://github.com/gear-tech/wasmi?branch=gear-v0.30.0)", + "wasmi_arena", + "wasmi_core 0.12.0", "wasmparser-nostd 0.100.1", ] @@ -14428,11 +14442,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "401c1f35e413fac1846d4843745589d9ec678977ab35a384db8ae7830525d468" -[[package]] -name = "wasmi_arena" -version = "0.4.0" -source = "git+https://github.com/gear-tech/wasmi?branch=gear-v0.30.0#c8b0be9c2012e0478959a59074fd953a942782bc" - [[package]] name = "wasmi_core" version = "0.2.1" @@ -14471,18 +14480,6 @@ dependencies = [ "paste", ] -[[package]] -name = "wasmi_core" -version = "0.12.0" -source = "git+https://github.com/gear-tech/wasmi?branch=gear-v0.30.0#c8b0be9c2012e0478959a59074fd953a942782bc" -dependencies = [ - "downcast-rs", - "libm", - "num-traits", - "paste", - "region", -] - [[package]] name = "wasmparser" version = "0.83.0" diff --git a/runtime-interface/Cargo.toml b/runtime-interface/Cargo.toml index f1b7f225064..7a06e86155e 100644 --- a/runtime-interface/Cargo.toml +++ b/runtime-interface/Cargo.toml @@ -29,6 +29,7 @@ winapi = { workspace = true, features = ["memoryapi"] } [features] default = ["std"] std = [ + "sp-io/std", "sp-runtime-interface/std", "sp-std/std", "sp-wasm-interface/std", diff --git a/sandbox/sandbox/Cargo.toml b/sandbox/sandbox/Cargo.toml index daef0ab3997..60d09a57b4d 100644 --- a/sandbox/sandbox/Cargo.toml +++ b/sandbox/sandbox/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "gear-sandbox" -version = "0.1.0" -authors = ["Gear Technologies"] -edition = "2021" -license = "GPL-3.0" -homepage = "https://gear-tech.io" -repository = "https://github.com/gear-tech/gear" description = "This crate provides means to instantiate and execute wasm modules." +version.workspace = true +authors.workspace = true +edition.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true readme = "README.md" [package.metadata.docs.rs] @@ -15,12 +15,19 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec.workspace = true log.workspace = true -wasmi = { git = "https://github.com/gear-tech/wasmi", branch = "gear-v0.30.0", default-features = false } sp-core.workspace = true sp-std.workspace = true -sp-wasm-interface-common.workspace = true + +# Local dependencies gear-runtime-interface.workspace = true gear-sandbox-env.workspace = true +sp-wasm-interface-common.workspace = true + +# TODO: sync wasmi (#3017) +[dependencies.wasmi] +default-features = false +version = "0.30.0" +package = "gwasmi" [dev-dependencies] assert_matches = "1.3.0" diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 199a0319195..135a62fdef7 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -28,8 +28,8 @@ use anyhow::Result; use std::process::{Command, ExitStatus}; /// Required Packages without local dependencies. -pub const SAFE_DEPENDENCIES: [&str; 4] = [ - // "actor-system-error", +pub const SAFE_DEPENDENCIES: [&str; 5] = [ + "actor-system-error", // "galloc", // "gear-stack-buffer", "gear-core-errors", @@ -45,7 +45,7 @@ pub const SAFE_DEPENDENCIES: [&str; 4] = [ /// Required packages with local dependencies. /// /// NOTE: DO NOT change the order of this array. -pub const STACKED_DEPENDENCIES: [&str; 4] = [ +pub const STACKED_DEPENDENCIES: [&str; 7] = [ // "gcore", // "gmeta", "gear-core", @@ -54,8 +54,9 @@ pub const STACKED_DEPENDENCIES: [&str; 4] = [ "gear-sandbox-host", "gear-lazy-pages-common", "gear-lazy-pages", - // "gear-runtime-interface", - // "gear-core-backend", + "gear-runtime-interface", + "gear-sandbox", + "gear-core-backend", ]; /// Packages need to be published. diff --git a/utils/crates-io/src/manifest.rs b/utils/crates-io/src/manifest.rs index 2ed93e6f5a1..545becdce9e 100644 --- a/utils/crates-io/src/manifest.rs +++ b/utils/crates-io/src/manifest.rs @@ -177,9 +177,20 @@ impl Manifest { // // TODO: add the branch name. "sp-allocator" => { - table.insert("version", "4.1.0".into()); + table.insert("version", "4.1.1".into()); table.insert("package", "gp-allocator".into()); } + "sp-runtime-interface" => { + table.insert("version", "7.0.2".into()); + table.insert("package", "gp-runtime-interface".into()); + } + // NOTE: use forked sp-wasm-interface. + // + // In case of we have modifed the original sp-wasm-interface. + "sp-wasm-interface" => { + table.insert("package", "gp-wasm-interface".into()); + table.insert("version", "7.0.1".into()); + } // NOTE: use forked sp-wasm-interface-common. // // In case of we have replaced sp-wasm-interface. From a42001937d36cce684f024425206da0da058d049 Mon Sep 17 00:00:00 2001 From: clearloop Date: Wed, 27 Dec 2023 06:08:19 +0800 Subject: [PATCH 09/37] chore(core-processor): use core-processor for core-processor --- Cargo.lock | 52 +++++++++++++++++++------------------- Cargo.toml | 4 +-- core-processor/Cargo.toml | 2 +- utils/crates-io/src/lib.rs | 10 +++++--- 4 files changed, 35 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4cddfec1200..ca15fc0766d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1403,6 +1403,25 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +[[package]] +name = "core-processor" +version = "1.0.4" +dependencies = [ + "actor-system-error", + "derive_more", + "enum-iterator 1.4.1", + "env_logger", + "gear-core", + "gear-core-backend", + "gear-core-errors", + "gear-lazy-pages-common", + "gear-lazy-pages-interface", + "gear-wasm-instrument", + "gsys", + "log", + "scale-info", +] + [[package]] name = "core2" version = "0.4.0" @@ -4137,25 +4156,6 @@ dependencies = [ "scale-info", ] -[[package]] -name = "gear-core-processor" -version = "1.0.4" -dependencies = [ - "actor-system-error", - "derive_more", - "enum-iterator 1.4.1", - "env_logger", - "gear-core", - "gear-core-backend", - "gear-core-errors", - "gear-lazy-pages-common", - "gear-lazy-pages-interface", - "gear-wasm-instrument", - "gsys", - "log", - "scale-info", -] - [[package]] name = "gear-dlmalloc" version = "0.1.4" @@ -4329,13 +4329,13 @@ dependencies = [ name = "gear-runtime-common" version = "1.0.4" dependencies = [ + "core-processor", "frame-benchmarking", "frame-support", "frame-system", "frame-system-benchmarking", "gear-common", "gear-core", - "gear-core-processor", "gear-lazy-pages-common", "gear-runtime-primitives", "log", @@ -4379,7 +4379,7 @@ dependencies = [ [[package]] name = "gear-sandbox" -version = "0.1.0" +version = "1.0.4" dependencies = [ "assert_matches", "gear-runtime-interface", @@ -4564,9 +4564,9 @@ name = "gear-wasm-gen" version = "0.1.0" dependencies = [ "arbitrary", + "core-processor", "gear-core", "gear-core-backend", - "gear-core-processor", "gear-lazy-pages-interface", "gear-utils", "gear-wasm-instrument", @@ -4888,6 +4888,7 @@ name = "gtest" version = "0.1.0" dependencies = [ "colored", + "core-processor", "demo-custom", "demo-futures-unordered", "demo-meta-io", @@ -4897,7 +4898,6 @@ dependencies = [ "env_logger", "gear-core", "gear-core-errors", - "gear-core-processor", "gear-lazy-pages", "gear-lazy-pages-common", "gear-utils", @@ -7682,6 +7682,7 @@ name = "pallet-gear" version = "1.0.4" dependencies = [ "blake2-rfc", + "core-processor", "demo-async", "demo-async-custom-entry", "demo-async-init", @@ -7735,7 +7736,6 @@ dependencies = [ "gear-core", "gear-core-backend", "gear-core-errors", - "gear-core-processor", "gear-lazy-pages-common", "gear-lazy-pages-interface", "gear-runtime-interface", @@ -7982,6 +7982,7 @@ dependencies = [ name = "pallet-gear-scheduler" version = "1.0.4" dependencies = [ + "core-processor", "env_logger", "frame-benchmarking", "frame-support", @@ -7990,7 +7991,6 @@ dependencies = [ "gear-common", "gear-core", "gear-core-errors", - "gear-core-processor", "log", "pallet-authorship", "pallet-balances", @@ -13771,6 +13771,7 @@ name = "vara-runtime" version = "1.0.4" dependencies = [ "const-str", + "core-processor", "env_logger", "frame-benchmarking", "frame-election-provider-support", @@ -13781,7 +13782,6 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "gear-common", - "gear-core-processor", "gear-lazy-pages-common", "gear-runtime-common", "gear-runtime-primitives", diff --git a/Cargo.toml b/Cargo.toml index 0834446729a..6d81e04e30c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -177,7 +177,7 @@ pwasm-utils = { version = "0.19.0", package = "gear-pwasm-utils" } numerated = { path = "common/numerated" } authorship = { package = "gear-authorship", path = "node/authorship" } common = { package = "gear-common", path = "common", default-features = false } -core-processor = { package = "gear-core-processor", path = "core-processor", default-features = false } +core-processor = { path = "core-processor", default-features = false } galloc = { path = "galloc" } gcore = { path = "gcore" } gcli = { path = "gcli" } @@ -195,7 +195,7 @@ gear-common = { path = "common", default-features = false } gear-common-codegen = { path = "common/codegen" } gear-core = { path = "core" } gear-core-errors = { path = "core-errors" } -gear-core-processor = { path = "core-processor", default-features = false } +gear-core-processor = { package ="core-processor", path = "core-processor", default-features = false } gear-lazy-pages = { path = "lazy-pages" } gear-lazy-pages-common = { path = "lazy-pages/common", default-features = false } gear-lazy-pages-interface = { path = "lazy-pages/interface", default-features = false } diff --git a/core-processor/Cargo.toml b/core-processor/Cargo.toml index adc3b72e80d..62640386c66 100644 --- a/core-processor/Cargo.toml +++ b/core-processor/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "gear-core-processor" +name = "core-processor" description = "The core processor for Gear programs" keywords = ["gear", "wasm"] categories = ["wasm"] diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 135a62fdef7..e8371c13a00 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -28,12 +28,12 @@ use anyhow::Result; use std::process::{Command, ExitStatus}; /// Required Packages without local dependencies. -pub const SAFE_DEPENDENCIES: [&str; 5] = [ +pub const SAFE_DEPENDENCIES: [&str; 6] = [ "actor-system-error", // "galloc", // "gear-stack-buffer", "gear-core-errors", - // "gear-common-codegen", + "gear-common-codegen", "gear-sandbox-env", "gear-wasm-instrument", // "gmeta-codegen", @@ -45,18 +45,20 @@ pub const SAFE_DEPENDENCIES: [&str; 5] = [ /// Required packages with local dependencies. /// /// NOTE: DO NOT change the order of this array. -pub const STACKED_DEPENDENCIES: [&str; 7] = [ +pub const STACKED_DEPENDENCIES: [&str; 10] = [ // "gcore", // "gmeta", "gear-core", // "gear-utils", - // "gear-common", + "gear-common", "gear-sandbox-host", "gear-lazy-pages-common", "gear-lazy-pages", "gear-runtime-interface", + "gear-lazy-pages-interface", "gear-sandbox", "gear-core-backend", + "core-processor", ]; /// Packages need to be published. From 0b9b74998af9b131ba10ac6783efb2528f52030d Mon Sep 17 00:00:00 2001 From: clearloop Date: Wed, 27 Dec 2023 06:27:32 +0800 Subject: [PATCH 10/37] feat(crates-io): publish gtest --- gtest/Cargo.toml | 3 ++- utils/crates-io/src/lib.rs | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gtest/Cargo.toml b/gtest/Cargo.toml index c091b9b977a..48b9b79ff08 100644 --- a/gtest/Cargo.toml +++ b/gtest/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "gtest" -version = "0.1.0" +description = "Testing utils for developing gear programs." +version.workspace = true authors.workspace = true edition.workspace = true license.workspace = true diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index e8371c13a00..18ec7dcf4a1 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -45,11 +45,11 @@ pub const SAFE_DEPENDENCIES: [&str; 6] = [ /// Required packages with local dependencies. /// /// NOTE: DO NOT change the order of this array. -pub const STACKED_DEPENDENCIES: [&str; 10] = [ +pub const STACKED_DEPENDENCIES: [&str; 11] = [ // "gcore", // "gmeta", "gear-core", - // "gear-utils", + "gear-utils", "gear-common", "gear-sandbox-host", "gear-lazy-pages-common", @@ -64,8 +64,14 @@ pub const STACKED_DEPENDENCIES: [&str; 10] = [ /// Packages need to be published. /// /// NOTE: DO NOT change the order of this array. -// pub const PACKAGES: [&str; 5] = ["gear-wasm-builder", "gstd", "gsdk", "gclient", "gcli"]; -pub const PACKAGES: [&str; 0] = []; +pub const PACKAGES: [&str; 1] = [ + // "gstd", + "gtest", + // "gsdk", + // "gclient", + // "gcli", + // "gear-wasm-builder", +]; /// Check the input package pub fn check(manifest: &str) -> Result { From 935b39d904e879c760b276a305802fd085355742 Mon Sep 17 00:00:00 2001 From: clearloop Date: Wed, 27 Dec 2023 06:42:31 +0800 Subject: [PATCH 11/37] chore(clippy): make clippy happy --- Cargo.lock | 2 +- Makefile | 2 +- utils/crates-io/src/manifest.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca15fc0766d..8b936ba656a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4885,7 +4885,7 @@ version = "1.0.4" [[package]] name = "gtest" -version = "0.1.0" +version = "1.0.4" dependencies = [ "colored", "core-processor", diff --git a/Makefile b/Makefile index 147ed020b68..ae29e21c61a 100644 --- a/Makefile +++ b/Makefile @@ -246,7 +246,7 @@ test-syscalls-integrity-release: doc: @ RUSTDOCFLAGS="--enable-index-page --generate-link-to-definition -Zunstable-options -D warnings" cargo doc --no-deps \ -p galloc -p gclient -p gcore -p gear-core-backend \ - -p gear-core -p gear-core-processor -p gear-lazy-pages -p gear-core-errors \ + -p gear-core -p core-processor -p gear-lazy-pages -p gear-core-errors \ -p gmeta -p gstd -p gtest -p gear-wasm-builder -p gear-common \ -p pallet-gear -p pallet-gear-gas -p pallet-gear-messenger -p pallet-gear-payment \ -p pallet-gear-program -p pallet-gear-rpc-runtime-api -p pallet-gear-rpc -p pallet-gear-scheduler -p gsdk diff --git a/utils/crates-io/src/manifest.rs b/utils/crates-io/src/manifest.rs index 545becdce9e..24ff32c5621 100644 --- a/utils/crates-io/src/manifest.rs +++ b/utils/crates-io/src/manifest.rs @@ -186,7 +186,7 @@ impl Manifest { } // NOTE: use forked sp-wasm-interface. // - // In case of we have modifed the original sp-wasm-interface. + // In case of we have modified the original sp-wasm-interface. "sp-wasm-interface" => { table.insert("package", "gp-wasm-interface".into()); table.insert("version", "7.0.1".into()); From 69b59da1b5bca22616fd1d7b13537fb89aae244f Mon Sep 17 00:00:00 2001 From: clearloop Date: Wed, 27 Dec 2023 10:30:24 +0800 Subject: [PATCH 12/37] chore(crates-io): annotations for modified packages --- Cargo.toml | 2 +- sandbox/host/Cargo.toml | 6 +-- utils/crates-io/src/lib.rs | 31 ++++++++------- utils/crates-io/src/manifest.rs | 70 +++++++++++++++++---------------- utils/wasm-builder/Cargo.toml | 2 +- 5 files changed, 55 insertions(+), 56 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6d81e04e30c..3544c80282c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -157,7 +157,7 @@ wabt = "0.10.0" wasmer = "2.2" wasmer-cache = "2.2.1" wasmer-types = "2.2" -wasmi = { version = "0.14.0", default-features = false } +wasmi = { version = "0.13.2", git = "https://github.com/gear-tech/wasmi", branch ="v0.13.2-sign-ext" } wasmparser = { package = "wasmparser-nostd", version = "0.100.1", default-features = false } which = "4.4.2" winapi = "0.3.9" diff --git a/sandbox/host/Cargo.toml b/sandbox/host/Cargo.toml index 90493638e3e..f54ba1e620a 100644 --- a/sandbox/host/Cargo.toml +++ b/sandbox/host/Cargo.toml @@ -27,12 +27,8 @@ tempfile.workspace = true # TODO: update wasmi (#3017) [dependencies.wasmi] -git = "https://github.com/gear-tech/wasmi" -branch = "v0.13.2-sign-ext" +workspace = true features = ["virtual_memory"] -# The specified version here is required for publishing -# this package on crates.io. -version = "0.13.2" [features] default = ["wasmer-cache"] diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 18ec7dcf4a1..47a583ed574 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -28,26 +28,26 @@ use anyhow::Result; use std::process::{Command, ExitStatus}; /// Required Packages without local dependencies. -pub const SAFE_DEPENDENCIES: [&str; 6] = [ +pub const SAFE_DEPENDENCIES: [&str; 11] = [ "actor-system-error", - // "galloc", - // "gear-stack-buffer", + "galloc", + "gear-stack-buffer", "gear-core-errors", "gear-common-codegen", "gear-sandbox-env", "gear-wasm-instrument", - // "gmeta-codegen", - // "gsdk-codegen", - // "gstd-codegen", + "gmeta-codegen", + "gsdk-codegen", + "gstd-codegen", "gsys", ]; /// Required packages with local dependencies. /// /// NOTE: DO NOT change the order of this array. -pub const STACKED_DEPENDENCIES: [&str; 11] = [ - // "gcore", - // "gmeta", +pub const STACKED_DEPENDENCIES: [&str; 13] = [ + "gcore", + "gmeta", "gear-core", "gear-utils", "gear-common", @@ -64,19 +64,20 @@ pub const STACKED_DEPENDENCIES: [&str; 11] = [ /// Packages need to be published. /// /// NOTE: DO NOT change the order of this array. -pub const PACKAGES: [&str; 1] = [ - // "gstd", +pub const PACKAGES: [&str; 6] = [ + "gstd", "gtest", - // "gsdk", - // "gclient", - // "gcli", - // "gear-wasm-builder", + "gsdk", + "gclient", + "gcli", + "gear-wasm-builder", ]; /// Check the input package pub fn check(manifest: &str) -> Result { Command::new("cargo") .arg("check") + .arg("--lib") .arg("--manifest-path") .arg(manifest) .status() diff --git a/utils/crates-io/src/manifest.rs b/utils/crates-io/src/manifest.rs index 24ff32c5621..1627e07e145 100644 --- a/utils/crates-io/src/manifest.rs +++ b/utils/crates-io/src/manifest.rs @@ -146,59 +146,61 @@ impl Manifest { for (name, dep) in deps.iter_mut() { let name = name.get(); - name.starts_with("sp-").then(|| { - if let Some(table) = dep.as_inline_table_mut() { - Self::rename_sp(name, table); - } - }); + ["sp-", "frame-"] + .iter() + .any(|patt| name.starts_with(patt)) + .then(|| { + let Some(table) = dep.as_inline_table_mut() else { + return; + }; + Self::rename_sub(name, table); + }); } Ok(()) } - /// Rename substrate primitive dependency. - fn rename_sp(name: &str, table: &mut InlineTable) { - table.remove("branch"); - table.remove("git"); - table.remove("workspace"); - + /// Rename substrate dependencies. + /// + /// NOTE: The packages inside of this function are located at + /// . + fn rename_sub(name: &str, table: &mut InlineTable) { match name { - // NOTE: use sp-arithmetic-7.0.0 on crates.io - // - // The required version of sp-arithmetic is 6.0.0 in the - // git repo, but 7.0.0 on crates.io. - "sp-arithmetic" => { - table.insert("version", "7.0.0".into()); - } - // NOTE: use gear-sp-allocator on crates.io - // - // sp-allocator is outdated on crates.io, aka, last 3.0.0 - // forever, here we use gear-sp-allocator instead. - // - // TODO: add the branch name. + // sp-allocator is outdated on crates.io, last + // 3.0.0 forever, here we use gp-allocator instead. "sp-allocator" => { table.insert("version", "4.1.1".into()); table.insert("package", "gp-allocator".into()); } - "sp-runtime-interface" => { - table.insert("version", "7.0.2".into()); - table.insert("package", "gp-runtime-interface".into()); - } - // NOTE: use forked sp-wasm-interface. - // - // In case of we have modified the original sp-wasm-interface. + // Our sp-wasm-interface is different from the + // original one. "sp-wasm-interface" => { table.insert("package", "gp-wasm-interface".into()); table.insert("version", "7.0.1".into()); } - // NOTE: use forked sp-wasm-interface-common. - // - // In case of we have replaced sp-wasm-interface. + // Related to sp-wasm-interface. "sp-wasm-interface-common" => { table.insert("version", "7.0.1".into()); } + // Related to sp-wasm-interface. + "sp-runtime-interface" => { + table.insert("version", "7.0.3".into()); + table.insert("package", "gp-runtime-interface".into()); + } + // The verions of these packages on crates.io are incorrect. + "sp-arithmetic" | "sp-core" | "sp-rpc" | "sp-version" => { + table.insert("version", "7.0.0".into()); + } + // Filter out this package for local testing. + "frame-support-test" => { + return; + } _ => {} } + + table.remove("branch"); + table.remove("git"); + table.remove("workspace"); } /// Ensure the current function is called on the workspace manifest diff --git a/utils/wasm-builder/Cargo.toml b/utils/wasm-builder/Cargo.toml index d9952c4dfd1..712776bb29f 100644 --- a/utils/wasm-builder/Cargo.toml +++ b/utils/wasm-builder/Cargo.toml @@ -30,7 +30,7 @@ regex.workspace = true [dev-dependencies] wabt.workspace = true -wasmi = { workspace = true, features = ["std"] } +wasmi = { version = "0.14.0", features = ["std"] } [features] metawasm = ["gmeta/codegen"] From fcd399cdd2347ba5752f9797ff77936c37b89104 Mon Sep 17 00:00:00 2001 From: clearloop Date: Wed, 27 Dec 2023 13:11:05 +0800 Subject: [PATCH 13/37] fix(crates-io): typos --- utils/crates-io/src/manifest.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/crates-io/src/manifest.rs b/utils/crates-io/src/manifest.rs index 1627e07e145..dfeeccc43aa 100644 --- a/utils/crates-io/src/manifest.rs +++ b/utils/crates-io/src/manifest.rs @@ -187,7 +187,7 @@ impl Manifest { table.insert("version", "7.0.3".into()); table.insert("package", "gp-runtime-interface".into()); } - // The verions of these packages on crates.io are incorrect. + // The versions of these packages on crates.io are incorrect. "sp-arithmetic" | "sp-core" | "sp-rpc" | "sp-version" => { table.insert("version", "7.0.0".into()); } From 8f1b5407c41eef124555ee29609df837691b3d86 Mon Sep 17 00:00:00 2001 From: clearloop Date: Wed, 27 Dec 2023 14:39:22 +0800 Subject: [PATCH 14/37] feat(crates-io): introduce instance workspace --- utils/crates-io/src/manifest.rs | 106 +++++++++++++++++-------------- utils/crates-io/src/publisher.rs | 17 +++-- 2 files changed, 70 insertions(+), 53 deletions(-) diff --git a/utils/crates-io/src/manifest.rs b/utils/crates-io/src/manifest.rs index dfeeccc43aa..cc6714d722e 100644 --- a/utils/crates-io/src/manifest.rs +++ b/utils/crates-io/src/manifest.rs @@ -20,7 +20,11 @@ use anyhow::{anyhow, Result}; use cargo_metadata::Package; -use std::{fs, path::PathBuf}; +use std::{ + fs, + ops::{Deref, DerefMut}, + path::PathBuf, +}; use toml_edit::{Document, InlineTable}; use crate::version; @@ -38,27 +42,9 @@ pub struct Manifest { } impl Manifest { - /// Get the workspace manifest - pub fn workspace() -> Result { - let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .ancestors() - .nth(2) - .map(|workspace_dir| workspace_dir.join("Cargo.toml")) - .ok_or_else(|| anyhow::anyhow!("Could not find workspace manifest"))? - .canonicalize()?; - - Ok(Self { - name: WORKSPACE_NAME.to_string(), - manifest: fs::read_to_string(&path)?.parse()?, - path, - }) - } - /// Complete the manifest of the specified crate from /// the workspace manifest - pub fn manifest(&self, pkg: &Package) -> Result { - self.ensure_workspace()?; - + pub fn new(pkg: &Package) -> Result { // Complete documentation as from let mut manifest: Document = fs::read_to_string(&pkg.manifest_path)?.parse()?; let name = pkg.name.clone(); @@ -71,11 +57,36 @@ impl Manifest { }) } + /// Write manifest to disk. + pub fn write(&self) -> Result<()> { + fs::write(&self.path, self.manifest.to_string()).map_err(Into::into) + } +} + +/// Workspace instance, which is a wrapper of [`Manifest`]. +pub struct Workspace(Manifest); + +impl Workspace { + /// Get the workspace manifest + pub fn lookup() -> Result { + let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .ancestors() + .nth(2) + .map(|workspace_dir| workspace_dir.join("Cargo.toml")) + .ok_or_else(|| anyhow::anyhow!("Could not find workspace manifest"))? + .canonicalize()?; + + Ok(Manifest { + name: WORKSPACE_NAME.to_string(), + manifest: fs::read_to_string(&path)?.parse()?, + path, + } + .into()) + } + /// complete the versions of the specified crates pub fn complete_versions(&mut self, index: &[&str]) -> Result<()> { - self.ensure_workspace()?; - - let version = self.manifest["workspace"]["package"]["version"] + let version = self.0.manifest["workspace"]["package"]["version"] .clone() .as_str() .ok_or_else(|| anyhow!("Could not find version in workspace manifest"))? @@ -97,14 +108,12 @@ impl Manifest { dep["version"] = toml_edit::value(version.clone()); } - self.rename_workspace()?; + self.rename()?; Ok(()) } /// Set version for the workspace. pub fn with_version(mut self, version: Option) -> Result { - self.ensure_workspace()?; - let version = if let Some(version) = version { version } else { @@ -112,14 +121,11 @@ impl Manifest { }; self.manifest["workspace"]["package"]["version"] = toml_edit::value(version); - Ok(self) } /// Get version from the current manifest. pub fn version(&self) -> Result { - self.ensure_workspace()?; - Ok(self.manifest["workspace"]["package"]["version"] .as_str() .ok_or_else(|| { @@ -131,15 +137,8 @@ impl Manifest { .to_string()) } - /// Write manifest to disk. - pub fn write(&self) -> Result<()> { - fs::write(&self.path, self.manifest.to_string()).map_err(Into::into) - } - /// Rename worskapce manifest. - fn rename_workspace(&mut self) -> Result<()> { - self.ensure_workspace()?; - + fn rename(&mut self) -> Result<()> { let Some(deps) = self.manifest["workspace"]["dependencies"].as_table_like_mut() else { return Ok(()); }; @@ -202,17 +201,30 @@ impl Manifest { table.remove("git"); table.remove("workspace"); } +} - /// Ensure the current function is called on the workspace manifest - /// - /// TODO: remove this interface after #3565 - fn ensure_workspace(&self) -> Result<()> { - if self.name != WORKSPACE_NAME { - return Err(anyhow!( - "This method can only be called on the workspace manifest" - )); - } +impl From for Manifest { + fn from(workspace: Workspace) -> Self { + workspace.0 + } +} - Ok(()) +impl From for Workspace { + fn from(manifest: Manifest) -> Self { + Self(manifest) + } +} + +impl Deref for Workspace { + type Target = Manifest; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl DerefMut for Workspace { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 } } diff --git a/utils/crates-io/src/publisher.rs b/utils/crates-io/src/publisher.rs index 4d4623dd6bb..1a91a87eb1d 100644 --- a/utils/crates-io/src/publisher.rs +++ b/utils/crates-io/src/publisher.rs @@ -18,7 +18,7 @@ //! Packages publisher -use crate::{Manifest, PACKAGES, SAFE_DEPENDENCIES, STACKED_DEPENDENCIES}; +use crate::{manifest::Workspace, Manifest, PACKAGES, SAFE_DEPENDENCIES, STACKED_DEPENDENCIES}; use anyhow::Result; use cargo_metadata::{Metadata, MetadataCommand, Package}; use std::collections::{BTreeMap, HashMap}; @@ -61,7 +61,7 @@ impl Publisher { /// 3. Patch dependencies if needed pub fn build(mut self, version: Option) -> Result { let index = self.index.keys().map(|s| s.as_ref()).collect::>(); - let mut workspace = Manifest::workspace()?.with_version(version)?; + let mut workspace = Workspace::lookup()?.with_version(version)?; let version = workspace.version()?; for pkg @ Package { name, .. } in &self.metadata.packages { @@ -75,13 +75,18 @@ impl Publisher { continue; } - self.graph - .insert(self.index.get(name).cloned(), workspace.manifest(pkg)?); + let mut manifest = Manifest::new(pkg)?; + if manifest.name == "gear-core-processor" { + manifest.manifest["package"]["name"] = toml_edit::value("core-processor"); + } + + self.graph.insert(self.index.get(name).cloned(), manifest); } - // Flush new manifests to disk + // Complete package versions from workspace. workspace.complete_versions(&index)?; - let manifests = [self.graph.values().collect::>(), vec![&workspace]].concat(); + let manifest = workspace.into(); + let manifests = [self.graph.values().collect::>(), vec![&manifest]].concat(); manifests .iter() .map(|m| m.write()) From b6cc6c3763ba39720cdcf94ca26e49a023a13467 Mon Sep 17 00:00:00 2001 From: clearloop Date: Wed, 27 Dec 2023 15:14:20 +0800 Subject: [PATCH 15/37] refactor(crates-io): rename gear-core-processor --- Cargo.lock | 50 ++++----- Cargo.toml | 4 +- core-processor/Cargo.toml | 2 +- sandbox/host/Cargo.toml | 4 +- utils/crates-io/src/handler.rs | 100 +++++++++++++++++ utils/crates-io/src/lib.rs | 3 +- utils/crates-io/src/manifest.rs | 186 +++++++++++++------------------ utils/crates-io/src/publisher.rs | 17 ++- 8 files changed, 219 insertions(+), 147 deletions(-) create mode 100644 utils/crates-io/src/handler.rs diff --git a/Cargo.lock b/Cargo.lock index 8b936ba656a..15f77cc4e71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1403,25 +1403,6 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" -[[package]] -name = "core-processor" -version = "1.0.4" -dependencies = [ - "actor-system-error", - "derive_more", - "enum-iterator 1.4.1", - "env_logger", - "gear-core", - "gear-core-backend", - "gear-core-errors", - "gear-lazy-pages-common", - "gear-lazy-pages-interface", - "gear-wasm-instrument", - "gsys", - "log", - "scale-info", -] - [[package]] name = "core2" version = "0.4.0" @@ -4156,6 +4137,25 @@ dependencies = [ "scale-info", ] +[[package]] +name = "gear-core-processor" +version = "1.0.4" +dependencies = [ + "actor-system-error", + "derive_more", + "enum-iterator 1.4.1", + "env_logger", + "gear-core", + "gear-core-backend", + "gear-core-errors", + "gear-lazy-pages-common", + "gear-lazy-pages-interface", + "gear-wasm-instrument", + "gsys", + "log", + "scale-info", +] + [[package]] name = "gear-dlmalloc" version = "0.1.4" @@ -4329,13 +4329,13 @@ dependencies = [ name = "gear-runtime-common" version = "1.0.4" dependencies = [ - "core-processor", "frame-benchmarking", "frame-support", "frame-system", "frame-system-benchmarking", "gear-common", "gear-core", + "gear-core-processor", "gear-lazy-pages-common", "gear-runtime-primitives", "log", @@ -4564,9 +4564,9 @@ name = "gear-wasm-gen" version = "0.1.0" dependencies = [ "arbitrary", - "core-processor", "gear-core", "gear-core-backend", + "gear-core-processor", "gear-lazy-pages-interface", "gear-utils", "gear-wasm-instrument", @@ -4888,7 +4888,6 @@ name = "gtest" version = "1.0.4" dependencies = [ "colored", - "core-processor", "demo-custom", "demo-futures-unordered", "demo-meta-io", @@ -4898,6 +4897,7 @@ dependencies = [ "env_logger", "gear-core", "gear-core-errors", + "gear-core-processor", "gear-lazy-pages", "gear-lazy-pages-common", "gear-utils", @@ -7682,7 +7682,6 @@ name = "pallet-gear" version = "1.0.4" dependencies = [ "blake2-rfc", - "core-processor", "demo-async", "demo-async-custom-entry", "demo-async-init", @@ -7736,6 +7735,7 @@ dependencies = [ "gear-core", "gear-core-backend", "gear-core-errors", + "gear-core-processor", "gear-lazy-pages-common", "gear-lazy-pages-interface", "gear-runtime-interface", @@ -7982,7 +7982,6 @@ dependencies = [ name = "pallet-gear-scheduler" version = "1.0.4" dependencies = [ - "core-processor", "env_logger", "frame-benchmarking", "frame-support", @@ -7991,6 +7990,7 @@ dependencies = [ "gear-common", "gear-core", "gear-core-errors", + "gear-core-processor", "log", "pallet-authorship", "pallet-balances", @@ -13771,7 +13771,6 @@ name = "vara-runtime" version = "1.0.4" dependencies = [ "const-str", - "core-processor", "env_logger", "frame-benchmarking", "frame-election-provider-support", @@ -13782,6 +13781,7 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "gear-common", + "gear-core-processor", "gear-lazy-pages-common", "gear-runtime-common", "gear-runtime-primitives", diff --git a/Cargo.toml b/Cargo.toml index 3544c80282c..254576622a1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -177,7 +177,7 @@ pwasm-utils = { version = "0.19.0", package = "gear-pwasm-utils" } numerated = { path = "common/numerated" } authorship = { package = "gear-authorship", path = "node/authorship" } common = { package = "gear-common", path = "common", default-features = false } -core-processor = { path = "core-processor", default-features = false } +core-processor = { package = "gear-core-processor", path = "core-processor", default-features = false } galloc = { path = "galloc" } gcore = { path = "gcore" } gcli = { path = "gcli" } @@ -195,7 +195,7 @@ gear-common = { path = "common", default-features = false } gear-common-codegen = { path = "common/codegen" } gear-core = { path = "core" } gear-core-errors = { path = "core-errors" } -gear-core-processor = { package ="core-processor", path = "core-processor", default-features = false } +gear-core-processor = { path = "core-processor", default-features = false } gear-lazy-pages = { path = "lazy-pages" } gear-lazy-pages-common = { path = "lazy-pages/common", default-features = false } gear-lazy-pages-interface = { path = "lazy-pages/interface", default-features = false } diff --git a/core-processor/Cargo.toml b/core-processor/Cargo.toml index 62640386c66..adc3b72e80d 100644 --- a/core-processor/Cargo.toml +++ b/core-processor/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "core-processor" +name = "gear-core-processor" description = "The core processor for Gear programs" keywords = ["gear", "wasm"] categories = ["wasm"] diff --git a/sandbox/host/Cargo.toml b/sandbox/host/Cargo.toml index f54ba1e620a..625db86215e 100644 --- a/sandbox/host/Cargo.toml +++ b/sandbox/host/Cargo.toml @@ -26,9 +26,7 @@ wasmer-cache = { workspace = true, optional = true } tempfile.workspace = true # TODO: update wasmi (#3017) -[dependencies.wasmi] -workspace = true -features = ["virtual_memory"] +wasmi = { workspace = true, features = ["virtual_memory"] } [features] default = ["wasmer-cache"] diff --git a/utils/crates-io/src/handler.rs b/utils/crates-io/src/handler.rs new file mode 100644 index 00000000000..96de5a814c1 --- /dev/null +++ b/utils/crates-io/src/handler.rs @@ -0,0 +1,100 @@ +// This file is part of Gear. + +// Copyright (C) 2021-2023 Gear Technologies Inc. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Handlers for specified manifest. + +/// gear-core-processor handler. +pub mod core_processor { + use toml_edit::{Document, InlineTable}; + + /// Rename core processor related package in the + /// manifest of workspace since `gear-core-processor` + /// has been published by others. + pub fn patch_workspace(name: &str, table: &mut InlineTable) { + match name { + "core-processor" => { + table.remove("package"); + } + "gear-core-processor" => { + table.insert("package", "core-processor".into()); + } + _ => {} + } + } + + /// Patch the manifest of core-processor. + pub fn patch(manifest: &mut Document) { + manifest["package"]["name"] = toml_edit::value("core-processor"); + } +} + +/// substrate handler. +pub mod substrate { + use toml_edit::InlineTable; + + /// Patch the substrate packages in the manifest of workspace. + /// + /// NOTE: The packages inside of this function are located at + /// . + pub fn patch_workspace(name: &str, table: &mut InlineTable) { + match name { + // sp-allocator is outdated on crates.io, last + // 3.0.0 forever, here we use gp-allocator instead. + "sp-allocator" => { + table.insert("version", "4.1.1".into()); + table.insert("package", "gp-allocator".into()); + } + // Our sp-wasm-interface is different from the + // original one. + "sp-wasm-interface" => { + table.insert("package", "gp-wasm-interface".into()); + table.insert("version", "7.0.1".into()); + } + // Related to sp-wasm-interface. + "sp-wasm-interface-common" => { + table.insert("version", "7.0.1".into()); + } + // Related to sp-wasm-interface. + "sp-runtime-interface" => { + table.insert("version", "7.0.3".into()); + table.insert("package", "gp-runtime-interface".into()); + } + // The versions of these packages on crates.io are incorrect. + "sp-arithmetic" | "sp-core" | "sp-rpc" | "sp-version" => { + table.insert("version", "7.0.0".into()); + } + // Filter out this package for local testing. + "frame-support-test" => return, + _ => {} + } + + table.remove("branch"); + table.remove("git"); + } +} + +/// wasmi handler. +pub mod wasmi { + use toml_edit::InlineTable; + + /// Convert the wasmi module to the crates-io version. + pub fn patch_workspace(table: &mut InlineTable) { + table.remove("branch"); + table.remove("git"); + } +} diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 47a583ed574..3e0a41d081a 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -19,6 +19,7 @@ //! crates-io-manager library #![deny(missing_docs)] +mod handler; mod manifest; mod publisher; mod version; @@ -58,7 +59,7 @@ pub const STACKED_DEPENDENCIES: [&str; 13] = [ "gear-lazy-pages-interface", "gear-sandbox", "gear-core-backend", - "core-processor", + "gear-core-processor", ]; /// Packages need to be published. diff --git a/utils/crates-io/src/manifest.rs b/utils/crates-io/src/manifest.rs index cc6714d722e..f45734c5c3b 100644 --- a/utils/crates-io/src/manifest.rs +++ b/utils/crates-io/src/manifest.rs @@ -18,6 +18,7 @@ //! Manifest utils for crates-io-manager +use crate::{handler, version}; use anyhow::{anyhow, Result}; use cargo_metadata::Package; use std::{ @@ -25,50 +26,16 @@ use std::{ ops::{Deref, DerefMut}, path::PathBuf, }; -use toml_edit::{Document, InlineTable}; - -use crate::version; +use toml_edit::Document; const WORKSPACE_NAME: &str = "__gear_workspace"; -/// Cargo manifest with path -pub struct Manifest { - /// Crate name - pub name: String, - /// Cargo manifest - pub manifest: Document, - /// Path of the manifest - pub path: PathBuf, -} - -impl Manifest { - /// Complete the manifest of the specified crate from - /// the workspace manifest - pub fn new(pkg: &Package) -> Result { - // Complete documentation as from - let mut manifest: Document = fs::read_to_string(&pkg.manifest_path)?.parse()?; - let name = pkg.name.clone(); - manifest["package"]["documentation"] = toml_edit::value(format!("https://docs.rs/{name}")); - - Ok(Self { - name, - manifest, - path: pkg.manifest_path.clone().into(), - }) - } - - /// Write manifest to disk. - pub fn write(&self) -> Result<()> { - fs::write(&self.path, self.manifest.to_string()).map_err(Into::into) - } -} - /// Workspace instance, which is a wrapper of [`Manifest`]. pub struct Workspace(Manifest); impl Workspace { - /// Get the workspace manifest - pub fn lookup() -> Result { + /// Get the workspace manifest with version overridden. + pub fn lookup(version: Option) -> Result { let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) .ancestors() .nth(2) @@ -76,16 +43,31 @@ impl Workspace { .ok_or_else(|| anyhow::anyhow!("Could not find workspace manifest"))? .canonicalize()?; - Ok(Manifest { + let mut workspace: Self = Manifest { name: WORKSPACE_NAME.to_string(), manifest: fs::read_to_string(&path)?.parse()?, path, } - .into()) + .into(); + + // NOTE: renaming version here is required because it could + // be easy to publish incorrect version to crates.io by mistake + // in testing. + { + let version = if let Some(version) = version { + version + } else { + workspace.version()? + "-" + &version::hash()? + }; + + workspace.manifest["workspace"]["package"]["version"] = toml_edit::value(version); + } + + Ok(workspace) } /// complete the versions of the specified crates - pub fn complete_versions(&mut self, index: &[&str]) -> Result<()> { + pub fn complete(&mut self, index: &[&str]) -> Result<()> { let version = self.0.manifest["workspace"]["package"]["version"] .clone() .as_str() @@ -112,18 +94,6 @@ impl Workspace { Ok(()) } - /// Set version for the workspace. - pub fn with_version(mut self, version: Option) -> Result { - let version = if let Some(version) = version { - version - } else { - self.version()? + "-" + &version::hash()? - }; - - self.manifest["workspace"]["package"]["version"] = toml_edit::value(version); - Ok(self) - } - /// Get version from the current manifest. pub fn version(&self) -> Result { Ok(self.manifest["workspace"]["package"]["version"] @@ -145,67 +115,25 @@ impl Workspace { for (name, dep) in deps.iter_mut() { let name = name.get(); - ["sp-", "frame-"] - .iter() - .any(|patt| name.starts_with(patt)) - .then(|| { - let Some(table) = dep.as_inline_table_mut() else { - return; - }; - Self::rename_sub(name, table); - }); - } - - Ok(()) - } - - /// Rename substrate dependencies. - /// - /// NOTE: The packages inside of this function are located at - /// . - fn rename_sub(name: &str, table: &mut InlineTable) { - match name { - // sp-allocator is outdated on crates.io, last - // 3.0.0 forever, here we use gp-allocator instead. - "sp-allocator" => { - table.insert("version", "4.1.1".into()); - table.insert("package", "gp-allocator".into()); - } - // Our sp-wasm-interface is different from the - // original one. - "sp-wasm-interface" => { - table.insert("package", "gp-wasm-interface".into()); - table.insert("version", "7.0.1".into()); - } - // Related to sp-wasm-interface. - "sp-wasm-interface-common" => { - table.insert("version", "7.0.1".into()); - } - // Related to sp-wasm-interface. - "sp-runtime-interface" => { - table.insert("version", "7.0.3".into()); - table.insert("package", "gp-runtime-interface".into()); - } - // The versions of these packages on crates.io are incorrect. - "sp-arithmetic" | "sp-core" | "sp-rpc" | "sp-version" => { - table.insert("version", "7.0.0".into()); - } - // Filter out this package for local testing. - "frame-support-test" => { - return; + let Some(table) = dep.as_inline_table_mut() else { + continue; + }; + + match name { + "core-processor" | "gear-core-processor" => { + handler::core_processor::patch_workspace(name, table); + } + "wasmi" => { + handler::wasmi::patch_workspace(table); + } + sub if sub.starts_with("sp-") || sub.starts_with("frame-") => { + handler::substrate::patch_workspace(sub, table); + } + _ => {} } - _ => {} } - table.remove("branch"); - table.remove("git"); - table.remove("workspace"); - } -} - -impl From for Manifest { - fn from(workspace: Workspace) -> Self { - workspace.0 + Ok(()) } } @@ -228,3 +156,41 @@ impl DerefMut for Workspace { &mut self.0 } } + +/// Cargo manifest with path +pub struct Manifest { + /// Crate name + pub name: String, + /// Cargo manifest + pub manifest: Document, + /// Path of the manifest + pub path: PathBuf, +} + +impl Manifest { + /// Complete the manifest of the specified crate from + /// the workspace manifest + pub fn new(pkg: &Package) -> Result { + // Complete documentation as from + let mut manifest: Document = fs::read_to_string(&pkg.manifest_path)?.parse()?; + let name = pkg.name.clone(); + manifest["package"]["documentation"] = toml_edit::value(format!("https://docs.rs/{name}")); + + Ok(Self { + name, + manifest, + path: pkg.manifest_path.clone().into(), + }) + } + + /// Write manifest to disk. + pub fn write(&self) -> Result<()> { + fs::write(&self.path, self.manifest.to_string()).map_err(Into::into) + } +} + +impl From for Manifest { + fn from(workspace: Workspace) -> Self { + workspace.0 + } +} diff --git a/utils/crates-io/src/publisher.rs b/utils/crates-io/src/publisher.rs index 1a91a87eb1d..44fa626e155 100644 --- a/utils/crates-io/src/publisher.rs +++ b/utils/crates-io/src/publisher.rs @@ -18,7 +18,9 @@ //! Packages publisher -use crate::{manifest::Workspace, Manifest, PACKAGES, SAFE_DEPENDENCIES, STACKED_DEPENDENCIES}; +use crate::{ + handler, manifest::Workspace, Manifest, PACKAGES, SAFE_DEPENDENCIES, STACKED_DEPENDENCIES, +}; use anyhow::Result; use cargo_metadata::{Metadata, MetadataCommand, Package}; use std::collections::{BTreeMap, HashMap}; @@ -61,7 +63,7 @@ impl Publisher { /// 3. Patch dependencies if needed pub fn build(mut self, version: Option) -> Result { let index = self.index.keys().map(|s| s.as_ref()).collect::>(); - let mut workspace = Workspace::lookup()?.with_version(version)?; + let mut workspace = Workspace::lookup(version)?; let version = workspace.version()?; for pkg @ Package { name, .. } in &self.metadata.packages { @@ -76,15 +78,20 @@ impl Publisher { } let mut manifest = Manifest::new(pkg)?; + + // NOTE: reanme gear-core-processor to core-processor + // + // gear-core-processor has already been taken by others. if manifest.name == "gear-core-processor" { - manifest.manifest["package"]["name"] = toml_edit::value("core-processor"); + handler::core_processor::patch(&mut manifest.manifest); } self.graph.insert(self.index.get(name).cloned(), manifest); } - // Complete package versions from workspace. - workspace.complete_versions(&index)?; + workspace.complete(&index)?; + + // write manifests to disk. let manifest = workspace.into(); let manifests = [self.graph.values().collect::>(), vec![&manifest]].concat(); manifests From 04809ef0c25bc7c582e6776f3e21b414b3816053 Mon Sep 17 00:00:00 2001 From: clearloop Date: Wed, 27 Dec 2023 15:40:15 +0800 Subject: [PATCH 16/37] chore(gh): trigger pr display From 266565395521591d8f6d8f77c86925857db71aab Mon Sep 17 00:00:00 2001 From: clearloop Date: Wed, 27 Dec 2023 15:45:07 +0800 Subject: [PATCH 17/37] fix(crates-io): typos --- Makefile | 2 +- utils/crates-io/src/publisher.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ae29e21c61a..147ed020b68 100644 --- a/Makefile +++ b/Makefile @@ -246,7 +246,7 @@ test-syscalls-integrity-release: doc: @ RUSTDOCFLAGS="--enable-index-page --generate-link-to-definition -Zunstable-options -D warnings" cargo doc --no-deps \ -p galloc -p gclient -p gcore -p gear-core-backend \ - -p gear-core -p core-processor -p gear-lazy-pages -p gear-core-errors \ + -p gear-core -p gear-core-processor -p gear-lazy-pages -p gear-core-errors \ -p gmeta -p gstd -p gtest -p gear-wasm-builder -p gear-common \ -p pallet-gear -p pallet-gear-gas -p pallet-gear-messenger -p pallet-gear-payment \ -p pallet-gear-program -p pallet-gear-rpc-runtime-api -p pallet-gear-rpc -p pallet-gear-scheduler -p gsdk diff --git a/utils/crates-io/src/publisher.rs b/utils/crates-io/src/publisher.rs index 44fa626e155..37edc625ae3 100644 --- a/utils/crates-io/src/publisher.rs +++ b/utils/crates-io/src/publisher.rs @@ -79,7 +79,7 @@ impl Publisher { let mut manifest = Manifest::new(pkg)?; - // NOTE: reanme gear-core-processor to core-processor + // NOTE: rename gear-core-processor to core-processor // // gear-core-processor has already been taken by others. if manifest.name == "gear-core-processor" { From 1c4e05f5ff7b8e9c3f8751273ed49f1f858e4724 Mon Sep 17 00:00:00 2001 From: clearloop Date: Wed, 27 Dec 2023 16:35:55 +0800 Subject: [PATCH 18/37] chore(crates-io): revert the changes around wasmi --- Cargo.toml | 2 +- sandbox/host/Cargo.toml | 4 +--- utils/crates-io/src/handler.rs | 14 +++++++++----- utils/crates-io/src/manifest.rs | 3 --- utils/crates-io/src/publisher.rs | 16 ++++++++++------ utils/wasm-builder/Cargo.toml | 2 +- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 254576622a1..0834446729a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -157,7 +157,7 @@ wabt = "0.10.0" wasmer = "2.2" wasmer-cache = "2.2.1" wasmer-types = "2.2" -wasmi = { version = "0.13.2", git = "https://github.com/gear-tech/wasmi", branch ="v0.13.2-sign-ext" } +wasmi = { version = "0.14.0", default-features = false } wasmparser = { package = "wasmparser-nostd", version = "0.100.1", default-features = false } which = "4.4.2" winapi = "0.3.9" diff --git a/sandbox/host/Cargo.toml b/sandbox/host/Cargo.toml index 625db86215e..97362a7feff 100644 --- a/sandbox/host/Cargo.toml +++ b/sandbox/host/Cargo.toml @@ -19,14 +19,12 @@ thiserror.workspace = true log = { workspace = true, features = ["std"] } sandbox-wasmer.workspace = true sandbox-wasmer-types.workspace = true +wasmi = { version = "0.13.2", git = "https://github.com/gear-tech/wasmi", branch = "v0.13.2-sign-ext", features = ["virtual_memory"] } sp-allocator = { workspace = true, features = ["std"] } sp-wasm-interface-common = { workspace = true, features = ["std"] } gear-sandbox-env = { workspace = true, features = ["std"] } wasmer-cache = { workspace = true, optional = true } tempfile.workspace = true -# TODO: update wasmi (#3017) -wasmi = { workspace = true, features = ["virtual_memory"] } - [features] default = ["wasmer-cache"] diff --git a/utils/crates-io/src/handler.rs b/utils/crates-io/src/handler.rs index 96de5a814c1..a264b71672b 100644 --- a/utils/crates-io/src/handler.rs +++ b/utils/crates-io/src/handler.rs @@ -89,12 +89,16 @@ pub mod substrate { } /// wasmi handler. -pub mod wasmi { - use toml_edit::InlineTable; +pub mod sandbox_host { + use toml_edit::Document; /// Convert the wasmi module to the crates-io version. - pub fn patch_workspace(table: &mut InlineTable) { - table.remove("branch"); - table.remove("git"); + pub fn patch(manifest: &mut Document) { + let Some(wasmi) = manifest["dependencies"]["wasmi"].as_inline_table_mut() else { + return; + }; + + wasmi.remove("branch"); + wasmi.remove("git"); } } diff --git a/utils/crates-io/src/manifest.rs b/utils/crates-io/src/manifest.rs index f45734c5c3b..ce6a67c611b 100644 --- a/utils/crates-io/src/manifest.rs +++ b/utils/crates-io/src/manifest.rs @@ -123,9 +123,6 @@ impl Workspace { "core-processor" | "gear-core-processor" => { handler::core_processor::patch_workspace(name, table); } - "wasmi" => { - handler::wasmi::patch_workspace(table); - } sub if sub.starts_with("sp-") || sub.starts_with("frame-") => { handler::substrate::patch_workspace(sub, table); } diff --git a/utils/crates-io/src/publisher.rs b/utils/crates-io/src/publisher.rs index 37edc625ae3..63d12639487 100644 --- a/utils/crates-io/src/publisher.rs +++ b/utils/crates-io/src/publisher.rs @@ -78,12 +78,16 @@ impl Publisher { } let mut manifest = Manifest::new(pkg)?; - - // NOTE: rename gear-core-processor to core-processor - // - // gear-core-processor has already been taken by others. - if manifest.name == "gear-core-processor" { - handler::core_processor::patch(&mut manifest.manifest); + match manifest.name.as_str() { + // gear-core-processor has already been taken by others. + "gear-core-processor" => { + handler::core_processor::patch(&mut manifest.manifest); + } + // convert git dependencies to crates-io dependencies. + "gear-sandbox-host" => { + handler::sandbox_host::patch(&mut manifest.manifest); + } + _ => {} } self.graph.insert(self.index.get(name).cloned(), manifest); diff --git a/utils/wasm-builder/Cargo.toml b/utils/wasm-builder/Cargo.toml index 712776bb29f..d9952c4dfd1 100644 --- a/utils/wasm-builder/Cargo.toml +++ b/utils/wasm-builder/Cargo.toml @@ -30,7 +30,7 @@ regex.workspace = true [dev-dependencies] wabt.workspace = true -wasmi = { version = "0.14.0", features = ["std"] } +wasmi = { workspace = true, features = ["std"] } [features] metawasm = ["gmeta/codegen"] From de8ef577046eff94c2a23893bfa2ed7be1c27a60 Mon Sep 17 00:00:00 2001 From: clearloop Date: Thu, 28 Dec 2023 07:45:31 +0800 Subject: [PATCH 19/37] chore(crates-io): improve patch handler --- utils/crates-io/src/handler.rs | 41 +++++++++++++++++++++++++++++--- utils/crates-io/src/publisher.rs | 16 ++----------- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/utils/crates-io/src/handler.rs b/utils/crates-io/src/handler.rs index a264b71672b..4402df4bdf0 100644 --- a/utils/crates-io/src/handler.rs +++ b/utils/crates-io/src/handler.rs @@ -16,7 +16,26 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -//! Handlers for specified manifest. +//! Handlers for patching manifests. + +use crate::Manifest; +use anyhow::Result; +use cargo_metadata::Package; + +/// Patch specified manifest by provided name. +pub fn patch(pkg: &Package) -> Result { + let mut manifest = Manifest::new(pkg)?; + let doc = &mut manifest.manifest; + + match manifest.name.as_str() { + "gear-core-processor" => core_processor::patch(doc), + "gear-sandbox" => sandbox::patch(doc), + "gear-sandbox-host" => sandbox_host::patch(doc), + _ => {} + } + + Ok(manifest) +} /// gear-core-processor handler. pub mod core_processor { @@ -88,8 +107,8 @@ pub mod substrate { } } -/// wasmi handler. -pub mod sandbox_host { +/// sandbox handler. +pub mod sandbox { use toml_edit::Document; /// Convert the wasmi module to the crates-io version. @@ -97,7 +116,23 @@ pub mod sandbox_host { let Some(wasmi) = manifest["dependencies"]["wasmi"].as_inline_table_mut() else { return; }; + wasmi.insert("package", "gwasmi".into()); + wasmi.insert("version", "0.30.0".into()); + wasmi.remove("branch"); + wasmi.remove("git"); + } +} +/// sandbox_host handler. +pub mod sandbox_host { + use toml_edit::Document; + + /// Convert the wasmi module to the crates-io version. + pub fn patch(manifest: &mut Document) { + let Some(wasmi) = manifest["dependencies"]["wasmi"].as_inline_table_mut() else { + return; + }; + wasmi.insert("version", "0.13.2".into()); wasmi.remove("branch"); wasmi.remove("git"); } diff --git a/utils/crates-io/src/publisher.rs b/utils/crates-io/src/publisher.rs index 63d12639487..03e08c4ca33 100644 --- a/utils/crates-io/src/publisher.rs +++ b/utils/crates-io/src/publisher.rs @@ -77,20 +77,8 @@ impl Publisher { continue; } - let mut manifest = Manifest::new(pkg)?; - match manifest.name.as_str() { - // gear-core-processor has already been taken by others. - "gear-core-processor" => { - handler::core_processor::patch(&mut manifest.manifest); - } - // convert git dependencies to crates-io dependencies. - "gear-sandbox-host" => { - handler::sandbox_host::patch(&mut manifest.manifest); - } - _ => {} - } - - self.graph.insert(self.index.get(name).cloned(), manifest); + self.graph + .insert(self.index.get(name).cloned(), handler::patch(pkg)?); } workspace.complete(&index)?; From 0b54d5c661da7bac5da615d0fbb17156396cb1f8 Mon Sep 17 00:00:00 2001 From: clearloop Date: Thu, 28 Dec 2023 07:56:37 +0800 Subject: [PATCH 20/37] chore(sandbox): discard the changes for gear-sandbox --- sandbox/host/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sandbox/host/Cargo.toml b/sandbox/host/Cargo.toml index 97362a7feff..662ad165e59 100644 --- a/sandbox/host/Cargo.toml +++ b/sandbox/host/Cargo.toml @@ -19,7 +19,7 @@ thiserror.workspace = true log = { workspace = true, features = ["std"] } sandbox-wasmer.workspace = true sandbox-wasmer-types.workspace = true -wasmi = { version = "0.13.2", git = "https://github.com/gear-tech/wasmi", branch = "v0.13.2-sign-ext", features = ["virtual_memory"] } +wasmi = { git = "https://github.com/gear-tech/wasmi", branch = "v0.13.2-sign-ext", features = ["virtual_memory"] } sp-allocator = { workspace = true, features = ["std"] } sp-wasm-interface-common = { workspace = true, features = ["std"] } gear-sandbox-env = { workspace = true, features = ["std"] } From 95efc71bc1daf81b2ed010a42c36038287cb6ac0 Mon Sep 17 00:00:00 2001 From: clearloop Date: Thu, 28 Dec 2023 08:06:36 +0800 Subject: [PATCH 21/37] chore(crates-io): trim dev-dependencies --- utils/crates-io/src/handler.rs | 104 +++++++++++++++++++++++---------- utils/crates-io/src/lib.rs | 8 +-- 2 files changed, 77 insertions(+), 35 deletions(-) diff --git a/utils/crates-io/src/handler.rs b/utils/crates-io/src/handler.rs index 4402df4bdf0..9b59e066685 100644 --- a/utils/crates-io/src/handler.rs +++ b/utils/crates-io/src/handler.rs @@ -21,6 +21,7 @@ use crate::Manifest; use anyhow::Result; use cargo_metadata::Package; +use toml_edit::Document; /// Patch specified manifest by provided name. pub fn patch(pkg: &Package) -> Result { @@ -31,12 +32,29 @@ pub fn patch(pkg: &Package) -> Result { "gear-core-processor" => core_processor::patch(doc), "gear-sandbox" => sandbox::patch(doc), "gear-sandbox-host" => sandbox_host::patch(doc), + "gmeta" => gmeta::patch(doc), + "gmeta-codegen" => gmeta_codegen::patch(doc), _ => {} } Ok(manifest) } +// Trim the version of dev dependency. +// +// issue: https://github.com/rust-lang/cargo/issues/4242 +fn trim_dev_dep(name: &str, manifest: &mut Document) { + if let Some(dep) = manifest["dev-dependencies"][name].as_inline_table_mut() { + dep.remove("workspace"); + dep.insert("version", "~1".into()); + } + + if let Some(dep) = manifest["dev-dependencies"][name].as_table_like_mut() { + dep.remove("workspace"); + dep.insert("version", toml_edit::value("~1")); + } +} + /// gear-core-processor handler. pub mod core_processor { use toml_edit::{Document, InlineTable}; @@ -62,6 +80,61 @@ pub mod core_processor { } } +/// gmeta handler +pub mod gmeta { + use super::trim_dev_dep; + use toml_edit::Document; + + /// Patch the manifest of gmetadata. + pub fn patch(manifest: &mut Document) { + trim_dev_dep("gstd", manifest); + trim_dev_dep("gear-wasm-builder", manifest); + } +} + +/// gmeta handler +pub mod gmeta_codegen { + use super::trim_dev_dep; + use toml_edit::Document; + + /// Patch the manifest of gmetadata. + pub fn patch(manifest: &mut Document) { + trim_dev_dep("gstd", manifest); + trim_dev_dep("gmeta", manifest); + } +} + +/// sandbox handler. +pub mod sandbox { + use toml_edit::Document; + + /// Convert the wasmi module to the crates-io version. + pub fn patch(manifest: &mut Document) { + let Some(wasmi) = manifest["dependencies"]["wasmi"].as_inline_table_mut() else { + return; + }; + wasmi.insert("package", "gwasmi".into()); + wasmi.insert("version", "0.30.0".into()); + wasmi.remove("branch"); + wasmi.remove("git"); + } +} + +/// sandbox_host handler. +pub mod sandbox_host { + use toml_edit::Document; + + /// Convert the wasmi module to the crates-io version. + pub fn patch(manifest: &mut Document) { + let Some(wasmi) = manifest["dependencies"]["wasmi"].as_inline_table_mut() else { + return; + }; + wasmi.insert("version", "0.13.2".into()); + wasmi.remove("branch"); + wasmi.remove("git"); + } +} + /// substrate handler. pub mod substrate { use toml_edit::InlineTable; @@ -106,34 +179,3 @@ pub mod substrate { table.remove("git"); } } - -/// sandbox handler. -pub mod sandbox { - use toml_edit::Document; - - /// Convert the wasmi module to the crates-io version. - pub fn patch(manifest: &mut Document) { - let Some(wasmi) = manifest["dependencies"]["wasmi"].as_inline_table_mut() else { - return; - }; - wasmi.insert("package", "gwasmi".into()); - wasmi.insert("version", "0.30.0".into()); - wasmi.remove("branch"); - wasmi.remove("git"); - } -} - -/// sandbox_host handler. -pub mod sandbox_host { - use toml_edit::Document; - - /// Convert the wasmi module to the crates-io version. - pub fn patch(manifest: &mut Document) { - let Some(wasmi) = manifest["dependencies"]["wasmi"].as_inline_table_mut() else { - return; - }; - wasmi.insert("version", "0.13.2".into()); - wasmi.remove("branch"); - wasmi.remove("git"); - } -} diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 3e0a41d081a..3b80eec479f 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -46,9 +46,8 @@ pub const SAFE_DEPENDENCIES: [&str; 11] = [ /// Required packages with local dependencies. /// /// NOTE: DO NOT change the order of this array. -pub const STACKED_DEPENDENCIES: [&str; 13] = [ +pub const STACKED_DEPENDENCIES: [&str; 12] = [ "gcore", - "gmeta", "gear-core", "gear-utils", "gear-common", @@ -65,13 +64,14 @@ pub const STACKED_DEPENDENCIES: [&str; 13] = [ /// Packages need to be published. /// /// NOTE: DO NOT change the order of this array. -pub const PACKAGES: [&str; 6] = [ +pub const PACKAGES: [&str; 7] = [ + "gear-wasm-builder", "gstd", + "gmeta", "gtest", "gsdk", "gclient", "gcli", - "gear-wasm-builder", ]; /// Check the input package From b736f8e7fa25d5cd513d3f207142d23d733ab01f Mon Sep 17 00:00:00 2001 From: clearloop Date: Thu, 28 Dec 2023 10:27:25 +0800 Subject: [PATCH 22/37] chore(sp-wasm-interface): hack the bug of crate_name --- utils/crates-io/src/handler.rs | 22 +++++++++++++++++++++- utils/crates-io/src/lib.rs | 6 +++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/utils/crates-io/src/handler.rs b/utils/crates-io/src/handler.rs index 9b59e066685..96c817cfb6b 100644 --- a/utils/crates-io/src/handler.rs +++ b/utils/crates-io/src/handler.rs @@ -23,6 +23,8 @@ use anyhow::Result; use cargo_metadata::Package; use toml_edit::Document; +const SP_WASM_INTERFACE_VERSION: &str = "7.0.5"; + /// Patch specified manifest by provided name. pub fn patch(pkg: &Package) -> Result { let mut manifest = Manifest::new(pkg)?; @@ -30,6 +32,7 @@ pub fn patch(pkg: &Package) -> Result { match manifest.name.as_str() { "gear-core-processor" => core_processor::patch(doc), + "gear-runtime-interface" => runtime_interface::patch(doc), "gear-sandbox" => sandbox::patch(doc), "gear-sandbox-host" => sandbox_host::patch(doc), "gmeta" => gmeta::patch(doc), @@ -104,6 +107,22 @@ pub mod gmeta_codegen { } } +/// runtime interface handler +pub mod runtime_interface { + use super::SP_WASM_INTERFACE_VERSION; + use toml_edit::Document; + + /// Convert the wasmi module to the crates-io version. + pub fn patch(manifest: &mut Document) { + let Some(wi) = manifest["dependencies"]["sp-runtime-interface"].as_table_mut() else { + return; + }; + wi.insert("version", toml_edit::value(SP_WASM_INTERFACE_VERSION)); + wi.insert("package", toml_edit::value("gp-runtime-interface")); + wi.remove("workspace"); + } +} + /// sandbox handler. pub mod sandbox { use toml_edit::Document; @@ -137,6 +156,7 @@ pub mod sandbox_host { /// substrate handler. pub mod substrate { + use super::SP_WASM_INTERFACE_VERSION; use toml_edit::InlineTable; /// Patch the substrate packages in the manifest of workspace. @@ -163,7 +183,7 @@ pub mod substrate { } // Related to sp-wasm-interface. "sp-runtime-interface" => { - table.insert("version", "7.0.3".into()); + table.insert("version", SP_WASM_INTERFACE_VERSION.into()); table.insert("package", "gp-runtime-interface".into()); } // The versions of these packages on crates.io are incorrect. diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 3b80eec479f..69556037b25 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -46,8 +46,9 @@ pub const SAFE_DEPENDENCIES: [&str; 11] = [ /// Required packages with local dependencies. /// /// NOTE: DO NOT change the order of this array. -pub const STACKED_DEPENDENCIES: [&str; 12] = [ +pub const STACKED_DEPENDENCIES: [&str; 13] = [ "gcore", + "gmeta", "gear-core", "gear-utils", "gear-common", @@ -64,10 +65,9 @@ pub const STACKED_DEPENDENCIES: [&str; 12] = [ /// Packages need to be published. /// /// NOTE: DO NOT change the order of this array. -pub const PACKAGES: [&str; 7] = [ +pub const PACKAGES: [&str; 6] = [ "gear-wasm-builder", "gstd", - "gmeta", "gtest", "gsdk", "gclient", From 707ffcaffe0fe14d2dd50ab241dd93f4b03895ac Mon Sep 17 00:00:00 2001 From: clearloop Date: Thu, 28 Dec 2023 10:48:09 +0800 Subject: [PATCH 23/37] chore(gstd): add codegen to workspace manifest --- Cargo.toml | 2 ++ gstd/Cargo.toml | 2 +- utils/crates-io/src/version.rs | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 23c91887b47..6344db119ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -80,6 +80,7 @@ members = [ "gsdk/codegen", "gsdk/api-gen", "gstd", + "gstd/codegen", "gsys", "gtest", "node/cli", @@ -184,6 +185,7 @@ gcli = { path = "gcli" } gclient = { path = "gclient" } gsdk = { path = "gsdk" } gstd = { path = "gstd", features = [ "nightly" ] } +gstd-codegen = { path = "gstd/codegen" } gsys = { path = "gsys" } gtest = { path = "gtest" } gmeta = { path = "gmeta" } diff --git a/gstd/Cargo.toml b/gstd/Cargo.toml index aa6c6ae6d5d..3b9ae7a9f78 100644 --- a/gstd/Cargo.toml +++ b/gstd/Cargo.toml @@ -14,7 +14,7 @@ repository.workspace = true document-features = { version = "0.2.7", optional = true } galloc.workspace = true gcore = { workspace = true, features = ["codec"] } -gstd-codegen = { path = "codegen" } +gstd-codegen.workspace = true gear-core-errors.workspace = true hashbrown.workspace = true bs58 = { workspace = true, features = ["alloc"] } diff --git a/utils/crates-io/src/version.rs b/utils/crates-io/src/version.rs index 7436ff8d3c7..08482142524 100644 --- a/utils/crates-io/src/version.rs +++ b/utils/crates-io/src/version.rs @@ -33,7 +33,11 @@ struct Version { } /// Verify if the package has already been published. -pub fn verify(name: &str, version: &str) -> Result { +pub fn verify(mut name: &str, version: &str) -> Result { + if name == "gear-core-processor" { + name = "core-processor"; + } + let client = reqwest::blocking::Client::builder() .user_agent("gear-crates-io-manager") .build()?; From de33531fce67826ac28a974f34472dfea337e94d Mon Sep 17 00:00:00 2001 From: clearloop Date: Thu, 28 Dec 2023 11:07:13 +0800 Subject: [PATCH 24/37] chore(crates-io): improve patch handler for workspace --- utils/crates-io/src/handler.rs | 25 ++++++++++++++++++------- utils/crates-io/src/manifest.rs | 14 ++++---------- utils/crates-io/src/publisher.rs | 2 +- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/utils/crates-io/src/handler.rs b/utils/crates-io/src/handler.rs index 96c817cfb6b..145dd9fc527 100644 --- a/utils/crates-io/src/handler.rs +++ b/utils/crates-io/src/handler.rs @@ -43,6 +43,17 @@ pub fn patch(pkg: &Package) -> Result { Ok(manifest) } +/// Patch the workspace manifest. +pub fn patch_workspace(name: &str, table: &mut toml_edit::InlineTable) { + match name { + "core-processor" | "gear-core-processor" => core_processor::patch_workspace(name, table), + sub if sub.starts_with("sp-") || sub.starts_with("frame-") => { + substrate::patch_workspace(name, table) + } + _ => {} + } +} + // Trim the version of dev dependency. // // issue: https://github.com/rust-lang/cargo/issues/4242 @@ -59,7 +70,7 @@ fn trim_dev_dep(name: &str, manifest: &mut Document) { } /// gear-core-processor handler. -pub mod core_processor { +mod core_processor { use toml_edit::{Document, InlineTable}; /// Rename core processor related package in the @@ -84,7 +95,7 @@ pub mod core_processor { } /// gmeta handler -pub mod gmeta { +mod gmeta { use super::trim_dev_dep; use toml_edit::Document; @@ -96,7 +107,7 @@ pub mod gmeta { } /// gmeta handler -pub mod gmeta_codegen { +mod gmeta_codegen { use super::trim_dev_dep; use toml_edit::Document; @@ -108,7 +119,7 @@ pub mod gmeta_codegen { } /// runtime interface handler -pub mod runtime_interface { +mod runtime_interface { use super::SP_WASM_INTERFACE_VERSION; use toml_edit::Document; @@ -124,7 +135,7 @@ pub mod runtime_interface { } /// sandbox handler. -pub mod sandbox { +mod sandbox { use toml_edit::Document; /// Convert the wasmi module to the crates-io version. @@ -140,7 +151,7 @@ pub mod sandbox { } /// sandbox_host handler. -pub mod sandbox_host { +mod sandbox_host { use toml_edit::Document; /// Convert the wasmi module to the crates-io version. @@ -155,7 +166,7 @@ pub mod sandbox_host { } /// substrate handler. -pub mod substrate { +mod substrate { use super::SP_WASM_INTERFACE_VERSION; use toml_edit::InlineTable; diff --git a/utils/crates-io/src/manifest.rs b/utils/crates-io/src/manifest.rs index ce6a67c611b..62c1ca105fd 100644 --- a/utils/crates-io/src/manifest.rs +++ b/utils/crates-io/src/manifest.rs @@ -67,7 +67,9 @@ impl Workspace { } /// complete the versions of the specified crates - pub fn complete(&mut self, index: &[&str]) -> Result<()> { + pub fn complete(&mut self, mut index: Vec<&str>) -> Result<()> { + index.push("core-processor"); + let version = self.0.manifest["workspace"]["package"]["version"] .clone() .as_str() @@ -119,15 +121,7 @@ impl Workspace { continue; }; - match name { - "core-processor" | "gear-core-processor" => { - handler::core_processor::patch_workspace(name, table); - } - sub if sub.starts_with("sp-") || sub.starts_with("frame-") => { - handler::substrate::patch_workspace(sub, table); - } - _ => {} - } + handler::patch_workspace(name, table); } Ok(()) diff --git a/utils/crates-io/src/publisher.rs b/utils/crates-io/src/publisher.rs index 03e08c4ca33..b4d350a6fbb 100644 --- a/utils/crates-io/src/publisher.rs +++ b/utils/crates-io/src/publisher.rs @@ -81,7 +81,7 @@ impl Publisher { .insert(self.index.get(name).cloned(), handler::patch(pkg)?); } - workspace.complete(&index)?; + workspace.complete(index)?; // write manifests to disk. let manifest = workspace.into(); From c947d7f158339e53847fc73b35707e8c2749acd6 Mon Sep 17 00:00:00 2001 From: clearloop Date: Thu, 28 Dec 2023 11:11:06 +0800 Subject: [PATCH 25/37] chore(workspace): add gsdk-codegen to workspace manifest --- Cargo.toml | 1 + gsdk/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 6344db119ff..f3991102252 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -184,6 +184,7 @@ gcore = { path = "gcore" } gcli = { path = "gcli" } gclient = { path = "gclient" } gsdk = { path = "gsdk" } +gsdk-codegen = { path = "gsdk/codegen" } gstd = { path = "gstd", features = [ "nightly" ] } gstd-codegen = { path = "gstd/codegen" } gsys = { path = "gsys" } diff --git a/gsdk/Cargo.toml b/gsdk/Cargo.toml index 08f5540537a..b49039d8855 100644 --- a/gsdk/Cargo.toml +++ b/gsdk/Cargo.toml @@ -29,7 +29,7 @@ subxt.workspace = true thiserror.workspace = true sp-runtime = { workspace = true, features = [ "std" ] } sp-core.workspace = true -gsdk-codegen = { path = "codegen" } +gsdk-codegen.workspace = true parking_lot.workspace = true # Importing these two libraries for trimming From 16395b95f03401c1f5745948d67da3df3324e6bb Mon Sep 17 00:00:00 2001 From: clearloop Date: Thu, 28 Dec 2023 11:16:12 +0800 Subject: [PATCH 26/37] chore(crates-io): add gear-runtime-primitives to the workspace --- Cargo.toml | 1 + utils/crates-io/src/lib.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index f3991102252..cb7007fabe6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -205,6 +205,7 @@ gear-lazy-pages-interface = { path = "lazy-pages/interface", default-features = gear-node-testing = { path = "node/testing" } gear-runtime-common = { path = "runtime/common", default-features = false } gear-runtime-interface = { path = "runtime-interface", default-features = false } +gear-runtime-primitives = { path = "runtime/primitives", default-features = false } gear-sandbox = { path = "sandbox/sandbox", default-features = false } gear-sandbox-env = { path = "sandbox/env", default-features = false } gear-sandbox-host = { path = "sandbox/host" } diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 69556037b25..71227ad1ca2 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -29,12 +29,13 @@ use anyhow::Result; use std::process::{Command, ExitStatus}; /// Required Packages without local dependencies. -pub const SAFE_DEPENDENCIES: [&str; 11] = [ +pub const SAFE_DEPENDENCIES: [&str; 12] = [ "actor-system-error", "galloc", "gear-stack-buffer", "gear-core-errors", "gear-common-codegen", + "gear-runtime-primitives", "gear-sandbox-env", "gear-wasm-instrument", "gmeta-codegen", From 87efb5441a2876f8da6e6f739119a171133556c4 Mon Sep 17 00:00:00 2001 From: clearloop Date: Thu, 28 Dec 2023 11:28:26 +0800 Subject: [PATCH 27/37] feat(crates-io): handle package alias --- utils/crates-io/src/handler.rs | 15 +++++++++++---- utils/crates-io/src/lib.rs | 9 +++++++++ utils/crates-io/src/manifest.rs | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/utils/crates-io/src/handler.rs b/utils/crates-io/src/handler.rs index 145dd9fc527..69001aaa15a 100644 --- a/utils/crates-io/src/handler.rs +++ b/utils/crates-io/src/handler.rs @@ -23,8 +23,6 @@ use anyhow::Result; use cargo_metadata::Package; use toml_edit::Document; -const SP_WASM_INTERFACE_VERSION: &str = "7.0.5"; - /// Patch specified manifest by provided name. pub fn patch(pkg: &Package) -> Result { let mut manifest = Manifest::new(pkg)?; @@ -43,6 +41,15 @@ pub fn patch(pkg: &Package) -> Result { Ok(manifest) } +/// Patch package alias. +pub fn patch_alias(index: &mut Vec<&str>) { + for (package, alias) in crate::PACKAGE_ALIAS { + if index.contains(&package) { + index.push(alias); + } + } +} + /// Patch the workspace manifest. pub fn patch_workspace(name: &str, table: &mut toml_edit::InlineTable) { match name { @@ -120,7 +127,7 @@ mod gmeta_codegen { /// runtime interface handler mod runtime_interface { - use super::SP_WASM_INTERFACE_VERSION; + use crate::SP_WASM_INTERFACE_VERSION; use toml_edit::Document; /// Convert the wasmi module to the crates-io version. @@ -167,7 +174,7 @@ mod sandbox_host { /// substrate handler. mod substrate { - use super::SP_WASM_INTERFACE_VERSION; + use crate::SP_WASM_INTERFACE_VERSION; use toml_edit::InlineTable; /// Patch the substrate packages in the manifest of workspace. diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 71227ad1ca2..7c5fc79d22e 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -75,6 +75,15 @@ pub const PACKAGES: [&str; 6] = [ "gcli", ]; +/// Alias for packages. +pub const PACKAGE_ALIAS: [(&str, &str); 2] = [ + ("gear-core-processor", "core-processor"), + ("gear-runtime-primitives", "runtime-primitives"), +]; + +/// The working version of sp-wasm-interface. +pub const SP_WASM_INTERFACE_VERSION: &str = "7.0.5"; + /// Check the input package pub fn check(manifest: &str) -> Result { Command::new("cargo") diff --git a/utils/crates-io/src/manifest.rs b/utils/crates-io/src/manifest.rs index 62c1ca105fd..99555655808 100644 --- a/utils/crates-io/src/manifest.rs +++ b/utils/crates-io/src/manifest.rs @@ -68,7 +68,7 @@ impl Workspace { /// complete the versions of the specified crates pub fn complete(&mut self, mut index: Vec<&str>) -> Result<()> { - index.push("core-processor"); + handler::patch_alias(&mut index); let version = self.0.manifest["workspace"]["package"]["version"] .clone() From 51ee3080d79c83bb6690086ede0be162906a91d5 Mon Sep 17 00:00:00 2001 From: clearloop Date: Mon, 8 Jan 2024 23:37:20 +0800 Subject: [PATCH 28/37] fix(crates-io): deps for gstd and wasm-builder --- Cargo.lock | 1250 ++++++++++++++++++++++++-------- Cargo.toml | 2 +- utils/crates-io/src/handler.rs | 8 +- utils/crates-io/src/lib.rs | 10 +- 4 files changed, 966 insertions(+), 304 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index abbc11c4882..6f28027acde 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,6 +43,15 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aead" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "aead" version = "0.4.3" @@ -50,6 +59,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ "generic-array 0.14.7", + "rand_core 0.6.4", +] + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array 0.14.7", +] + +[[package]] +name = "aes" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" +dependencies = [ + "aes-soft", + "aesni", + "cipher 0.2.5", ] [[package]] @@ -59,25 +90,70 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ "cfg-if", - "cipher", + "cipher 0.3.0", "cpufeatures", "opaque-debug 0.3.0", ] +[[package]] +name = "aes" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +dependencies = [ + "cfg-if", + "cipher 0.4.4", + "cpufeatures", +] + [[package]] name = "aes-gcm" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "ghash", + "aead 0.4.3", + "aes 0.7.5", + "cipher 0.3.0", + "ctr 0.8.0", + "ghash 0.4.4", + "subtle", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead 0.5.2", + "aes 0.8.3", + "cipher 0.4.4", + "ctr 0.9.2", + "ghash 0.5.0", "subtle", ] +[[package]] +name = "aes-soft" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" +dependencies = [ + "cipher 0.2.5", + "opaque-debug 0.3.0", +] + +[[package]] +name = "aesni" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" +dependencies = [ + "cipher 0.2.5", + "opaque-debug 0.3.0", +] + [[package]] name = "ahash" version = "0.7.6" @@ -213,6 +289,12 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + [[package]] name = "array-bytes" version = "6.2.2" @@ -246,13 +328,29 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "asn1-rs" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" +dependencies = [ + "asn1-rs-derive 0.1.0", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] + [[package]] name = "asn1-rs" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ - "asn1-rs-derive", + "asn1-rs-derive 0.4.0", "asn1-rs-impl", "displaydoc", "nom", @@ -262,6 +360,18 @@ dependencies = [ "time", ] +[[package]] +name = "asn1-rs-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + [[package]] name = "asn1-rs-derive" version = "0.4.0" @@ -285,12 +395,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "asn1_der" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" - [[package]] name = "assert_matches" version = "1.5.0" @@ -705,6 +809,16 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "block-modes" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" +dependencies = [ + "block-padding 0.2.1", + "cipher 0.2.5", +] + [[package]] name = "block-modes" version = "0.8.1" @@ -712,7 +826,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2cb03d1bed155d89dce0f845b7899b18a9a163e148fd004e1c28421a783e2d8e" dependencies = [ "block-padding 0.2.1", - "cipher", + "cipher 0.3.0", ] [[package]] @@ -938,6 +1052,17 @@ dependencies = [ "libc", ] +[[package]] +name = "ccm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aca1a8fbc20b50ac9673ff014abfb2b5f4085ee1a850d408f14a159c5853ac7" +dependencies = [ + "aead 0.3.2", + "cipher 0.2.5", + "subtle", +] + [[package]] name = "cexpr" version = "0.6.0" @@ -975,7 +1100,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" dependencies = [ "cfg-if", - "cipher", + "cipher 0.3.0", "cpufeatures", "zeroize", ] @@ -986,9 +1111,9 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" dependencies = [ - "aead", + "aead 0.4.3", "chacha20", - "cipher", + "cipher 0.3.0", "poly1305", "zeroize", ] @@ -1015,11 +1140,20 @@ checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143" dependencies = [ "core2", "multibase", - "multihash 0.17.0", + "multihash", "serde", "unsigned-varint", ] +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "cipher" version = "0.3.0" @@ -1029,6 +1163,16 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + [[package]] name = "clang-sys" version = "1.6.1" @@ -1489,6 +1633,21 @@ dependencies = [ "toml_edit 0.21.0", ] +[[package]] +name = "crc" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crc32fast" version = "1.3.2" @@ -1557,6 +1716,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-bigint" version = "0.5.5" @@ -1576,6 +1747,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.7", + "rand_core 0.6.4", "typenum", ] @@ -1605,7 +1777,16 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" dependencies = [ - "cipher", + "cipher 0.3.0", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher 0.4.4", ] [[package]] @@ -2378,6 +2559,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" dependencies = [ "const-oid", + "pem-rfc7468", "zeroize", ] @@ -2391,13 +2573,27 @@ dependencies = [ "zeroize", ] +[[package]] +name = "der-parser" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" +dependencies = [ + "asn1-rs 0.3.1", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + [[package]] name = "der-parser" version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ - "asn1-rs", + "asn1-rs 0.5.2", "displaydoc", "nom", "num-bigint", @@ -2444,6 +2640,37 @@ dependencies = [ "syn 2.0.41", ] +[[package]] +name = "derive_builder" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -2667,6 +2894,18 @@ dependencies = [ "memmap2", ] +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", +] + [[package]] name = "ecdsa" version = "0.16.9" @@ -2675,8 +2914,8 @@ checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der 0.7.8", "digest 0.10.7", - "elliptic-curve", - "rfc6979", + "elliptic-curve 0.13.7", + "rfc6979 0.4.0", "signature 2.1.0", "spki 0.7.2", ] @@ -2708,8 +2947,6 @@ checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ "curve25519-dalek 3.2.0", "ed25519 1.5.3", - "rand 0.7.3", - "serde", "sha2 0.9.9", "zeroize", ] @@ -2748,6 +2985,28 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest 0.10.7", + "ff 0.12.1", + "generic-array 0.14.7", + "group 0.12.1", + "hkdf 0.12.4", + "pem-rfc7468", + "pkcs8 0.9.0", + "rand_core 0.6.4", + "sec1 0.3.0", + "subtle", + "zeroize", +] + [[package]] name = "elliptic-curve" version = "0.13.7" @@ -2755,11 +3014,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9775b22bc152ad86a0cf23f0f348b884b26add12bf741e7ffc4d4ab2ab4d205" dependencies = [ "base16ct 0.2.0", - "crypto-bigint", + "crypto-bigint 0.5.5", "digest 0.10.7", - "ff", + "ff 0.13.0", "generic-array 0.14.7", - "group", + "group 0.13.0", "pkcs8 0.10.2", "rand_core 0.6.4", "sec1 0.7.3", @@ -3022,6 +3281,16 @@ dependencies = [ "libc", ] +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "ff" version = "0.13.0" @@ -3609,7 +3878,7 @@ checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", "rustls 0.20.8", - "webpki", + "webpki 0.22.0", ] [[package]] @@ -3689,7 +3958,7 @@ dependencies = [ "jsonrpsee 0.16.3", "keyring", "lazy_static", - "libp2p 0.50.1", + "libp2p", "log", "nacl", "rand 0.8.5", @@ -4502,7 +4771,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" dependencies = [ "opaque-debug 0.3.0", - "polyval", + "polyval 0.5.3", +] + +[[package]] +name = "ghash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +dependencies = [ + "opaque-debug 0.3.0", + "polyval 0.6.1", ] [[package]] @@ -4585,13 +4864,24 @@ dependencies = [ "syn 2.0.41", ] +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff", + "ff 0.13.0", "rand_core 0.6.4", "subtle", ] @@ -4858,6 +5148,15 @@ dependencies = [ "hmac 0.11.0", ] +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac 0.12.1", +] + [[package]] name = "hmac" version = "0.8.1" @@ -5173,6 +5472,15 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "instant" version = "0.1.12" @@ -5192,13 +5500,32 @@ dependencies = [ ] [[package]] -name = "intx" -version = "0.1.0" +name = "interceptor" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f38a50a899dc47a6d0ed5508e7f601a2e34c3a85303514b5d137f3c10a0c75" - -[[package]] -name = "io-lifetimes" +checksum = "1e8a11ae2da61704edada656798b61c94b35ecac2c58eb955156987d5e6be90b" +dependencies = [ + "async-trait", + "bytes", + "log", + "rand 0.8.5", + "rtcp", + "rtp", + "thiserror", + "tokio", + "waitgroup", + "webrtc-srtp", + "webrtc-util", +] + +[[package]] +name = "intx" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f38a50a899dc47a6d0ed5508e7f601a2e34c3a85303514b5d137f3c10a0c75" + +[[package]] +name = "io-lifetimes" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" @@ -5522,8 +5849,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b" dependencies = [ "cfg-if", - "ecdsa", - "elliptic-curve", + "ecdsa 0.16.9", + "elliptic-curve 0.13.7", "once_cell", "sha2 0.10.8", ] @@ -5654,30 +5981,9 @@ dependencies = [ [[package]] name = "libp2p" -version = "0.50.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7b0104790be871edcf97db9bd2356604984e623a08d825c3f27852290266b8" -dependencies = [ - "bytes", - "futures", - "futures-timer", - "getrandom 0.2.10", - "instant", - "libp2p-core 0.38.0", - "libp2p-identify 0.41.1", - "libp2p-metrics 0.11.0", - "libp2p-swarm 0.41.1", - "multiaddr 0.16.0", - "parking_lot 0.12.1", - "pin-project", - "smallvec", -] - -[[package]] -name = "libp2p" -version = "0.51.4" +version = "0.51.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" +checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" dependencies = [ "bytes", "futures", @@ -5686,23 +5992,24 @@ dependencies = [ "instant", "libp2p-allow-block-list", "libp2p-connection-limits", - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-dns", - "libp2p-identify 0.42.2", + "libp2p-identify", "libp2p-identity", "libp2p-kad", "libp2p-mdns", - "libp2p-metrics 0.12.0", + "libp2p-metrics", "libp2p-noise", "libp2p-ping", "libp2p-quic", "libp2p-request-response", - "libp2p-swarm 0.42.2", + "libp2p-swarm", "libp2p-tcp", "libp2p-wasm-ext", + "libp2p-webrtc", "libp2p-websocket", "libp2p-yamux", - "multiaddr 0.17.1", + "multiaddr", "pin-project", ] @@ -5712,9 +6019,9 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "510daa05efbc25184458db837f6f9a5143888f1caa742426d92e1833ddd38a50" dependencies = [ - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.42.2", + "libp2p-swarm", "void", ] @@ -5724,44 +6031,10 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4caa33f1d26ed664c4fe2cca81a08c8e07d4c1c04f2f4ac7655c2dd85467fda0" dependencies = [ - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.42.2", - "void", -] - -[[package]] -name = "libp2p-core" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a8fcd392ff67af6cc3f03b1426c41f7f26b6b9aff2dc632c1c56dd649e571f" -dependencies = [ - "asn1_der", - "bs58 0.4.0", - "ed25519-dalek 1.0.1", - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "log", - "multiaddr 0.16.0", - "multihash 0.16.3", - "multistream-select", - "once_cell", - "parking_lot 0.12.1", - "pin-project", - "prost", - "prost-build", - "rand 0.8.5", - "rw-stream-sink", - "sec1 0.3.0", - "sha2 0.10.8", - "smallvec", - "thiserror", - "unsigned-varint", + "libp2p-swarm", "void", - "zeroize", ] [[package]] @@ -5777,8 +6050,8 @@ dependencies = [ "instant", "libp2p-identity", "log", - "multiaddr 0.17.1", - "multihash 0.17.0", + "multiaddr", + "multihash", "multistream-select", "once_cell", "parking_lot 0.12.1", @@ -5799,34 +6072,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146ff7034daae62077c415c2376b8057368042df6ab95f5432ad5e88568b1554" dependencies = [ "futures", - "libp2p-core 0.39.2", + "libp2p-core", "log", "parking_lot 0.12.1", "smallvec", "trust-dns-resolver", ] -[[package]] -name = "libp2p-identify" -version = "0.41.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c052d0026f4817b44869bfb6810f4e1112f43aec8553f2cb38881c524b563abf" -dependencies = [ - "asynchronous-codec", - "futures", - "futures-timer", - "libp2p-core 0.38.0", - "libp2p-swarm 0.41.1", - "log", - "lru 0.8.1", - "prost", - "prost-build", - "prost-codec", - "smallvec", - "thiserror", - "void", -] - [[package]] name = "libp2p-identify" version = "0.42.2" @@ -5837,11 +6089,11 @@ dependencies = [ "either", "futures", "futures-timer", - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.42.2", + "libp2p-swarm", "log", - "lru 0.10.1", + "lru", "quick-protobuf", "quick-protobuf-codec", "smallvec", @@ -5858,8 +6110,8 @@ dependencies = [ "bs58 0.4.0", "ed25519-dalek 2.0.0", "log", - "multiaddr 0.17.1", - "multihash 0.17.0", + "multiaddr", + "multihash", "quick-protobuf", "rand 0.8.5", "sha2 0.10.8", @@ -5881,9 +6133,9 @@ dependencies = [ "futures", "futures-timer", "instant", - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.42.2", + "libp2p-swarm", "log", "quick-protobuf", "rand 0.8.5", @@ -5904,9 +6156,9 @@ dependencies = [ "data-encoding", "futures", "if-watch", - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.42.2", + "libp2p-swarm", "log", "rand 0.8.5", "smallvec", @@ -5916,30 +6168,18 @@ dependencies = [ "void", ] -[[package]] -name = "libp2p-metrics" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad8a64f29da86005c86a4d2728b8a0719e9b192f4092b609fd8790acb9dec55" -dependencies = [ - "libp2p-core 0.38.0", - "libp2p-identify 0.41.1", - "libp2p-swarm 0.41.1", - "prometheus-client 0.18.1", -] - [[package]] name = "libp2p-metrics" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a42ec91e227d7d0dafa4ce88b333cdf5f277253873ab087555c92798db2ddd46" dependencies = [ - "libp2p-core 0.39.2", - "libp2p-identify 0.42.2", + "libp2p-core", + "libp2p-identify", "libp2p-kad", "libp2p-ping", - "libp2p-swarm 0.42.2", - "prometheus-client 0.19.0", + "libp2p-swarm", + "prometheus-client", ] [[package]] @@ -5951,7 +6191,7 @@ dependencies = [ "bytes", "curve25519-dalek 3.2.0", "futures", - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-identity", "log", "once_cell", @@ -5961,7 +6201,7 @@ dependencies = [ "snow", "static_assertions", "thiserror", - "x25519-dalek", + "x25519-dalek 1.1.1", "zeroize", ] @@ -5975,8 +6215,8 @@ dependencies = [ "futures", "futures-timer", "instant", - "libp2p-core 0.39.2", - "libp2p-swarm 0.42.2", + "libp2p-core", + "libp2p-swarm", "log", "rand 0.8.5", "void", @@ -5992,7 +6232,7 @@ dependencies = [ "futures", "futures-timer", "if-watch", - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-identity", "libp2p-tls", "log", @@ -6013,31 +6253,11 @@ dependencies = [ "async-trait", "futures", "instant", - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-identity", - "libp2p-swarm 0.42.2", - "rand 0.8.5", - "smallvec", -] - -[[package]] -name = "libp2p-swarm" -version = "0.41.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a35472fe3276b3855c00f1c032ea8413615e030256429ad5349cdf67c6e1a0" -dependencies = [ - "either", - "fnv", - "futures", - "futures-timer", - "instant", - "libp2p-core 0.38.0", - "log", - "pin-project", + "libp2p-swarm", "rand 0.8.5", "smallvec", - "thiserror", - "void", ] [[package]] @@ -6051,7 +6271,7 @@ dependencies = [ "futures", "futures-timer", "instant", - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-identity", "libp2p-swarm-derive", "log", @@ -6082,7 +6302,7 @@ dependencies = [ "futures-timer", "if-watch", "libc", - "libp2p-core 0.39.2", + "libp2p-core", "log", "socket2 0.4.9", "tokio", @@ -6096,14 +6316,14 @@ checksum = "ff08d13d0dc66e5e9ba6279c1de417b84fa0d0adc3b03e5732928c180ec02781" dependencies = [ "futures", "futures-rustls", - "libp2p-core 0.39.2", + "libp2p-core", "libp2p-identity", - "rcgen", + "rcgen 0.10.0", "ring", "rustls 0.20.8", "thiserror", - "webpki", - "x509-parser", + "webpki 0.22.0", + "x509-parser 0.14.0", "yasna", ] @@ -6115,12 +6335,43 @@ checksum = "77dff9d32353a5887adb86c8afc1de1a94d9e8c3bc6df8b2201d7cdf5c848f43" dependencies = [ "futures", "js-sys", - "libp2p-core 0.39.2", + "libp2p-core", "parity-send-wrapper", "wasm-bindgen", "wasm-bindgen-futures", ] +[[package]] +name = "libp2p-webrtc" +version = "0.4.0-alpha.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dba48592edbc2f60b4bc7c10d65445b0c3964c07df26fdf493b6880d33be36f8" +dependencies = [ + "async-trait", + "asynchronous-codec", + "bytes", + "futures", + "futures-timer", + "hex", + "if-watch", + "libp2p-core", + "libp2p-identity", + "libp2p-noise", + "log", + "multihash", + "quick-protobuf", + "quick-protobuf-codec", + "rand 0.8.5", + "rcgen 0.9.3", + "serde", + "stun", + "thiserror", + "tinytemplate", + "tokio", + "tokio-util", + "webrtc", +] + [[package]] name = "libp2p-websocket" version = "0.41.0" @@ -6130,7 +6381,7 @@ dependencies = [ "either", "futures", "futures-rustls", - "libp2p-core 0.39.2", + "libp2p-core", "log", "parking_lot 0.12.1", "quicksink", @@ -6147,7 +6398,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd21d950662700a385d4c6d68e2f5f54d778e97068cdd718522222ef513bda" dependencies = [ "futures", - "libp2p-core 0.39.2", + "libp2p-core", "log", "thiserror", "yamux", @@ -6321,15 +6572,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "lru" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" -dependencies = [ - "hashbrown 0.12.3", -] - [[package]] name = "lru" version = "0.10.1" @@ -6471,6 +6713,16 @@ dependencies = [ "rawpointer", ] +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest 0.10.7", +] + [[package]] name = "memchr" version = "2.5.0" @@ -6644,24 +6896,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" -[[package]] -name = "multiaddr" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aebdb21e90f81d13ed01dc84123320838e53963c2ca94b60b305d3fa64f31e" -dependencies = [ - "arrayref", - "byteorder", - "data-encoding", - "multibase", - "multihash 0.16.3", - "percent-encoding", - "serde", - "static_assertions", - "unsigned-varint", - "url", -] - [[package]] name = "multiaddr" version = "0.17.1" @@ -6673,7 +6907,7 @@ dependencies = [ "data-encoding", "log", "multibase", - "multihash 0.17.0", + "multihash", "percent-encoding", "serde", "static_assertions", @@ -6692,19 +6926,6 @@ dependencies = [ "data-encoding-macro", ] -[[package]] -name = "multihash" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" -dependencies = [ - "core2", - "digest 0.10.7", - "multihash-derive", - "sha2 0.10.8", - "unsigned-varint", -] - [[package]] name = "multihash" version = "0.17.0" @@ -6953,6 +7174,7 @@ dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", + "memoffset 0.6.5", ] [[package]] @@ -7187,13 +7409,22 @@ dependencies = [ "memchr", ] +[[package]] +name = "oid-registry" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e20717fa0541f39bd146692035c37bedfa532b3e5071b35761082407546b2a" +dependencies = [ + "asn1-rs 0.3.1", +] + [[package]] name = "oid-registry" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" dependencies = [ - "asn1-rs", + "asn1-rs 0.5.2", ] [[package]] @@ -7282,6 +7513,28 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +[[package]] +name = "p256" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" +dependencies = [ + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.8", +] + +[[package]] +name = "p384" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" +dependencies = [ + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.8", +] + [[package]] name = "page_size" version = "0.6.0" @@ -8478,6 +8731,15 @@ dependencies = [ "base64 0.13.1", ] +[[package]] +name = "pem-rfc7468" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -8643,7 +8905,7 @@ checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" dependencies = [ "cpufeatures", "opaque-debug 0.3.0", - "universal-hash", + "universal-hash 0.4.1", ] [[package]] @@ -8655,7 +8917,19 @@ dependencies = [ "cfg-if", "cpufeatures", "opaque-debug 0.3.0", - "universal-hash", + "universal-hash 0.4.1", +] + +[[package]] +name = "polyval" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash 0.5.1", ] [[package]] @@ -8820,18 +9094,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "prometheus-client" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83cd1b99916654a69008fd66b4f9397fbe08e6e51dfe23d4417acf5d3b8cb87c" -dependencies = [ - "dtoa", - "itoa", - "parking_lot 0.12.1", - "prometheus-client-derive-text-encode", -] - [[package]] name = "prometheus-client" version = "0.19.0" @@ -8855,17 +9117,6 @@ dependencies = [ "syn 2.0.41", ] -[[package]] -name = "prometheus-client-derive-text-encode" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a455fbcb954c1a7decf3c586e860fd7889cddf4b8e164be736dbac95a953cd" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "proptest" version = "1.4.0" @@ -8918,19 +9169,6 @@ dependencies = [ "which", ] -[[package]] -name = "prost-codec" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc34979ff898b6e141106178981ce2596c387ea6e62533facfc61a37fc879c0" -dependencies = [ - "asynchronous-codec", - "bytes", - "prost", - "thiserror", - "unsigned-varint", -] - [[package]] name = "prost-derive" version = "0.11.9" @@ -9046,7 +9284,7 @@ dependencies = [ "thiserror", "tinyvec", "tracing", - "webpki", + "webpki 0.22.0", ] [[package]] @@ -9189,6 +9427,19 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "rcgen" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" +dependencies = [ + "pem", + "ring", + "time", + "x509-parser 0.13.2", + "yasna", +] + [[package]] name = "rcgen" version = "0.10.0" @@ -9422,6 +9673,17 @@ dependencies = [ "quick-error", ] +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac 0.12.1", + "zeroize", +] + [[package]] name = "rfc6979" version = "0.4.0" @@ -9497,8 +9759,19 @@ dependencies = [ ] [[package]] -name = "rtnetlink" -version = "0.10.1" +name = "rtcp" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1919efd6d4a6a85d13388f9487549bb8e359f17198cc03ffd72f79b553873691" +dependencies = [ + "bytes", + "thiserror", + "webrtc-util", +] + +[[package]] +name = "rtnetlink" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" dependencies = [ @@ -9521,6 +9794,20 @@ dependencies = [ "winapi", ] +[[package]] +name = "rtp" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2a095411ff00eed7b12e4c6a118ba984d113e1079582570d56a5ee723f11f80" +dependencies = [ + "async-trait", + "bytes", + "rand 0.8.5", + "serde", + "thiserror", + "webrtc-util", +] + [[package]] name = "runtime-fuzzer" version = "0.1.0" @@ -9646,6 +9933,19 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64 0.13.1", + "log", + "ring", + "sct 0.6.1", + "webpki 0.21.4", +] + [[package]] name = "rustls" version = "0.20.8" @@ -9654,8 +9954,8 @@ checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", - "sct", - "webpki", + "sct 0.7.0", + "webpki 0.22.0", ] [[package]] @@ -9667,7 +9967,7 @@ dependencies = [ "log", "ring", "rustls-webpki 0.101.4", - "sct", + "sct 0.7.0", ] [[package]] @@ -10189,7 +10489,7 @@ dependencies = [ "futures", "futures-timer", "ip_network", - "libp2p 0.51.4", + "libp2p", "linked_hash_set", "log", "mockall", @@ -10260,7 +10560,7 @@ dependencies = [ "ahash 0.8.6", "futures", "futures-timer", - "libp2p 0.51.4", + "libp2p", "log", "sc-network", "sc-network-common", @@ -10299,7 +10599,7 @@ dependencies = [ "array-bytes", "async-channel", "futures", - "libp2p 0.51.4", + "libp2p", "log", "parity-scale-codec", "sc-network", @@ -10320,7 +10620,7 @@ dependencies = [ "fork-tree", "futures", "futures-timer", - "libp2p 0.51.4", + "libp2p", "log", "mockall", "parity-scale-codec", @@ -10350,7 +10650,7 @@ source = "git+https://github.com/gear-tech/substrate.git?branch=gear-polkadot-v1 dependencies = [ "array-bytes", "futures", - "libp2p 0.51.4", + "libp2p", "log", "parity-scale-codec", "sc-network", @@ -10373,7 +10673,7 @@ dependencies = [ "futures-timer", "hyper", "hyper-rustls", - "libp2p 0.51.4", + "libp2p", "log", "num_cpus", "once_cell", @@ -10615,7 +10915,7 @@ source = "git+https://github.com/gear-tech/substrate.git?branch=gear-polkadot-v1 dependencies = [ "chrono", "futures", - "libp2p 0.51.4", + "libp2p", "log", "parking_lot 0.12.1", "pin-project", @@ -10909,6 +11209,16 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "sct" version = "0.7.0" @@ -10919,6 +11229,18 @@ dependencies = [ "untrusted", ] +[[package]] +name = "sdp" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d22a5ef407871893fd72b4562ee15e4742269b173959db4b8df6f538c414e13" +dependencies = [ + "rand 0.8.5", + "substring", + "thiserror", + "url", +] + [[package]] name = "seahash" version = "4.1.0" @@ -10935,6 +11257,7 @@ dependencies = [ "der 0.6.1", "generic-array 0.14.7", "pkcs8 0.9.0", + "subtle", "zeroize", ] @@ -10985,9 +11308,9 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1da5c423b8783185fd3fecd1c8796c267d2c089d894ce5a93c280a5d3f780a2" dependencies = [ - "aes", - "block-modes", - "hkdf", + "aes 0.7.5", + "block-modes 0.8.1", + "hkdf 0.11.0", "lazy_static", "num", "rand 0.8.5", @@ -11142,6 +11465,17 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha2" version = "0.8.2" @@ -11227,6 +11561,10 @@ name = "signature" version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] [[package]] name = "signature" @@ -11384,7 +11722,7 @@ dependencies = [ "hex", "itertools", "log", - "lru 0.10.1", + "lru", "parking_lot 0.12.1", "rand 0.8.5", "serde", @@ -11407,7 +11745,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" dependencies = [ - "aes-gcm", + "aes-gcm 0.9.4", "blake2", "chacha20poly1305", "curve25519-dalek 4.0.0", @@ -12338,6 +12676,25 @@ dependencies = [ "syn 2.0.41", ] +[[package]] +name = "stun" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" +dependencies = [ + "base64 0.13.1", + "crc", + "lazy_static", + "md-5", + "rand 0.8.5", + "ring", + "subtle", + "thiserror", + "tokio", + "url", + "webrtc-util", +] + [[package]] name = "substrate-bip39" version = "0.4.4" @@ -12461,6 +12818,15 @@ dependencies = [ "wasm-opt", ] +[[package]] +name = "substring" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" +dependencies = [ + "autocfg", +] + [[package]] name = "subtle" version = "2.4.1" @@ -12833,6 +13199,16 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -13308,6 +13684,25 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" +[[package]] +name = "turn" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" +dependencies = [ + "async-trait", + "base64 0.13.1", + "futures", + "log", + "md-5", + "rand 0.8.5", + "ring", + "stun", + "thiserror", + "tokio", + "webrtc-util", +] + [[package]] name = "twox-hash" version = "1.6.3" @@ -13393,6 +13788,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + [[package]] name = "unsigned-varint" version = "0.7.1" @@ -13433,6 +13838,9 @@ name = "uuid" version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +dependencies = [ + "getrandom 0.2.10", +] [[package]] name = "valuable" @@ -13578,6 +13986,15 @@ dependencies = [ "libc", ] +[[package]] +name = "waitgroup" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" +dependencies = [ + "atomic-waker", +] + [[package]] name = "waker-fn" version = "1.1.0" @@ -14460,6 +14877,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "webpki" version = "0.22.0" @@ -14476,7 +14903,7 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki", + "webpki 0.22.0", ] [[package]] @@ -14494,6 +14921,214 @@ version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +[[package]] +name = "webrtc" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3bc9049bdb2cea52f5fd4f6f728184225bdb867ed0dc2410eab6df5bdd67bb" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "hex", + "interceptor", + "lazy_static", + "log", + "rand 0.8.5", + "rcgen 0.9.3", + "regex", + "ring", + "rtcp", + "rtp", + "rustls 0.19.1", + "sdp", + "serde", + "serde_json", + "sha2 0.10.8", + "stun", + "thiserror", + "time", + "tokio", + "turn", + "url", + "waitgroup", + "webrtc-data", + "webrtc-dtls", + "webrtc-ice", + "webrtc-mdns", + "webrtc-media", + "webrtc-sctp", + "webrtc-srtp", + "webrtc-util", +] + +[[package]] +name = "webrtc-data" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ef36a4d12baa6e842582fe9ec16a57184ba35e1a09308307b67d43ec8883100" +dependencies = [ + "bytes", + "derive_builder", + "log", + "thiserror", + "tokio", + "webrtc-sctp", + "webrtc-util", +] + +[[package]] +name = "webrtc-dtls" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a00f4242f2db33307347bd5be53263c52a0331c96c14292118c9a6bb48d267" +dependencies = [ + "aes 0.6.0", + "aes-gcm 0.10.3", + "async-trait", + "bincode", + "block-modes 0.7.0", + "byteorder", + "ccm", + "curve25519-dalek 3.2.0", + "der-parser 8.2.0", + "elliptic-curve 0.12.3", + "hkdf 0.12.4", + "hmac 0.12.1", + "log", + "p256", + "p384", + "rand 0.8.5", + "rand_core 0.6.4", + "rcgen 0.10.0", + "ring", + "rustls 0.19.1", + "sec1 0.3.0", + "serde", + "sha1", + "sha2 0.10.8", + "signature 1.6.4", + "subtle", + "thiserror", + "tokio", + "webpki 0.21.4", + "webrtc-util", + "x25519-dalek 2.0.0", + "x509-parser 0.13.2", +] + +[[package]] +name = "webrtc-ice" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" +dependencies = [ + "arc-swap", + "async-trait", + "crc", + "log", + "rand 0.8.5", + "serde", + "serde_json", + "stun", + "thiserror", + "tokio", + "turn", + "url", + "uuid", + "waitgroup", + "webrtc-mdns", + "webrtc-util", +] + +[[package]] +name = "webrtc-mdns" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" +dependencies = [ + "log", + "socket2 0.4.9", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-media" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" +dependencies = [ + "byteorder", + "bytes", + "rand 0.8.5", + "rtp", + "thiserror", +] + +[[package]] +name = "webrtc-sctp" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d47adcd9427eb3ede33d5a7f3424038f63c965491beafcc20bc650a2f6679c0" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "crc", + "log", + "rand 0.8.5", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-srtp" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6183edc4c1c6c0175f8812eefdce84dfa0aea9c3ece71c2bf6ddd3c964de3da5" +dependencies = [ + "aead 0.4.3", + "aes 0.7.5", + "aes-gcm 0.9.4", + "async-trait", + "byteorder", + "bytes", + "ctr 0.8.0", + "hmac 0.11.0", + "log", + "rtcp", + "rtp", + "sha-1 0.9.8", + "subtle", + "thiserror", + "tokio", + "webrtc-util", +] + +[[package]] +name = "webrtc-util" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" +dependencies = [ + "async-trait", + "bitflags 1.3.2", + "bytes", + "cc", + "ipnet", + "lazy_static", + "libc", + "log", + "nix 0.24.3", + "rand 0.8.5", + "thiserror", + "tokio", + "winapi", +] + [[package]] name = "which" version = "4.4.2" @@ -14895,19 +15530,50 @@ dependencies = [ "zeroize", ] +[[package]] +name = "x25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" +dependencies = [ + "curve25519-dalek 4.0.0", + "rand_core 0.6.4", + "serde", + "zeroize", +] + +[[package]] +name = "x509-parser" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" +dependencies = [ + "asn1-rs 0.3.1", + "base64 0.13.1", + "data-encoding", + "der-parser 7.0.0", + "lazy_static", + "nom", + "oid-registry 0.4.0", + "ring", + "rusticata-macros", + "thiserror", + "time", +] + [[package]] name = "x509-parser" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" dependencies = [ - "asn1-rs", + "asn1-rs 0.5.2", "base64 0.13.1", "data-encoding", - "der-parser", + "der-parser 8.2.0", "lazy_static", "nom", - "oid-registry", + "oid-registry 0.6.1", "rusticata-macros", "thiserror", "time", diff --git a/Cargo.toml b/Cargo.toml index 975bff2f9b8..8bbb88e0b29 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -429,7 +429,7 @@ impl-trait-for-tuples = "0.2.2" # pall indexmap = "2.1.0" # utils/weight-diff indicatif = "*" # utils/wasm-gen keyring = "1.2.1" # gcli -libp2p = "=0.50.1" # gcli (same version as sc-consensus) +libp2p = "=0.51.3" # gcli (same version as sc-consensus) mimalloc = { version = "0.1.39", default-features = false } # node/cli nacl = "0.5.3" # gcli nonempty = "0.8.1" # utils/utils diff --git a/utils/crates-io/src/handler.rs b/utils/crates-io/src/handler.rs index 69001aaa15a..5913cb8b152 100644 --- a/utils/crates-io/src/handler.rs +++ b/utils/crates-io/src/handler.rs @@ -54,9 +54,7 @@ pub fn patch_alias(index: &mut Vec<&str>) { pub fn patch_workspace(name: &str, table: &mut toml_edit::InlineTable) { match name { "core-processor" | "gear-core-processor" => core_processor::patch_workspace(name, table), - sub if sub.starts_with("sp-") || sub.starts_with("frame-") => { - substrate::patch_workspace(name, table) - } + sub if sub.starts_with("sp-") => substrate::patch_workspace(name, table), _ => {} } } @@ -206,10 +204,8 @@ mod substrate { } // The versions of these packages on crates.io are incorrect. "sp-arithmetic" | "sp-core" | "sp-rpc" | "sp-version" => { - table.insert("version", "7.0.0".into()); + table.insert("version", "22.0.0".into()); } - // Filter out this package for local testing. - "frame-support-test" => return, _ => {} } diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 7c5fc79d22e..978084c8790 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -66,13 +66,13 @@ pub const STACKED_DEPENDENCIES: [&str; 13] = [ /// Packages need to be published. /// /// NOTE: DO NOT change the order of this array. -pub const PACKAGES: [&str; 6] = [ +pub const PACKAGES: [&str; 2] = [ "gear-wasm-builder", "gstd", - "gtest", - "gsdk", - "gclient", - "gcli", + // "gtest", + // "gsdk", + // "gclient", + // "gcli", ]; /// Alias for packages. From 9dbe0dcfd867f05bb9aa5775674e1af972d52d83 Mon Sep 17 00:00:00 2001 From: clearloop Date: Tue, 9 Jan 2024 13:38:45 +0800 Subject: [PATCH 29/37] feat(crates-io): allow skipping verification --- utils/crates-io/src/main.rs | 9 +++++++-- utils/crates-io/src/publisher.rs | 7 ++++--- utils/crates-io/src/version.rs | 2 ++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/utils/crates-io/src/main.rs b/utils/crates-io/src/main.rs index 15fc0b0fe85..a286e9d4568 100644 --- a/utils/crates-io/src/main.rs +++ b/utils/crates-io/src/main.rs @@ -43,14 +43,19 @@ enum Command { /// but run in CI. #[derive(Debug, Parser)] pub struct Opt { + #[clap(short, long, global)] + skip_verify: bool, #[clap(subcommand)] command: Command, } fn main() -> Result<()> { - let Opt { command } = Opt::parse(); + let Opt { + command, + skip_verify, + } = Opt::parse(); - let publisher = Publisher::new()?; + let publisher = Publisher::new(skip_verify)?; match command { Command::Check => publisher.build(None)?.check(), Command::Publish { version } => publisher.build(version)?.publish(), diff --git a/utils/crates-io/src/publisher.rs b/utils/crates-io/src/publisher.rs index b4d350a6fbb..ec2e0925ee5 100644 --- a/utils/crates-io/src/publisher.rs +++ b/utils/crates-io/src/publisher.rs @@ -30,11 +30,12 @@ pub struct Publisher { metadata: Metadata, graph: BTreeMap, Manifest>, index: HashMap, + verify: bool, } impl Publisher { /// Create a new publisher. - pub fn new() -> Result { + pub fn new(skip_verify: bool) -> Result { let metadata = MetadataCommand::new().no_deps().exec()?; let graph = BTreeMap::new(); let index = HashMap::::from_iter( @@ -53,6 +54,7 @@ impl Publisher { metadata, graph, index, + verify: !skip_verify, }) } @@ -71,8 +73,7 @@ impl Publisher { continue; } - println!("Verifying {}@{} ...", &name, &version); - if crate::verify(name, &version)? { + if self.verify && crate::verify(name, &version)? { println!("Package {}@{} already published .", &name, &version); continue; } diff --git a/utils/crates-io/src/version.rs b/utils/crates-io/src/version.rs index 08482142524..aab71a3d12c 100644 --- a/utils/crates-io/src/version.rs +++ b/utils/crates-io/src/version.rs @@ -34,6 +34,8 @@ struct Version { /// Verify if the package has already been published. pub fn verify(mut name: &str, version: &str) -> Result { + println!("Verifying {}@{} ...", &name, &version); + if name == "gear-core-processor" { name = "core-processor"; } From 57c5989917f21ddbc79547e84827e1590e908039 Mon Sep 17 00:00:00 2001 From: clearloop Date: Tue, 9 Jan 2024 13:47:37 +0800 Subject: [PATCH 30/37] fix(crates-io): deps of gsdk --- utils/crates-io/src/handler.rs | 2 +- utils/crates-io/src/lib.rs | 4 ++-- utils/crates-io/src/main.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/crates-io/src/handler.rs b/utils/crates-io/src/handler.rs index 5913cb8b152..fa4540e95d2 100644 --- a/utils/crates-io/src/handler.rs +++ b/utils/crates-io/src/handler.rs @@ -204,7 +204,7 @@ mod substrate { } // The versions of these packages on crates.io are incorrect. "sp-arithmetic" | "sp-core" | "sp-rpc" | "sp-version" => { - table.insert("version", "22.0.0".into()); + table.insert("version", "21.0.0".into()); } _ => {} } diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 978084c8790..490afbbb067 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -66,11 +66,11 @@ pub const STACKED_DEPENDENCIES: [&str; 13] = [ /// Packages need to be published. /// /// NOTE: DO NOT change the order of this array. -pub const PACKAGES: [&str; 2] = [ +pub const PACKAGES: [&str; 3] = [ "gear-wasm-builder", "gstd", // "gtest", - // "gsdk", + "gsdk", // "gclient", // "gcli", ]; diff --git a/utils/crates-io/src/main.rs b/utils/crates-io/src/main.rs index a286e9d4568..dface80a232 100644 --- a/utils/crates-io/src/main.rs +++ b/utils/crates-io/src/main.rs @@ -43,7 +43,7 @@ enum Command { /// but run in CI. #[derive(Debug, Parser)] pub struct Opt { - #[clap(short, long, global)] + #[clap(short, long, global = true)] skip_verify: bool, #[clap(subcommand)] command: Command, From f54af2d49f4fb0ce87d1bf7bee31f8117b98d7d2 Mon Sep 17 00:00:00 2001 From: clearloop Date: Tue, 9 Jan 2024 14:08:22 +0800 Subject: [PATCH 31/37] fix(crates-io): deps of gcli and gclient --- utils/crates-io/src/lib.rs | 6 +++--- utils/crates-io/src/main.rs | 15 +++++---------- utils/crates-io/src/publisher.rs | 8 +++----- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 490afbbb067..4b79fdc6a3e 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -66,13 +66,13 @@ pub const STACKED_DEPENDENCIES: [&str; 13] = [ /// Packages need to be published. /// /// NOTE: DO NOT change the order of this array. -pub const PACKAGES: [&str; 3] = [ +pub const PACKAGES: [&str; 5] = [ "gear-wasm-builder", "gstd", // "gtest", "gsdk", - // "gclient", - // "gcli", + "gclient", + "gcli", ]; /// Alias for packages. diff --git a/utils/crates-io/src/main.rs b/utils/crates-io/src/main.rs index dface80a232..896a1946073 100644 --- a/utils/crates-io/src/main.rs +++ b/utils/crates-io/src/main.rs @@ -43,24 +43,19 @@ enum Command { /// but run in CI. #[derive(Debug, Parser)] pub struct Opt { - #[clap(short, long, global = true)] - skip_verify: bool, #[clap(subcommand)] command: Command, } fn main() -> Result<()> { - let Opt { - command, - skip_verify, - } = Opt::parse(); + let Opt { command } = Opt::parse(); - let publisher = Publisher::new(skip_verify)?; + let publisher = Publisher::new()?; match command { - Command::Check => publisher.build(None)?.check(), - Command::Publish { version } => publisher.build(version)?.publish(), + Command::Check => publisher.build(false, None)?.check(), + Command::Publish { version } => publisher.build(true, version)?.publish(), Command::Build => { - publisher.build(None)?; + publisher.build(false, None)?; Ok(()) } } diff --git a/utils/crates-io/src/publisher.rs b/utils/crates-io/src/publisher.rs index ec2e0925ee5..2153cdac6f8 100644 --- a/utils/crates-io/src/publisher.rs +++ b/utils/crates-io/src/publisher.rs @@ -30,12 +30,11 @@ pub struct Publisher { metadata: Metadata, graph: BTreeMap, Manifest>, index: HashMap, - verify: bool, } impl Publisher { /// Create a new publisher. - pub fn new(skip_verify: bool) -> Result { + pub fn new() -> Result { let metadata = MetadataCommand::new().no_deps().exec()?; let graph = BTreeMap::new(); let index = HashMap::::from_iter( @@ -54,7 +53,6 @@ impl Publisher { metadata, graph, index, - verify: !skip_verify, }) } @@ -63,7 +61,7 @@ impl Publisher { /// 1. Replace git dependencies to crates-io dependencies. /// 2. Rename version of all local packages /// 3. Patch dependencies if needed - pub fn build(mut self, version: Option) -> Result { + pub fn build(mut self, verify: bool, version: Option) -> Result { let index = self.index.keys().map(|s| s.as_ref()).collect::>(); let mut workspace = Workspace::lookup(version)?; let version = workspace.version()?; @@ -73,7 +71,7 @@ impl Publisher { continue; } - if self.verify && crate::verify(name, &version)? { + if verify && crate::verify(name, &version)? { println!("Package {}@{} already published .", &name, &version); continue; } From 4ae13a9ce36f89a93b2b5f32da9a64fdcdfd0fc0 Mon Sep 17 00:00:00 2001 From: clearloop Date: Tue, 9 Jan 2024 14:15:18 +0800 Subject: [PATCH 32/37] fix(crates-io): deps of gtest --- common/src/pallet_tests.rs | 3 +-- utils/crates-io/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/common/src/pallet_tests.rs b/common/src/pallet_tests.rs index 8fdb6b1a044..430084a134b 100644 --- a/common/src/pallet_tests.rs +++ b/common/src/pallet_tests.rs @@ -20,9 +20,8 @@ //! for various pallets of Substrate. //! All used types should be in scope. -use frame_support::{pallet_prelude::*, weights::RuntimeDbWeight}; +use frame_support::{pallet_prelude::*, sp_runtime::Perbill, weights::RuntimeDbWeight}; use frame_system::limits::BlockWeights; -use sp_arithmetic::Perbill; #[macro_export] macro_rules! impl_pallet_balances { diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 4b79fdc6a3e..7c5fc79d22e 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -66,10 +66,10 @@ pub const STACKED_DEPENDENCIES: [&str; 13] = [ /// Packages need to be published. /// /// NOTE: DO NOT change the order of this array. -pub const PACKAGES: [&str; 5] = [ +pub const PACKAGES: [&str; 6] = [ "gear-wasm-builder", "gstd", - // "gtest", + "gtest", "gsdk", "gclient", "gcli", From 0af13a68404b767aa052f135634a18b67d7cb62c Mon Sep 17 00:00:00 2001 From: clearloop Date: Tue, 9 Jan 2024 15:12:30 +0800 Subject: [PATCH 33/37] chore(dep): sync libp2p --- Cargo.lock | 1023 +++---------------------------------------- Cargo.toml | 2 +- core/Cargo.toml | 8 +- gcli/src/cmd/key.rs | 12 +- 4 files changed, 65 insertions(+), 980 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6f28027acde..583227515ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,15 +43,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "aead" version = "0.4.3" @@ -59,28 +50,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ "generic-array 0.14.7", - "rand_core 0.6.4", -] - -[[package]] -name = "aead" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" -dependencies = [ - "crypto-common", - "generic-array 0.14.7", -] - -[[package]] -name = "aes" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" -dependencies = [ - "aes-soft", - "aesni", - "cipher 0.2.5", ] [[package]] @@ -90,70 +59,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ "cfg-if", - "cipher 0.3.0", + "cipher", "cpufeatures", "opaque-debug 0.3.0", ] -[[package]] -name = "aes" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" -dependencies = [ - "cfg-if", - "cipher 0.4.4", - "cpufeatures", -] - [[package]] name = "aes-gcm" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "cipher 0.3.0", - "ctr 0.8.0", - "ghash 0.4.4", - "subtle", -] - -[[package]] -name = "aes-gcm" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" -dependencies = [ - "aead 0.5.2", - "aes 0.8.3", - "cipher 0.4.4", - "ctr 0.9.2", - "ghash 0.5.0", + "aead", + "aes", + "cipher", + "ctr", + "ghash", "subtle", ] -[[package]] -name = "aes-soft" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.0", -] - -[[package]] -name = "aesni" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.0", -] - [[package]] name = "ahash" version = "0.7.6" @@ -289,12 +213,6 @@ dependencies = [ "derive_arbitrary", ] -[[package]] -name = "arc-swap" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" - [[package]] name = "array-bytes" version = "6.2.2" @@ -328,29 +246,13 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "asn1-rs" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" -dependencies = [ - "asn1-rs-derive 0.1.0", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror", - "time", -] - [[package]] name = "asn1-rs" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ - "asn1-rs-derive 0.4.0", + "asn1-rs-derive", "asn1-rs-impl", "displaydoc", "nom", @@ -360,18 +262,6 @@ dependencies = [ "time", ] -[[package]] -name = "asn1-rs-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", -] - [[package]] name = "asn1-rs-derive" version = "0.4.0" @@ -587,12 +477,6 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - [[package]] name = "base16ct" version = "0.2.0" @@ -809,16 +693,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "block-modes" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" -dependencies = [ - "block-padding 0.2.1", - "cipher 0.2.5", -] - [[package]] name = "block-modes" version = "0.8.1" @@ -826,7 +700,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2cb03d1bed155d89dce0f845b7899b18a9a163e148fd004e1c28421a783e2d8e" dependencies = [ "block-padding 0.2.1", - "cipher 0.3.0", + "cipher", ] [[package]] @@ -1052,17 +926,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ccm" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca1a8fbc20b50ac9673ff014abfb2b5f4085ee1a850d408f14a159c5853ac7" -dependencies = [ - "aead 0.3.2", - "cipher 0.2.5", - "subtle", -] - [[package]] name = "cexpr" version = "0.6.0" @@ -1100,7 +963,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" dependencies = [ "cfg-if", - "cipher 0.3.0", + "cipher", "cpufeatures", "zeroize", ] @@ -1111,9 +974,9 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" dependencies = [ - "aead 0.4.3", + "aead", "chacha20", - "cipher 0.3.0", + "cipher", "poly1305", "zeroize", ] @@ -1145,15 +1008,6 @@ dependencies = [ "unsigned-varint", ] -[[package]] -name = "cipher" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "cipher" version = "0.3.0" @@ -1163,16 +1017,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - [[package]] name = "clang-sys" version = "1.6.1" @@ -1633,21 +1477,6 @@ dependencies = [ "toml_edit 0.21.0", ] -[[package]] -name = "crc" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" - [[package]] name = "crc32fast" version = "1.3.2" @@ -1716,18 +1545,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-bigint" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" -dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", - "subtle", - "zeroize", -] - [[package]] name = "crypto-bigint" version = "0.5.5" @@ -1747,7 +1564,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.7", - "rand_core 0.6.4", "typenum", ] @@ -1777,16 +1593,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" dependencies = [ - "cipher 0.3.0", -] - -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher 0.4.4", + "cipher", ] [[package]] @@ -2552,17 +2359,6 @@ dependencies = [ "wabt", ] -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - [[package]] name = "der" version = "0.7.8" @@ -2573,27 +2369,13 @@ dependencies = [ "zeroize", ] -[[package]] -name = "der-parser" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" -dependencies = [ - "asn1-rs 0.3.1", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", -] - [[package]] name = "der-parser" version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "displaydoc", "nom", "num-bigint", @@ -2640,37 +2422,6 @@ dependencies = [ "syn 2.0.41", ] -[[package]] -name = "derive_builder" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" -dependencies = [ - "darling 0.14.4", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_macro" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" -dependencies = [ - "derive_builder_core", - "syn 1.0.109", -] - [[package]] name = "derive_more" version = "0.99.17" @@ -2894,30 +2645,18 @@ dependencies = [ "memmap2", ] -[[package]] -name = "ecdsa" -version = "0.14.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" -dependencies = [ - "der 0.6.1", - "elliptic-curve 0.12.3", - "rfc6979 0.3.1", - "signature 1.6.4", -] - [[package]] name = "ecdsa" version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der 0.7.8", + "der", "digest 0.10.7", - "elliptic-curve 0.13.7", - "rfc6979 0.4.0", + "elliptic-curve", + "rfc6979", "signature 2.1.0", - "spki 0.7.2", + "spki", ] [[package]] @@ -2935,7 +2674,7 @@ version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ - "pkcs8 0.10.2", + "pkcs8", "signature 2.1.0", ] @@ -2985,43 +2724,21 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" -[[package]] -name = "elliptic-curve" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" -dependencies = [ - "base16ct 0.1.1", - "crypto-bigint 0.4.9", - "der 0.6.1", - "digest 0.10.7", - "ff 0.12.1", - "generic-array 0.14.7", - "group 0.12.1", - "hkdf 0.12.4", - "pem-rfc7468", - "pkcs8 0.9.0", - "rand_core 0.6.4", - "sec1 0.3.0", - "subtle", - "zeroize", -] - [[package]] name = "elliptic-curve" version = "0.13.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9775b22bc152ad86a0cf23f0f348b884b26add12bf741e7ffc4d4ab2ab4d205" dependencies = [ - "base16ct 0.2.0", - "crypto-bigint 0.5.5", + "base16ct", + "crypto-bigint", "digest 0.10.7", - "ff 0.13.0", + "ff", "generic-array 0.14.7", - "group 0.13.0", - "pkcs8 0.10.2", + "group", + "pkcs8", "rand_core 0.6.4", - "sec1 0.7.3", + "sec1", "subtle", "zeroize", ] @@ -3281,16 +2998,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ff" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" -dependencies = [ - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "ff" version = "0.13.0" @@ -3878,7 +3585,7 @@ checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", "rustls 0.20.8", - "webpki 0.22.0", + "webpki", ] [[package]] @@ -4771,17 +4478,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" dependencies = [ "opaque-debug 0.3.0", - "polyval 0.5.3", -] - -[[package]] -name = "ghash" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" -dependencies = [ - "opaque-debug 0.3.0", - "polyval 0.6.1", + "polyval", ] [[package]] @@ -4864,24 +4561,13 @@ dependencies = [ "syn 2.0.41", ] -[[package]] -name = "group" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" -dependencies = [ - "ff 0.12.1", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff 0.13.0", + "ff", "rand_core 0.6.4", "subtle", ] @@ -5148,15 +4834,6 @@ dependencies = [ "hmac 0.11.0", ] -[[package]] -name = "hkdf" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" -dependencies = [ - "hmac 0.12.1", -] - [[package]] name = "hmac" version = "0.8.1" @@ -5472,15 +5149,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "instant" version = "0.1.12" @@ -5500,27 +5168,8 @@ dependencies = [ ] [[package]] -name = "interceptor" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8a11ae2da61704edada656798b61c94b35ecac2c58eb955156987d5e6be90b" -dependencies = [ - "async-trait", - "bytes", - "log", - "rand 0.8.5", - "rtcp", - "rtp", - "thiserror", - "tokio", - "waitgroup", - "webrtc-srtp", - "webrtc-util", -] - -[[package]] -name = "intx" -version = "0.1.0" +name = "intx" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f38a50a899dc47a6d0ed5508e7f601a2e34c3a85303514b5d137f3c10a0c75" @@ -5849,8 +5498,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b" dependencies = [ "cfg-if", - "ecdsa 0.16.9", - "elliptic-curve 0.13.7", + "ecdsa", + "elliptic-curve", "once_cell", "sha2 0.10.8", ] @@ -5981,9 +5630,9 @@ dependencies = [ [[package]] name = "libp2p" -version = "0.51.3" +version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" +checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" dependencies = [ "bytes", "futures", @@ -6006,7 +5655,6 @@ dependencies = [ "libp2p-swarm", "libp2p-tcp", "libp2p-wasm-ext", - "libp2p-webrtc", "libp2p-websocket", "libp2p-yamux", "multiaddr", @@ -6201,7 +5849,7 @@ dependencies = [ "snow", "static_assertions", "thiserror", - "x25519-dalek 1.1.1", + "x25519-dalek", "zeroize", ] @@ -6318,12 +5966,12 @@ dependencies = [ "futures-rustls", "libp2p-core", "libp2p-identity", - "rcgen 0.10.0", + "rcgen", "ring", "rustls 0.20.8", "thiserror", - "webpki 0.22.0", - "x509-parser 0.14.0", + "webpki", + "x509-parser", "yasna", ] @@ -6341,37 +5989,6 @@ dependencies = [ "wasm-bindgen-futures", ] -[[package]] -name = "libp2p-webrtc" -version = "0.4.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba48592edbc2f60b4bc7c10d65445b0c3964c07df26fdf493b6880d33be36f8" -dependencies = [ - "async-trait", - "asynchronous-codec", - "bytes", - "futures", - "futures-timer", - "hex", - "if-watch", - "libp2p-core", - "libp2p-identity", - "libp2p-noise", - "log", - "multihash", - "quick-protobuf", - "quick-protobuf-codec", - "rand 0.8.5", - "rcgen 0.9.3", - "serde", - "stun", - "thiserror", - "tinytemplate", - "tokio", - "tokio-util", - "webrtc", -] - [[package]] name = "libp2p-websocket" version = "0.41.0" @@ -6713,16 +6330,6 @@ dependencies = [ "rawpointer", ] -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest 0.10.7", -] - [[package]] name = "memchr" version = "2.5.0" @@ -7174,7 +6781,6 @@ dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", - "memoffset 0.6.5", ] [[package]] @@ -7409,22 +7015,13 @@ dependencies = [ "memchr", ] -[[package]] -name = "oid-registry" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e20717fa0541f39bd146692035c37bedfa532b3e5071b35761082407546b2a" -dependencies = [ - "asn1-rs 0.3.1", -] - [[package]] name = "oid-registry" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", ] [[package]] @@ -7513,28 +7110,6 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" -[[package]] -name = "p256" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.8", -] - -[[package]] -name = "p384" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.8", -] - [[package]] name = "page_size" version = "0.6.0" @@ -8731,15 +8306,6 @@ dependencies = [ "base64 0.13.1", ] -[[package]] -name = "pem-rfc7468" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" -dependencies = [ - "base64ct", -] - [[package]] name = "percent-encoding" version = "2.3.1" @@ -8849,24 +8415,14 @@ dependencies = [ "futures-io", ] -[[package]] -name = "pkcs8" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" -dependencies = [ - "der 0.6.1", - "spki 0.6.0", -] - [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.8", - "spki 0.7.2", + "der", + "spki", ] [[package]] @@ -8905,7 +8461,7 @@ checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" dependencies = [ "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.4.1", + "universal-hash", ] [[package]] @@ -8917,19 +8473,7 @@ dependencies = [ "cfg-if", "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.4.1", -] - -[[package]] -name = "polyval" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" -dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash 0.5.1", + "universal-hash", ] [[package]] @@ -9284,7 +8828,7 @@ dependencies = [ "thiserror", "tinyvec", "tracing", - "webpki 0.22.0", + "webpki", ] [[package]] @@ -9427,19 +8971,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "rcgen" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" -dependencies = [ - "pem", - "ring", - "time", - "x509-parser 0.13.2", - "yasna", -] - [[package]] name = "rcgen" version = "0.10.0" @@ -9673,17 +9204,6 @@ dependencies = [ "quick-error", ] -[[package]] -name = "rfc6979" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" -dependencies = [ - "crypto-bigint 0.4.9", - "hmac 0.12.1", - "zeroize", -] - [[package]] name = "rfc6979" version = "0.4.0" @@ -9758,17 +9278,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rtcp" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1919efd6d4a6a85d13388f9487549bb8e359f17198cc03ffd72f79b553873691" -dependencies = [ - "bytes", - "thiserror", - "webrtc-util", -] - [[package]] name = "rtnetlink" version = "0.10.1" @@ -9794,20 +9303,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rtp" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a095411ff00eed7b12e4c6a118ba984d113e1079582570d56a5ee723f11f80" -dependencies = [ - "async-trait", - "bytes", - "rand 0.8.5", - "serde", - "thiserror", - "webrtc-util", -] - [[package]] name = "runtime-fuzzer" version = "0.1.0" @@ -9933,19 +9428,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "rustls" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" -dependencies = [ - "base64 0.13.1", - "log", - "ring", - "sct 0.6.1", - "webpki 0.21.4", -] - [[package]] name = "rustls" version = "0.20.8" @@ -9954,8 +9436,8 @@ checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", - "sct 0.7.0", - "webpki 0.22.0", + "sct", + "webpki", ] [[package]] @@ -9967,7 +9449,7 @@ dependencies = [ "log", "ring", "rustls-webpki 0.101.4", - "sct 0.7.0", + "sct", ] [[package]] @@ -11209,16 +10691,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" -[[package]] -name = "sct" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "sct" version = "0.7.0" @@ -11229,48 +10701,22 @@ dependencies = [ "untrusted", ] -[[package]] -name = "sdp" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d22a5ef407871893fd72b4562ee15e4742269b173959db4b8df6f538c414e13" -dependencies = [ - "rand 0.8.5", - "substring", - "thiserror", - "url", -] - [[package]] name = "seahash" version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct 0.1.1", - "der 0.6.1", - "generic-array 0.14.7", - "pkcs8 0.9.0", - "subtle", - "zeroize", -] - [[package]] name = "sec1" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct 0.2.0", - "der 0.7.8", + "base16ct", + "der", "generic-array 0.14.7", - "pkcs8 0.10.2", + "pkcs8", "subtle", "zeroize", ] @@ -11308,9 +10754,9 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1da5c423b8783185fd3fecd1c8796c267d2c089d894ce5a93c280a5d3f780a2" dependencies = [ - "aes 0.7.5", - "block-modes 0.8.1", - "hkdf 0.11.0", + "aes", + "block-modes", + "hkdf", "lazy_static", "num", "rand 0.8.5", @@ -11465,17 +10911,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - [[package]] name = "sha2" version = "0.8.2" @@ -11561,10 +10996,6 @@ name = "signature" version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] [[package]] name = "signature" @@ -11745,7 +11176,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" dependencies = [ - "aes-gcm 0.9.4", + "aes-gcm", "blake2", "chacha20poly1305", "curve25519-dalek 4.0.0", @@ -12535,16 +11966,6 @@ dependencies = [ "strum 0.24.1", ] -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der 0.6.1", -] - [[package]] name = "spki" version = "0.7.2" @@ -12552,7 +11973,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der 0.7.8", + "der", ] [[package]] @@ -12676,25 +12097,6 @@ dependencies = [ "syn 2.0.41", ] -[[package]] -name = "stun" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" -dependencies = [ - "base64 0.13.1", - "crc", - "lazy_static", - "md-5", - "rand 0.8.5", - "ring", - "subtle", - "thiserror", - "tokio", - "url", - "webrtc-util", -] - [[package]] name = "substrate-bip39" version = "0.4.4" @@ -12818,15 +12220,6 @@ dependencies = [ "wasm-opt", ] -[[package]] -name = "substring" -version = "1.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" -dependencies = [ - "autocfg", -] - [[package]] name = "subtle" version = "2.4.1" @@ -13199,16 +12592,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -13684,25 +13067,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" -[[package]] -name = "turn" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" -dependencies = [ - "async-trait", - "base64 0.13.1", - "futures", - "log", - "md-5", - "rand 0.8.5", - "ring", - "stun", - "thiserror", - "tokio", - "webrtc-util", -] - [[package]] name = "twox-hash" version = "1.6.3" @@ -13788,16 +13152,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "universal-hash" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" -dependencies = [ - "crypto-common", - "subtle", -] - [[package]] name = "unsigned-varint" version = "0.7.1" @@ -13838,9 +13192,6 @@ name = "uuid" version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" -dependencies = [ - "getrandom 0.2.10", -] [[package]] name = "valuable" @@ -13986,15 +13337,6 @@ dependencies = [ "libc", ] -[[package]] -name = "waitgroup" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" -dependencies = [ - "atomic-waker", -] - [[package]] name = "waker-fn" version = "1.1.0" @@ -14877,16 +14219,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "webpki" version = "0.22.0" @@ -14903,7 +14235,7 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.0", + "webpki", ] [[package]] @@ -14921,214 +14253,6 @@ version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" -[[package]] -name = "webrtc" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3bc9049bdb2cea52f5fd4f6f728184225bdb867ed0dc2410eab6df5bdd67bb" -dependencies = [ - "arc-swap", - "async-trait", - "bytes", - "hex", - "interceptor", - "lazy_static", - "log", - "rand 0.8.5", - "rcgen 0.9.3", - "regex", - "ring", - "rtcp", - "rtp", - "rustls 0.19.1", - "sdp", - "serde", - "serde_json", - "sha2 0.10.8", - "stun", - "thiserror", - "time", - "tokio", - "turn", - "url", - "waitgroup", - "webrtc-data", - "webrtc-dtls", - "webrtc-ice", - "webrtc-mdns", - "webrtc-media", - "webrtc-sctp", - "webrtc-srtp", - "webrtc-util", -] - -[[package]] -name = "webrtc-data" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef36a4d12baa6e842582fe9ec16a57184ba35e1a09308307b67d43ec8883100" -dependencies = [ - "bytes", - "derive_builder", - "log", - "thiserror", - "tokio", - "webrtc-sctp", - "webrtc-util", -] - -[[package]] -name = "webrtc-dtls" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a00f4242f2db33307347bd5be53263c52a0331c96c14292118c9a6bb48d267" -dependencies = [ - "aes 0.6.0", - "aes-gcm 0.10.3", - "async-trait", - "bincode", - "block-modes 0.7.0", - "byteorder", - "ccm", - "curve25519-dalek 3.2.0", - "der-parser 8.2.0", - "elliptic-curve 0.12.3", - "hkdf 0.12.4", - "hmac 0.12.1", - "log", - "p256", - "p384", - "rand 0.8.5", - "rand_core 0.6.4", - "rcgen 0.10.0", - "ring", - "rustls 0.19.1", - "sec1 0.3.0", - "serde", - "sha1", - "sha2 0.10.8", - "signature 1.6.4", - "subtle", - "thiserror", - "tokio", - "webpki 0.21.4", - "webrtc-util", - "x25519-dalek 2.0.0", - "x509-parser 0.13.2", -] - -[[package]] -name = "webrtc-ice" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" -dependencies = [ - "arc-swap", - "async-trait", - "crc", - "log", - "rand 0.8.5", - "serde", - "serde_json", - "stun", - "thiserror", - "tokio", - "turn", - "url", - "uuid", - "waitgroup", - "webrtc-mdns", - "webrtc-util", -] - -[[package]] -name = "webrtc-mdns" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" -dependencies = [ - "log", - "socket2 0.4.9", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-media" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" -dependencies = [ - "byteorder", - "bytes", - "rand 0.8.5", - "rtp", - "thiserror", -] - -[[package]] -name = "webrtc-sctp" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d47adcd9427eb3ede33d5a7f3424038f63c965491beafcc20bc650a2f6679c0" -dependencies = [ - "arc-swap", - "async-trait", - "bytes", - "crc", - "log", - "rand 0.8.5", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-srtp" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6183edc4c1c6c0175f8812eefdce84dfa0aea9c3ece71c2bf6ddd3c964de3da5" -dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "aes-gcm 0.9.4", - "async-trait", - "byteorder", - "bytes", - "ctr 0.8.0", - "hmac 0.11.0", - "log", - "rtcp", - "rtp", - "sha-1 0.9.8", - "subtle", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-util" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" -dependencies = [ - "async-trait", - "bitflags 1.3.2", - "bytes", - "cc", - "ipnet", - "lazy_static", - "libc", - "log", - "nix 0.24.3", - "rand 0.8.5", - "thiserror", - "tokio", - "winapi", -] - [[package]] name = "which" version = "4.4.2" @@ -15530,50 +14654,19 @@ dependencies = [ "zeroize", ] -[[package]] -name = "x25519-dalek" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" -dependencies = [ - "curve25519-dalek 4.0.0", - "rand_core 0.6.4", - "serde", - "zeroize", -] - -[[package]] -name = "x509-parser" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" -dependencies = [ - "asn1-rs 0.3.1", - "base64 0.13.1", - "data-encoding", - "der-parser 7.0.0", - "lazy_static", - "nom", - "oid-registry 0.4.0", - "ring", - "rusticata-macros", - "thiserror", - "time", -] - [[package]] name = "x509-parser" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "base64 0.13.1", "data-encoding", - "der-parser 8.2.0", + "der-parser", "lazy_static", "nom", - "oid-registry 0.6.1", + "oid-registry", "rusticata-macros", "thiserror", "time", diff --git a/Cargo.toml b/Cargo.toml index 2815b939c03..5ab9757fcb1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -429,7 +429,7 @@ impl-trait-for-tuples = "0.2.2" # pall indexmap = "2.1.0" # utils/weight-diff indicatif = "*" # utils/wasm-gen keyring = "1.2.1" # gcli -libp2p = "=0.51.3" # gcli (same version as sc-consensus) +libp2p = "=0.51.4" # gcli (same version as sc-consensus) mimalloc = { version = "0.1.39", default-features = false } # node/cli nacl = "0.5.3" # gcli nonempty = "0.8.1" # utils/utils diff --git a/core/Cargo.toml b/core/Cargo.toml index 7ce41ebc620..70bf12eb509 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -11,11 +11,14 @@ homepage.workspace = true repository.workspace = true [dependencies] +gear-core-errors = { workspace = true, features = ["codec"] } +gsys.workspace = true blake2-rfc.workspace = true parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] } scale-info = { workspace = true, features = ["derive"] } derive_more.workspace = true log.workspace = true +gear-wasm-instrument.workspace = true wasmparser.workspace = true hex = { workspace = true, features = ["alloc"] } hashbrown.workspace = true @@ -25,11 +28,6 @@ enum-iterator.workspace = true byteorder.workspace = true num-traits.workspace = true -# local dependencies -gear-core-errors = { workspace = true, features = ["codec"] } -gear-wasm-instrument.workspace = true -gsys.workspace = true - # Optional dependencies serde = { workspace = true, features = ["derive"], optional = true } diff --git a/gcli/src/cmd/key.rs b/gcli/src/cmd/key.rs index f4ea4d5f715..a2959b5ef4d 100644 --- a/gcli/src/cmd/key.rs +++ b/gcli/src/cmd/key.rs @@ -161,10 +161,7 @@ impl Key { let pair = Keypair::generate(); println!("Secret: 0x{}", hex::encode(pair.secret().as_ref())); - println!( - "Peer ID: {}", - PublicKey::Ed25519(pair.public()).to_peer_id() - ); + println!("Peer ID: {}", PublicKey::from(pair.public()).to_peer_id()); } fn info

(title: &str, signer: &P, seed: Option>) @@ -203,14 +200,11 @@ impl Key { PublicKey, }; let pair = Keypair::from( - SecretKey::from_bytes(&mut hex::decode(secret)?) + SecretKey::try_from_bytes(&mut hex::decode(secret)?) .map_err(|_| crate::result::Error::BadNodeKey)?, ); - println!( - "Peer ID: {}", - PublicKey::Ed25519(pair.public()).to_peer_id() - ); + println!("Peer ID: {}", PublicKey::from(pair.public()).to_peer_id()); Ok(()) } From ddbafb8b59de1e4e9664c29ac3c1ad8e80c9d67e Mon Sep 17 00:00:00 2001 From: clearloop Date: Tue, 9 Jan 2024 15:33:09 +0800 Subject: [PATCH 34/37] ci(crates-io): requires version on publishing --- .github/workflows/crates-io.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/crates-io.yml b/.github/workflows/crates-io.yml index eb7c0fd1b0f..130f2c24041 100644 --- a/.github/workflows/crates-io.yml +++ b/.github/workflows/crates-io.yml @@ -9,6 +9,7 @@ on: default: false version: description: "Workspace version to publish" + required: true type: string pull_request: branches: [master] From c815950aec051422abc97b9865483005dd193c6d Mon Sep 17 00:00:00 2001 From: clearloop Date: Tue, 9 Jan 2024 15:37:52 +0800 Subject: [PATCH 35/37] docs(crates-io): correct the branch of sp-runtime-intefaces --- utils/crates-io/src/handler.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/utils/crates-io/src/handler.rs b/utils/crates-io/src/handler.rs index fa4540e95d2..99703ba07bd 100644 --- a/utils/crates-io/src/handler.rs +++ b/utils/crates-io/src/handler.rs @@ -116,7 +116,7 @@ mod gmeta_codegen { use super::trim_dev_dep; use toml_edit::Document; - /// Patch the manifest of gmetadata. + /// Patch the manifest of gmeta. pub fn patch(manifest: &mut Document) { trim_dev_dep("gstd", manifest); trim_dev_dep("gmeta", manifest); @@ -128,7 +128,7 @@ mod runtime_interface { use crate::SP_WASM_INTERFACE_VERSION; use toml_edit::Document; - /// Convert the wasmi module to the crates-io version. + /// Patch sp-runtime-interface. pub fn patch(manifest: &mut Document) { let Some(wi) = manifest["dependencies"]["sp-runtime-interface"].as_table_mut() else { return; @@ -143,7 +143,7 @@ mod runtime_interface { mod sandbox { use toml_edit::Document; - /// Convert the wasmi module to the crates-io version. + /// Replace the wasmi module to the crates-io version. pub fn patch(manifest: &mut Document) { let Some(wasmi) = manifest["dependencies"]["wasmi"].as_inline_table_mut() else { return; @@ -159,7 +159,7 @@ mod sandbox { mod sandbox_host { use toml_edit::Document; - /// Convert the wasmi module to the crates-io version. + /// Replace the wasmi module to the crates-io version. pub fn patch(manifest: &mut Document) { let Some(wasmi) = manifest["dependencies"]["wasmi"].as_inline_table_mut() else { return; @@ -178,7 +178,7 @@ mod substrate { /// Patch the substrate packages in the manifest of workspace. /// /// NOTE: The packages inside of this function are located at - /// . + /// . pub fn patch_workspace(name: &str, table: &mut InlineTable) { match name { // sp-allocator is outdated on crates.io, last From a58644faf297fd4ff8b7584e16eb486f4862a923 Mon Sep 17 00:00:00 2001 From: clearloop Date: Wed, 10 Jan 2024 21:51:02 +0800 Subject: [PATCH 36/37] docs(crates-io): more docs for core-processor --- utils/crates-io/src/handler.rs | 35 +++++++++++++++++++++++++--------- utils/crates-io/src/lib.rs | 2 +- utils/crates-io/src/version.rs | 13 +++++++------ 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/utils/crates-io/src/handler.rs b/utils/crates-io/src/handler.rs index 99703ba07bd..489bb9bad13 100644 --- a/utils/crates-io/src/handler.rs +++ b/utils/crates-io/src/handler.rs @@ -23,6 +23,17 @@ use anyhow::Result; use cargo_metadata::Package; use toml_edit::Document; +/// Get the crates-io name of package. +pub fn crates_io_name(pkg: &str) -> &str { + // `gear-core-processor` is taken by others, see the docs + // of [`core-processor::patch_workspace`] for more details. + if pkg == "gear-core-processor" { + "core-processor" + } else { + pkg + } +} + /// Patch specified manifest by provided name. pub fn patch(pkg: &Package) -> Result { let mut manifest = Manifest::new(pkg)?; @@ -78,14 +89,17 @@ fn trim_dev_dep(name: &str, manifest: &mut Document) { mod core_processor { use toml_edit::{Document, InlineTable}; - /// Rename core processor related package in the - /// manifest of workspace since `gear-core-processor` - /// has been published by others. + /// Pointing the package name of core-processor to + /// `core-processor` on `crates-io` since this is + /// the one we own. pub fn patch_workspace(name: &str, table: &mut InlineTable) { match name { + // Remove the path definition to point core-processor to + // crates-io. "core-processor" => { table.remove("package"); } + // Points to `core-processor` for the one on crates-io. "gear-core-processor" => { table.insert("package", "core-processor".into()); } @@ -123,17 +137,20 @@ mod gmeta_codegen { } } -/// runtime interface handler mod runtime_interface { - use crate::SP_WASM_INTERFACE_VERSION; + use crate::GP_RUNTIME_INTERFACE_VERSION; use toml_edit::Document; - /// Patch sp-runtime-interface. + /// Patch the manifest of runtime-interface. + /// + /// We need to patch the manifest of package again because + /// `sp_runtime_interface_proc_macro` includes some hardcode + /// that could not locate alias packages. pub fn patch(manifest: &mut Document) { let Some(wi) = manifest["dependencies"]["sp-runtime-interface"].as_table_mut() else { return; }; - wi.insert("version", toml_edit::value(SP_WASM_INTERFACE_VERSION)); + wi.insert("version", toml_edit::value(GP_RUNTIME_INTERFACE_VERSION)); wi.insert("package", toml_edit::value("gp-runtime-interface")); wi.remove("workspace"); } @@ -172,7 +189,7 @@ mod sandbox_host { /// substrate handler. mod substrate { - use crate::SP_WASM_INTERFACE_VERSION; + use crate::GP_RUNTIME_INTERFACE_VERSION; use toml_edit::InlineTable; /// Patch the substrate packages in the manifest of workspace. @@ -199,7 +216,7 @@ mod substrate { } // Related to sp-wasm-interface. "sp-runtime-interface" => { - table.insert("version", SP_WASM_INTERFACE_VERSION.into()); + table.insert("version", GP_RUNTIME_INTERFACE_VERSION.into()); table.insert("package", "gp-runtime-interface".into()); } // The versions of these packages on crates.io are incorrect. diff --git a/utils/crates-io/src/lib.rs b/utils/crates-io/src/lib.rs index 7c5fc79d22e..f75d37b77cb 100644 --- a/utils/crates-io/src/lib.rs +++ b/utils/crates-io/src/lib.rs @@ -82,7 +82,7 @@ pub const PACKAGE_ALIAS: [(&str, &str); 2] = [ ]; /// The working version of sp-wasm-interface. -pub const SP_WASM_INTERFACE_VERSION: &str = "7.0.5"; +pub const GP_RUNTIME_INTERFACE_VERSION: &str = "7.0.5"; /// Check the input package pub fn check(manifest: &str) -> Result { diff --git a/utils/crates-io/src/version.rs b/utils/crates-io/src/version.rs index aab71a3d12c..b5fd0e657f7 100644 --- a/utils/crates-io/src/version.rs +++ b/utils/crates-io/src/version.rs @@ -22,6 +22,8 @@ use anyhow::{anyhow, Result}; use serde::Deserialize; use std::process::Command; +use crate::handler; + #[derive(Debug, Deserialize)] struct Resp { pub versions: Vec, @@ -33,19 +35,18 @@ struct Version { } /// Verify if the package has already been published. -pub fn verify(mut name: &str, version: &str) -> Result { +pub fn verify(name: &str, version: &str) -> Result { println!("Verifying {}@{} ...", &name, &version); - if name == "gear-core-processor" { - name = "core-processor"; - } - let client = reqwest::blocking::Client::builder() .user_agent("gear-crates-io-manager") .build()?; if let Ok(resp) = client - .get(format!("https://crates.io/api/v1/crates/{name}/versions")) + .get(format!( + "https://crates.io/api/v1/crates/{}/versions", + handler::crates_io_name(name) + )) .send()? .json::() { From 6f5c8fa269ac7e8c238ebb3df909aa473c841320 Mon Sep 17 00:00:00 2001 From: clearloop Date: Fri, 12 Jan 2024 14:42:33 +0800 Subject: [PATCH 37/37] docs(gtest): address comments --- gtest/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtest/Cargo.toml b/gtest/Cargo.toml index 48b9b79ff08..73f8817e787 100644 --- a/gtest/Cargo.toml +++ b/gtest/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gtest" -description = "Testing utils for developing gear programs." +description = "Testing utils for developing Gear programs." version.workspace = true authors.workspace = true edition.workspace = true