From 275b4d36f85b50aa913a7437ae54b99434cb9b63 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Fri, 26 Jul 2024 16:05:19 +0200 Subject: [PATCH 01/39] Use umbrella crate for minimal template --- Cargo.lock | 35 ++----------------- templates/minimal/node/Cargo.toml | 31 +--------------- templates/minimal/node/src/chain_spec.rs | 7 ++-- templates/minimal/node/src/cli.rs | 2 +- templates/minimal/node/src/command.rs | 3 +- templates/minimal/node/src/main.rs | 2 +- templates/minimal/node/src/rpc.rs | 11 +++--- templates/minimal/node/src/service.rs | 15 ++++---- templates/minimal/pallets/template/Cargo.toml | 15 +++----- templates/minimal/pallets/template/src/lib.rs | 3 +- templates/minimal/runtime/Cargo.toml | 34 ++---------------- templates/minimal/runtime/build.rs | 2 +- templates/minimal/runtime/src/lib.rs | 28 ++++++++------- 13 files changed, 54 insertions(+), 134 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 05386203452c2..ed52ed88ec0bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8735,48 +8735,19 @@ dependencies = [ "futures-timer", "jsonrpsee", "minimal-template-runtime", - "polkadot-sdk-frame", - "sc-basic-authorship", - "sc-cli", - "sc-client-api", - "sc-consensus", - "sc-consensus-manual-seal", - "sc-executor", - "sc-network", - "sc-offchain", - "sc-rpc-api", - "sc-service", - "sc-telemetry", - "sc-transaction-pool", - "sc-transaction-pool-api", + "polkadot-sdk", "serde_json", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-io", - "sp-keyring", - "sp-runtime", - "sp-timestamp", "substrate-build-script-utils", - "substrate-frame-rpc-system", ] [[package]] name = "minimal-template-runtime" version = "0.0.0" dependencies = [ - "pallet-balances", "pallet-minimal-template", - "pallet-sudo", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", - "polkadot-sdk-frame", + "polkadot-sdk", "scale-info", - "sp-genesis-builder", - "sp-runtime", - "substrate-wasm-builder", ] [[package]] @@ -10960,7 +10931,7 @@ name = "pallet-minimal-template" version = "0.0.0" dependencies = [ "parity-scale-codec", - "polkadot-sdk-frame", + "polkadot-sdk", "scale-info", ] diff --git a/templates/minimal/node/Cargo.toml b/templates/minimal/node/Cargo.toml index 70b24c19f8e7c..3a460d3f7892f 100644 --- a/templates/minimal/node/Cargo.toml +++ b/templates/minimal/node/Cargo.toml @@ -21,36 +21,7 @@ futures-timer = { workspace = true } jsonrpsee = { features = ["server"], workspace = true } serde_json = { workspace = true, default-features = true } -sc-cli = { workspace = true, default-features = true } -sc-executor = { workspace = true, default-features = true } -sc-network = { workspace = true, default-features = true } -sc-service = { workspace = true, default-features = true } -sc-telemetry = { workspace = true, default-features = true } -sc-transaction-pool = { workspace = true, default-features = true } -sc-transaction-pool-api = { workspace = true, default-features = true } -sc-consensus = { workspace = true, default-features = true } -sc-consensus-manual-seal = { workspace = true, default-features = true } -sc-rpc-api = { workspace = true, default-features = true } -sc-basic-authorship = { workspace = true, default-features = true } -sc-offchain = { workspace = true, default-features = true } -sc-client-api = { workspace = true, default-features = true } - -sp-timestamp = { workspace = true, default-features = true } -sp-keyring = { workspace = true, default-features = true } -sp-api = { workspace = true, default-features = true } -sp-blockchain = { workspace = true, default-features = true } -sp-block-builder = { workspace = true, default-features = true } -sp-io = { workspace = true, default-features = true } -sp-runtime = { workspace = true, default-features = true } - -substrate-frame-rpc-system = { workspace = true, default-features = true } - -# Once the native runtime is gone, there should be little to no dependency on FRAME here, and -# certainly no dependency on the runtime. -frame = { features = [ - "experimental", - "runtime", -], workspace = true, default-features = true } +polkadot-sdk = { workspace = true, features = ["node"] } minimal-template-runtime = { workspace = true } [build-dependencies] diff --git a/templates/minimal/node/src/chain_spec.rs b/templates/minimal/node/src/chain_spec.rs index 5b53b0f80ac00..81054b3c194a0 100644 --- a/templates/minimal/node/src/chain_spec.rs +++ b/templates/minimal/node/src/chain_spec.rs @@ -16,9 +16,12 @@ // limitations under the License. use minimal_template_runtime::{BalancesConfig, SudoConfig, WASM_BINARY}; -use sc_service::{ChainType, Properties}; +use polkadot_sdk::{ + sc_service::{ChainType, Properties}, + sp_keyring::AccountKeyring, + *, +}; use serde_json::{json, Value}; -use sp_keyring::AccountKeyring; /// This is a specialization of the general Substrate ChainSpec type. pub type ChainSpec = sc_service::GenericChainSpec; diff --git a/templates/minimal/node/src/cli.rs b/templates/minimal/node/src/cli.rs index 22726b7eb9a36..54107df75a363 100644 --- a/templates/minimal/node/src/cli.rs +++ b/templates/minimal/node/src/cli.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use sc_cli::RunCmd; +use polkadot_sdk::{sc_cli::RunCmd, *}; #[derive(Debug, Clone)] pub enum Consensus { diff --git a/templates/minimal/node/src/command.rs b/templates/minimal/node/src/command.rs index c17f9bc55927b..9c627e2bdf340 100644 --- a/templates/minimal/node/src/command.rs +++ b/templates/minimal/node/src/command.rs @@ -20,8 +20,7 @@ use crate::{ cli::{Cli, Subcommand}, service, }; -use sc_cli::SubstrateCli; -use sc_service::PartialComponents; +use polkadot_sdk::{sc_cli::SubstrateCli, sc_service::PartialComponents, *}; #[cfg(feature = "try-runtime")] use try_runtime_cli::block_building_info::timestamp_with_aura_info; diff --git a/templates/minimal/node/src/main.rs b/templates/minimal/node/src/main.rs index 3cf7d98311eaa..8f36da5bf83a8 100644 --- a/templates/minimal/node/src/main.rs +++ b/templates/minimal/node/src/main.rs @@ -24,6 +24,6 @@ mod command; mod rpc; mod service; -fn main() -> sc_cli::Result<()> { +fn main() -> polkadot_sdk::sc_cli::Result<()> { command::run() } diff --git a/templates/minimal/node/src/rpc.rs b/templates/minimal/node/src/rpc.rs index 451e7b21dd0c1..adc66a0e7dc51 100644 --- a/templates/minimal/node/src/rpc.rs +++ b/templates/minimal/node/src/rpc.rs @@ -24,11 +24,14 @@ use jsonrpsee::RpcModule; use minimal_template_runtime::interface::{AccountId, Nonce, OpaqueBlock}; -use sc_transaction_pool_api::TransactionPool; -use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; +use polkadot_sdk::{ + sc_transaction_pool_api::TransactionPool, + sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}, + *, +}; use std::sync::Arc; -pub use sc_rpc_api::DenyUnsafe; +pub use polkadot_sdk::sc_rpc_api::DenyUnsafe; /// Full client dependencies. pub struct FullDeps { @@ -57,7 +60,7 @@ where C::Api: substrate_frame_rpc_system::AccountNonceApi, P: TransactionPool + 'static, { - use substrate_frame_rpc_system::{System, SystemApiServer}; + use polkadot_sdk::substrate_frame_rpc_system::{System, SystemApiServer}; let mut module = RpcModule::new(()); let FullDeps { client, pool, deny_unsafe } = deps; diff --git a/templates/minimal/node/src/service.rs b/templates/minimal/node/src/service.rs index e298d3dd6dc1f..7338064839912 100644 --- a/templates/minimal/node/src/service.rs +++ b/templates/minimal/node/src/service.rs @@ -17,12 +17,15 @@ use futures::FutureExt; use minimal_template_runtime::{interface::OpaqueBlock as Block, RuntimeApi}; -use sc_client_api::backend::Backend; -use sc_executor::WasmExecutor; -use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; -use sc_telemetry::{Telemetry, TelemetryWorker}; -use sc_transaction_pool_api::OffchainTransactionPoolFactory; -use sp_runtime::traits::Block as BlockT; +use polkadot_sdk::{ + sc_client_api::backend::Backend, + sc_executor::WasmExecutor, + sc_service::{error::Error as ServiceError, Configuration, TaskManager}, + sc_telemetry::{Telemetry, TelemetryWorker}, + sc_transaction_pool_api::OffchainTransactionPoolFactory, + sp_runtime::traits::Block as BlockT, + *, +}; use std::sync::Arc; use crate::cli::Consensus; diff --git a/templates/minimal/pallets/template/Cargo.toml b/templates/minimal/pallets/template/Cargo.toml index 9d231fe7d7d45..c7eea002a999f 100644 --- a/templates/minimal/pallets/template/Cargo.toml +++ b/templates/minimal/pallets/template/Cargo.toml @@ -13,18 +13,11 @@ publish = false targets = ["x86_64-unknown-linux-gnu"] [dependencies] -codec = { features = [ - "derive", -], workspace = true } -scale-info = { features = [ - "derive", -], workspace = true } -frame = { features = [ - "experimental", - "runtime", -], workspace = true } +codec = { features = ["derive"], workspace = true } +scale-info = { features = ["derive"], workspace = true } +polkadot-sdk = { workspace = true, default-features = false, features = ["runtime", "experimental"] } [features] default = ["std"] -std = ["codec/std", "frame/std", "scale-info/std"] +std = ["codec/std", "polkadot-sdk/std", "scale-info/std"] diff --git a/templates/minimal/pallets/template/src/lib.rs b/templates/minimal/pallets/template/src/lib.rs index 92b90ad4412b0..debb834903156 100644 --- a/templates/minimal/pallets/template/src/lib.rs +++ b/templates/minimal/pallets/template/src/lib.rs @@ -5,7 +5,7 @@ #![cfg_attr(not(feature = "std"), no_std)] -use frame::prelude::*; +use polkadot_sdk::{polkadot_sdk_frame as frame, polkadot_sdk_frame::prelude::*}; // Re-export all pallet parts, this is needed to properly import the pallet into the runtime. pub use pallet::*; @@ -15,6 +15,7 @@ pub mod pallet { use super::*; #[pallet::config] + #[pallet::disable_frame_system_supertrait_check] pub trait Config: frame_system::Config {} #[pallet::pallet] diff --git a/templates/minimal/runtime/Cargo.toml b/templates/minimal/runtime/Cargo.toml index 5d3cf8492e522..7dc155fbb512d 100644 --- a/templates/minimal/runtime/Cargo.toml +++ b/templates/minimal/runtime/Cargo.toml @@ -12,47 +12,19 @@ publish = false [dependencies] codec = { workspace = true } scale-info = { workspace = true } - -# this is a frame-based runtime, thus importing `frame` with runtime feature enabled. -frame = { features = [ - "experimental", - "runtime", -], workspace = true } - -# pallets that we want to use -pallet-balances = { workspace = true } -pallet-sudo = { workspace = true } -pallet-timestamp = { workspace = true } -pallet-transaction-payment = { workspace = true } -pallet-transaction-payment-rpc-runtime-api = { workspace = true } - -# genesis builder that allows us to interact with runtime genesis config -sp-genesis-builder = { workspace = true } -sp-runtime = { features = ["serde"], workspace = true } +polkadot-sdk = { workspace = true, features = ["runtime"] } # local pallet templates pallet-minimal-template = { workspace = true } [build-dependencies] -substrate-wasm-builder = { optional = true, workspace = true, default-features = true } +polkadot-sdk = { optional = true, workspace = true, features = ["substrate-wasm-builder"] } [features] default = ["std"] std = [ "codec/std", "scale-info/std", - - "frame/std", - - "pallet-balances/std", - "pallet-sudo/std", - "pallet-timestamp/std", - "pallet-transaction-payment-rpc-runtime-api/std", - "pallet-transaction-payment/std", - + "polkadot-sdk/std", "pallet-minimal-template/std", - - "sp-genesis-builder/std", - "sp-runtime/std", - "substrate-wasm-builder", ] diff --git a/templates/minimal/runtime/build.rs b/templates/minimal/runtime/build.rs index e6f92757e2254..2cb2966b5d822 100644 --- a/templates/minimal/runtime/build.rs +++ b/templates/minimal/runtime/build.rs @@ -18,6 +18,6 @@ fn main() { #[cfg(feature = "std")] { - substrate_wasm_builder::WasmBuilder::build_using_defaults(); + polkadot_sdk::substrate_wasm_builder::WasmBuilder::build_using_defaults(); } } diff --git a/templates/minimal/runtime/src/lib.rs b/templates/minimal/runtime/src/lib.rs index 08ad537ecdd14..a5b23f37de1b6 100644 --- a/templates/minimal/runtime/src/lib.rs +++ b/templates/minimal/runtime/src/lib.rs @@ -26,20 +26,24 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); extern crate alloc; use alloc::{vec, vec::Vec}; -use frame::{ - deps::frame_support::{ - genesis_builder_helper::{build_state, get_preset}, - runtime, - weights::{FixedFee, NoFee}, - }, - prelude::*, - runtime::{ - apis::{ - self, impl_runtime_apis, ApplyExtrinsicResult, CheckInherentsResult, - ExtrinsicInclusionMode, OpaqueMetadata, +use polkadot_sdk::{ + polkadot_sdk_frame as frame, + polkadot_sdk_frame::{ + deps::frame_support::{ + genesis_builder_helper::{build_state, get_preset}, + runtime, + weights::{FixedFee, NoFee}, }, prelude::*, + runtime::{ + apis::{ + self, impl_runtime_apis, ApplyExtrinsicResult, CheckInherentsResult, + ExtrinsicInclusionMode, OpaqueMetadata, + }, + prelude::*, + }, }, + *, }; /// The runtime version. @@ -296,7 +300,7 @@ impl_runtime_apis! { // https://github.com/paritytech/substrate/issues/10579#issuecomment-1600537558 pub mod interface { use super::Runtime; - use frame::deps::frame_system; + use polkadot_sdk::{polkadot_sdk_frame as frame, *}; pub type Block = super::Block; pub use frame::runtime::types_common::OpaqueBlock; From 6630adc9cd533a53e639246f788f575c65aa318c Mon Sep 17 00:00:00 2001 From: pgherveou Date: Fri, 26 Jul 2024 16:14:12 +0200 Subject: [PATCH 02/39] Add missing cargo changes --- Cargo.lock | 1 - templates/minimal/node/Cargo.toml | 4 ++-- templates/minimal/node/build.rs | 2 +- templates/minimal/node/src/chain_spec.rs | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed52ed88ec0bd..782091ceaa310 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8737,7 +8737,6 @@ dependencies = [ "minimal-template-runtime", "polkadot-sdk", "serde_json", - "substrate-build-script-utils", ] [[package]] diff --git a/templates/minimal/node/Cargo.toml b/templates/minimal/node/Cargo.toml index 3a460d3f7892f..d1d1dd455378f 100644 --- a/templates/minimal/node/Cargo.toml +++ b/templates/minimal/node/Cargo.toml @@ -21,11 +21,11 @@ futures-timer = { workspace = true } jsonrpsee = { features = ["server"], workspace = true } serde_json = { workspace = true, default-features = true } -polkadot-sdk = { workspace = true, features = ["node"] } +polkadot-sdk = { workspace = true, features = ["node", "experimental"] } minimal-template-runtime = { workspace = true } [build-dependencies] -substrate-build-script-utils = { workspace = true, default-features = true } +polkadot-sdk = { workspace = true, features = ["substrate-build-script-utils"] } [features] default = [] diff --git a/templates/minimal/node/build.rs b/templates/minimal/node/build.rs index fa7686e01099f..47ab77ae29690 100644 --- a/templates/minimal/node/build.rs +++ b/templates/minimal/node/build.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed}; +use polkadot_sdk::substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed}; fn main() { generate_cargo_keys(); diff --git a/templates/minimal/node/src/chain_spec.rs b/templates/minimal/node/src/chain_spec.rs index 81054b3c194a0..0646460acef64 100644 --- a/templates/minimal/node/src/chain_spec.rs +++ b/templates/minimal/node/src/chain_spec.rs @@ -45,8 +45,8 @@ pub fn development_config() -> Result { /// Configure initial storage state for FRAME pallets. fn testnet_genesis() -> Value { - use frame::traits::Get; use minimal_template_runtime::interface::{Balance, MinimumBalance}; + use polkadot_sdk::polkadot_sdk_frame::traits::Get; let endowment = >::get().max(1) * 1000; let balances = AccountKeyring::iter() .map(|a| (a.to_account_id(), endowment)) From 93d6364fd81850040f83fc4f3e9b8db5d1cc64da Mon Sep 17 00:00:00 2001 From: pgherveou Date: Fri, 26 Jul 2024 16:22:41 +0200 Subject: [PATCH 03/39] format cargo.toml with taplo --- templates/minimal/pallets/template/Cargo.toml | 5 ++++- templates/minimal/runtime/Cargo.toml | 12 +++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/templates/minimal/pallets/template/Cargo.toml b/templates/minimal/pallets/template/Cargo.toml index c7eea002a999f..e07409b6cb4c7 100644 --- a/templates/minimal/pallets/template/Cargo.toml +++ b/templates/minimal/pallets/template/Cargo.toml @@ -15,7 +15,10 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { features = ["derive"], workspace = true } scale-info = { features = ["derive"], workspace = true } -polkadot-sdk = { workspace = true, default-features = false, features = ["runtime", "experimental"] } +polkadot-sdk = { workspace = true, default-features = false, features = [ + "runtime", + "experimental", +] } [features] diff --git a/templates/minimal/runtime/Cargo.toml b/templates/minimal/runtime/Cargo.toml index 7dc155fbb512d..d67d752a79045 100644 --- a/templates/minimal/runtime/Cargo.toml +++ b/templates/minimal/runtime/Cargo.toml @@ -18,13 +18,15 @@ polkadot-sdk = { workspace = true, features = ["runtime"] } pallet-minimal-template = { workspace = true } [build-dependencies] -polkadot-sdk = { optional = true, workspace = true, features = ["substrate-wasm-builder"] } +polkadot-sdk = { optional = true, workspace = true, features = [ + "substrate-wasm-builder", +] } [features] default = ["std"] std = [ - "codec/std", - "scale-info/std", - "polkadot-sdk/std", - "pallet-minimal-template/std", + "codec/std", + "scale-info/std", + "polkadot-sdk/std", + "pallet-minimal-template/std", ] From 694294dff4144d37f89869eafea005341d1ed7fd Mon Sep 17 00:00:00 2001 From: pgherveou Date: Fri, 26 Jul 2024 16:27:31 +0200 Subject: [PATCH 04/39] Update cargo.toml formatting (2) --- templates/minimal/node/Cargo.toml | 2 +- templates/minimal/pallets/template/Cargo.toml | 4 ++-- templates/minimal/runtime/Cargo.toml | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/minimal/node/Cargo.toml b/templates/minimal/node/Cargo.toml index d1d1dd455378f..b551530ca00ff 100644 --- a/templates/minimal/node/Cargo.toml +++ b/templates/minimal/node/Cargo.toml @@ -21,7 +21,7 @@ futures-timer = { workspace = true } jsonrpsee = { features = ["server"], workspace = true } serde_json = { workspace = true, default-features = true } -polkadot-sdk = { workspace = true, features = ["node", "experimental"] } +polkadot-sdk = { workspace = true, features = ["experimental", "node"] } minimal-template-runtime = { workspace = true } [build-dependencies] diff --git a/templates/minimal/pallets/template/Cargo.toml b/templates/minimal/pallets/template/Cargo.toml index e07409b6cb4c7..9a02d4daeaac3 100644 --- a/templates/minimal/pallets/template/Cargo.toml +++ b/templates/minimal/pallets/template/Cargo.toml @@ -16,8 +16,8 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { features = ["derive"], workspace = true } scale-info = { features = ["derive"], workspace = true } polkadot-sdk = { workspace = true, default-features = false, features = [ - "runtime", - "experimental", + "experimental", + "runtime", ] } diff --git a/templates/minimal/runtime/Cargo.toml b/templates/minimal/runtime/Cargo.toml index d67d752a79045..19bb5befdb8ed 100644 --- a/templates/minimal/runtime/Cargo.toml +++ b/templates/minimal/runtime/Cargo.toml @@ -19,14 +19,14 @@ pallet-minimal-template = { workspace = true } [build-dependencies] polkadot-sdk = { optional = true, workspace = true, features = [ - "substrate-wasm-builder", + "substrate-wasm-builder", ] } [features] default = ["std"] std = [ - "codec/std", - "scale-info/std", - "polkadot-sdk/std", - "pallet-minimal-template/std", + "codec/std", + "pallet-minimal-template/std", + "polkadot-sdk/std", + "scale-info/std", ] From a7c49f0b13621c70536a3e26bf9527be38a53d68 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Fri, 26 Jul 2024 16:39:59 +0200 Subject: [PATCH 05/39] remove minimal/Cargo.toml --- templates/minimal/Cargo.toml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 templates/minimal/Cargo.toml diff --git a/templates/minimal/Cargo.toml b/templates/minimal/Cargo.toml deleted file mode 100644 index ba96e139bcf19..0000000000000 --- a/templates/minimal/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "minimal-template" -description = "A minimal template built with Substrate, part of Polkadot Sdk." -version = "0.0.0" -license = "Unlicense" -authors.workspace = true -homepage.workspace = true -repository.workspace = true -edition.workspace = true -publish = false - -[dependencies] -minimal-template-node = { workspace = true } -minimal-template-runtime = { workspace = true } -pallet-minimal-template = { workspace = true, default-features = true } -polkadot-sdk-docs = { workspace = true } - -frame = { workspace = true, default-features = true } - -# How we build docs in rust-docs -simple-mermaid = "0.1.1" -docify = { workspace = true } From b6d704d8ccd935c4fe545ae7fa4111a0ae371ad6 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Fri, 26 Jul 2024 16:42:38 +0200 Subject: [PATCH 06/39] Update cargo.toml --- Cargo.lock | 13 ------------- Cargo.toml | 1 - 2 files changed, 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 782091ceaa310..f102143d1ef9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8712,19 +8712,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "minimal-template" -version = "0.0.0" -dependencies = [ - "docify", - "minimal-template-node", - "minimal-template-runtime", - "pallet-minimal-template", - "polkadot-sdk-docs", - "polkadot-sdk-frame", - "simple-mermaid 0.1.1", -] - [[package]] name = "minimal-template-node" version = "0.0.0" diff --git a/Cargo.toml b/Cargo.toml index 50c9fc88836fe..8a491abba9094 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -522,7 +522,6 @@ members = [ "substrate/utils/prometheus", "substrate/utils/substrate-bip39", "substrate/utils/wasm-builder", - "templates/minimal", "templates/minimal/node", "templates/minimal/pallets/template", "templates/minimal/runtime", From 64910cfdadbc614b30eab1125e1b41ea5fc9c040 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Fri, 26 Jul 2024 16:51:50 +0200 Subject: [PATCH 07/39] Add experimental feature flag --- templates/minimal/runtime/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/minimal/runtime/Cargo.toml b/templates/minimal/runtime/Cargo.toml index 19bb5befdb8ed..96029fc461b01 100644 --- a/templates/minimal/runtime/Cargo.toml +++ b/templates/minimal/runtime/Cargo.toml @@ -12,7 +12,7 @@ publish = false [dependencies] codec = { workspace = true } scale-info = { workspace = true } -polkadot-sdk = { workspace = true, features = ["runtime"] } +polkadot-sdk = { workspace = true, features = ["runtime", "experimental"] } # local pallet templates pallet-minimal-template = { workspace = true } From 1ef3029e66cf7098cb4f2dee0eed19db1f60c5f8 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Sun, 28 Jul 2024 11:15:27 +0200 Subject: [PATCH 08/39] Fix minimal template pallet::config check --- templates/minimal/pallets/template/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/minimal/pallets/template/src/lib.rs b/templates/minimal/pallets/template/src/lib.rs index debb834903156..b8a8614932a63 100644 --- a/templates/minimal/pallets/template/src/lib.rs +++ b/templates/minimal/pallets/template/src/lib.rs @@ -5,7 +5,7 @@ #![cfg_attr(not(feature = "std"), no_std)] -use polkadot_sdk::{polkadot_sdk_frame as frame, polkadot_sdk_frame::prelude::*}; +use polkadot_sdk::polkadot_sdk_frame as frame; // Re-export all pallet parts, this is needed to properly import the pallet into the runtime. pub use pallet::*; @@ -15,8 +15,7 @@ pub mod pallet { use super::*; #[pallet::config] - #[pallet::disable_frame_system_supertrait_check] - pub trait Config: frame_system::Config {} + pub trait Config: polkadot_sdk::frame_system::Config {} #[pallet::pallet] pub struct Pallet(_); From d96d3b2b9411663a89356003fbfe2ac045b40aec Mon Sep 17 00:00:00 2001 From: kianenigma Date: Tue, 13 Aug 2024 15:17:13 +0100 Subject: [PATCH 09/39] a few fixes from kian --- substrate/frame/src/lib.rs | 27 ++++++++++++++++++++------- templates/minimal/runtime/src/lib.rs | 20 ++++---------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/substrate/frame/src/lib.rs b/substrate/frame/src/lib.rs index 3836e71cb00f2..c563a8967dbf5 100644 --- a/substrate/frame/src/lib.rs +++ b/substrate/frame/src/lib.rs @@ -177,8 +177,15 @@ pub mod runtime { pub use frame_executive::*; /// Macro to amalgamate the runtime into `struct Runtime`. + /// + /// Consider using the new version of this [`frame_runtime`]. pub use frame_support::construct_runtime; + /// Macro to amalgamate the runtime into `struct Runtime`. + /// + /// This is the newer version of [`construct_runtime`]. + pub use frame_support::runtime as frame_construct_runtime; + /// Macro to easily derive the `Config` trait of various pallet for `Runtime`. pub use frame_support::derive_impl; @@ -186,12 +193,18 @@ pub mod runtime { // TODO: using linking in the Get in the line above triggers an ICE :/ pub use frame_support::{ord_parameter_types, parameter_types}; + /// For building genesis config. + pub use frame_support::genesis_builder_helper::{build_state, get_preset}; + /// Const types that can easily be used in conjuncture with `Get`. pub use frame_support::traits::{ ConstBool, ConstI128, ConstI16, ConstI32, ConstI64, ConstI8, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, }; + /// Used for simple fee calculation. + pub use frame_support::weights::{self, FixedFee, NoFee}; + /// Primary types used to parameterize `EnsureOrigin` and `EnsureRootWithArg`. pub use frame_system::{ EnsureNever, EnsureNone, EnsureRoot, EnsureRootWithSuccess, EnsureSigned, @@ -201,11 +214,16 @@ pub mod runtime { /// Types to define your runtime version. pub use sp_version::{create_runtime_str, runtime_version, RuntimeVersion}; + #[cfg(feature = "std")] + pub use sp_version::NativeVersion; + /// Macro to implement runtime APIs. pub use sp_api::impl_runtime_apis; - #[cfg(feature = "std")] - pub use sp_version::NativeVersion; + // Types often used in the runtime APIs. + pub use sp_core::OpaqueMetadata; + pub use sp_inherents::{CheckInherentsResult, InherentData}; + pub use sp_runtime::{ApplyExtrinsicResult, ExtrinsicInclusionMode}; } /// Types and traits for runtimes that implement runtime APIs. @@ -223,11 +241,6 @@ pub mod runtime { // moved to file similarly. #[allow(ambiguous_glob_reexports)] pub mod apis { - // Types often used in the runtime APIs. - pub use sp_core::OpaqueMetadata; - pub use sp_inherents::{CheckInherentsResult, InherentData}; - pub use sp_runtime::{ApplyExtrinsicResult, ExtrinsicInclusionMode}; - pub use frame_system_rpc_runtime_api::*; pub use sp_api::{self, *}; pub use sp_block_builder::*; diff --git a/templates/minimal/runtime/src/lib.rs b/templates/minimal/runtime/src/lib.rs index a5b23f37de1b6..474d9ddfb9e87 100644 --- a/templates/minimal/runtime/src/lib.rs +++ b/templates/minimal/runtime/src/lib.rs @@ -26,22 +26,12 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); extern crate alloc; use alloc::{vec, vec::Vec}; +use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; use polkadot_sdk::{ - polkadot_sdk_frame as frame, polkadot_sdk_frame::{ - deps::frame_support::{ - genesis_builder_helper::{build_state, get_preset}, - runtime, - weights::{FixedFee, NoFee}, - }, + self as frame, prelude::*, - runtime::{ - apis::{ - self, impl_runtime_apis, ApplyExtrinsicResult, CheckInherentsResult, - ExtrinsicInclusionMode, OpaqueMetadata, - }, - prelude::*, - }, + runtime::{apis, prelude::*}, }, *, }; @@ -87,7 +77,7 @@ type SignedExtra = ( ); // Composes the runtime by adding all the used pallets and deriving necessary types. -#[runtime] +#[frame_construct_runtime] mod runtime { /// The main runtime type. #[runtime::runtime] @@ -175,8 +165,6 @@ type Header = HeaderFor; type RuntimeExecutive = Executive, Runtime, AllPalletsWithSystem>; -use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; - impl_runtime_apis! { impl apis::Core for Runtime { fn version() -> RuntimeVersion { From 8cea3d85b9b481bb018cc08e094a2ba57b2814b5 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Tue, 13 Aug 2024 15:19:11 +0100 Subject: [PATCH 10/39] fix toml --- templates/minimal/runtime/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/minimal/runtime/Cargo.toml b/templates/minimal/runtime/Cargo.toml index 96029fc461b01..6feaf2534df36 100644 --- a/templates/minimal/runtime/Cargo.toml +++ b/templates/minimal/runtime/Cargo.toml @@ -12,7 +12,7 @@ publish = false [dependencies] codec = { workspace = true } scale-info = { workspace = true } -polkadot-sdk = { workspace = true, features = ["runtime", "experimental"] } +polkadot-sdk = { workspace = true, features = ["experimental", "runtime"] } # local pallet templates pallet-minimal-template = { workspace = true } From 472c7d95dd821848fdaa27fe6cc8631c8e111c32 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Thu, 15 Aug 2024 17:52:52 +0100 Subject: [PATCH 11/39] fix and prdoc --- .../chain_spec_runtime/src/runtime.rs | 5 +---- prdoc/pr_5155.prdoc | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 prdoc/pr_5155.prdoc diff --git a/docs/sdk/src/reference_docs/chain_spec_runtime/src/runtime.rs b/docs/sdk/src/reference_docs/chain_spec_runtime/src/runtime.rs index c45f0126337e5..195d1b124474d 100644 --- a/docs/sdk/src/reference_docs/chain_spec_runtime/src/runtime.rs +++ b/docs/sdk/src/reference_docs/chain_spec_runtime/src/runtime.rs @@ -32,10 +32,7 @@ use frame::{ runtime, }, prelude::*, - runtime::{ - apis::{self, impl_runtime_apis, ExtrinsicInclusionMode}, - prelude::*, - }, + runtime::{apis, prelude::*}, }; use sp_genesis_builder::PresetId; diff --git a/prdoc/pr_5155.prdoc b/prdoc/pr_5155.prdoc new file mode 100644 index 0000000000000..26e3d9884db3e --- /dev/null +++ b/prdoc/pr_5155.prdoc @@ -0,0 +1,14 @@ +# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 +# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json + +title: Use umbrella crate for minimal template + +doc: + - audience: Runtime Dev + description: | + Minor additions to the `polkadot-sdk-frame` crate and making it ready for usage in more templates. This PR already integrates it in the minimal template. + + +crates: + - name: polkadot-sdk-frame + bump: patch From 4a4e46a52e79aebe46826716551fa47465b9b0e3 Mon Sep 17 00:00:00 2001 From: kianenigma Date: Fri, 16 Aug 2024 10:09:44 +0100 Subject: [PATCH 12/39] docs --- substrate/frame/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/src/lib.rs b/substrate/frame/src/lib.rs index 086f8a2b0d028..e5fb15cdd07cb 100644 --- a/substrate/frame/src/lib.rs +++ b/substrate/frame/src/lib.rs @@ -178,7 +178,7 @@ pub mod runtime { /// Macro to amalgamate the runtime into `struct Runtime`. /// - /// Consider using the new version of this [`frame_runtime`]. + /// Consider using the new version of this [`frame_construct_runtime`]. pub use frame_support::construct_runtime; /// Macro to amalgamate the runtime into `struct Runtime`. From 53fa677132df9bb0bf27c0b4b5ef169ab4d14d8b Mon Sep 17 00:00:00 2001 From: kianenigma Date: Fri, 16 Aug 2024 16:25:09 +0100 Subject: [PATCH 13/39] fix feature --- templates/minimal/node/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/minimal/node/Cargo.toml b/templates/minimal/node/Cargo.toml index 9660c7a627825..956efca34532d 100644 --- a/templates/minimal/node/Cargo.toml +++ b/templates/minimal/node/Cargo.toml @@ -31,4 +31,5 @@ polkadot-sdk = { workspace = true, features = ["substrate-build-script-utils"] } default = ["std"] std = [ "minimal-template-runtime/std", + "polkadot-sdk/std", ] From e9cbcb389f1584a2aba1e1c9f200f2a4fd6e6e97 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 20 Aug 2024 14:23:09 +0200 Subject: [PATCH 14/39] Test fix CI clippy job --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 054c7d786ca97..2fb4d34759bd9 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -47,7 +47,7 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: script run: | - forklift cargo clippy --all-targets --locked --workspace + forklift cargo clippy --all-targets --locked --workspace --features experimental forklift cargo clippy --all-targets --all-features --locked --workspace check-try-runtime: runs-on: arc-runners-polkadot-sdk-beefy From 525abf6e693f85766230243deaab705691b66354 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 20 Aug 2024 15:04:24 +0200 Subject: [PATCH 15/39] Tweak experimental flag for tests --- .github/workflows/checks.yml | 2 +- .../frame/support/test/tests/pallet_outer_enums_explicit.rs | 3 +-- .../frame/support/test/tests/pallet_outer_enums_implicit.rs | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 2fb4d34759bd9..054c7d786ca97 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -47,7 +47,7 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: script run: | - forklift cargo clippy --all-targets --locked --workspace --features experimental + forklift cargo clippy --all-targets --locked --workspace forklift cargo clippy --all-targets --all-features --locked --workspace check-try-runtime: runs-on: arc-runners-polkadot-sdk-beefy diff --git a/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs b/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs index 326f3530e26ec..8835e74280609 100644 --- a/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs +++ b/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs @@ -75,6 +75,7 @@ frame_support::construct_runtime!( } ); +#[cfg(feature = "experimental")] #[test] fn module_error_outer_enum_expand_explicit() { // The Runtime has *all* parts explicitly defined. @@ -90,9 +91,7 @@ fn module_error_outer_enum_expand_explicit() { frame_system::Error::NonZeroRefCount => (), frame_system::Error::CallFiltered => (), frame_system::Error::MultiBlockMigrationsOngoing => (), - #[cfg(feature = "experimental")] frame_system::Error::InvalidTask => (), - #[cfg(feature = "experimental")] frame_system::Error::FailedTask => (), frame_system::Error::NothingAuthorized => (), frame_system::Error::Unauthorized => (), diff --git a/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs b/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs index 4149c4880cca2..6f452c666dace 100644 --- a/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs +++ b/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs @@ -75,6 +75,7 @@ frame_support::construct_runtime!( } ); +#[cfg(feature = "experimental")] #[test] fn module_error_outer_enum_expand_implicit() { // The Runtime has *all* parts implicitly defined. @@ -90,9 +91,7 @@ fn module_error_outer_enum_expand_implicit() { frame_system::Error::NonZeroRefCount => (), frame_system::Error::CallFiltered => (), frame_system::Error::MultiBlockMigrationsOngoing => (), - #[cfg(feature = "experimental")] frame_system::Error::InvalidTask => (), - #[cfg(feature = "experimental")] frame_system::Error::FailedTask => (), frame_system::Error::NothingAuthorized => (), frame_system::Error::Unauthorized => (), From 9b71984e87dd356d13ac02aef73c7bd70deba04b Mon Sep 17 00:00:00 2001 From: pgherveou Date: Wed, 21 Aug 2024 11:04:22 +0200 Subject: [PATCH 16/39] Fix clippy --- .../frame/support/test/tests/pallet_outer_enums_explicit.rs | 3 ++- .../frame/support/test/tests/pallet_outer_enums_implicit.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs b/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs index 8835e74280609..dd17d6766b062 100644 --- a/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs +++ b/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs @@ -19,7 +19,7 @@ use frame_support::derive_impl; mod common; -use common::outer_enums::{pallet, pallet2}; +use common::outer_enums::pallet; pub type Header = sp_runtime::generic::Header; pub type Block = sp_runtime::generic::Block; @@ -78,6 +78,7 @@ frame_support::construct_runtime!( #[cfg(feature = "experimental")] #[test] fn module_error_outer_enum_expand_explicit() { + use common::outer_enums::pallet2; // The Runtime has *all* parts explicitly defined. // Check that all error types are propagated diff --git a/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs b/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs index 6f452c666dace..9c1031552f501 100644 --- a/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs +++ b/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs @@ -19,7 +19,7 @@ use frame_support::derive_impl; mod common; -use common::outer_enums::{pallet, pallet2}; +use common::outer_enums::pallet; pub type Header = sp_runtime::generic::Header; pub type Block = sp_runtime::generic::Block; @@ -78,6 +78,7 @@ frame_support::construct_runtime!( #[cfg(feature = "experimental")] #[test] fn module_error_outer_enum_expand_implicit() { + use common::outer_enums::pallet2; // The Runtime has *all* parts implicitly defined. // Check that all error types are propagated From ea08cc2e41986b006df9504fdc1cf8632c80dbb7 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Wed, 21 Aug 2024 11:32:39 +0200 Subject: [PATCH 17/39] Fix clippy 2 --- .../frame/support/test/tests/pallet_outer_enums_explicit.rs | 4 +--- .../frame/support/test/tests/pallet_outer_enums_implicit.rs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs b/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs index dd17d6766b062..81cdd40d1bcf5 100644 --- a/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs +++ b/substrate/frame/support/test/tests/pallet_outer_enums_explicit.rs @@ -19,8 +19,6 @@ use frame_support::derive_impl; mod common; -use common::outer_enums::pallet; - pub type Header = sp_runtime::generic::Header; pub type Block = sp_runtime::generic::Block; pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; @@ -78,7 +76,7 @@ frame_support::construct_runtime!( #[cfg(feature = "experimental")] #[test] fn module_error_outer_enum_expand_explicit() { - use common::outer_enums::pallet2; + use common::outer_enums::{pallet, pallet2}; // The Runtime has *all* parts explicitly defined. // Check that all error types are propagated diff --git a/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs b/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs index 9c1031552f501..d2e759640c732 100644 --- a/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs +++ b/substrate/frame/support/test/tests/pallet_outer_enums_implicit.rs @@ -19,8 +19,6 @@ use frame_support::derive_impl; mod common; -use common::outer_enums::pallet; - pub type Header = sp_runtime::generic::Header; pub type Block = sp_runtime::generic::Block; pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; @@ -78,7 +76,7 @@ frame_support::construct_runtime!( #[cfg(feature = "experimental")] #[test] fn module_error_outer_enum_expand_implicit() { - use common::outer_enums::pallet2; + use common::outer_enums::{pallet, pallet2}; // The Runtime has *all* parts implicitly defined. // Check that all error types are propagated From 9076909da269c6232f78160a1608ecebf292386c Mon Sep 17 00:00:00 2001 From: pgherveou Date: Mon, 26 Aug 2024 10:47:43 +0200 Subject: [PATCH 18/39] use no-default-features for anyhow --- Cargo.toml | 2 +- substrate/primitives/wasm-interface/Cargo.toml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 275efe1df6383..b525e873c2bf5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -584,7 +584,7 @@ ahash = { version = "0.8.2" } alloy-primitives = { version = "0.4.2", default-features = false } alloy-sol-types = { version = "0.4.2", default-features = false } always-assert = { version = "0.1" } -anyhow = { version = "1.0.81" } +anyhow = { version = "1.0.81", default-features = false } aquamarine = { version = "0.5.0" } arbitrary = { version = "1.3.2" } ark-bls12-377 = { version = "0.4.0", default-features = false } diff --git a/substrate/primitives/wasm-interface/Cargo.toml b/substrate/primitives/wasm-interface/Cargo.toml index 96ea8f4235d50..1fb465c1b0ca6 100644 --- a/substrate/primitives/wasm-interface/Cargo.toml +++ b/substrate/primitives/wasm-interface/Cargo.toml @@ -25,5 +25,9 @@ anyhow = { optional = true, workspace = true } [features] default = ["std"] -std = ["codec/std", "log/std"] +std = [ + "codec/std", + "log/std", + "anyhow?/std" +] wasmtime = ["anyhow", "dep:wasmtime"] From e987766b0719110cf43274abaa53fba79e878a57 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Mon, 26 Aug 2024 10:53:07 +0200 Subject: [PATCH 19/39] taplo fix --- substrate/primitives/wasm-interface/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/primitives/wasm-interface/Cargo.toml b/substrate/primitives/wasm-interface/Cargo.toml index 1fb465c1b0ca6..9d0310fd22e8e 100644 --- a/substrate/primitives/wasm-interface/Cargo.toml +++ b/substrate/primitives/wasm-interface/Cargo.toml @@ -26,8 +26,8 @@ anyhow = { optional = true, workspace = true } [features] default = ["std"] std = [ + "anyhow?/std", "codec/std", "log/std", - "anyhow?/std" ] wasmtime = ["anyhow", "dep:wasmtime"] From 0f5e103b9d8b1516194aca78e3fa85232723209a Mon Sep 17 00:00:00 2001 From: pgherveou Date: Mon, 26 Aug 2024 10:54:08 +0200 Subject: [PATCH 20/39] fix revive --- substrate/frame/revive/fixtures/Cargo.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/substrate/frame/revive/fixtures/Cargo.toml b/substrate/frame/revive/fixtures/Cargo.toml index 1b668c061f85a..9e54acdace709 100644 --- a/substrate/frame/revive/fixtures/Cargo.toml +++ b/substrate/frame/revive/fixtures/Cargo.toml @@ -29,4 +29,8 @@ default = ["std"] # we will remove this once there is an upstream toolchain riscv = [] # only when std is enabled all fixtures are available -std = ["frame-system", "sp-runtime"] +std = [ + "anyhow/std", + "frame-system", + "sp-runtime", +] From 60931409ce39b4363ba5f659e605882f544e22fb Mon Sep 17 00:00:00 2001 From: pgherveou Date: Mon, 26 Aug 2024 11:50:26 +0200 Subject: [PATCH 21/39] Do not add pallet-contracts when arch = riscv This probably need a follow up to fix the unbrella generation script --- substrate/frame/revive/src/wasm/runtime.rs | 2 +- umbrella/Cargo.toml | 2 +- umbrella/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/substrate/frame/revive/src/wasm/runtime.rs b/substrate/frame/revive/src/wasm/runtime.rs index de910e79e73e9..eb93cb410c599 100644 --- a/substrate/frame/revive/src/wasm/runtime.rs +++ b/substrate/frame/revive/src/wasm/runtime.rs @@ -556,7 +556,7 @@ impl<'a, E: Ext, M: PolkaVmInstance> Runtime<'a, E, M> { } } -impl<'a, E: Ext, M: ?Sized + Memory> Runtime<'a, E, M> { +impl<'a, E: Ext + 'a, M: ?Sized + Memory> Runtime<'a, E, M> { pub fn new(ext: &'a mut E, input_data: Vec) -> Self { Self { ext, diff --git a/umbrella/Cargo.toml b/umbrella/Cargo.toml index 9c2ed30c527a9..17afbd9db5910 100644 --- a/umbrella/Cargo.toml +++ b/umbrella/Cargo.toml @@ -1134,7 +1134,7 @@ path = "../cumulus/parachains/pallets/collective-content" default-features = false optional = true -[dependencies.pallet-contracts] +[target.'cfg(not(target_arch = "riscv32"))'.dependencies.pallet-contracts] path = "../substrate/frame/contracts" default-features = false optional = true diff --git a/umbrella/src/lib.rs b/umbrella/src/lib.rs index b7b9c15fe5880..69613069c5032 100644 --- a/umbrella/src/lib.rs +++ b/umbrella/src/lib.rs @@ -400,7 +400,7 @@ pub use pallet_collective; pub use pallet_collective_content; /// FRAME pallet for WASM contracts. -#[cfg(feature = "pallet-contracts")] +#[cfg(all(feature = "pallet-contracts", not(target_arch = "riscv32")))] pub use pallet_contracts; /// A mock network for testing pallet-contracts. From 5d270ac188e25594d39ec5b7faea48afd042c241 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Mon, 26 Aug 2024 13:11:39 +0200 Subject: [PATCH 22/39] fixed anyhow dep --- cumulus/client/consensus/proposer/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulus/client/consensus/proposer/Cargo.toml b/cumulus/client/consensus/proposer/Cargo.toml index ce91d48bf589a..bb760ae03f4df 100644 --- a/cumulus/client/consensus/proposer/Cargo.toml +++ b/cumulus/client/consensus/proposer/Cargo.toml @@ -10,7 +10,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" workspace = true [dependencies] -anyhow = { workspace = true } +anyhow = { workspace = true, default-features = true } async-trait = { workspace = true } thiserror = { workspace = true } From 3ede08dce2dd9f631eac19c87fa64339b740750f Mon Sep 17 00:00:00 2001 From: pgherveou Date: Mon, 26 Aug 2024 16:23:19 +0200 Subject: [PATCH 23/39] Fix prdoc --- prdoc/pr_5155.prdoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/prdoc/pr_5155.prdoc b/prdoc/pr_5155.prdoc index 26e3d9884db3e..7edd6b6c6df82 100644 --- a/prdoc/pr_5155.prdoc +++ b/prdoc/pr_5155.prdoc @@ -10,5 +10,13 @@ doc: crates: + - name: polkadot-sdk + bump: patch - name: polkadot-sdk-frame bump: patch + - name: sp-wasm-interface + bump: patch + - name: pallet-revive + bump: patch + - name: pallet-revive-fixtures + bump: patch From 69968aa3ec175f95c52654510db3f0e95512a2e3 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Mon, 26 Aug 2024 17:06:17 +0200 Subject: [PATCH 24/39] Patch generate-umbrella for crate that do not support riscv --- scripts/generate-umbrella.py | 28 +++++++-- umbrella/Cargo.toml | 10 ++-- umbrella/src/lib.rs | 111 ++++++++++++----------------------- 3 files changed, 65 insertions(+), 84 deletions(-) diff --git a/scripts/generate-umbrella.py b/scripts/generate-umbrella.py index 5b9cc89c5308a..6fddf88562e90 100644 --- a/scripts/generate-umbrella.py +++ b/scripts/generate-umbrella.py @@ -38,6 +38,12 @@ def exclude(crate): return False + +def no_riscv_target(crate): + if crate.name == "pallet-contracts": + return True + return False + def main(path, version): delete_umbrella(path) workspace = Workspace.from_path(path) @@ -89,13 +95,21 @@ def main(path, version): all_crates = std_crates + nostd_crates all_crates.sort(key=lambda x: x[0].name) dependencies = {} - + target = {} + no_arch_riscv_deps = {} + target["cfg(not(target_arch = \"riscv32\"))"] = {} + target["cfg(not(target_arch = \"riscv32\"))"]["dependencies"] = no_arch_riscv_deps + + def add_dependency(crate, path): + deps = no_arch_riscv_deps if no_riscv_target(crate) else dependencies + deps[crate.name] = {"path": f"../{path}", "default-features": False, "optional": True} + for (crate, path) in nostd_crates: - dependencies[crate.name] = {"path": f"../{path}", "default-features": False, "optional": True} + add_dependency(crate, path) for (crate, path) in std_crates: - dependencies[crate.name] = {"path": f"../{path}", "default-features": False, "optional": True} - + add_dependency(crate, path) + # The empty features are filled by Zepter features = { "default": [ "std" ], @@ -126,6 +140,7 @@ def main(path, version): }, "dependencies": dependencies, "features": features, + "target": target, } umbrella_dir = os.path.join(workspace.path, "umbrella") @@ -158,7 +173,10 @@ def main(path, version): use = crate.name.replace("-", "_") desc = crate.description if crate.description.endswith(".") else crate.description + "." f.write(f'\n/// {desc}') - f.write(f'\n#[cfg(feature = "{crate.name}")]\n') + if no_riscv_target(crate): + f.write(f'\n#[cfg(all(feature = "{crate.name}", not(target_arch = "riscv32")))]\n') + else: + f.write(f'\n#[cfg(feature = "{crate.name}")]\n') f.write(f"pub use {use};\n") print(f"Wrote {lib_path}") diff --git a/umbrella/Cargo.toml b/umbrella/Cargo.toml index 17afbd9db5910..1701d5ae27eb5 100644 --- a/umbrella/Cargo.toml +++ b/umbrella/Cargo.toml @@ -1134,11 +1134,6 @@ path = "../cumulus/parachains/pallets/collective-content" default-features = false optional = true -[target.'cfg(not(target_arch = "riscv32"))'.dependencies.pallet-contracts] -path = "../substrate/frame/contracts" -default-features = false -optional = true - [dependencies.pallet-contracts-proc-macro] path = "../substrate/frame/contracts/proc-macro" default-features = false @@ -2657,3 +2652,8 @@ optional = true [package.metadata.docs.rs] features = ["node", "runtime"] targets = ["x86_64-unknown-linux-gnu"] + +[target."cfg(not(target_arch = \"riscv32\"))".dependencies.pallet-contracts] +path = "../substrate/frame/contracts" +default-features = false +optional = true diff --git a/umbrella/src/lib.rs b/umbrella/src/lib.rs index 69613069c5032..41a2cc030f285 100644 --- a/umbrella/src/lib.rs +++ b/umbrella/src/lib.rs @@ -71,8 +71,7 @@ pub use bridge_hub_common; #[cfg(feature = "bridge-hub-test-utils")] pub use bridge_hub_test_utils; -/// Common types and functions that may be used by substrate-based runtimes of all bridged -/// chains. +/// Common types and functions that may be used by substrate-based runtimes of all bridged chains. #[cfg(feature = "bridge-runtime-common")] pub use bridge_runtime_common; @@ -104,8 +103,7 @@ pub use cumulus_client_consensus_relay_chain; #[cfg(feature = "cumulus-client-network")] pub use cumulus_client_network; -/// Inherent that needs to be present in every parachain block. Contains messages and a relay -/// chain storage-proof. +/// Inherent that needs to be present in every parachain block. Contains messages and a relay chain storage-proof. #[cfg(feature = "cumulus-client-parachain-inherent")] pub use cumulus_client_parachain_inherent; @@ -161,8 +159,7 @@ pub use cumulus_primitives_aura; #[cfg(feature = "cumulus-primitives-core")] pub use cumulus_primitives_core; -/// Inherent that needs to be present in every parachain block. Contains messages and a relay -/// chain storage-proof. +/// Inherent that needs to be present in every parachain block. Contains messages and a relay chain storage-proof. #[cfg(feature = "cumulus-primitives-parachain-inherent")] pub use cumulus_primitives_parachain_inherent; @@ -206,8 +203,7 @@ pub use cumulus_test_relay_sproof_builder; #[cfg(feature = "emulated-integration-tests-common")] pub use emulated_integration_tests_common; -/// Utility library for managing tree-like ordered data with logic for pruning the tree while -/// finalizing nodes. +/// Utility library for managing tree-like ordered data with logic for pruning the tree while finalizing nodes. #[cfg(feature = "fork-tree")] pub use fork_tree; @@ -239,8 +235,7 @@ pub use frame_executive; #[cfg(feature = "frame-metadata-hash-extension")] pub use frame_metadata_hash_extension; -/// An externalities provided environment that can load itself from remote nodes or cached -/// files. +/// An externalities provided environment that can load itself from remote nodes or cached files. #[cfg(feature = "frame-remote-externalities")] pub use frame_remote_externalities; @@ -336,8 +331,7 @@ pub use pallet_authority_discovery; #[cfg(feature = "pallet-authorship")] pub use pallet_authorship; -/// Consensus extension module for BABE consensus. Collects on-chain randomness from VRF -/// outputs and manages epoch transitions. +/// Consensus extension module for BABE consensus. Collects on-chain randomness from VRF outputs and manages epoch transitions. #[cfg(feature = "pallet-babe")] pub use pallet_babe; @@ -361,8 +355,7 @@ pub use pallet_beefy_mmr; #[cfg(feature = "pallet-bounties")] pub use pallet_bounties; -/// Module implementing GRANDPA on-chain light client used for bridging consensus of -/// substrate-based chains. +/// Module implementing GRANDPA on-chain light client used for bridging consensus of substrate-based chains. #[cfg(feature = "pallet-bridge-grandpa")] pub use pallet_bridge_grandpa; @@ -390,8 +383,7 @@ pub use pallet_child_bounties; #[cfg(feature = "pallet-collator-selection")] pub use pallet_collator_selection; -/// Collective system: Members of a set of account IDs can make their collective feelings known -/// through dispatched calls from one of two specialized origins. +/// Collective system: Members of a set of account IDs can make their collective feelings known through dispatched calls from one of two specialized origins. #[cfg(feature = "pallet-collective")] pub use pallet_collective; @@ -559,8 +551,7 @@ pub use pallet_preimage; #[cfg(feature = "pallet-proxy")] pub use pallet_proxy; -/// Ranked collective system: Members of a set of account IDs can make their collective -/// feelings known through dispatched calls from one of two specialized origins. +/// Ranked collective system: Members of a set of account IDs can make their collective feelings known through dispatched calls from one of two specialized origins. #[cfg(feature = "pallet-ranked-collective")] pub use pallet_ranked_collective; @@ -628,8 +619,7 @@ pub use pallet_session; #[cfg(feature = "pallet-session-benchmarking")] pub use pallet_session_benchmarking; -/// Pallet to skip payments for calls annotated with `feeless_if` if the respective conditions -/// are satisfied. +/// Pallet to skip payments for calls annotated with `feeless_if` if the respective conditions are satisfied. #[cfg(feature = "pallet-skip-feeless-payment")] pub use pallet_skip_feeless_payment; @@ -737,23 +727,19 @@ pub use parachains_common; #[cfg(feature = "parachains-runtimes-test-utils")] pub use parachains_runtimes_test_utils; -/// Polkadot Approval Distribution subsystem for the distribution of assignments and approvals -/// for approval checks on candidates over the network. +/// Polkadot Approval Distribution subsystem for the distribution of assignments and approvals for approval checks on candidates over the network. #[cfg(feature = "polkadot-approval-distribution")] pub use polkadot_approval_distribution; -/// Polkadot Bitfiled Distribution subsystem, which gossips signed availability bitfields used -/// to compactly determine which backed candidates are available or not based on a 2/3+ quorum. +/// Polkadot Bitfiled Distribution subsystem, which gossips signed availability bitfields used to compactly determine which backed candidates are available or not based on a 2/3+ quorum. #[cfg(feature = "polkadot-availability-bitfield-distribution")] pub use polkadot_availability_bitfield_distribution; -/// The Availability Distribution subsystem. Requests the required availability data. Also -/// distributes availability data and chunks to requesters. +/// The Availability Distribution subsystem. Requests the required availability data. Also distributes availability data and chunks to requesters. #[cfg(feature = "polkadot-availability-distribution")] pub use polkadot_availability_distribution; -/// The Availability Recovery subsystem. Handles requests for recovering the availability data -/// of included candidates. +/// The Availability Recovery subsystem. Handles requests for recovering the availability data of included candidates. #[cfg(feature = "polkadot-availability-recovery")] pub use polkadot_availability_recovery; @@ -761,8 +747,7 @@ pub use polkadot_availability_recovery; #[cfg(feature = "polkadot-cli")] pub use polkadot_cli; -/// Polkadot Collator Protocol subsystem. Allows collators and validators to talk to each -/// other. +/// Polkadot Collator Protocol subsystem. Allows collators and validators to talk to each other. #[cfg(feature = "polkadot-collator-protocol")] pub use polkadot_collator_protocol; @@ -770,8 +755,7 @@ pub use polkadot_collator_protocol; #[cfg(feature = "polkadot-core-primitives")] pub use polkadot_core_primitives; -/// Polkadot Dispute Distribution subsystem, which ensures all concerned validators are aware -/// of a dispute and have the relevant votes. +/// Polkadot Dispute Distribution subsystem, which ensures all concerned validators are aware of a dispute and have the relevant votes. #[cfg(feature = "polkadot-dispute-distribution")] pub use polkadot_dispute_distribution; @@ -779,8 +763,7 @@ pub use polkadot_dispute_distribution; #[cfg(feature = "polkadot-erasure-coding")] pub use polkadot_erasure_coding; -/// Polkadot Gossip Support subsystem. Responsible for keeping track of session changes and -/// issuing a connection request to the relevant validators on every new session. +/// Polkadot Gossip Support subsystem. Responsible for keeping track of session changes and issuing a connection request to the relevant validators on every new session. #[cfg(feature = "polkadot-gossip-support")] pub use polkadot_gossip_support; @@ -796,13 +779,11 @@ pub use polkadot_node_collation_generation; #[cfg(feature = "polkadot-node-core-approval-voting")] pub use polkadot_node_core_approval_voting; -/// The Availability Store subsystem. Wrapper over the DB that stores availability data and -/// chunks. +/// The Availability Store subsystem. Wrapper over the DB that stores availability data and chunks. #[cfg(feature = "polkadot-node-core-av-store")] pub use polkadot_node_core_av_store; -/// The Candidate Backing Subsystem. Tracks parachain candidates that can be backed, as well as -/// the issuance of statements about candidates. +/// The Candidate Backing Subsystem. Tracks parachain candidates that can be backed, as well as the issuance of statements about candidates. #[cfg(feature = "polkadot-node-core-backing")] pub use polkadot_node_core_backing; @@ -810,13 +791,11 @@ pub use polkadot_node_core_backing; #[cfg(feature = "polkadot-node-core-bitfield-signing")] pub use polkadot_node_core_bitfield_signing; -/// Polkadot crate that implements the Candidate Validation subsystem. Handles requests to -/// validate candidates according to a PVF. +/// Polkadot crate that implements the Candidate Validation subsystem. Handles requests to validate candidates according to a PVF. #[cfg(feature = "polkadot-node-core-candidate-validation")] pub use polkadot_node_core_candidate_validation; -/// The Chain API subsystem provides access to chain related utility functions like block -/// number to hash conversions. +/// The Chain API subsystem provides access to chain related utility functions like block number to hash conversions. #[cfg(feature = "polkadot-node-core-chain-api")] pub use polkadot_node_core_chain_api; @@ -836,33 +815,27 @@ pub use polkadot_node_core_parachains_inherent; #[cfg(feature = "polkadot-node-core-prospective-parachains")] pub use polkadot_node_core_prospective_parachains; -/// Responsible for assembling a relay chain block from a set of available parachain -/// candidates. +/// Responsible for assembling a relay chain block from a set of available parachain candidates. #[cfg(feature = "polkadot-node-core-provisioner")] pub use polkadot_node_core_provisioner; -/// Polkadot crate that implements the PVF validation host. Responsible for coordinating -/// preparation and execution of PVFs. +/// Polkadot crate that implements the PVF validation host. Responsible for coordinating preparation and execution of PVFs. #[cfg(feature = "polkadot-node-core-pvf")] pub use polkadot_node_core_pvf; -/// Polkadot crate that implements the PVF pre-checking subsystem. Responsible for checking and -/// voting for PVFs that are pending approval. +/// Polkadot crate that implements the PVF pre-checking subsystem. Responsible for checking and voting for PVFs that are pending approval. #[cfg(feature = "polkadot-node-core-pvf-checker")] pub use polkadot_node_core_pvf_checker; -/// Polkadot crate that contains functionality related to PVFs that is shared by the PVF host -/// and the PVF workers. +/// Polkadot crate that contains functionality related to PVFs that is shared by the PVF host and the PVF workers. #[cfg(feature = "polkadot-node-core-pvf-common")] pub use polkadot_node_core_pvf_common; -/// Polkadot crate that contains the logic for executing PVFs. Used by the -/// polkadot-execute-worker binary. +/// Polkadot crate that contains the logic for executing PVFs. Used by the polkadot-execute-worker binary. #[cfg(feature = "polkadot-node-core-pvf-execute-worker")] pub use polkadot_node_core_pvf_execute_worker; -/// Polkadot crate that contains the logic for preparing PVFs. Used by the -/// polkadot-prepare-worker binary. +/// Polkadot crate that contains the logic for preparing PVFs. Used by the polkadot-prepare-worker binary. #[cfg(feature = "polkadot-node-core-pvf-prepare-worker")] pub use polkadot_node_core_pvf_prepare_worker; @@ -930,8 +903,7 @@ pub use polkadot_runtime_metrics; #[cfg(feature = "polkadot-runtime-parachains")] pub use polkadot_runtime_parachains; -/// Experimental: The single package to get you started with building frame pallets and -/// runtimes. +/// Experimental: The single package to get you started with building frame pallets and runtimes. #[cfg(feature = "polkadot-sdk-frame")] pub use polkadot_sdk_frame; @@ -1115,8 +1087,7 @@ pub use sc_rpc_server; #[cfg(feature = "sc-rpc-spec-v2")] pub use sc_rpc_spec_v2; -/// Substrate service. Starts a thread that spins up the network, client, and extrinsic pool. -/// Manages communication between them. +/// Substrate service. Starts a thread that spins up the network, client, and extrinsic pool. Manages communication between them. #[cfg(feature = "sc-service")] pub use sc_service; @@ -1292,8 +1263,7 @@ pub use sp_core; #[cfg(feature = "sp-core-hashing")] pub use sp_core_hashing; -/// Procedural macros for calculating static hashes (deprecated in favor of -/// `sp-crypto-hashing-proc-macro`). +/// Procedural macros for calculating static hashes (deprecated in favor of `sp-crypto-hashing-proc-macro`). #[cfg(feature = "sp-core-hashing-proc-macro")] pub use sp_core_hashing_proc_macro; @@ -1381,8 +1351,7 @@ pub use sp_runtime; #[cfg(feature = "sp-runtime-interface")] pub use sp_runtime_interface; -/// This crate provides procedural macros for usage within the context of the Substrate runtime -/// interface. +/// This crate provides procedural macros for usage within the context of the Substrate runtime interface. #[cfg(feature = "sp-runtime-interface-proc-macro")] pub use sp_runtime_interface_proc_macro; @@ -1390,8 +1359,7 @@ pub use sp_runtime_interface_proc_macro; #[cfg(feature = "sp-session")] pub use sp_session; -/// A crate which contains primitives that are useful for implementation that uses staking -/// approaches in general. Definitions related to sessions, slashing, etc go here. +/// A crate which contains primitives that are useful for implementation that uses staking approaches in general. Definitions related to sessions, slashing, etc go here. #[cfg(feature = "sp-staking")] pub use sp_staking; @@ -1403,8 +1371,7 @@ pub use sp_state_machine; #[cfg(feature = "sp-statement-store")] pub use sp_statement_store; -/// Lowest-abstraction level for the Substrate runtime: just exports useful primitives from std -/// or client/alloc to be used with any code that depends on the runtime. +/// Lowest-abstraction level for the Substrate runtime: just exports useful primitives from std or client/alloc to be used with any code that depends on the runtime. #[cfg(feature = "sp-std")] pub use sp_std; @@ -1432,8 +1399,7 @@ pub use sp_transaction_storage_proof; #[cfg(feature = "sp-trie")] pub use sp_trie; -/// Version module for the Substrate runtime; Provides a function that returns the runtime -/// version. +/// Version module for the Substrate runtime; Provides a function that returns the runtime version. #[cfg(feature = "sp-version")] pub use sp_version; @@ -1449,8 +1415,7 @@ pub use sp_wasm_interface; #[cfg(feature = "sp-weights")] pub use sp_weights; -/// Utility for building chain-specification files for Substrate-based runtimes based on -/// `sp-genesis-builder`. +/// Utility for building chain-specification files for Substrate-based runtimes based on `sp-genesis-builder`. #[cfg(feature = "staging-chain-spec-builder")] pub use staging_chain_spec_builder; @@ -1478,8 +1443,7 @@ pub use staging_xcm_builder; #[cfg(feature = "staging-xcm-executor")] pub use staging_xcm_executor; -/// Generate and restore keys for Substrate based chains such as Polkadot, Kusama and a growing -/// number of parachains and Substrate based projects. +/// Generate and restore keys for Substrate based chains such as Polkadot, Kusama and a growing number of parachains and Substrate based projects. #[cfg(feature = "subkey")] pub use subkey; @@ -1523,8 +1487,7 @@ pub use testnet_parachains_constants; #[cfg(feature = "tracing-gum")] pub use tracing_gum; -/// Generate an overseer including builder pattern and message wrapper from a single annotated -/// struct definition. +/// Generate an overseer including builder pattern and message wrapper from a single annotated struct definition. #[cfg(feature = "tracing-gum-proc-macro")] pub use tracing_gum_proc_macro; From 7b1d5e633b45a025527c8e2e165d30d07d3df023 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Mon, 26 Aug 2024 17:27:02 +0200 Subject: [PATCH 25/39] Add missing pallet prdoc complains about --- prdoc/pr_5155.prdoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/prdoc/pr_5155.prdoc b/prdoc/pr_5155.prdoc index 7edd6b6c6df82..e874258ffa834 100644 --- a/prdoc/pr_5155.prdoc +++ b/prdoc/pr_5155.prdoc @@ -20,3 +20,8 @@ crates: bump: patch - name: pallet-revive-fixtures bump: patch + - name: frame-support + bump: patch + - name pallet-balances + bump: patch + From bb7f6f98ce1a84734dd64f1240d723b4a8b718a6 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Mon, 26 Aug 2024 17:32:46 +0200 Subject: [PATCH 26/39] add missing : --- prdoc/pr_5155.prdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prdoc/pr_5155.prdoc b/prdoc/pr_5155.prdoc index e874258ffa834..08643525dbcc1 100644 --- a/prdoc/pr_5155.prdoc +++ b/prdoc/pr_5155.prdoc @@ -22,6 +22,6 @@ crates: bump: patch - name: frame-support bump: patch - - name pallet-balances + - name: pallet-balances bump: patch From 3bc01aa947dbdac9e7f0d66102ea633d2fcb146a Mon Sep 17 00:00:00 2001 From: pgherveou Date: Mon, 26 Aug 2024 21:40:17 +0200 Subject: [PATCH 27/39] fix fmt --- umbrella/src/lib.rs | 111 +++++++++++++++++++++++++++++--------------- 1 file changed, 74 insertions(+), 37 deletions(-) diff --git a/umbrella/src/lib.rs b/umbrella/src/lib.rs index 41a2cc030f285..69613069c5032 100644 --- a/umbrella/src/lib.rs +++ b/umbrella/src/lib.rs @@ -71,7 +71,8 @@ pub use bridge_hub_common; #[cfg(feature = "bridge-hub-test-utils")] pub use bridge_hub_test_utils; -/// Common types and functions that may be used by substrate-based runtimes of all bridged chains. +/// Common types and functions that may be used by substrate-based runtimes of all bridged +/// chains. #[cfg(feature = "bridge-runtime-common")] pub use bridge_runtime_common; @@ -103,7 +104,8 @@ pub use cumulus_client_consensus_relay_chain; #[cfg(feature = "cumulus-client-network")] pub use cumulus_client_network; -/// Inherent that needs to be present in every parachain block. Contains messages and a relay chain storage-proof. +/// Inherent that needs to be present in every parachain block. Contains messages and a relay +/// chain storage-proof. #[cfg(feature = "cumulus-client-parachain-inherent")] pub use cumulus_client_parachain_inherent; @@ -159,7 +161,8 @@ pub use cumulus_primitives_aura; #[cfg(feature = "cumulus-primitives-core")] pub use cumulus_primitives_core; -/// Inherent that needs to be present in every parachain block. Contains messages and a relay chain storage-proof. +/// Inherent that needs to be present in every parachain block. Contains messages and a relay +/// chain storage-proof. #[cfg(feature = "cumulus-primitives-parachain-inherent")] pub use cumulus_primitives_parachain_inherent; @@ -203,7 +206,8 @@ pub use cumulus_test_relay_sproof_builder; #[cfg(feature = "emulated-integration-tests-common")] pub use emulated_integration_tests_common; -/// Utility library for managing tree-like ordered data with logic for pruning the tree while finalizing nodes. +/// Utility library for managing tree-like ordered data with logic for pruning the tree while +/// finalizing nodes. #[cfg(feature = "fork-tree")] pub use fork_tree; @@ -235,7 +239,8 @@ pub use frame_executive; #[cfg(feature = "frame-metadata-hash-extension")] pub use frame_metadata_hash_extension; -/// An externalities provided environment that can load itself from remote nodes or cached files. +/// An externalities provided environment that can load itself from remote nodes or cached +/// files. #[cfg(feature = "frame-remote-externalities")] pub use frame_remote_externalities; @@ -331,7 +336,8 @@ pub use pallet_authority_discovery; #[cfg(feature = "pallet-authorship")] pub use pallet_authorship; -/// Consensus extension module for BABE consensus. Collects on-chain randomness from VRF outputs and manages epoch transitions. +/// Consensus extension module for BABE consensus. Collects on-chain randomness from VRF +/// outputs and manages epoch transitions. #[cfg(feature = "pallet-babe")] pub use pallet_babe; @@ -355,7 +361,8 @@ pub use pallet_beefy_mmr; #[cfg(feature = "pallet-bounties")] pub use pallet_bounties; -/// Module implementing GRANDPA on-chain light client used for bridging consensus of substrate-based chains. +/// Module implementing GRANDPA on-chain light client used for bridging consensus of +/// substrate-based chains. #[cfg(feature = "pallet-bridge-grandpa")] pub use pallet_bridge_grandpa; @@ -383,7 +390,8 @@ pub use pallet_child_bounties; #[cfg(feature = "pallet-collator-selection")] pub use pallet_collator_selection; -/// Collective system: Members of a set of account IDs can make their collective feelings known through dispatched calls from one of two specialized origins. +/// Collective system: Members of a set of account IDs can make their collective feelings known +/// through dispatched calls from one of two specialized origins. #[cfg(feature = "pallet-collective")] pub use pallet_collective; @@ -551,7 +559,8 @@ pub use pallet_preimage; #[cfg(feature = "pallet-proxy")] pub use pallet_proxy; -/// Ranked collective system: Members of a set of account IDs can make their collective feelings known through dispatched calls from one of two specialized origins. +/// Ranked collective system: Members of a set of account IDs can make their collective +/// feelings known through dispatched calls from one of two specialized origins. #[cfg(feature = "pallet-ranked-collective")] pub use pallet_ranked_collective; @@ -619,7 +628,8 @@ pub use pallet_session; #[cfg(feature = "pallet-session-benchmarking")] pub use pallet_session_benchmarking; -/// Pallet to skip payments for calls annotated with `feeless_if` if the respective conditions are satisfied. +/// Pallet to skip payments for calls annotated with `feeless_if` if the respective conditions +/// are satisfied. #[cfg(feature = "pallet-skip-feeless-payment")] pub use pallet_skip_feeless_payment; @@ -727,19 +737,23 @@ pub use parachains_common; #[cfg(feature = "parachains-runtimes-test-utils")] pub use parachains_runtimes_test_utils; -/// Polkadot Approval Distribution subsystem for the distribution of assignments and approvals for approval checks on candidates over the network. +/// Polkadot Approval Distribution subsystem for the distribution of assignments and approvals +/// for approval checks on candidates over the network. #[cfg(feature = "polkadot-approval-distribution")] pub use polkadot_approval_distribution; -/// Polkadot Bitfiled Distribution subsystem, which gossips signed availability bitfields used to compactly determine which backed candidates are available or not based on a 2/3+ quorum. +/// Polkadot Bitfiled Distribution subsystem, which gossips signed availability bitfields used +/// to compactly determine which backed candidates are available or not based on a 2/3+ quorum. #[cfg(feature = "polkadot-availability-bitfield-distribution")] pub use polkadot_availability_bitfield_distribution; -/// The Availability Distribution subsystem. Requests the required availability data. Also distributes availability data and chunks to requesters. +/// The Availability Distribution subsystem. Requests the required availability data. Also +/// distributes availability data and chunks to requesters. #[cfg(feature = "polkadot-availability-distribution")] pub use polkadot_availability_distribution; -/// The Availability Recovery subsystem. Handles requests for recovering the availability data of included candidates. +/// The Availability Recovery subsystem. Handles requests for recovering the availability data +/// of included candidates. #[cfg(feature = "polkadot-availability-recovery")] pub use polkadot_availability_recovery; @@ -747,7 +761,8 @@ pub use polkadot_availability_recovery; #[cfg(feature = "polkadot-cli")] pub use polkadot_cli; -/// Polkadot Collator Protocol subsystem. Allows collators and validators to talk to each other. +/// Polkadot Collator Protocol subsystem. Allows collators and validators to talk to each +/// other. #[cfg(feature = "polkadot-collator-protocol")] pub use polkadot_collator_protocol; @@ -755,7 +770,8 @@ pub use polkadot_collator_protocol; #[cfg(feature = "polkadot-core-primitives")] pub use polkadot_core_primitives; -/// Polkadot Dispute Distribution subsystem, which ensures all concerned validators are aware of a dispute and have the relevant votes. +/// Polkadot Dispute Distribution subsystem, which ensures all concerned validators are aware +/// of a dispute and have the relevant votes. #[cfg(feature = "polkadot-dispute-distribution")] pub use polkadot_dispute_distribution; @@ -763,7 +779,8 @@ pub use polkadot_dispute_distribution; #[cfg(feature = "polkadot-erasure-coding")] pub use polkadot_erasure_coding; -/// Polkadot Gossip Support subsystem. Responsible for keeping track of session changes and issuing a connection request to the relevant validators on every new session. +/// Polkadot Gossip Support subsystem. Responsible for keeping track of session changes and +/// issuing a connection request to the relevant validators on every new session. #[cfg(feature = "polkadot-gossip-support")] pub use polkadot_gossip_support; @@ -779,11 +796,13 @@ pub use polkadot_node_collation_generation; #[cfg(feature = "polkadot-node-core-approval-voting")] pub use polkadot_node_core_approval_voting; -/// The Availability Store subsystem. Wrapper over the DB that stores availability data and chunks. +/// The Availability Store subsystem. Wrapper over the DB that stores availability data and +/// chunks. #[cfg(feature = "polkadot-node-core-av-store")] pub use polkadot_node_core_av_store; -/// The Candidate Backing Subsystem. Tracks parachain candidates that can be backed, as well as the issuance of statements about candidates. +/// The Candidate Backing Subsystem. Tracks parachain candidates that can be backed, as well as +/// the issuance of statements about candidates. #[cfg(feature = "polkadot-node-core-backing")] pub use polkadot_node_core_backing; @@ -791,11 +810,13 @@ pub use polkadot_node_core_backing; #[cfg(feature = "polkadot-node-core-bitfield-signing")] pub use polkadot_node_core_bitfield_signing; -/// Polkadot crate that implements the Candidate Validation subsystem. Handles requests to validate candidates according to a PVF. +/// Polkadot crate that implements the Candidate Validation subsystem. Handles requests to +/// validate candidates according to a PVF. #[cfg(feature = "polkadot-node-core-candidate-validation")] pub use polkadot_node_core_candidate_validation; -/// The Chain API subsystem provides access to chain related utility functions like block number to hash conversions. +/// The Chain API subsystem provides access to chain related utility functions like block +/// number to hash conversions. #[cfg(feature = "polkadot-node-core-chain-api")] pub use polkadot_node_core_chain_api; @@ -815,27 +836,33 @@ pub use polkadot_node_core_parachains_inherent; #[cfg(feature = "polkadot-node-core-prospective-parachains")] pub use polkadot_node_core_prospective_parachains; -/// Responsible for assembling a relay chain block from a set of available parachain candidates. +/// Responsible for assembling a relay chain block from a set of available parachain +/// candidates. #[cfg(feature = "polkadot-node-core-provisioner")] pub use polkadot_node_core_provisioner; -/// Polkadot crate that implements the PVF validation host. Responsible for coordinating preparation and execution of PVFs. +/// Polkadot crate that implements the PVF validation host. Responsible for coordinating +/// preparation and execution of PVFs. #[cfg(feature = "polkadot-node-core-pvf")] pub use polkadot_node_core_pvf; -/// Polkadot crate that implements the PVF pre-checking subsystem. Responsible for checking and voting for PVFs that are pending approval. +/// Polkadot crate that implements the PVF pre-checking subsystem. Responsible for checking and +/// voting for PVFs that are pending approval. #[cfg(feature = "polkadot-node-core-pvf-checker")] pub use polkadot_node_core_pvf_checker; -/// Polkadot crate that contains functionality related to PVFs that is shared by the PVF host and the PVF workers. +/// Polkadot crate that contains functionality related to PVFs that is shared by the PVF host +/// and the PVF workers. #[cfg(feature = "polkadot-node-core-pvf-common")] pub use polkadot_node_core_pvf_common; -/// Polkadot crate that contains the logic for executing PVFs. Used by the polkadot-execute-worker binary. +/// Polkadot crate that contains the logic for executing PVFs. Used by the +/// polkadot-execute-worker binary. #[cfg(feature = "polkadot-node-core-pvf-execute-worker")] pub use polkadot_node_core_pvf_execute_worker; -/// Polkadot crate that contains the logic for preparing PVFs. Used by the polkadot-prepare-worker binary. +/// Polkadot crate that contains the logic for preparing PVFs. Used by the +/// polkadot-prepare-worker binary. #[cfg(feature = "polkadot-node-core-pvf-prepare-worker")] pub use polkadot_node_core_pvf_prepare_worker; @@ -903,7 +930,8 @@ pub use polkadot_runtime_metrics; #[cfg(feature = "polkadot-runtime-parachains")] pub use polkadot_runtime_parachains; -/// Experimental: The single package to get you started with building frame pallets and runtimes. +/// Experimental: The single package to get you started with building frame pallets and +/// runtimes. #[cfg(feature = "polkadot-sdk-frame")] pub use polkadot_sdk_frame; @@ -1087,7 +1115,8 @@ pub use sc_rpc_server; #[cfg(feature = "sc-rpc-spec-v2")] pub use sc_rpc_spec_v2; -/// Substrate service. Starts a thread that spins up the network, client, and extrinsic pool. Manages communication between them. +/// Substrate service. Starts a thread that spins up the network, client, and extrinsic pool. +/// Manages communication between them. #[cfg(feature = "sc-service")] pub use sc_service; @@ -1263,7 +1292,8 @@ pub use sp_core; #[cfg(feature = "sp-core-hashing")] pub use sp_core_hashing; -/// Procedural macros for calculating static hashes (deprecated in favor of `sp-crypto-hashing-proc-macro`). +/// Procedural macros for calculating static hashes (deprecated in favor of +/// `sp-crypto-hashing-proc-macro`). #[cfg(feature = "sp-core-hashing-proc-macro")] pub use sp_core_hashing_proc_macro; @@ -1351,7 +1381,8 @@ pub use sp_runtime; #[cfg(feature = "sp-runtime-interface")] pub use sp_runtime_interface; -/// This crate provides procedural macros for usage within the context of the Substrate runtime interface. +/// This crate provides procedural macros for usage within the context of the Substrate runtime +/// interface. #[cfg(feature = "sp-runtime-interface-proc-macro")] pub use sp_runtime_interface_proc_macro; @@ -1359,7 +1390,8 @@ pub use sp_runtime_interface_proc_macro; #[cfg(feature = "sp-session")] pub use sp_session; -/// A crate which contains primitives that are useful for implementation that uses staking approaches in general. Definitions related to sessions, slashing, etc go here. +/// A crate which contains primitives that are useful for implementation that uses staking +/// approaches in general. Definitions related to sessions, slashing, etc go here. #[cfg(feature = "sp-staking")] pub use sp_staking; @@ -1371,7 +1403,8 @@ pub use sp_state_machine; #[cfg(feature = "sp-statement-store")] pub use sp_statement_store; -/// Lowest-abstraction level for the Substrate runtime: just exports useful primitives from std or client/alloc to be used with any code that depends on the runtime. +/// Lowest-abstraction level for the Substrate runtime: just exports useful primitives from std +/// or client/alloc to be used with any code that depends on the runtime. #[cfg(feature = "sp-std")] pub use sp_std; @@ -1399,7 +1432,8 @@ pub use sp_transaction_storage_proof; #[cfg(feature = "sp-trie")] pub use sp_trie; -/// Version module for the Substrate runtime; Provides a function that returns the runtime version. +/// Version module for the Substrate runtime; Provides a function that returns the runtime +/// version. #[cfg(feature = "sp-version")] pub use sp_version; @@ -1415,7 +1449,8 @@ pub use sp_wasm_interface; #[cfg(feature = "sp-weights")] pub use sp_weights; -/// Utility for building chain-specification files for Substrate-based runtimes based on `sp-genesis-builder`. +/// Utility for building chain-specification files for Substrate-based runtimes based on +/// `sp-genesis-builder`. #[cfg(feature = "staging-chain-spec-builder")] pub use staging_chain_spec_builder; @@ -1443,7 +1478,8 @@ pub use staging_xcm_builder; #[cfg(feature = "staging-xcm-executor")] pub use staging_xcm_executor; -/// Generate and restore keys for Substrate based chains such as Polkadot, Kusama and a growing number of parachains and Substrate based projects. +/// Generate and restore keys for Substrate based chains such as Polkadot, Kusama and a growing +/// number of parachains and Substrate based projects. #[cfg(feature = "subkey")] pub use subkey; @@ -1487,7 +1523,8 @@ pub use testnet_parachains_constants; #[cfg(feature = "tracing-gum")] pub use tracing_gum; -/// Generate an overseer including builder pattern and message wrapper from a single annotated struct definition. +/// Generate an overseer including builder pattern and message wrapper from a single annotated +/// struct definition. #[cfg(feature = "tracing-gum-proc-macro")] pub use tracing_gum_proc_macro; From 69d998e3ce88d362bfc08ea128951cd3cd488b85 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Mon, 26 Aug 2024 23:26:53 +0200 Subject: [PATCH 28/39] fix missing default features --- bridges/relays/utils/Cargo.toml | 2 +- substrate/client/executor/wasmtime/Cargo.toml | 2 +- substrate/frame/contracts/fixtures/Cargo.toml | 4 ++-- substrate/frame/revive/fixtures/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bridges/relays/utils/Cargo.toml b/bridges/relays/utils/Cargo.toml index beb03b9381d4f..4c25566607dcd 100644 --- a/bridges/relays/utils/Cargo.toml +++ b/bridges/relays/utils/Cargo.toml @@ -11,7 +11,7 @@ publish = false workspace = true [dependencies] -anyhow = { workspace = true } +anyhow = { workspace = true, default-features = true } async-std = { workspace = true } async-trait = { workspace = true } backoff = { workspace = true } diff --git a/substrate/client/executor/wasmtime/Cargo.toml b/substrate/client/executor/wasmtime/Cargo.toml index ef8e5da876aa6..53dd22858dd9f 100644 --- a/substrate/client/executor/wasmtime/Cargo.toml +++ b/substrate/client/executor/wasmtime/Cargo.toml @@ -30,7 +30,7 @@ wasmtime = { features = [ "parallel-compilation", "pooling-allocator", ], workspace = true } -anyhow = { workspace = true } +anyhow = { workspace = true, default-features = true } sc-allocator = { workspace = true, default-features = true } sc-executor-common = { workspace = true, default-features = true } sp-runtime-interface = { workspace = true, default-features = true } diff --git a/substrate/frame/contracts/fixtures/Cargo.toml b/substrate/frame/contracts/fixtures/Cargo.toml index 6b0751571cc9c..6cb6447d8fd7e 100644 --- a/substrate/frame/contracts/fixtures/Cargo.toml +++ b/substrate/frame/contracts/fixtures/Cargo.toml @@ -13,7 +13,7 @@ workspace = true [dependencies] frame-system = { workspace = true, default-features = true } sp-runtime = { workspace = true, default-features = true } -anyhow = { workspace = true } +anyhow = { workspace = true, default-features = true } [build-dependencies] parity-wasm = { workspace = true } @@ -21,7 +21,7 @@ tempfile = { workspace = true } toml = { workspace = true } twox-hash = { workspace = true, default-features = true } polkavm-linker = { workspace = true, optional = true } -anyhow = { workspace = true } +anyhow = { workspace = true, default-features = true } [features] riscv = ["polkavm-linker"] diff --git a/substrate/frame/revive/fixtures/Cargo.toml b/substrate/frame/revive/fixtures/Cargo.toml index 9e54acdace709..216db8d42023d 100644 --- a/substrate/frame/revive/fixtures/Cargo.toml +++ b/substrate/frame/revive/fixtures/Cargo.toml @@ -13,7 +13,7 @@ workspace = true [dependencies] frame-system = { workspace = true, default-features = true, optional = true } sp-runtime = { workspace = true, default-features = true, optional = true } -anyhow = { workspace = true } +anyhow = { workspace = true, default-features = true } [build-dependencies] parity-wasm = { workspace = true } From f87dd47ade81558bc770ddd1e0153c954511a860 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 27 Aug 2024 07:58:10 +0200 Subject: [PATCH 29/39] Revert "fix missing default features" This reverts commit 69d998e3ce88d362bfc08ea128951cd3cd488b85. --- substrate/client/executor/wasmtime/Cargo.toml | 2 +- substrate/frame/contracts/fixtures/Cargo.toml | 4 ++-- substrate/frame/revive/fixtures/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/substrate/client/executor/wasmtime/Cargo.toml b/substrate/client/executor/wasmtime/Cargo.toml index 53dd22858dd9f..ef8e5da876aa6 100644 --- a/substrate/client/executor/wasmtime/Cargo.toml +++ b/substrate/client/executor/wasmtime/Cargo.toml @@ -30,7 +30,7 @@ wasmtime = { features = [ "parallel-compilation", "pooling-allocator", ], workspace = true } -anyhow = { workspace = true, default-features = true } +anyhow = { workspace = true } sc-allocator = { workspace = true, default-features = true } sc-executor-common = { workspace = true, default-features = true } sp-runtime-interface = { workspace = true, default-features = true } diff --git a/substrate/frame/contracts/fixtures/Cargo.toml b/substrate/frame/contracts/fixtures/Cargo.toml index 6cb6447d8fd7e..6b0751571cc9c 100644 --- a/substrate/frame/contracts/fixtures/Cargo.toml +++ b/substrate/frame/contracts/fixtures/Cargo.toml @@ -13,7 +13,7 @@ workspace = true [dependencies] frame-system = { workspace = true, default-features = true } sp-runtime = { workspace = true, default-features = true } -anyhow = { workspace = true, default-features = true } +anyhow = { workspace = true } [build-dependencies] parity-wasm = { workspace = true } @@ -21,7 +21,7 @@ tempfile = { workspace = true } toml = { workspace = true } twox-hash = { workspace = true, default-features = true } polkavm-linker = { workspace = true, optional = true } -anyhow = { workspace = true, default-features = true } +anyhow = { workspace = true } [features] riscv = ["polkavm-linker"] diff --git a/substrate/frame/revive/fixtures/Cargo.toml b/substrate/frame/revive/fixtures/Cargo.toml index 216db8d42023d..9e54acdace709 100644 --- a/substrate/frame/revive/fixtures/Cargo.toml +++ b/substrate/frame/revive/fixtures/Cargo.toml @@ -13,7 +13,7 @@ workspace = true [dependencies] frame-system = { workspace = true, default-features = true, optional = true } sp-runtime = { workspace = true, default-features = true, optional = true } -anyhow = { workspace = true, default-features = true } +anyhow = { workspace = true } [build-dependencies] parity-wasm = { workspace = true } From 1dc603d496c32eb7f5ec2cf8266011fa0c5c3151 Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Tue, 27 Aug 2024 09:01:51 +0200 Subject: [PATCH 30/39] Update Cargo.toml --- substrate/frame/contracts/fixtures/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/contracts/fixtures/Cargo.toml b/substrate/frame/contracts/fixtures/Cargo.toml index 6b0751571cc9c..209003615c4e0 100644 --- a/substrate/frame/contracts/fixtures/Cargo.toml +++ b/substrate/frame/contracts/fixtures/Cargo.toml @@ -13,7 +13,7 @@ workspace = true [dependencies] frame-system = { workspace = true, default-features = true } sp-runtime = { workspace = true, default-features = true } -anyhow = { workspace = true } +anyhow = { workspace = true, default-features = true } [build-dependencies] parity-wasm = { workspace = true } From 5928b87c559cf52530b9734d7261aeec22cde7fc Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 27 Aug 2024 10:40:08 +0200 Subject: [PATCH 31/39] fixes --- Cargo.lock | 1 - substrate/frame/contracts/fixtures/Cargo.toml | 3 +++ substrate/frame/revive/fixtures/Cargo.toml | 3 +++ umbrella/Cargo.toml | 8 -------- umbrella/src/lib.rs | 4 ---- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bc48b81c9e542..eccedfc1e82e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14393,7 +14393,6 @@ dependencies = [ "pallet-referenda", "pallet-remark", "pallet-revive", - "pallet-revive-fixtures", "pallet-revive-mock-network", "pallet-revive-proc-macro", "pallet-revive-uapi", diff --git a/substrate/frame/contracts/fixtures/Cargo.toml b/substrate/frame/contracts/fixtures/Cargo.toml index 209003615c4e0..cb47a6b5839d2 100644 --- a/substrate/frame/contracts/fixtures/Cargo.toml +++ b/substrate/frame/contracts/fixtures/Cargo.toml @@ -10,6 +10,9 @@ description = "Fixtures for testing contracts pallet." [lints] workspace = true +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [dependencies] frame-system = { workspace = true, default-features = true } sp-runtime = { workspace = true, default-features = true } diff --git a/substrate/frame/revive/fixtures/Cargo.toml b/substrate/frame/revive/fixtures/Cargo.toml index 9e54acdace709..48d7f717b878d 100644 --- a/substrate/frame/revive/fixtures/Cargo.toml +++ b/substrate/frame/revive/fixtures/Cargo.toml @@ -15,6 +15,9 @@ frame-system = { workspace = true, default-features = true, optional = true } sp-runtime = { workspace = true, default-features = true, optional = true } anyhow = { workspace = true } +[package.metadata.polkadot-sdk] +exclude-from-umbrella = true + [build-dependencies] parity-wasm = { workspace = true } tempfile = { workspace = true } diff --git a/umbrella/Cargo.toml b/umbrella/Cargo.toml index 1701d5ae27eb5..08e35111beddf 100644 --- a/umbrella/Cargo.toml +++ b/umbrella/Cargo.toml @@ -120,7 +120,6 @@ std = [ "pallet-recovery?/std", "pallet-referenda?/std", "pallet-remark?/std", - "pallet-revive-fixtures?/std", "pallet-revive-mock-network?/std", "pallet-revive?/std", "pallet-root-offences?/std", @@ -651,7 +650,6 @@ runtime = [ "pallet-referenda", "pallet-remark", "pallet-revive", - "pallet-revive-fixtures", "pallet-revive-proc-macro", "pallet-revive-uapi", "pallet-root-offences", @@ -774,7 +772,6 @@ tuples-96 = [ "frame-support?/tuples-96", ] riscv = [ - "pallet-revive-fixtures?/riscv", "pallet-revive?/riscv", ] @@ -1349,11 +1346,6 @@ path = "../substrate/frame/revive" default-features = false optional = true -[dependencies.pallet-revive-fixtures] -path = "../substrate/frame/revive/fixtures" -default-features = false -optional = true - [dependencies.pallet-revive-proc-macro] path = "../substrate/frame/revive/proc-macro" default-features = false diff --git a/umbrella/src/lib.rs b/umbrella/src/lib.rs index 69613069c5032..0c74eb33249be 100644 --- a/umbrella/src/lib.rs +++ b/umbrella/src/lib.rs @@ -580,10 +580,6 @@ pub use pallet_remark; #[cfg(feature = "pallet-revive")] pub use pallet_revive; -/// Fixtures for testing and benchmarking. -#[cfg(feature = "pallet-revive-fixtures")] -pub use pallet_revive_fixtures; - /// A mock network for testing pallet-revive. #[cfg(feature = "pallet-revive-mock-network")] pub use pallet_revive_mock_network; From f6c0d2b358a7150e42ff33c4fc604d50bd69eb0f Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 27 Aug 2024 10:49:42 +0200 Subject: [PATCH 32/39] fix --- substrate/frame/contracts/fixtures/Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/substrate/frame/contracts/fixtures/Cargo.toml b/substrate/frame/contracts/fixtures/Cargo.toml index cb47a6b5839d2..caae68295c535 100644 --- a/substrate/frame/contracts/fixtures/Cargo.toml +++ b/substrate/frame/contracts/fixtures/Cargo.toml @@ -7,12 +7,12 @@ edition.workspace = true license.workspace = true description = "Fixtures for testing contracts pallet." -[lints] -workspace = true - [package.metadata.polkadot-sdk] exclude-from-umbrella = true +[lints] +workspace = true + [dependencies] frame-system = { workspace = true, default-features = true } sp-runtime = { workspace = true, default-features = true } @@ -24,7 +24,7 @@ tempfile = { workspace = true } toml = { workspace = true } twox-hash = { workspace = true, default-features = true } polkavm-linker = { workspace = true, optional = true } -anyhow = { workspace = true } +anyhow = { workspace = true, default-features = true } [features] riscv = ["polkavm-linker"] From 4f4256af81e6f27f4e3fd07135a7d58dc82ef00b Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 27 Aug 2024 13:41:08 +0200 Subject: [PATCH 33/39] Rollback changes and update polkadot-sdk feature flags --- prdoc/pr_5155.prdoc | 2 +- scripts/generate-umbrella.py | 41 ++--- templates/minimal/runtime/Cargo.toml | 10 +- umbrella/Cargo.toml | 222 +-------------------------- umbrella/src/lib.rs | 2 +- 5 files changed, 34 insertions(+), 243 deletions(-) diff --git a/prdoc/pr_5155.prdoc b/prdoc/pr_5155.prdoc index 08643525dbcc1..373522eea1c39 100644 --- a/prdoc/pr_5155.prdoc +++ b/prdoc/pr_5155.prdoc @@ -11,7 +11,7 @@ doc: crates: - name: polkadot-sdk - bump: patch + bump: major - name: polkadot-sdk-frame bump: patch - name: sp-wasm-interface diff --git a/scripts/generate-umbrella.py b/scripts/generate-umbrella.py index 6fddf88562e90..c94e9f8770f57 100644 --- a/scripts/generate-umbrella.py +++ b/scripts/generate-umbrella.py @@ -38,12 +38,6 @@ def exclude(crate): return False - -def no_riscv_target(crate): - if crate.name == "pallet-contracts": - return True - return False - def main(path, version): delete_umbrella(path) workspace = Workspace.from_path(path) @@ -92,24 +86,25 @@ def main(path, version): # Sort by name std_crates.sort(key=lambda x: x[0].name) nostd_crates.sort(key=lambda x: x[0].name) + runtime_crates_names = [ + "frame-support", + "frame-system", + "polkadot-sdk-frame", + "sp-api", + "sp-genesis-builder", + "sp-runtime", + ] + runtime_crates = [crate for crate in nostd_crates if crate[0].name in runtime_crates_names or crate[0].name.startswith("frame")] all_crates = std_crates + nostd_crates all_crates.sort(key=lambda x: x[0].name) dependencies = {} - target = {} - no_arch_riscv_deps = {} - target["cfg(not(target_arch = \"riscv32\"))"] = {} - target["cfg(not(target_arch = \"riscv32\"))"]["dependencies"] = no_arch_riscv_deps - - def add_dependency(crate, path): - deps = no_arch_riscv_deps if no_riscv_target(crate) else dependencies - deps[crate.name] = {"path": f"../{path}", "default-features": False, "optional": True} - + for (crate, path) in nostd_crates: - add_dependency(crate, path) + dependencies[crate.name] = {"path": f"../{path}", "default-features": False, "optional": True} for (crate, path) in std_crates: - add_dependency(crate, path) - + dependencies[crate.name] = {"path": f"../{path}", "default-features": False, "optional": True} + # The empty features are filled by Zepter features = { "default": [ "std" ], @@ -119,7 +114,8 @@ def add_dependency(crate, path): "serde": [], "experimental": [], "with-tracing": [], - "runtime": list([f"{d.name}" for d, _ in nostd_crates]), + "runtime-full": list([f"{d.name}" for d, _ in nostd_crates]), + "runtime": list([f"{d.name}" for d, _ in runtime_crates]), "node": ["std"] + list([f"{d.name}" for d, _ in std_crates]), "tuples-96": [], "riscv": [], @@ -140,7 +136,6 @@ def add_dependency(crate, path): }, "dependencies": dependencies, "features": features, - "target": target, } umbrella_dir = os.path.join(workspace.path, "umbrella") @@ -173,10 +168,7 @@ def add_dependency(crate, path): use = crate.name.replace("-", "_") desc = crate.description if crate.description.endswith(".") else crate.description + "." f.write(f'\n/// {desc}') - if no_riscv_target(crate): - f.write(f'\n#[cfg(all(feature = "{crate.name}", not(target_arch = "riscv32")))]\n') - else: - f.write(f'\n#[cfg(feature = "{crate.name}")]\n') + f.write(f'\n#[cfg(feature = "{crate.name}")]\n') f.write(f"pub use {use};\n") print(f"Wrote {lib_path}") @@ -222,3 +214,4 @@ def parse_args(): if __name__ == "__main__": args = parse_args() main(args.sdk, args.version) + diff --git a/templates/minimal/runtime/Cargo.toml b/templates/minimal/runtime/Cargo.toml index 6feaf2534df36..49ddf3987e96f 100644 --- a/templates/minimal/runtime/Cargo.toml +++ b/templates/minimal/runtime/Cargo.toml @@ -12,7 +12,15 @@ publish = false [dependencies] codec = { workspace = true } scale-info = { workspace = true } -polkadot-sdk = { workspace = true, features = ["experimental", "runtime"] } +polkadot-sdk = { workspace = true, features = [ + "experimental", + "pallet-balances", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "runtime", +] } # local pallet templates pallet-minimal-template = { workspace = true } diff --git a/umbrella/Cargo.toml b/umbrella/Cargo.toml index 08e35111beddf..350a5eaaf0906 100644 --- a/umbrella/Cargo.toml +++ b/umbrella/Cargo.toml @@ -535,37 +535,8 @@ with-tracing = [ "sp-tracing?/with-tracing", "sp-tracing?/with-tracing", ] +runtime-full = ["assets-common", "binary-merkle-tree", "bp-header-chain", "bp-messages", "bp-parachains", "bp-polkadot", "bp-polkadot-core", "bp-relayers", "bp-runtime", "bp-test-utils", "bp-xcm-bridge-hub", "bp-xcm-bridge-hub-router", "bridge-hub-common", "bridge-runtime-common", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", "cumulus-pallet-parachain-system-proc-macro", "cumulus-pallet-session-benchmarking", "cumulus-pallet-solo-to-para", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", "cumulus-ping", "cumulus-primitives-aura", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-primitives-proof-size-hostfunction", "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-timestamp", "cumulus-primitives-utility", "frame-benchmarking", "frame-benchmarking-pallet-pov", "frame-election-provider-solution-type", "frame-election-provider-support", "frame-executive", "frame-metadata-hash-extension", "frame-support", "frame-support-procedural", "frame-support-procedural-tools-derive", "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", "pallet-alliance", "pallet-asset-conversion", "pallet-asset-conversion-ops", "pallet-asset-conversion-tx-payment", "pallet-asset-rate", "pallet-asset-tx-payment", "pallet-assets", "pallet-assets-freezer", "pallet-atomic-swap", "pallet-aura", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", "pallet-bags-list", "pallet-balances", "pallet-beefy", "pallet-beefy-mmr", "pallet-bounties", "pallet-bridge-grandpa", "pallet-bridge-messages", "pallet-bridge-parachains", "pallet-bridge-relayers", "pallet-broker", "pallet-child-bounties", "pallet-collator-selection", "pallet-collective", "pallet-collective-content", "pallet-contracts", "pallet-contracts-proc-macro", "pallet-contracts-uapi", "pallet-conviction-voting", "pallet-core-fellowship", "pallet-delegated-staking", "pallet-democracy", "pallet-dev-mode", "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", "pallet-fast-unstake", "pallet-glutton", "pallet-grandpa", "pallet-identity", "pallet-im-online", "pallet-indices", "pallet-insecure-randomness-collective-flip", "pallet-lottery", "pallet-membership", "pallet-message-queue", "pallet-migrations", "pallet-mixnet", "pallet-mmr", "pallet-multisig", "pallet-nft-fractionalization", "pallet-nfts", "pallet-nfts-runtime-api", "pallet-nis", "pallet-node-authorization", "pallet-nomination-pools", "pallet-nomination-pools-benchmarking", "pallet-nomination-pools-runtime-api", "pallet-offences", "pallet-offences-benchmarking", "pallet-paged-list", "pallet-parameters", "pallet-preimage", "pallet-proxy", "pallet-ranked-collective", "pallet-recovery", "pallet-referenda", "pallet-remark", "pallet-revive", "pallet-revive-proc-macro", "pallet-revive-uapi", "pallet-root-offences", "pallet-root-testing", "pallet-safe-mode", "pallet-salary", "pallet-scheduler", "pallet-scored-pool", "pallet-session", "pallet-session-benchmarking", "pallet-skip-feeless-payment", "pallet-society", "pallet-staking", "pallet-staking-reward-curve", "pallet-staking-reward-fn", "pallet-staking-runtime-api", "pallet-state-trie-migration", "pallet-statement", "pallet-sudo", "pallet-timestamp", "pallet-tips", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-transaction-storage", "pallet-treasury", "pallet-tx-pause", "pallet-uniques", "pallet-utility", "pallet-vesting", "pallet-whitelist", "pallet-xcm", "pallet-xcm-benchmarks", "pallet-xcm-bridge-hub", "pallet-xcm-bridge-hub-router", "parachains-common", "polkadot-core-primitives", "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-metrics", "polkadot-runtime-parachains", "polkadot-sdk-frame", "sc-chain-spec-derive", "sc-tracing-proc-macro", "slot-range-helper", "snowbridge-beacon-primitives", "snowbridge-core", "snowbridge-ethereum", "snowbridge-outbound-queue-merkle-tree", "snowbridge-outbound-queue-runtime-api", "snowbridge-pallet-ethereum-client", "snowbridge-pallet-ethereum-client-fixtures", "snowbridge-pallet-inbound-queue", "snowbridge-pallet-inbound-queue-fixtures", "snowbridge-pallet-outbound-queue", "snowbridge-pallet-system", "snowbridge-router-primitives", "snowbridge-runtime-common", "snowbridge-system-runtime-api", "sp-api", "sp-api-proc-macro", "sp-application-crypto", "sp-arithmetic", "sp-authority-discovery", "sp-block-builder", "sp-consensus-aura", "sp-consensus-babe", "sp-consensus-beefy", "sp-consensus-grandpa", "sp-consensus-pow", "sp-consensus-slots", "sp-core", "sp-crypto-ec-utils", "sp-crypto-hashing", "sp-crypto-hashing-proc-macro", "sp-debug-derive", "sp-externalities", "sp-genesis-builder", "sp-inherents", "sp-io", "sp-keyring", "sp-keystore", "sp-metadata-ir", "sp-mixnet", "sp-mmr-primitives", "sp-npos-elections", "sp-offchain", "sp-runtime", "sp-runtime-interface", "sp-runtime-interface-proc-macro", "sp-session", "sp-staking", "sp-state-machine", "sp-statement-store", "sp-std", "sp-storage", "sp-timestamp", "sp-tracing", "sp-transaction-pool", "sp-transaction-storage-proof", "sp-trie", "sp-version", "sp-version-proc-macro", "sp-wasm-interface", "sp-weights", "staging-parachain-info", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", "substrate-bip39", "testnet-parachains-constants", "tracing-gum-proc-macro", "xcm-procedural", "xcm-runtime-apis"] runtime = [ - "assets-common", - "binary-merkle-tree", - "bp-header-chain", - "bp-messages", - "bp-parachains", - "bp-polkadot", - "bp-polkadot-core", - "bp-relayers", - "bp-runtime", - "bp-test-utils", - "bp-xcm-bridge-hub", - "bp-xcm-bridge-hub-router", - "bridge-hub-common", - "bridge-runtime-common", - "cumulus-pallet-aura-ext", - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", - "cumulus-pallet-parachain-system-proc-macro", - "cumulus-pallet-session-benchmarking", - "cumulus-pallet-solo-to-para", - "cumulus-pallet-xcm", - "cumulus-pallet-xcmp-queue", - "cumulus-ping", - "cumulus-primitives-aura", - "cumulus-primitives-core", - "cumulus-primitives-parachain-inherent", - "cumulus-primitives-proof-size-hostfunction", - "cumulus-primitives-storage-weight-reclaim", - "cumulus-primitives-timestamp", - "cumulus-primitives-utility", "frame-benchmarking", "frame-benchmarking-pallet-pov", "frame-election-provider-solution-type", @@ -579,192 +550,11 @@ runtime = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", - "pallet-alliance", - "pallet-asset-conversion", - "pallet-asset-conversion-ops", - "pallet-asset-conversion-tx-payment", - "pallet-asset-rate", - "pallet-asset-tx-payment", - "pallet-assets", - "pallet-assets-freezer", - "pallet-atomic-swap", - "pallet-aura", - "pallet-authority-discovery", - "pallet-authorship", - "pallet-babe", - "pallet-bags-list", - "pallet-balances", - "pallet-beefy", - "pallet-beefy-mmr", - "pallet-bounties", - "pallet-bridge-grandpa", - "pallet-bridge-messages", - "pallet-bridge-parachains", - "pallet-bridge-relayers", - "pallet-broker", - "pallet-child-bounties", - "pallet-collator-selection", - "pallet-collective", - "pallet-collective-content", - "pallet-contracts", - "pallet-contracts-proc-macro", - "pallet-contracts-uapi", - "pallet-conviction-voting", - "pallet-core-fellowship", - "pallet-delegated-staking", - "pallet-democracy", - "pallet-dev-mode", - "pallet-election-provider-multi-phase", - "pallet-election-provider-support-benchmarking", - "pallet-elections-phragmen", - "pallet-fast-unstake", - "pallet-glutton", - "pallet-grandpa", - "pallet-identity", - "pallet-im-online", - "pallet-indices", - "pallet-insecure-randomness-collective-flip", - "pallet-lottery", - "pallet-membership", - "pallet-message-queue", - "pallet-migrations", - "pallet-mixnet", - "pallet-mmr", - "pallet-multisig", - "pallet-nft-fractionalization", - "pallet-nfts", - "pallet-nfts-runtime-api", - "pallet-nis", - "pallet-node-authorization", - "pallet-nomination-pools", - "pallet-nomination-pools-benchmarking", - "pallet-nomination-pools-runtime-api", - "pallet-offences", - "pallet-offences-benchmarking", - "pallet-paged-list", - "pallet-parameters", - "pallet-preimage", - "pallet-proxy", - "pallet-ranked-collective", - "pallet-recovery", - "pallet-referenda", - "pallet-remark", - "pallet-revive", - "pallet-revive-proc-macro", - "pallet-revive-uapi", - "pallet-root-offences", - "pallet-root-testing", - "pallet-safe-mode", - "pallet-salary", - "pallet-scheduler", - "pallet-scored-pool", - "pallet-session", - "pallet-session-benchmarking", - "pallet-skip-feeless-payment", - "pallet-society", - "pallet-staking", - "pallet-staking-reward-curve", - "pallet-staking-reward-fn", - "pallet-staking-runtime-api", - "pallet-state-trie-migration", - "pallet-statement", - "pallet-sudo", - "pallet-timestamp", - "pallet-tips", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", - "pallet-transaction-storage", - "pallet-treasury", - "pallet-tx-pause", - "pallet-uniques", - "pallet-utility", - "pallet-vesting", - "pallet-whitelist", - "pallet-xcm", - "pallet-xcm-benchmarks", - "pallet-xcm-bridge-hub", - "pallet-xcm-bridge-hub-router", - "parachains-common", - "polkadot-core-primitives", - "polkadot-parachain-primitives", - "polkadot-primitives", - "polkadot-runtime-common", - "polkadot-runtime-metrics", - "polkadot-runtime-parachains", "polkadot-sdk-frame", "polkadot-sdk-frame?/runtime", - "sc-chain-spec-derive", - "sc-tracing-proc-macro", - "slot-range-helper", - "snowbridge-beacon-primitives", - "snowbridge-core", - "snowbridge-ethereum", - "snowbridge-outbound-queue-merkle-tree", - "snowbridge-outbound-queue-runtime-api", - "snowbridge-pallet-ethereum-client", - "snowbridge-pallet-ethereum-client-fixtures", - "snowbridge-pallet-inbound-queue", - "snowbridge-pallet-inbound-queue-fixtures", - "snowbridge-pallet-outbound-queue", - "snowbridge-pallet-system", - "snowbridge-router-primitives", - "snowbridge-runtime-common", - "snowbridge-system-runtime-api", "sp-api", - "sp-api-proc-macro", - "sp-application-crypto", - "sp-arithmetic", - "sp-authority-discovery", - "sp-block-builder", - "sp-consensus-aura", - "sp-consensus-babe", - "sp-consensus-beefy", - "sp-consensus-grandpa", - "sp-consensus-pow", - "sp-consensus-slots", - "sp-core", - "sp-crypto-ec-utils", - "sp-crypto-hashing", - "sp-crypto-hashing-proc-macro", - "sp-debug-derive", - "sp-externalities", "sp-genesis-builder", - "sp-inherents", - "sp-io", - "sp-keyring", - "sp-keystore", - "sp-metadata-ir", - "sp-mixnet", - "sp-mmr-primitives", - "sp-npos-elections", - "sp-offchain", "sp-runtime", - "sp-runtime-interface", - "sp-runtime-interface-proc-macro", - "sp-session", - "sp-staking", - "sp-state-machine", - "sp-statement-store", - "sp-std", - "sp-storage", - "sp-timestamp", - "sp-tracing", - "sp-transaction-pool", - "sp-transaction-storage-proof", - "sp-trie", - "sp-version", - "sp-version-proc-macro", - "sp-wasm-interface", - "sp-weights", - "staging-parachain-info", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", - "substrate-bip39", - "testnet-parachains-constants", - "tracing-gum-proc-macro", - "xcm-procedural", - "xcm-runtime-apis", ] node = ["asset-test-utils", "bridge-hub-test-utils", "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-aura", "cumulus-client-consensus-common", "cumulus-client-consensus-proposer", "cumulus-client-consensus-relay-chain", "cumulus-client-network", "cumulus-client-parachain-inherent", "cumulus-client-pov-recovery", "cumulus-client-service", "cumulus-relay-chain-inprocess-interface", "cumulus-relay-chain-interface", "cumulus-relay-chain-minimal-node", "cumulus-relay-chain-rpc-interface", "cumulus-test-relay-sproof-builder", "emulated-integration-tests-common", "fork-tree", "frame-benchmarking-cli", "frame-remote-externalities", "frame-support-procedural-tools", "generate-bags", "mmr-gadget", "mmr-rpc", "pallet-contracts-mock-network", "pallet-revive-mock-network", "pallet-transaction-payment-rpc", "parachains-runtimes-test-utils", "polkadot-approval-distribution", "polkadot-availability-bitfield-distribution", "polkadot-availability-distribution", "polkadot-availability-recovery", "polkadot-cli", "polkadot-collator-protocol", "polkadot-dispute-distribution", "polkadot-erasure-coding", "polkadot-gossip-support", "polkadot-network-bridge", "polkadot-node-collation-generation", "polkadot-node-core-approval-voting", "polkadot-node-core-av-store", "polkadot-node-core-backing", "polkadot-node-core-bitfield-signing", "polkadot-node-core-candidate-validation", "polkadot-node-core-chain-api", "polkadot-node-core-chain-selection", "polkadot-node-core-dispute-coordinator", "polkadot-node-core-parachains-inherent", "polkadot-node-core-prospective-parachains", "polkadot-node-core-provisioner", "polkadot-node-core-pvf", "polkadot-node-core-pvf-checker", "polkadot-node-core-pvf-common", "polkadot-node-core-pvf-execute-worker", "polkadot-node-core-pvf-prepare-worker", "polkadot-node-core-runtime-api", "polkadot-node-jaeger", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-types", "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-parachain-lib", "polkadot-rpc", "polkadot-service", "polkadot-statement-distribution", "polkadot-statement-table", "sc-allocator", "sc-authority-discovery", "sc-basic-authorship", "sc-block-builder", "sc-chain-spec", "sc-cli", "sc-client-api", "sc-client-db", "sc-consensus", "sc-consensus-aura", "sc-consensus-babe", "sc-consensus-babe-rpc", "sc-consensus-beefy", "sc-consensus-beefy-rpc", "sc-consensus-epochs", "sc-consensus-grandpa", "sc-consensus-grandpa-rpc", "sc-consensus-manual-seal", "sc-consensus-pow", "sc-consensus-slots", "sc-executor", "sc-executor-common", "sc-executor-polkavm", "sc-executor-wasmtime", "sc-informant", "sc-keystore", "sc-mixnet", "sc-network", "sc-network-common", "sc-network-gossip", "sc-network-light", "sc-network-statement", "sc-network-sync", "sc-network-transactions", "sc-network-types", "sc-offchain", "sc-proposer-metrics", "sc-rpc", "sc-rpc-api", "sc-rpc-server", "sc-rpc-spec-v2", "sc-service", "sc-state-db", "sc-statement-store", "sc-storage-monitor", "sc-sync-state-rpc", "sc-sysinfo", "sc-telemetry", "sc-tracing", "sc-transaction-pool", "sc-transaction-pool-api", "sc-utils", "snowbridge-runtime-test-common", "sp-blockchain", "sp-consensus", "sp-core-hashing", "sp-core-hashing-proc-macro", "sp-database", "sp-maybe-compressed-blob", "sp-panic-handler", "sp-rpc", "staging-chain-spec-builder", "staging-node-inspect", "staging-tracking-allocator", "std", "subkey", "substrate-build-script-utils", "substrate-frame-rpc-support", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", "substrate-rpc-client", "substrate-state-trie-migration-rpc", "substrate-wasm-builder", "tracing-gum", "xcm-emulator", "xcm-simulator"] tuples-96 = [ @@ -1131,6 +921,11 @@ path = "../cumulus/parachains/pallets/collective-content" default-features = false optional = true +[dependencies.pallet-contracts] +path = "../substrate/frame/contracts" +default-features = false +optional = true + [dependencies.pallet-contracts-proc-macro] path = "../substrate/frame/contracts/proc-macro" default-features = false @@ -2644,8 +2439,3 @@ optional = true [package.metadata.docs.rs] features = ["node", "runtime"] targets = ["x86_64-unknown-linux-gnu"] - -[target."cfg(not(target_arch = \"riscv32\"))".dependencies.pallet-contracts] -path = "../substrate/frame/contracts" -default-features = false -optional = true diff --git a/umbrella/src/lib.rs b/umbrella/src/lib.rs index 0c74eb33249be..841089c175cfb 100644 --- a/umbrella/src/lib.rs +++ b/umbrella/src/lib.rs @@ -400,7 +400,7 @@ pub use pallet_collective; pub use pallet_collective_content; /// FRAME pallet for WASM contracts. -#[cfg(all(feature = "pallet-contracts", not(target_arch = "riscv32")))] +#[cfg(feature = "pallet-contracts")] pub use pallet_contracts; /// A mock network for testing pallet-contracts. From 6c3f7596e72fa2c000370ae5e950b7431be8038e Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Tue, 27 Aug 2024 13:41:59 +0200 Subject: [PATCH 34/39] Update substrate/frame/revive/src/wasm/runtime.rs --- substrate/frame/revive/src/wasm/runtime.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substrate/frame/revive/src/wasm/runtime.rs b/substrate/frame/revive/src/wasm/runtime.rs index eb93cb410c599..de910e79e73e9 100644 --- a/substrate/frame/revive/src/wasm/runtime.rs +++ b/substrate/frame/revive/src/wasm/runtime.rs @@ -556,7 +556,7 @@ impl<'a, E: Ext, M: PolkaVmInstance> Runtime<'a, E, M> { } } -impl<'a, E: Ext + 'a, M: ?Sized + Memory> Runtime<'a, E, M> { +impl<'a, E: Ext, M: ?Sized + Memory> Runtime<'a, E, M> { pub fn new(ext: &'a mut E, input_data: Vec) -> Self { Self { ext, From 6fc20c3258c1fae9678c8bf5bd04f40b5892d450 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 27 Aug 2024 13:43:24 +0200 Subject: [PATCH 35/39] rollback package.metadata.polkadot-sdk changes --- substrate/frame/contracts/fixtures/Cargo.toml | 3 --- substrate/frame/revive/fixtures/Cargo.toml | 3 --- 2 files changed, 6 deletions(-) diff --git a/substrate/frame/contracts/fixtures/Cargo.toml b/substrate/frame/contracts/fixtures/Cargo.toml index caae68295c535..6cb6447d8fd7e 100644 --- a/substrate/frame/contracts/fixtures/Cargo.toml +++ b/substrate/frame/contracts/fixtures/Cargo.toml @@ -7,9 +7,6 @@ edition.workspace = true license.workspace = true description = "Fixtures for testing contracts pallet." -[package.metadata.polkadot-sdk] -exclude-from-umbrella = true - [lints] workspace = true diff --git a/substrate/frame/revive/fixtures/Cargo.toml b/substrate/frame/revive/fixtures/Cargo.toml index 48d7f717b878d..9e54acdace709 100644 --- a/substrate/frame/revive/fixtures/Cargo.toml +++ b/substrate/frame/revive/fixtures/Cargo.toml @@ -15,9 +15,6 @@ frame-system = { workspace = true, default-features = true, optional = true } sp-runtime = { workspace = true, default-features = true, optional = true } anyhow = { workspace = true } -[package.metadata.polkadot-sdk] -exclude-from-umbrella = true - [build-dependencies] parity-wasm = { workspace = true } tempfile = { workspace = true } From 467758393f6722ef07f69c9aa40ac2828e62800e Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 27 Aug 2024 13:45:14 +0200 Subject: [PATCH 36/39] use runtime-full instead of runtime --- docs/sdk/Cargo.toml | 2 +- substrate/bin/node/runtime/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sdk/Cargo.toml b/docs/sdk/Cargo.toml index 424758c32b345..adc1c1a8efbca 100644 --- a/docs/sdk/Cargo.toml +++ b/docs/sdk/Cargo.toml @@ -31,7 +31,7 @@ simple-mermaid = "0.1.1" docify = { workspace = true } # Polkadot SDK deps, typically all should only be in scope such that we can link to their doc item. -polkadot-sdk = { features = ["runtime"], workspace = true, default-features = true } +polkadot-sdk = { features = ["runtime-full"], workspace = true, default-features = true } node-cli = { workspace = true } kitchensink-runtime = { workspace = true } chain-spec-builder = { workspace = true, default-features = true } diff --git a/substrate/bin/node/runtime/Cargo.toml b/substrate/bin/node/runtime/Cargo.toml index c262d74fa8a8c..6310e16d5a14d 100644 --- a/substrate/bin/node/runtime/Cargo.toml +++ b/substrate/bin/node/runtime/Cargo.toml @@ -31,7 +31,7 @@ serde_json = { features = ["alloc", "arbitrary_precision"], workspace = true } # pallet-asset-conversion: turn on "num-traits" feature primitive-types = { features = ["codec", "num-traits", "scale-info"], workspace = true } -polkadot-sdk = { features = ["runtime", "tuples-96"], workspace = true } +polkadot-sdk = { features = ["runtime-full", "tuples-96"], workspace = true } # shared code between runtime and node node-primitives = { workspace = true } From 7031a43379a6e061f7f0a4154a349be42bb7d814 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 27 Aug 2024 15:24:18 +0200 Subject: [PATCH 37/39] Update umbrella --- Cargo.lock | 1 + umbrella/Cargo.toml | 9 ++++++++- umbrella/src/lib.rs | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index eccedfc1e82e8..bc48b81c9e542 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14393,6 +14393,7 @@ dependencies = [ "pallet-referenda", "pallet-remark", "pallet-revive", + "pallet-revive-fixtures", "pallet-revive-mock-network", "pallet-revive-proc-macro", "pallet-revive-uapi", diff --git a/umbrella/Cargo.toml b/umbrella/Cargo.toml index 350a5eaaf0906..15c79217cdf04 100644 --- a/umbrella/Cargo.toml +++ b/umbrella/Cargo.toml @@ -120,6 +120,7 @@ std = [ "pallet-recovery?/std", "pallet-referenda?/std", "pallet-remark?/std", + "pallet-revive-fixtures?/std", "pallet-revive-mock-network?/std", "pallet-revive?/std", "pallet-root-offences?/std", @@ -535,7 +536,7 @@ with-tracing = [ "sp-tracing?/with-tracing", "sp-tracing?/with-tracing", ] -runtime-full = ["assets-common", "binary-merkle-tree", "bp-header-chain", "bp-messages", "bp-parachains", "bp-polkadot", "bp-polkadot-core", "bp-relayers", "bp-runtime", "bp-test-utils", "bp-xcm-bridge-hub", "bp-xcm-bridge-hub-router", "bridge-hub-common", "bridge-runtime-common", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", "cumulus-pallet-parachain-system-proc-macro", "cumulus-pallet-session-benchmarking", "cumulus-pallet-solo-to-para", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", "cumulus-ping", "cumulus-primitives-aura", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-primitives-proof-size-hostfunction", "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-timestamp", "cumulus-primitives-utility", "frame-benchmarking", "frame-benchmarking-pallet-pov", "frame-election-provider-solution-type", "frame-election-provider-support", "frame-executive", "frame-metadata-hash-extension", "frame-support", "frame-support-procedural", "frame-support-procedural-tools-derive", "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", "pallet-alliance", "pallet-asset-conversion", "pallet-asset-conversion-ops", "pallet-asset-conversion-tx-payment", "pallet-asset-rate", "pallet-asset-tx-payment", "pallet-assets", "pallet-assets-freezer", "pallet-atomic-swap", "pallet-aura", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", "pallet-bags-list", "pallet-balances", "pallet-beefy", "pallet-beefy-mmr", "pallet-bounties", "pallet-bridge-grandpa", "pallet-bridge-messages", "pallet-bridge-parachains", "pallet-bridge-relayers", "pallet-broker", "pallet-child-bounties", "pallet-collator-selection", "pallet-collective", "pallet-collective-content", "pallet-contracts", "pallet-contracts-proc-macro", "pallet-contracts-uapi", "pallet-conviction-voting", "pallet-core-fellowship", "pallet-delegated-staking", "pallet-democracy", "pallet-dev-mode", "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", "pallet-fast-unstake", "pallet-glutton", "pallet-grandpa", "pallet-identity", "pallet-im-online", "pallet-indices", "pallet-insecure-randomness-collective-flip", "pallet-lottery", "pallet-membership", "pallet-message-queue", "pallet-migrations", "pallet-mixnet", "pallet-mmr", "pallet-multisig", "pallet-nft-fractionalization", "pallet-nfts", "pallet-nfts-runtime-api", "pallet-nis", "pallet-node-authorization", "pallet-nomination-pools", "pallet-nomination-pools-benchmarking", "pallet-nomination-pools-runtime-api", "pallet-offences", "pallet-offences-benchmarking", "pallet-paged-list", "pallet-parameters", "pallet-preimage", "pallet-proxy", "pallet-ranked-collective", "pallet-recovery", "pallet-referenda", "pallet-remark", "pallet-revive", "pallet-revive-proc-macro", "pallet-revive-uapi", "pallet-root-offences", "pallet-root-testing", "pallet-safe-mode", "pallet-salary", "pallet-scheduler", "pallet-scored-pool", "pallet-session", "pallet-session-benchmarking", "pallet-skip-feeless-payment", "pallet-society", "pallet-staking", "pallet-staking-reward-curve", "pallet-staking-reward-fn", "pallet-staking-runtime-api", "pallet-state-trie-migration", "pallet-statement", "pallet-sudo", "pallet-timestamp", "pallet-tips", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-transaction-storage", "pallet-treasury", "pallet-tx-pause", "pallet-uniques", "pallet-utility", "pallet-vesting", "pallet-whitelist", "pallet-xcm", "pallet-xcm-benchmarks", "pallet-xcm-bridge-hub", "pallet-xcm-bridge-hub-router", "parachains-common", "polkadot-core-primitives", "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-metrics", "polkadot-runtime-parachains", "polkadot-sdk-frame", "sc-chain-spec-derive", "sc-tracing-proc-macro", "slot-range-helper", "snowbridge-beacon-primitives", "snowbridge-core", "snowbridge-ethereum", "snowbridge-outbound-queue-merkle-tree", "snowbridge-outbound-queue-runtime-api", "snowbridge-pallet-ethereum-client", "snowbridge-pallet-ethereum-client-fixtures", "snowbridge-pallet-inbound-queue", "snowbridge-pallet-inbound-queue-fixtures", "snowbridge-pallet-outbound-queue", "snowbridge-pallet-system", "snowbridge-router-primitives", "snowbridge-runtime-common", "snowbridge-system-runtime-api", "sp-api", "sp-api-proc-macro", "sp-application-crypto", "sp-arithmetic", "sp-authority-discovery", "sp-block-builder", "sp-consensus-aura", "sp-consensus-babe", "sp-consensus-beefy", "sp-consensus-grandpa", "sp-consensus-pow", "sp-consensus-slots", "sp-core", "sp-crypto-ec-utils", "sp-crypto-hashing", "sp-crypto-hashing-proc-macro", "sp-debug-derive", "sp-externalities", "sp-genesis-builder", "sp-inherents", "sp-io", "sp-keyring", "sp-keystore", "sp-metadata-ir", "sp-mixnet", "sp-mmr-primitives", "sp-npos-elections", "sp-offchain", "sp-runtime", "sp-runtime-interface", "sp-runtime-interface-proc-macro", "sp-session", "sp-staking", "sp-state-machine", "sp-statement-store", "sp-std", "sp-storage", "sp-timestamp", "sp-tracing", "sp-transaction-pool", "sp-transaction-storage-proof", "sp-trie", "sp-version", "sp-version-proc-macro", "sp-wasm-interface", "sp-weights", "staging-parachain-info", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", "substrate-bip39", "testnet-parachains-constants", "tracing-gum-proc-macro", "xcm-procedural", "xcm-runtime-apis"] +runtime-full = ["assets-common", "binary-merkle-tree", "bp-header-chain", "bp-messages", "bp-parachains", "bp-polkadot", "bp-polkadot-core", "bp-relayers", "bp-runtime", "bp-test-utils", "bp-xcm-bridge-hub", "bp-xcm-bridge-hub-router", "bridge-hub-common", "bridge-runtime-common", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", "cumulus-pallet-parachain-system-proc-macro", "cumulus-pallet-session-benchmarking", "cumulus-pallet-solo-to-para", "cumulus-pallet-xcm", "cumulus-pallet-xcmp-queue", "cumulus-ping", "cumulus-primitives-aura", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-primitives-proof-size-hostfunction", "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-timestamp", "cumulus-primitives-utility", "frame-benchmarking", "frame-benchmarking-pallet-pov", "frame-election-provider-solution-type", "frame-election-provider-support", "frame-executive", "frame-metadata-hash-extension", "frame-support", "frame-support-procedural", "frame-support-procedural-tools-derive", "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", "pallet-alliance", "pallet-asset-conversion", "pallet-asset-conversion-ops", "pallet-asset-conversion-tx-payment", "pallet-asset-rate", "pallet-asset-tx-payment", "pallet-assets", "pallet-assets-freezer", "pallet-atomic-swap", "pallet-aura", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", "pallet-bags-list", "pallet-balances", "pallet-beefy", "pallet-beefy-mmr", "pallet-bounties", "pallet-bridge-grandpa", "pallet-bridge-messages", "pallet-bridge-parachains", "pallet-bridge-relayers", "pallet-broker", "pallet-child-bounties", "pallet-collator-selection", "pallet-collective", "pallet-collective-content", "pallet-contracts", "pallet-contracts-proc-macro", "pallet-contracts-uapi", "pallet-conviction-voting", "pallet-core-fellowship", "pallet-delegated-staking", "pallet-democracy", "pallet-dev-mode", "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", "pallet-fast-unstake", "pallet-glutton", "pallet-grandpa", "pallet-identity", "pallet-im-online", "pallet-indices", "pallet-insecure-randomness-collective-flip", "pallet-lottery", "pallet-membership", "pallet-message-queue", "pallet-migrations", "pallet-mixnet", "pallet-mmr", "pallet-multisig", "pallet-nft-fractionalization", "pallet-nfts", "pallet-nfts-runtime-api", "pallet-nis", "pallet-node-authorization", "pallet-nomination-pools", "pallet-nomination-pools-benchmarking", "pallet-nomination-pools-runtime-api", "pallet-offences", "pallet-offences-benchmarking", "pallet-paged-list", "pallet-parameters", "pallet-preimage", "pallet-proxy", "pallet-ranked-collective", "pallet-recovery", "pallet-referenda", "pallet-remark", "pallet-revive", "pallet-revive-fixtures", "pallet-revive-proc-macro", "pallet-revive-uapi", "pallet-root-offences", "pallet-root-testing", "pallet-safe-mode", "pallet-salary", "pallet-scheduler", "pallet-scored-pool", "pallet-session", "pallet-session-benchmarking", "pallet-skip-feeless-payment", "pallet-society", "pallet-staking", "pallet-staking-reward-curve", "pallet-staking-reward-fn", "pallet-staking-runtime-api", "pallet-state-trie-migration", "pallet-statement", "pallet-sudo", "pallet-timestamp", "pallet-tips", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-transaction-storage", "pallet-treasury", "pallet-tx-pause", "pallet-uniques", "pallet-utility", "pallet-vesting", "pallet-whitelist", "pallet-xcm", "pallet-xcm-benchmarks", "pallet-xcm-bridge-hub", "pallet-xcm-bridge-hub-router", "parachains-common", "polkadot-core-primitives", "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", "polkadot-runtime-metrics", "polkadot-runtime-parachains", "polkadot-sdk-frame", "sc-chain-spec-derive", "sc-tracing-proc-macro", "slot-range-helper", "snowbridge-beacon-primitives", "snowbridge-core", "snowbridge-ethereum", "snowbridge-outbound-queue-merkle-tree", "snowbridge-outbound-queue-runtime-api", "snowbridge-pallet-ethereum-client", "snowbridge-pallet-ethereum-client-fixtures", "snowbridge-pallet-inbound-queue", "snowbridge-pallet-inbound-queue-fixtures", "snowbridge-pallet-outbound-queue", "snowbridge-pallet-system", "snowbridge-router-primitives", "snowbridge-runtime-common", "snowbridge-system-runtime-api", "sp-api", "sp-api-proc-macro", "sp-application-crypto", "sp-arithmetic", "sp-authority-discovery", "sp-block-builder", "sp-consensus-aura", "sp-consensus-babe", "sp-consensus-beefy", "sp-consensus-grandpa", "sp-consensus-pow", "sp-consensus-slots", "sp-core", "sp-crypto-ec-utils", "sp-crypto-hashing", "sp-crypto-hashing-proc-macro", "sp-debug-derive", "sp-externalities", "sp-genesis-builder", "sp-inherents", "sp-io", "sp-keyring", "sp-keystore", "sp-metadata-ir", "sp-mixnet", "sp-mmr-primitives", "sp-npos-elections", "sp-offchain", "sp-runtime", "sp-runtime-interface", "sp-runtime-interface-proc-macro", "sp-session", "sp-staking", "sp-state-machine", "sp-statement-store", "sp-std", "sp-storage", "sp-timestamp", "sp-tracing", "sp-transaction-pool", "sp-transaction-storage-proof", "sp-trie", "sp-version", "sp-version-proc-macro", "sp-wasm-interface", "sp-weights", "staging-parachain-info", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", "substrate-bip39", "testnet-parachains-constants", "tracing-gum-proc-macro", "xcm-procedural", "xcm-runtime-apis"] runtime = [ "frame-benchmarking", "frame-benchmarking-pallet-pov", @@ -562,6 +563,7 @@ tuples-96 = [ "frame-support?/tuples-96", ] riscv = [ + "pallet-revive-fixtures?/riscv", "pallet-revive?/riscv", ] @@ -1141,6 +1143,11 @@ path = "../substrate/frame/revive" default-features = false optional = true +[dependencies.pallet-revive-fixtures] +path = "../substrate/frame/revive/fixtures" +default-features = false +optional = true + [dependencies.pallet-revive-proc-macro] path = "../substrate/frame/revive/proc-macro" default-features = false diff --git a/umbrella/src/lib.rs b/umbrella/src/lib.rs index 841089c175cfb..b7b9c15fe5880 100644 --- a/umbrella/src/lib.rs +++ b/umbrella/src/lib.rs @@ -580,6 +580,10 @@ pub use pallet_remark; #[cfg(feature = "pallet-revive")] pub use pallet_revive; +/// Fixtures for testing and benchmarking. +#[cfg(feature = "pallet-revive-fixtures")] +pub use pallet_revive_fixtures; + /// A mock network for testing pallet-revive. #[cfg(feature = "pallet-revive-mock-network")] pub use pallet_revive_mock_network; From 5eff7764c2e3c0f20f7c1fa5787cbbf12c86816e Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 27 Aug 2024 16:08:40 +0200 Subject: [PATCH 38/39] Update features runtime --- scripts/generate-umbrella.py | 13 +++-------- umbrella/Cargo.toml | 45 +++++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/scripts/generate-umbrella.py b/scripts/generate-umbrella.py index c94e9f8770f57..e1ef6de86f9c4 100644 --- a/scripts/generate-umbrella.py +++ b/scripts/generate-umbrella.py @@ -86,15 +86,8 @@ def main(path, version): # Sort by name std_crates.sort(key=lambda x: x[0].name) nostd_crates.sort(key=lambda x: x[0].name) - runtime_crates_names = [ - "frame-support", - "frame-system", - "polkadot-sdk-frame", - "sp-api", - "sp-genesis-builder", - "sp-runtime", - ] - runtime_crates = [crate for crate in nostd_crates if crate[0].name in runtime_crates_names or crate[0].name.startswith("frame")] + + runtime_crates = [crate for crate in nostd_crates if 'frame' in crate[0].name or crate[0].name.startswith('sp-')] all_crates = std_crates + nostd_crates all_crates.sort(key=lambda x: x[0].name) dependencies = {} @@ -130,7 +123,7 @@ def main(path, version): "description": "Polkadot SDK umbrella crate.", "license": "Apache-2.0", "metadata": { "docs": { "rs": { - "features": ["runtime", "node"], + "features": ["runtime-full", "node"], "targets": ["x86_64-unknown-linux-gnu"] }}} }, diff --git a/umbrella/Cargo.toml b/umbrella/Cargo.toml index 15c79217cdf04..6d380a4bcbb7c 100644 --- a/umbrella/Cargo.toml +++ b/umbrella/Cargo.toml @@ -554,8 +554,51 @@ runtime = [ "polkadot-sdk-frame", "polkadot-sdk-frame?/runtime", "sp-api", + "sp-api-proc-macro", + "sp-application-crypto", + "sp-arithmetic", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", + "sp-consensus-pow", + "sp-consensus-slots", + "sp-core", + "sp-crypto-ec-utils", + "sp-crypto-hashing", + "sp-crypto-hashing-proc-macro", + "sp-debug-derive", + "sp-externalities", "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-keyring", + "sp-keystore", + "sp-metadata-ir", + "sp-mixnet", + "sp-mmr-primitives", + "sp-npos-elections", + "sp-offchain", "sp-runtime", + "sp-runtime-interface", + "sp-runtime-interface-proc-macro", + "sp-session", + "sp-staking", + "sp-state-machine", + "sp-statement-store", + "sp-std", + "sp-storage", + "sp-timestamp", + "sp-tracing", + "sp-transaction-pool", + "sp-transaction-storage-proof", + "sp-trie", + "sp-version", + "sp-version-proc-macro", + "sp-wasm-interface", + "sp-weights", ] node = ["asset-test-utils", "bridge-hub-test-utils", "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-aura", "cumulus-client-consensus-common", "cumulus-client-consensus-proposer", "cumulus-client-consensus-relay-chain", "cumulus-client-network", "cumulus-client-parachain-inherent", "cumulus-client-pov-recovery", "cumulus-client-service", "cumulus-relay-chain-inprocess-interface", "cumulus-relay-chain-interface", "cumulus-relay-chain-minimal-node", "cumulus-relay-chain-rpc-interface", "cumulus-test-relay-sproof-builder", "emulated-integration-tests-common", "fork-tree", "frame-benchmarking-cli", "frame-remote-externalities", "frame-support-procedural-tools", "generate-bags", "mmr-gadget", "mmr-rpc", "pallet-contracts-mock-network", "pallet-revive-mock-network", "pallet-transaction-payment-rpc", "parachains-runtimes-test-utils", "polkadot-approval-distribution", "polkadot-availability-bitfield-distribution", "polkadot-availability-distribution", "polkadot-availability-recovery", "polkadot-cli", "polkadot-collator-protocol", "polkadot-dispute-distribution", "polkadot-erasure-coding", "polkadot-gossip-support", "polkadot-network-bridge", "polkadot-node-collation-generation", "polkadot-node-core-approval-voting", "polkadot-node-core-av-store", "polkadot-node-core-backing", "polkadot-node-core-bitfield-signing", "polkadot-node-core-candidate-validation", "polkadot-node-core-chain-api", "polkadot-node-core-chain-selection", "polkadot-node-core-dispute-coordinator", "polkadot-node-core-parachains-inherent", "polkadot-node-core-prospective-parachains", "polkadot-node-core-provisioner", "polkadot-node-core-pvf", "polkadot-node-core-pvf-checker", "polkadot-node-core-pvf-common", "polkadot-node-core-pvf-execute-worker", "polkadot-node-core-pvf-prepare-worker", "polkadot-node-core-runtime-api", "polkadot-node-jaeger", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-types", "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-parachain-lib", "polkadot-rpc", "polkadot-service", "polkadot-statement-distribution", "polkadot-statement-table", "sc-allocator", "sc-authority-discovery", "sc-basic-authorship", "sc-block-builder", "sc-chain-spec", "sc-cli", "sc-client-api", "sc-client-db", "sc-consensus", "sc-consensus-aura", "sc-consensus-babe", "sc-consensus-babe-rpc", "sc-consensus-beefy", "sc-consensus-beefy-rpc", "sc-consensus-epochs", "sc-consensus-grandpa", "sc-consensus-grandpa-rpc", "sc-consensus-manual-seal", "sc-consensus-pow", "sc-consensus-slots", "sc-executor", "sc-executor-common", "sc-executor-polkavm", "sc-executor-wasmtime", "sc-informant", "sc-keystore", "sc-mixnet", "sc-network", "sc-network-common", "sc-network-gossip", "sc-network-light", "sc-network-statement", "sc-network-sync", "sc-network-transactions", "sc-network-types", "sc-offchain", "sc-proposer-metrics", "sc-rpc", "sc-rpc-api", "sc-rpc-server", "sc-rpc-spec-v2", "sc-service", "sc-state-db", "sc-statement-store", "sc-storage-monitor", "sc-sync-state-rpc", "sc-sysinfo", "sc-telemetry", "sc-tracing", "sc-transaction-pool", "sc-transaction-pool-api", "sc-utils", "snowbridge-runtime-test-common", "sp-blockchain", "sp-consensus", "sp-core-hashing", "sp-core-hashing-proc-macro", "sp-database", "sp-maybe-compressed-blob", "sp-panic-handler", "sp-rpc", "staging-chain-spec-builder", "staging-node-inspect", "staging-tracking-allocator", "std", "subkey", "substrate-build-script-utils", "substrate-frame-rpc-support", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", "substrate-rpc-client", "substrate-state-trie-migration-rpc", "substrate-wasm-builder", "tracing-gum", "xcm-emulator", "xcm-simulator"] tuples-96 = [ @@ -2444,5 +2487,5 @@ default-features = false optional = true [package.metadata.docs.rs] -features = ["node", "runtime"] +features = ["node", "runtime-full"] targets = ["x86_64-unknown-linux-gnu"] From fac03446d67366648fe92367f2ee3c15efd1b414 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Wed, 28 Aug 2024 14:04:13 +0200 Subject: [PATCH 39/39] Update Cargo.lock --- Cargo.lock | 35 +++-------------------------------- 1 file changed, 3 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8bf4c356397d7..885e2b4b4cf30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8726,47 +8726,18 @@ dependencies = [ "futures-timer", "jsonrpsee", "minimal-template-runtime", - "polkadot-sdk-frame", - "sc-basic-authorship", - "sc-cli", - "sc-client-api", - "sc-consensus", - "sc-consensus-manual-seal", - "sc-executor", - "sc-network", - "sc-offchain", - "sc-service", - "sc-telemetry", - "sc-transaction-pool", - "sc-transaction-pool-api", + "polkadot-sdk", "serde_json", - "sp-api", - "sp-block-builder", - "sp-blockchain", - "sp-io", - "sp-keyring", - "sp-runtime", - "sp-timestamp", - "substrate-build-script-utils", - "substrate-frame-rpc-system", ] [[package]] name = "minimal-template-runtime" version = "0.0.0" dependencies = [ - "pallet-balances", "pallet-minimal-template", - "pallet-sudo", - "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", - "polkadot-sdk-frame", + "polkadot-sdk", "scale-info", - "sp-genesis-builder", - "sp-runtime", - "substrate-wasm-builder", ] [[package]] @@ -10957,7 +10928,7 @@ name = "pallet-minimal-template" version = "0.0.0" dependencies = [ "parity-scale-codec", - "polkadot-sdk-frame", + "polkadot-sdk", "scale-info", ]