diff --git a/Cargo.lock b/Cargo.lock index 492739ac4e2f..9613844a9178 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13249,7 +13249,6 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std 14.0.0", "sp-transaction-pool", "sp-version", ] @@ -18219,7 +18218,6 @@ dependencies = [ "scale-info", "serde", "sp-crypto-hashing", - "sp-std 14.0.0", "static_assertions", ] @@ -22265,7 +22263,6 @@ dependencies = [ "scale-info", "sp-api", "sp-runtime", - "sp-std 14.0.0", "sp-weights", "staging-xcm", ] diff --git a/bridges/snowbridge/pallets/ethereum-client/src/mock.rs b/bridges/snowbridge/pallets/ethereum-client/src/mock.rs index bd6144ebd8f9..e4375140e5ad 100644 --- a/bridges/snowbridge/pallets/ethereum-client/src/mock.rs +++ b/bridges/snowbridge/pallets/ethereum-client/src/mock.rs @@ -6,7 +6,7 @@ use frame_support::{derive_impl, dispatch::DispatchResult, parameter_types}; use pallet_timestamp; use primitives::{Fork, ForkVersions}; use snowbridge_core::inbound::{Log, Proof}; -use sp_std::default::Default; +use core::default::Default; use std::{fs::File, path::PathBuf}; type Block = frame_system::mocking::MockBlock; diff --git a/polkadot/primitives/src/runtime_api.rs b/polkadot/primitives/src/runtime_api.rs index d30a3b63b74f..2a3538a7a6f5 100644 --- a/polkadot/primitives/src/runtime_api.rs +++ b/polkadot/primitives/src/runtime_api.rs @@ -121,13 +121,9 @@ use crate::{ SessionIndex, SessionInfo, ValidatorId, ValidatorIndex, ValidatorSignature, }; -use alloc::{collections::btree_map::BTreeMap, vec::Vec}; +use alloc::{collections::{btree_map::BTreeMap, vec_deque::VecDeque}, vec::Vec}; use polkadot_core_primitives as pcp; use polkadot_parachain_primitives::primitives as ppp; -use sp_std::{ - collections::{btree_map::BTreeMap, vec_deque::VecDeque}, - prelude::*, -}; sp_api::decl_runtime_apis! { /// The API for querying the state of parachains on-chain. diff --git a/polkadot/runtime/common/src/paras_registrar/mod.rs b/polkadot/runtime/common/src/paras_registrar/mod.rs index b522433017a0..08baac696927 100644 --- a/polkadot/runtime/common/src/paras_registrar/mod.rs +++ b/polkadot/runtime/common/src/paras_registrar/mod.rs @@ -35,7 +35,7 @@ use parity_scale_codec::{Decode, Encode}; use primitives::{HeadData, Id as ParaId, ValidationCode, LOWEST_PUBLIC_ID, MIN_CODE_SIZE}; use runtime_parachains::{ configuration, ensure_parachain, - paras::{self, ParaGenesisArgs, UpgradeStrategy}, + paras::{self, OnNewHead, ParaGenesisArgs, ParaKind, UpgradeStrategy}, Origin, ParaLifecycle, }; use scale_info::TypeInfo; diff --git a/polkadot/runtime/parachains/src/assigner_on_demand/migration.rs b/polkadot/runtime/parachains/src/assigner_on_demand/migration.rs index 8589ddc292bd..3a7a42983f1c 100644 --- a/polkadot/runtime/parachains/src/assigner_on_demand/migration.rs +++ b/polkadot/runtime/parachains/src/assigner_on_demand/migration.rs @@ -23,7 +23,7 @@ use frame_support::{ mod v0 { use super::*; - use sp_std::collections::vec_deque::VecDeque; + use alloc::collections::vec_deque::VecDeque; #[derive(Encode, Decode, TypeInfo, Debug, PartialEq, Clone)] pub(super) struct EnqueuedOrder { @@ -50,7 +50,7 @@ mod v1 { use crate::assigner_on_demand::LOG_TARGET; /// Migration to V1 - pub struct UncheckedMigrateToV1(sp_std::marker::PhantomData); + pub struct UncheckedMigrateToV1(core::marker::PhantomData); impl UncheckedOnRuntimeUpgrade for UncheckedMigrateToV1 { fn on_runtime_upgrade() -> Weight { let mut weight: Weight = Weight::zero(); diff --git a/polkadot/runtime/parachains/src/inclusion/migration.rs b/polkadot/runtime/parachains/src/inclusion/migration.rs index 5f35680ee694..6750669711bc 100644 --- a/polkadot/runtime/parachains/src/inclusion/migration.rs +++ b/polkadot/runtime/parachains/src/inclusion/migration.rs @@ -75,7 +75,7 @@ mod v1 { }; use frame_support::{traits::UncheckedOnRuntimeUpgrade, weights::Weight}; use sp_core::Get; - use sp_std::{collections::vec_deque::VecDeque, vec::Vec}; + use alloc::{collections::vec_deque::VecDeque, vec::Vec}; #[cfg(feature = "try-runtime")] use frame_support::{ @@ -85,7 +85,7 @@ mod v1 { #[cfg(feature = "try-runtime")] use parity_scale_codec::{Decode, Encode}; - pub struct VersionUncheckedMigrateToV1(sp_std::marker::PhantomData); + pub struct VersionUncheckedMigrateToV1(core::marker::PhantomData); impl UncheckedOnRuntimeUpgrade for VersionUncheckedMigrateToV1 { #[cfg(feature = "try-runtime")] diff --git a/polkadot/xcm/xcm-fee-payment-runtime-api/Cargo.toml b/polkadot/xcm/xcm-fee-payment-runtime-api/Cargo.toml index 30c7c0bac14f..a240f07c6b9e 100644 --- a/polkadot/xcm/xcm-fee-payment-runtime-api/Cargo.toml +++ b/polkadot/xcm/xcm-fee-payment-runtime-api/Cargo.toml @@ -20,7 +20,6 @@ scale-info = { version = "2.11.1", default-features = false, features = [ "derive", "serde", ] } -sp-std = { path = "../../../substrate/primitives/std", default-features = false } sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false } sp-weights = { path = "../../../substrate/primitives/weights", default-features = false } xcm = { package = "staging-xcm", path = "../", default-features = false } @@ -34,7 +33,6 @@ std = [ "scale-info/std", "sp-api/std", "sp-runtime/std", - "sp-std/std", "sp-weights/std", "xcm/std", ] diff --git a/polkadot/xcm/xcm-fee-payment-runtime-api/src/lib.rs b/polkadot/xcm/xcm-fee-payment-runtime-api/src/lib.rs index 20bf9236f1fb..9f0edddeb4ee 100644 --- a/polkadot/xcm/xcm-fee-payment-runtime-api/src/lib.rs +++ b/polkadot/xcm/xcm-fee-payment-runtime-api/src/lib.rs @@ -18,9 +18,12 @@ #![cfg_attr(not(feature = "std"), no_std)] +extern crate alloc; + use codec::{Decode, Encode}; use frame_support::pallet_prelude::TypeInfo; -use sp_std::vec::Vec; +#[cfg(not(feature = "std"))] +use alloc::vec::Vec; use sp_weights::Weight; use xcm::{Version, VersionedAssetId, VersionedAssets, VersionedLocation, VersionedXcm}; diff --git a/substrate/frame/examples/single-block-migrations/src/migrations/v1.rs b/substrate/frame/examples/single-block-migrations/src/migrations/v1.rs index f33685bf8d49..94c85ab807b9 100644 --- a/substrate/frame/examples/single-block-migrations/src/migrations/v1.rs +++ b/substrate/frame/examples/single-block-migrations/src/migrations/v1.rs @@ -41,7 +41,7 @@ mod v0 { /// /// In this migration, update the on-chain storage for the pallet to reflect the new storage /// layout. -pub struct InnerMigrateV0ToV1(sp_std::marker::PhantomData); +pub struct InnerMigrateV0ToV1(core::marker::PhantomData); impl UncheckedOnRuntimeUpgrade for InnerMigrateV0ToV1 { /// Return the existing [`crate::Value`] so we can check that it was correctly set in diff --git a/substrate/primitives/arithmetic/Cargo.toml b/substrate/primitives/arithmetic/Cargo.toml index 16eae43c73fa..e94f63fd5018 100644 --- a/substrate/primitives/arithmetic/Cargo.toml +++ b/substrate/primitives/arithmetic/Cargo.toml @@ -26,7 +26,6 @@ num-traits = { version = "0.2.17", default-features = false } scale-info = { version = "2.11.1", default-features = false, features = ["derive"] } serde = { features = ["alloc", "derive"], optional = true, workspace = true } static_assertions = "1.1.0" -sp-std = { path = "../std", default-features = false } docify = "0.2.8" [dev-dependencies] @@ -43,7 +42,6 @@ std = [ "scale-info/std", "serde/std", "sp-crypto-hashing/std", - "sp-std/std", ] # Serde support without relying on std features. serde = ["dep:serde", "scale-info/serde"] diff --git a/substrate/primitives/core/src/crypto_bytes.rs b/substrate/primitives/core/src/crypto_bytes.rs index ee5f3482f743..e5130e6d5007 100644 --- a/substrate/primitives/core/src/crypto_bytes.rs +++ b/substrate/primitives/core/src/crypto_bytes.rs @@ -34,7 +34,7 @@ use crate::crypto::Ss58Codec; use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; #[cfg(all(not(feature = "std"), feature = "serde"))] -use sp_std::alloc::{format, string::String}; +use alloc::{format, string::String}; pub use public_bytes::*; pub use signature_bytes::*; @@ -256,7 +256,7 @@ mod public_bytes { impl Public for PublicBytes where Self: CryptoType {} - impl sp_std::fmt::Debug for PublicBytes + impl core::fmt::Debug for PublicBytes where Self: CryptoType, { @@ -267,7 +267,7 @@ mod public_bytes { } #[cfg(not(feature = "std"))] - fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { + fn fmt(&self, _: &mut core::fmt::Formatter) -> core::fmt::Result { Ok(()) } } @@ -362,17 +362,17 @@ mod signature_bytes { } } - impl sp_std::fmt::Debug for SignatureBytes + impl core::fmt::Debug for SignatureBytes where Self: CryptoType, { #[cfg(feature = "std")] - fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { write!(f, "{}", crate::hexdisplay::HexDisplay::from(&&self.0[..])) } #[cfg(not(feature = "std"))] - fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { + fn fmt(&self, _: &mut core::fmt::Formatter) -> core::fmt::Result { Ok(()) } } diff --git a/substrate/primitives/core/src/ecdsa.rs b/substrate/primitives/core/src/ecdsa.rs index da71a52d837d..ffb9fa894ca0 100644 --- a/substrate/primitives/core/src/ecdsa.rs +++ b/substrate/primitives/core/src/ecdsa.rs @@ -35,8 +35,6 @@ use secp256k1::{ ecdsa::{RecoverableSignature, RecoveryId}, Message, PublicKey, SecretKey, SECP256K1, }; -#[cfg(not(feature = "std"))] -use alloc::vec::Vec; /// An identifier used to match public keys against ecdsa keys pub const CRYPTO_ID: CryptoTypeId = CryptoTypeId(*b"ecds"); diff --git a/templates/parachain/runtime/src/apis.rs b/templates/parachain/runtime/src/apis.rs index 74c7476e1520..80486e38d411 100644 --- a/templates/parachain/runtime/src/apis.rs +++ b/templates/parachain/runtime/src/apis.rs @@ -37,7 +37,8 @@ use sp_runtime::{ transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; -use sp_std::prelude::Vec; +#[cfg(not(feature = "std"))] +use alloc::vec::Vec; use sp_version::RuntimeVersion; // Local module imports @@ -80,7 +81,7 @@ impl_runtime_apis! { Runtime::metadata_at_version(version) } - fn metadata_versions() -> sp_std::vec::Vec { + fn metadata_versions() -> alloc::vec::Vec { Runtime::metadata_versions() } } @@ -238,7 +239,7 @@ impl_runtime_apis! { use frame_system_benchmarking::Pallet as SystemBench; impl frame_system_benchmarking::Config for Runtime { - fn setup_set_code_requirements(code: &sp_std::vec::Vec) -> Result<(), BenchmarkError> { + fn setup_set_code_requirements(code: &alloc::vec::Vec) -> Result<(), BenchmarkError> { ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32); Ok(()) }