diff --git a/.github/workflows/misc-sync-templates.yml b/.github/workflows/misc-sync-templates.yml index 7ff0705fe249..8d06d89621d7 100644 --- a/.github/workflows/misc-sync-templates.yml +++ b/.github/workflows/misc-sync-templates.yml @@ -21,6 +21,10 @@ on: stable_release_branch: description: 'Stable release branch, e.g. stable2407' required: true + debug: + description: Enable runner debug logging + required: false + default: false jobs: sync-templates: @@ -86,7 +90,7 @@ jobs: EOF [ ${{ matrix.template }} != "solochain" ] && echo "# Leave out the node compilation from regular template usage." \ - && echo "\"default-members\" = [\"pallets/template\", \"runtime\"]" >> Cargo.toml + && echo "default-members = [\"pallets/template\", \"runtime\"]" >> Cargo.toml [ ${{ matrix.template }} == "solochain" ] && echo "# The node isn't yet replaceable by Omni Node." cat << EOF >> Cargo.toml members = [ @@ -115,8 +119,9 @@ jobs: toml set templates/${{ matrix.template }}/Cargo.toml 'workspace.package.edition' "$(toml get --raw Cargo.toml 'workspace.package.edition')" > Cargo.temp mv Cargo.temp ./templates/${{ matrix.template }}/Cargo.toml working-directory: polkadot-sdk + - name: Print the result Cargo.tomls for debugging - if: runner.debug == '1' + if: ${{ github.event.inputs.debug }} run: find . -type f -name 'Cargo.toml' -exec cat {} \; working-directory: polkadot-sdk/templates/${{ matrix.template }}/ @@ -142,6 +147,12 @@ jobs: done; working-directory: "${{ env.template-path }}" + - name: Print the result Cargo.tomls for debugging after copying required workspace dependencies + if: ${{ github.event.inputs.debug }} + run: find . -type f -name 'Cargo.toml' -exec cat {} \; + working-directory: polkadot-sdk/templates/${{ matrix.template }}/ + + # 3. Verify the build. Push the changes or create a PR. # We've run into out-of-disk error when compiling in the next step, so we free up some space this way. diff --git a/Cargo.lock b/Cargo.lock index b0fb0586be38..ef0eb9f7e3dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7716,7 +7716,6 @@ dependencies = [ "sp-externalities 0.25.0", "sp-io 30.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0", "sp-version 29.0.0", "sp-weights 27.0.0", "substrate-test-runtime-client", @@ -12371,7 +12370,6 @@ dependencies = [ "pallet-staking 28.0.0", "sp-core 28.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0", "sp-storage 19.0.0", "sp-tracing 16.0.0", ] @@ -12967,7 +12965,6 @@ dependencies = [ "sp-io 30.0.0", "sp-keystore 0.34.0", "sp-runtime 31.0.1", - "sp-std 14.0.0", "sp-tracing 16.0.0", "staging-xcm 7.0.0", "staging-xcm-builder 7.0.0", @@ -13352,7 +13349,6 @@ dependencies = [ "sp-npos-elections 26.0.0", "sp-runtime 31.0.1", "sp-staking 26.0.0", - "sp-std 14.0.0", "sp-tracing 16.0.0", ] @@ -14157,7 +14153,6 @@ dependencies = [ "sp-core 28.0.0", "sp-io 30.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0", ] [[package]] @@ -14432,7 +14427,6 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-staking 26.0.0", - "sp-std 14.0.0", "sp-tracing 16.0.0", ] @@ -14456,7 +14450,6 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-staking 26.0.0", - "sp-std 14.0.0", "sp-tracing 16.0.0", ] @@ -14870,7 +14863,6 @@ dependencies = [ "sp-io 30.0.0", "sp-keystore 0.34.0", "sp-runtime 31.0.1", - "sp-std 14.0.0", "sp-tracing 16.0.0", "staging-xcm 7.0.0", "staging-xcm-builder 7.0.0", @@ -15095,7 +15087,6 @@ dependencies = [ "sp-io 30.0.0", "sp-runtime 31.0.1", "sp-staking 26.0.0", - "sp-std 14.0.0", ] [[package]] @@ -15941,7 +15932,6 @@ dependencies = [ "sp-core 28.0.0", "sp-io 30.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0", ] [[package]] @@ -23681,7 +23671,6 @@ dependencies = [ "sp-crypto-hashing 0.1.0", "sp-io 30.0.0", "sp-runtime 31.0.1", - "sp-std 14.0.0", ] [[package]] diff --git a/bridges/SECURITY.md b/bridges/SECURITY.md index 9f215c887654..ea19eca42cc3 100644 --- a/bridges/SECURITY.md +++ b/bridges/SECURITY.md @@ -13,6 +13,6 @@ If you think that your report might be eligible for the Bug Bounty Program, plea Please check up-to-date [Parity Bug Bounty Program rules](https://www.parity.io/bug-bounty) to find out the information about our Bug Bounty Program. -**Warning**: This is an unified SECURITY.md file for Paritytech GitHub Organization. The presence of this file does not +**Warning**: This is a unified SECURITY.md file for Paritytech GitHub Organization. The presence of this file does not mean that this repository is covered by the Bug Bounty program. Please always check the Bug Bounty Program scope for information. diff --git a/bridges/modules/messages/README.md b/bridges/modules/messages/README.md index a78c86802498..7d9a23b4ba14 100644 --- a/bridges/modules/messages/README.md +++ b/bridges/modules/messages/README.md @@ -13,7 +13,7 @@ module and the final goal is to hand message to the message dispatch mechanism. ## Overview -Message lane is an unidirectional channel, where messages are sent from source chain to the target chain. At the same +Message lane is a unidirectional channel, where messages are sent from source chain to the target chain. At the same time, a single instance of messages module supports both outbound lanes and inbound lanes. So the chain where the module is deployed (this chain), may act as a source chain for outbound messages (heading to a bridged chain) and as a target chain for inbound messages (coming from a bridged chain). diff --git a/cumulus/client/consensus/aura/src/equivocation_import_queue.rs b/cumulus/client/consensus/aura/src/equivocation_import_queue.rs index 68f2d37c8748..dbd9d5ba6a6f 100644 --- a/cumulus/client/consensus/aura/src/equivocation_import_queue.rs +++ b/cumulus/client/consensus/aura/src/equivocation_import_queue.rs @@ -97,6 +97,7 @@ where // This is done for example when gap syncing and it is expected that the block after the gap // was checked/chosen properly, e.g. by warp syncing to this block using a finality proof. if block_params.state_action.skip_execution_checks() || block_params.with_state() { + block_params.fork_choice = Some(ForkChoiceStrategy::Custom(block_params.with_state())); return Ok(block_params) } diff --git a/cumulus/docs/overview.md b/cumulus/docs/overview.md index 402c56042c49..82603257a871 100644 --- a/cumulus/docs/overview.md +++ b/cumulus/docs/overview.md @@ -70,7 +70,7 @@ A Parachain validator needs to validate a given PoVBlock, but without requiring the Parachain. To still make it possible to validate the Parachain block, the PoVBlock contains the witness data. The witness data is a proof that is collected while building the block. The proof will contain all trie nodes that are read during the block production. Cumulus uses the witness data to -reconstruct a partial trie and uses this a storage when executing the block. +reconstruct a partial trie and uses this as storage when executing the block. The outgoing messages are also collected at block production. These are messages from the Parachain the block is built for to other Parachains or to the relay chain itself. diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_core_fellowship_ambassador_core.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_core_fellowship_ambassador_core.rs index 6bedfcc7e012..4d092ec80313 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_core_fellowship_ambassador_core.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_core_fellowship_ambassador_core.rs @@ -1,4 +1,4 @@ -// Copyright Parity Technologies (UK) Ltd. +// Copyright (C) Parity Technologies (UK) Ltd. // This file is part of Cumulus. // Cumulus is free software: you can redistribute it and/or modify @@ -16,25 +16,29 @@ //! Autogenerated weights for `pallet_core_fellowship` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-08-11, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2025-01-03, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `cob`, CPU: `` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("collectives-polkadot-dev")`, DB CACHE: 1024 +//! HOSTNAME: `623e9e4b814e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// target/release/polkadot-parachain +// frame-omni-bencher +// v1 // benchmark // pallet -// --chain=collectives-polkadot-dev -// --wasm-execution=compiled -// --pallet=pallet_core_fellowship // --extrinsic=* -// --steps=2 -// --repeat=2 -// --json -// --header=./file_header.txt -// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/ +// --runtime=target/production/wbuild/collectives-westend-runtime/collectives_westend_runtime.wasm +// --pallet=pallet_core_fellowship +// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt +// --output=./cumulus/parachains/runtimes/collectives/collectives-westend/src/weights +// --wasm-execution=compiled +// --steps=50 +// --repeat=20 +// --heap-pages=4096 +// --no-storage-info +// --no-min-squares +// --no-median-slopes #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -48,25 +52,26 @@ use core::marker::PhantomData; pub struct WeightInfo(PhantomData); impl pallet_core_fellowship::WeightInfo for WeightInfo { /// Storage: `AmbassadorCore::Params` (r:0 w:1) - /// Proof: `AmbassadorCore::Params` (`max_values`: Some(1), `max_size`: Some(364), added: 859, mode: `MaxEncodedLen`) + /// Proof: `AmbassadorCore::Params` (`max_values`: Some(1), `max_size`: Some(368), added: 863, mode: `MaxEncodedLen`) fn set_params() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_000_000, 0) + // Minimum execution time: 9_131_000 picoseconds. + Weight::from_parts(9_371_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: `AmbassadorCore::Params` (r:0 w:1) - /// Proof: `AmbassadorCore::Params` (`max_values`: Some(1), `max_size`: Some(364), added: 859, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::Params` (r:1 w:1) + /// Proof: `AmbassadorCore::Params` (`max_values`: Some(1), `max_size`: Some(368), added: 863, mode: `MaxEncodedLen`) fn set_partial_params() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(11_000_000, 0) - .saturating_add(Weight::from_parts(0, 0)) + // Measured: `471` + // Estimated: `1853` + // Minimum execution time: 18_375_000 picoseconds. + Weight::from_parts(18_872_000, 0) + .saturating_add(Weight::from_parts(0, 1853)) + .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `AmbassadorCore::Member` (r:1 w:1) @@ -74,44 +79,48 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Storage: `AmbassadorCollective::Members` (r:1 w:1) /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) /// Storage: `AmbassadorCore::Params` (r:1 w:0) - /// Proof: `AmbassadorCore::Params` (`max_values`: Some(1), `max_size`: Some(364), added: 859, mode: `MaxEncodedLen`) + /// Proof: `AmbassadorCore::Params` (`max_values`: Some(1), `max_size`: Some(368), added: 863, mode: `MaxEncodedLen`) /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:1) /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) - /// Storage: `AmbassadorCollective::IdToIndex` (r:1 w:0) + /// Storage: `AmbassadorCollective::IdToIndex` (r:1 w:1) /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) /// Storage: `AmbassadorCore::MemberEvidence` (r:1 w:1) /// Proof: `AmbassadorCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IndexToId` (r:0 w:1) + /// Proof: `AmbassadorCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) fn bump_offboard() -> Weight { // Proof Size summary in bytes: - // Measured: `66011` + // Measured: `66402` // Estimated: `69046` - // Minimum execution time: 96_000_000 picoseconds. - Weight::from_parts(111_000_000, 0) + // Minimum execution time: 156_752_000 picoseconds. + Weight::from_parts(164_242_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(6)) } /// Storage: `AmbassadorCore::Member` (r:1 w:1) /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) /// Storage: `AmbassadorCollective::Members` (r:1 w:1) /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) /// Storage: `AmbassadorCore::Params` (r:1 w:0) - /// Proof: `AmbassadorCore::Params` (`max_values`: Some(1), `max_size`: Some(364), added: 859, mode: `MaxEncodedLen`) + /// Proof: `AmbassadorCore::Params` (`max_values`: Some(1), `max_size`: Some(368), added: 863, mode: `MaxEncodedLen`) /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:1) /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) - /// Storage: `AmbassadorCollective::IdToIndex` (r:1 w:0) + /// Storage: `AmbassadorCollective::IdToIndex` (r:1 w:1) /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) /// Storage: `AmbassadorCore::MemberEvidence` (r:1 w:1) /// Proof: `AmbassadorCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IndexToId` (r:0 w:1) + /// Proof: `AmbassadorCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) fn bump_demote() -> Weight { // Proof Size summary in bytes: - // Measured: `66121` + // Measured: `66512` // Estimated: `69046` - // Minimum execution time: 99_000_000 picoseconds. - Weight::from_parts(116_000_000, 0) + // Minimum execution time: 158_877_000 picoseconds. + Weight::from_parts(165_228_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(6)) } /// Storage: `AmbassadorCollective::Members` (r:1 w:0) /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) @@ -121,8 +130,8 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `360` // Estimated: `3514` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 0) + // Minimum execution time: 25_056_000 picoseconds. + Weight::from_parts(26_028_000, 0) .saturating_add(Weight::from_parts(0, 3514)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -141,8 +150,8 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `118` // Estimated: `3514` - // Minimum execution time: 36_000_000 picoseconds. - Weight::from_parts(36_000_000, 0) + // Minimum execution time: 34_784_000 picoseconds. + Weight::from_parts(35_970_000, 0) .saturating_add(Weight::from_parts(0, 3514)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(5)) @@ -152,7 +161,7 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Storage: `AmbassadorCore::Member` (r:1 w:1) /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) /// Storage: `AmbassadorCore::Params` (r:1 w:0) - /// Proof: `AmbassadorCore::Params` (`max_values`: Some(1), `max_size`: Some(364), added: 859, mode: `MaxEncodedLen`) + /// Proof: `AmbassadorCore::Params` (`max_values`: Some(1), `max_size`: Some(368), added: 863, mode: `MaxEncodedLen`) /// Storage: `AmbassadorCollective::MemberCount` (r:1 w:1) /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) /// Storage: `AmbassadorCore::MemberEvidence` (r:1 w:1) @@ -163,25 +172,40 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) fn promote() -> Weight { // Proof Size summary in bytes: - // Measured: `65989` + // Measured: `66055` // Estimated: `69046` - // Minimum execution time: 95_000_000 picoseconds. - Weight::from_parts(110_000_000, 0) + // Minimum execution time: 147_616_000 picoseconds. + Weight::from_parts(154_534_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(6)) } + /// Storage: `AmbassadorCollective::Members` (r:1 w:1) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::Member` (r:1 w:1) + /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::MemberCount` (r:9 w:9) + /// Proof: `AmbassadorCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCore::MemberEvidence` (r:1 w:1) + /// Proof: `AmbassadorCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IndexToId` (r:0 w:9) + /// Proof: `AmbassadorCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::IdToIndex` (r:0 w:9) + /// Proof: `AmbassadorCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// The range of component `r` is `[1, 9]`. + /// The range of component `r` is `[1, 9]`. fn promote_fast(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `16844` - // Estimated: `19894 + r * (2489 ±0)` - // Minimum execution time: 45_065_000 picoseconds. - Weight::from_parts(34_090_392, 19894) - // Standard Error: 18_620 - .saturating_add(Weight::from_parts(13_578_046, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(3_u64)) + // Measured: `65968` + // Estimated: `69046 + r * (2489 ±0)` + // Minimum execution time: 138_323_000 picoseconds. + Weight::from_parts(125_497_264, 0) + .saturating_add(Weight::from_parts(0, 69046)) + // Standard Error: 56_050 + .saturating_add(Weight::from_parts(19_863_853, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(r.into()))) .saturating_add(Weight::from_parts(0, 2489).saturating_mul(r.into())) } @@ -193,10 +217,10 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `AmbassadorCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) fn offboard() -> Weight { // Proof Size summary in bytes: - // Measured: `331` + // Measured: `265` // Estimated: `3514` - // Minimum execution time: 21_000_000 picoseconds. - Weight::from_parts(22_000_000, 0) + // Minimum execution time: 26_903_000 picoseconds. + Weight::from_parts(27_645_000, 0) .saturating_add(Weight::from_parts(0, 3514)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -209,8 +233,22 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `285` // Estimated: `3514` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(21_000_000, 0) + // Minimum execution time: 23_286_000 picoseconds. + Weight::from_parts(23_848_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `AmbassadorCore::Member` (r:1 w:1) + /// Proof: `AmbassadorCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `AmbassadorCollective::Members` (r:1 w:0) + /// Proof: `AmbassadorCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + fn import_member() -> Weight { + // Proof Size summary in bytes: + // Measured: `285` + // Estimated: `3514` + // Minimum execution time: 23_239_000 picoseconds. + Weight::from_parts(23_684_000, 0) .saturating_add(Weight::from_parts(0, 3514)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -225,8 +263,8 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `65967` // Estimated: `69046` - // Minimum execution time: 78_000_000 picoseconds. - Weight::from_parts(104_000_000, 0) + // Minimum execution time: 125_987_000 picoseconds. + Weight::from_parts(130_625_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -239,8 +277,8 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `151` // Estimated: `69046` - // Minimum execution time: 43_000_000 picoseconds. - Weight::from_parts(44_000_000, 0) + // Minimum execution time: 104_431_000 picoseconds. + Weight::from_parts(106_646_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_core_fellowship_fellowship_core.rs b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_core_fellowship_fellowship_core.rs index 05014e273f00..acb1f82985db 100644 --- a/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_core_fellowship_fellowship_core.rs +++ b/cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_core_fellowship_fellowship_core.rs @@ -1,39 +1,44 @@ // Copyright (C) Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 +// This file is part of Cumulus. -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . //! Autogenerated weights for `pallet_core_fellowship` //! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-08-11, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 +//! DATE: 2025-01-03, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `cob`, CPU: `` -//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("collectives-polkadot-dev")`, DB CACHE: 1024 +//! HOSTNAME: `623e9e4b814e`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 // Executed Command: -// target/release/polkadot-parachain +// frame-omni-bencher +// v1 // benchmark // pallet -// --chain=collectives-polkadot-dev -// --wasm-execution=compiled -// --pallet=pallet_core_fellowship // --extrinsic=* -// --steps=2 -// --repeat=2 -// --json -// --header=./file_header.txt -// --output=./parachains/runtimes/collectives/collectives-polkadot/src/weights/ +// --runtime=target/production/wbuild/collectives-westend-runtime/collectives_westend_runtime.wasm +// --pallet=pallet_core_fellowship +// --header=/__w/polkadot-sdk/polkadot-sdk/cumulus/file_header.txt +// --output=./cumulus/parachains/runtimes/collectives/collectives-westend/src/weights +// --wasm-execution=compiled +// --steps=50 +// --repeat=20 +// --heap-pages=4096 +// --no-storage-info +// --no-min-squares +// --no-median-slopes #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -47,25 +52,26 @@ use core::marker::PhantomData; pub struct WeightInfo(PhantomData); impl pallet_core_fellowship::WeightInfo for WeightInfo { /// Storage: `FellowshipCore::Params` (r:0 w:1) - /// Proof: `FellowshipCore::Params` (`max_values`: Some(1), `max_size`: Some(364), added: 859, mode: `MaxEncodedLen`) + /// Proof: `FellowshipCore::Params` (`max_values`: Some(1), `max_size`: Some(368), added: 863, mode: `MaxEncodedLen`) fn set_params() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) + // Minimum execution time: 9_115_000 picoseconds. + Weight::from_parts(9_523_000, 0) .saturating_add(Weight::from_parts(0, 0)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: `FellowshipCore::Params` (r:0 w:1) - /// Proof: `FellowshipCore::Params` (`max_values`: Some(1), `max_size`: Some(364), added: 859, mode: `MaxEncodedLen`) + /// Storage: `FellowshipCore::Params` (r:1 w:1) + /// Proof: `FellowshipCore::Params` (`max_values`: Some(1), `max_size`: Some(368), added: 863, mode: `MaxEncodedLen`) fn set_partial_params() -> Weight { // Proof Size summary in bytes: - // Measured: `0` - // Estimated: `0` - // Minimum execution time: 11_000_000 picoseconds. - Weight::from_parts(12_000_000, 0) - .saturating_add(Weight::from_parts(0, 0)) + // Measured: `504` + // Estimated: `1853` + // Minimum execution time: 18_294_000 picoseconds. + Weight::from_parts(18_942_000, 0) + .saturating_add(Weight::from_parts(0, 1853)) + .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } /// Storage: `FellowshipCore::Member` (r:1 w:1) @@ -73,44 +79,48 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Storage: `FellowshipCollective::Members` (r:1 w:1) /// Proof: `FellowshipCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) /// Storage: `FellowshipCore::Params` (r:1 w:0) - /// Proof: `FellowshipCore::Params` (`max_values`: Some(1), `max_size`: Some(364), added: 859, mode: `MaxEncodedLen`) + /// Proof: `FellowshipCore::Params` (`max_values`: Some(1), `max_size`: Some(368), added: 863, mode: `MaxEncodedLen`) /// Storage: `FellowshipCollective::MemberCount` (r:1 w:1) /// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) - /// Storage: `FellowshipCollective::IdToIndex` (r:1 w:0) + /// Storage: `FellowshipCollective::IdToIndex` (r:1 w:1) /// Proof: `FellowshipCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) /// Storage: `FellowshipCore::MemberEvidence` (r:1 w:1) /// Proof: `FellowshipCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `FellowshipCollective::IndexToId` (r:0 w:1) + /// Proof: `FellowshipCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) fn bump_offboard() -> Weight { // Proof Size summary in bytes: - // Measured: `66144` + // Measured: `66535` // Estimated: `69046` - // Minimum execution time: 109_000_000 picoseconds. - Weight::from_parts(125_000_000, 0) + // Minimum execution time: 152_823_000 picoseconds. + Weight::from_parts(158_737_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(6)) } /// Storage: `FellowshipCore::Member` (r:1 w:1) /// Proof: `FellowshipCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) /// Storage: `FellowshipCollective::Members` (r:1 w:1) /// Proof: `FellowshipCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) /// Storage: `FellowshipCore::Params` (r:1 w:0) - /// Proof: `FellowshipCore::Params` (`max_values`: Some(1), `max_size`: Some(364), added: 859, mode: `MaxEncodedLen`) + /// Proof: `FellowshipCore::Params` (`max_values`: Some(1), `max_size`: Some(368), added: 863, mode: `MaxEncodedLen`) /// Storage: `FellowshipCollective::MemberCount` (r:1 w:1) /// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) - /// Storage: `FellowshipCollective::IdToIndex` (r:1 w:0) + /// Storage: `FellowshipCollective::IdToIndex` (r:1 w:1) /// Proof: `FellowshipCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) /// Storage: `FellowshipCore::MemberEvidence` (r:1 w:1) /// Proof: `FellowshipCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `FellowshipCollective::IndexToId` (r:0 w:1) + /// Proof: `FellowshipCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) fn bump_demote() -> Weight { // Proof Size summary in bytes: - // Measured: `66254` + // Measured: `66645` // Estimated: `69046` - // Minimum execution time: 112_000_000 picoseconds. - Weight::from_parts(114_000_000, 0) + // Minimum execution time: 157_605_000 picoseconds. + Weight::from_parts(162_341_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(6)) - .saturating_add(T::DbWeight::get().writes(4)) + .saturating_add(T::DbWeight::get().writes(6)) } /// Storage: `FellowshipCollective::Members` (r:1 w:0) /// Proof: `FellowshipCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) @@ -120,8 +130,8 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `493` // Estimated: `3514` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(27_000_000, 0) + // Minimum execution time: 25_194_000 picoseconds. + Weight::from_parts(26_262_000, 0) .saturating_add(Weight::from_parts(0, 3514)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -140,8 +150,8 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `251` // Estimated: `3514` - // Minimum execution time: 35_000_000 picoseconds. - Weight::from_parts(36_000_000, 0) + // Minimum execution time: 35_479_000 picoseconds. + Weight::from_parts(36_360_000, 0) .saturating_add(Weight::from_parts(0, 3514)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(5)) @@ -151,7 +161,7 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Storage: `FellowshipCore::Member` (r:1 w:1) /// Proof: `FellowshipCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) /// Storage: `FellowshipCore::Params` (r:1 w:0) - /// Proof: `FellowshipCore::Params` (`max_values`: Some(1), `max_size`: Some(364), added: 859, mode: `MaxEncodedLen`) + /// Proof: `FellowshipCore::Params` (`max_values`: Some(1), `max_size`: Some(368), added: 863, mode: `MaxEncodedLen`) /// Storage: `FellowshipCollective::MemberCount` (r:1 w:1) /// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) /// Storage: `FellowshipCore::MemberEvidence` (r:1 w:1) @@ -162,25 +172,40 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `FellowshipCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) fn promote() -> Weight { // Proof Size summary in bytes: - // Measured: `66122` + // Measured: `66188` // Estimated: `69046` - // Minimum execution time: 97_000_000 picoseconds. - Weight::from_parts(129_000_000, 0) + // Minimum execution time: 147_993_000 picoseconds. + Weight::from_parts(153_943_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(6)) } + /// Storage: `FellowshipCollective::Members` (r:1 w:1) + /// Proof: `FellowshipCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + /// Storage: `FellowshipCore::Member` (r:1 w:1) + /// Proof: `FellowshipCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `FellowshipCollective::MemberCount` (r:9 w:9) + /// Proof: `FellowshipCollective::MemberCount` (`max_values`: None, `max_size`: Some(14), added: 2489, mode: `MaxEncodedLen`) + /// Storage: `FellowshipCore::MemberEvidence` (r:1 w:1) + /// Proof: `FellowshipCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) + /// Storage: `FellowshipCollective::IndexToId` (r:0 w:9) + /// Proof: `FellowshipCollective::IndexToId` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// Storage: `FellowshipCollective::IdToIndex` (r:0 w:9) + /// Proof: `FellowshipCollective::IdToIndex` (`max_values`: None, `max_size`: Some(54), added: 2529, mode: `MaxEncodedLen`) + /// The range of component `r` is `[1, 9]`. + /// The range of component `r` is `[1, 9]`. fn promote_fast(r: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `16844` - // Estimated: `19894 + r * (2489 ±0)` - // Minimum execution time: 45_065_000 picoseconds. - Weight::from_parts(34_090_392, 19894) - // Standard Error: 18_620 - .saturating_add(Weight::from_parts(13_578_046, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(3_u64)) + // Measured: `66101` + // Estimated: `69046 + r * (2489 ±0)` + // Minimum execution time: 138_444_000 picoseconds. + Weight::from_parts(125_440_035, 0) + .saturating_add(Weight::from_parts(0, 69046)) + // Standard Error: 55_452 + .saturating_add(Weight::from_parts(19_946_954, 0).saturating_mul(r.into())) + .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(r.into()))) .saturating_add(Weight::from_parts(0, 2489).saturating_mul(r.into())) } @@ -192,10 +217,10 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< /// Proof: `FellowshipCore::MemberEvidence` (`max_values`: None, `max_size`: Some(65581), added: 68056, mode: `MaxEncodedLen`) fn offboard() -> Weight { // Proof Size summary in bytes: - // Measured: `464` + // Measured: `398` // Estimated: `3514` - // Minimum execution time: 22_000_000 picoseconds. - Weight::from_parts(22_000_000, 0) + // Minimum execution time: 27_392_000 picoseconds. + Weight::from_parts(28_134_000, 0) .saturating_add(Weight::from_parts(0, 3514)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) @@ -208,8 +233,22 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `418` // Estimated: `3514` - // Minimum execution time: 20_000_000 picoseconds. - Weight::from_parts(24_000_000, 0) + // Minimum execution time: 23_523_000 picoseconds. + Weight::from_parts(24_046_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `FellowshipCore::Member` (r:1 w:1) + /// Proof: `FellowshipCore::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) + /// Storage: `FellowshipCollective::Members` (r:1 w:0) + /// Proof: `FellowshipCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) + fn import_member() -> Weight { + // Proof Size summary in bytes: + // Measured: `418` + // Estimated: `3514` + // Minimum execution time: 23_369_000 picoseconds. + Weight::from_parts(24_088_000, 0) .saturating_add(Weight::from_parts(0, 3514)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) @@ -224,8 +263,8 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `66100` // Estimated: `69046` - // Minimum execution time: 89_000_000 picoseconds. - Weight::from_parts(119_000_000, 0) + // Minimum execution time: 127_137_000 picoseconds. + Weight::from_parts(131_638_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(2)) @@ -238,8 +277,8 @@ impl pallet_core_fellowship::WeightInfo for WeightInfo< // Proof Size summary in bytes: // Measured: `184` // Estimated: `69046` - // Minimum execution time: 43_000_000 picoseconds. - Weight::from_parts(52_000_000, 0) + // Minimum execution time: 103_212_000 picoseconds. + Weight::from_parts(105_488_000, 0) .saturating_add(Weight::from_parts(0, 69046)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) diff --git a/prdoc/pr_7030.prdoc b/prdoc/pr_7030.prdoc new file mode 100644 index 000000000000..3b1f7be558d8 --- /dev/null +++ b/prdoc/pr_7030.prdoc @@ -0,0 +1,24 @@ +# 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: "[core-fellowship] Add permissionless import_member" + +doc: + - audience: [Runtime Dev, Runtime User] + description: | + Changes: + - Add call `import_member` to the core-fellowship pallet. + - Move common logic between `import` and `import_member` into `do_import`. + + This is a minor change as to not impact UI and downstream integration. + + ## `import_member` + + Can be used to induct an arbitrary collective member and is callable by any signed origin. Pays no fees upon success. + This is useful in the case that members did not induct themselves and are idling on their rank. + +crates: +- name: pallet-core-fellowship + bump: major +- name: collectives-westend-runtime + bump: patch diff --git a/prdoc/pr_7043.prdoc b/prdoc/pr_7043.prdoc new file mode 100644 index 000000000000..d7f6cd6907c8 --- /dev/null +++ b/prdoc/pr_7043.prdoc @@ -0,0 +1,51 @@ +title: Remove usage of `sp-std` from Substrate +doc: +- audience: Runtime Dev + description: |- + # Description + + This PR removes usage of deprecated `sp-std` from Substrate. (following PR of #5010) + + ## Integration + + This PR doesn't remove re-exported `sp_std` from any crates yet, so downstream projects using re-exported `sp_std` will not be affected. + + ## Review Notes + + The existing code using `sp-std` is refactored to use `alloc` and `core` directly. The key-value maps are instantiated from an array of tuples directly instead of using `sp_std::map!` macro. + + This PR replaces `sp_std::Writer`, a helper type for using `Vec` with `core::fmt::Write` trait, with `alloc::string::String`. + +crates: +- name: pallet-contracts + bump: patch +- name: pallet-revive + bump: patch +- name: sp-runtime + bump: patch +- name: frame-support-procedural + bump: patch +- name: frame-system + bump: patch +- name: pallet-contracts-proc-macro + bump: patch +- name: pallet-revive-proc-macro + bump: patch +- name: frame-support + bump: patch +- name: sc-sysinfo + bump: patch +- name: pallet-bags-list-remote-tests + bump: patch +- name: pallet-election-provider-e2e-test + bump: patch +- name: pallet-nft-fractionalization + bump: patch +- name: pallet-nomination-pools-test-delegate-stake + bump: patch +- name: pallet-nomination-pools-test-transfer-stake + bump: patch +- name: pallet-root-offences + bump: patch +- name: pallet-uniques + bump: patch diff --git a/prdoc/pr_7050.prdoc b/prdoc/pr_7050.prdoc new file mode 100644 index 000000000000..da9dd808033d --- /dev/null +++ b/prdoc/pr_7050.prdoc @@ -0,0 +1,11 @@ +title: Avoid incomplete block import pipeline with full verifying import queue +doc: +- audience: Node Dev + description: |- + When warp syncing a node using the equivocation checking verifier, we now properly set the fork_choice rule. + Affected are mostly nodes that are derived from the parachain template. Omni-node is not affected. + + The prevents the error `ClientImport("Incomplete block import pipeline.")` after state sync. +crates: +- name: cumulus-client-consensus-aura + bump: patch diff --git a/substrate/client/network/README.md b/substrate/client/network/README.md index 9903109d847c..4336bb78533c 100644 --- a/substrate/client/network/README.md +++ b/substrate/client/network/README.md @@ -245,7 +245,7 @@ only downloads finalized authority set changes. GRANDPA keeps justifications for each finalized authority set change. Each change is signed by the authorities from the previous set. By downloading and verifying these signed hand-offs starting from genesis, we arrive at a recent header faster than downloading full header chain. Each `WarpSyncRequest` contains a block -hash to a to start collecting proofs from. `WarpSyncResponse` contains a sequence of block headers and +hash to start collecting proofs from. `WarpSyncResponse` contains a sequence of block headers and justifications. The proof downloader checks the justifications and continues requesting proofs from the last header hash, until it arrives at some recent header. diff --git a/substrate/client/sysinfo/Cargo.toml b/substrate/client/sysinfo/Cargo.toml index c7eed77eda7f..afc464c35881 100644 --- a/substrate/client/sysinfo/Cargo.toml +++ b/substrate/client/sysinfo/Cargo.toml @@ -30,7 +30,6 @@ serde_json = { workspace = true, default-features = true } sp-core = { workspace = true, default-features = true } sp-crypto-hashing = { workspace = true, default-features = true } sp-io = { workspace = true, default-features = true } -sp-std = { workspace = true, default-features = true } [dev-dependencies] sp-runtime = { workspace = true, default-features = true } diff --git a/substrate/frame/bags-list/remote-tests/Cargo.toml b/substrate/frame/bags-list/remote-tests/Cargo.toml index 99b203e73fb0..e3215803a020 100644 --- a/substrate/frame/bags-list/remote-tests/Cargo.toml +++ b/substrate/frame/bags-list/remote-tests/Cargo.toml @@ -26,7 +26,6 @@ pallet-staking = { workspace = true, default-features = true } # core sp-core = { workspace = true, default-features = true } sp-runtime = { workspace = true, default-features = true } -sp-std = { workspace = true, default-features = true } sp-storage = { workspace = true, default-features = true } sp-tracing = { workspace = true, default-features = true } diff --git a/substrate/frame/bounties/README.md b/substrate/frame/bounties/README.md index 232334cb1edd..2293ae161e28 100644 --- a/substrate/frame/bounties/README.md +++ b/substrate/frame/bounties/README.md @@ -19,7 +19,7 @@ curator or once the bounty is active or payout is pending, resulting in the slas curator's deposit. This pallet may opt into using a [`ChildBountyManager`] that enables bounties to be split into -sub-bounties, as children of anh established bounty (called the parent in the context of it's +sub-bounties, as children of an established bounty (called the parent in the context of it's children). > NOTE: The parent bounty cannot be closed if it has a non-zero number of it has active child diff --git a/substrate/frame/bounties/src/lib.rs b/substrate/frame/bounties/src/lib.rs index d9accc5061cf..9b6e3c06e914 100644 --- a/substrate/frame/bounties/src/lib.rs +++ b/substrate/frame/bounties/src/lib.rs @@ -36,7 +36,7 @@ //! curator's deposit. //! //! This pallet may opt into using a [`ChildBountyManager`] that enables bounties to be split into -//! sub-bounties, as children of anh established bounty (called the parent in the context of it's +//! sub-bounties, as children of an established bounty (called the parent in the context of it's //! children). //! //! > NOTE: The parent bounty cannot be closed if it has a non-zero number of it has active child diff --git a/substrate/frame/contracts/Cargo.toml b/substrate/frame/contracts/Cargo.toml index e39128639e3e..5784e6dd1553 100644 --- a/substrate/frame/contracts/Cargo.toml +++ b/substrate/frame/contracts/Cargo.toml @@ -50,7 +50,6 @@ sp-api = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } sp-runtime = { workspace = true } -sp-std = { workspace = true } xcm = { workspace = true } xcm-builder = { workspace = true } @@ -98,7 +97,6 @@ std = [ "sp-io/std", "sp-keystore/std", "sp-runtime/std", - "sp-std/std", "wasm-instrument?/std", "wasmi/std", "xcm-builder/std", diff --git a/substrate/frame/contracts/proc-macro/src/lib.rs b/substrate/frame/contracts/proc-macro/src/lib.rs index 4aba1d24dbd5..5c3c34e6ef32 100644 --- a/substrate/frame/contracts/proc-macro/src/lib.rs +++ b/substrate/frame/contracts/proc-macro/src/lib.rs @@ -650,10 +650,9 @@ fn expand_functions(def: &EnvDef, expand_mode: ExpandMode) -> TokenStream2 { let result = #body; if ::log::log_enabled!(target: "runtime::contracts::strace", ::log::Level::Trace) { use core::fmt::Write; - let mut w = sp_std::Writer::default(); - let _ = core::write!(&mut w, #trace_fmt_str, #( #trace_fmt_args, )* result); - let msg = core::str::from_utf8(&w.inner()).unwrap_or_default(); - ctx.ext().append_debug_buffer(msg); + let mut msg = alloc::string::String::default(); + let _ = core::write!(&mut msg, #trace_fmt_str, #( #trace_fmt_args, )* result); + ctx.ext().append_debug_buffer(&msg); } result } diff --git a/substrate/frame/contracts/src/transient_storage.rs b/substrate/frame/contracts/src/transient_storage.rs index c795a966385a..c9b1dac1ad75 100644 --- a/substrate/frame/contracts/src/transient_storage.rs +++ b/substrate/frame/contracts/src/transient_storage.rs @@ -22,11 +22,11 @@ use crate::{ storage::WriteOutcome, Config, Error, }; +use alloc::{collections::BTreeMap, vec::Vec}; use codec::Encode; -use core::marker::PhantomData; +use core::{marker::PhantomData, mem}; use frame_support::DefaultNoBound; use sp_runtime::{DispatchError, DispatchResult, Saturating}; -use sp_std::{collections::btree_map::BTreeMap, mem, vec::Vec}; /// Meter entry tracks transaction allocations. #[derive(Default, Debug)] diff --git a/substrate/frame/core-fellowship/src/benchmarking.rs b/substrate/frame/core-fellowship/src/benchmarking.rs index adb8a4a091b8..ac0d489953c1 100644 --- a/substrate/frame/core-fellowship/src/benchmarking.rs +++ b/substrate/frame/core-fellowship/src/benchmarking.rs @@ -50,6 +50,7 @@ mod benchmarks { for _ in 0..rank { T::Members::promote(&member)?; } + #[allow(deprecated)] CoreFellowship::::import(RawOrigin::Signed(member.clone()).into())?; Ok(member) } @@ -260,6 +261,23 @@ mod benchmarks { Ok(()) } + #[benchmark] + fn import_member() -> Result<(), BenchmarkError> { + let member = account("member", 0, SEED); + let sender = account("sender", 0, SEED); + + T::Members::induct(&member)?; + T::Members::promote(&member)?; + + assert!(!Member::::contains_key(&member)); + + #[extrinsic_call] + _(RawOrigin::Signed(sender), member.clone()); + + assert!(Member::::contains_key(&member)); + Ok(()) + } + #[benchmark] fn approve() -> Result<(), BenchmarkError> { let member = make_member::(1)?; diff --git a/substrate/frame/core-fellowship/src/lib.rs b/substrate/frame/core-fellowship/src/lib.rs index c61447e36280..22ba63b26161 100644 --- a/substrate/frame/core-fellowship/src/lib.rs +++ b/substrate/frame/core-fellowship/src/lib.rs @@ -21,6 +21,7 @@ //! This only handles members of non-zero rank. //! //! # Process Flow +//! //! - Begin with a call to `induct`, where some privileged origin (perhaps a pre-existing member of //! `rank > 1`) is able to make a candidate from an account and introduce it to be tracked in this //! pallet in order to allow evidence to be submitted and promotion voted on. @@ -36,8 +37,9 @@ //! `bump` to demote the candidate by one rank. //! - If a candidate fails to be promoted to a member within the `offboard_timeout` period, then //! anyone may call `bump` to remove the account's candidacy. -//! - Pre-existing members may call `import` to have their rank recognised and be inducted into this -//! pallet (to gain a salary and allow for eventual promotion). +//! - Pre-existing members may call `import_member` on themselves (formerly `import`) to have their +//! rank recognised and be inducted into this pallet (to gain a salary and allow for eventual +//! promotion). //! - If, externally to this pallet, a member or candidate has their rank removed completely, then //! `offboard` may be called to remove them entirely from this pallet. //! @@ -585,28 +587,44 @@ pub mod pallet { Ok(if replaced { Pays::Yes } else { Pays::No }.into()) } - /// Introduce an already-ranked individual of the collective into this pallet. The rank may - /// still be zero. + /// Introduce an already-ranked individual of the collective into this pallet. /// - /// This resets `last_proof` to the current block and `last_promotion` will be set to zero, - /// thereby delaying any automatic demotion but allowing immediate promotion. + /// The rank may still be zero. This resets `last_proof` to the current block and + /// `last_promotion` will be set to zero, thereby delaying any automatic demotion but + /// allowing immediate promotion. /// /// - `origin`: A signed origin of a ranked, but not tracked, account. #[pallet::weight(T::WeightInfo::import())] #[pallet::call_index(8)] + #[deprecated = "Use `import_member` instead"] + #[allow(deprecated)] // Otherwise FRAME will complain about using something deprecated. pub fn import(origin: OriginFor) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; - ensure!(!Member::::contains_key(&who), Error::::AlreadyInducted); - let rank = T::Members::rank_of(&who).ok_or(Error::::Unranked)?; + Self::do_import(who)?; - let now = frame_system::Pallet::::block_number(); - Member::::insert( - &who, - MemberStatus { is_active: true, last_promotion: 0u32.into(), last_proof: now }, - ); - Self::deposit_event(Event::::Imported { who, rank }); + Ok(Pays::No.into()) // Successful imports are free + } - Ok(Pays::No.into()) + /// Introduce an already-ranked individual of the collective into this pallet. + /// + /// The rank may still be zero. Can be called by anyone on any collective member - including + /// the sender. + /// + /// This resets `last_proof` to the current block and `last_promotion` will be set to zero, + /// thereby delaying any automatic demotion but allowing immediate promotion. + /// + /// - `origin`: A signed origin of a ranked, but not tracked, account. + /// - `who`: The account ID of the collective member to be inducted. + #[pallet::weight(T::WeightInfo::set_partial_params())] + #[pallet::call_index(11)] + pub fn import_member( + origin: OriginFor, + who: T::AccountId, + ) -> DispatchResultWithPostInfo { + ensure_signed(origin)?; + Self::do_import(who)?; + + Ok(Pays::No.into()) // Successful imports are free } /// Set the parameters partially. @@ -661,6 +679,24 @@ pub mod pallet { } } } + + /// Import `who` into the core-fellowship pallet. + /// + /// `who` must be a member of the collective but *not* already imported. + pub(crate) fn do_import(who: T::AccountId) -> DispatchResult { + ensure!(!Member::::contains_key(&who), Error::::AlreadyInducted); + let rank = T::Members::rank_of(&who).ok_or(Error::::Unranked)?; + + let now = frame_system::Pallet::::block_number(); + Member::::insert( + &who, + MemberStatus { is_active: true, last_promotion: 0u32.into(), last_proof: now }, + ); + Self::deposit_event(Event::::Imported { who, rank }); + + Ok(()) + } + /// Convert a rank into a `0..RANK_COUNT` index suitable for the arrays in Params. /// /// Rank 1 becomes index 0, rank `RANK_COUNT` becomes index `RANK_COUNT - 1`. Any rank not @@ -766,6 +802,7 @@ impl, I: 'static> pallet_ranked_collective::BenchmarkSetup<::AccountId> for Pallet { fn ensure_member(who: &::AccountId) { + #[allow(deprecated)] Self::import(frame_system::RawOrigin::Signed(who.clone()).into()).unwrap(); } } diff --git a/substrate/frame/core-fellowship/src/tests/integration.rs b/substrate/frame/core-fellowship/src/tests/integration.rs index 7a48ed9783e7..b2149336547d 100644 --- a/substrate/frame/core-fellowship/src/tests/integration.rs +++ b/substrate/frame/core-fellowship/src/tests/integration.rs @@ -17,8 +17,10 @@ //! Integration test together with the ranked-collective pallet. +#![allow(deprecated)] + use frame_support::{ - assert_noop, assert_ok, derive_impl, hypothetically, ord_parameter_types, + assert_noop, assert_ok, derive_impl, hypothetically, hypothetically_ok, ord_parameter_types, pallet_prelude::Weight, parameter_types, traits::{ConstU16, EitherOf, IsInVec, MapSuccess, NoOpPoll, TryMapSuccess}, @@ -170,6 +172,37 @@ fn evidence(e: u32) -> Evidence { .expect("Static length matches") } +#[test] +fn import_simple_works() { + new_test_ext().execute_with(|| { + for i in 0u16..9 { + let acc = i as u64; + + // Does not work yet + assert_noop!(CoreFellowship::import(signed(acc)), Error::::Unranked); + assert_noop!( + CoreFellowship::import_member(signed(acc + 1), acc), + Error::::Unranked + ); + + assert_ok!(Club::add_member(RuntimeOrigin::root(), acc)); + promote_n_times(acc, i); + + hypothetically_ok!(CoreFellowship::import(signed(acc))); + hypothetically_ok!(CoreFellowship::import_member(signed(acc), acc)); + // Works from other accounts + assert_ok!(CoreFellowship::import_member(signed(acc + 1), acc)); + + // Does not work again + assert_noop!(CoreFellowship::import(signed(acc)), Error::::AlreadyInducted); + assert_noop!( + CoreFellowship::import_member(signed(acc + 1), acc), + Error::::AlreadyInducted + ); + } + }); +} + #[test] fn swap_simple_works() { new_test_ext().execute_with(|| { @@ -178,7 +211,8 @@ fn swap_simple_works() { assert_ok!(Club::add_member(RuntimeOrigin::root(), acc)); promote_n_times(acc, i); - assert_ok!(CoreFellowship::import(signed(acc))); + hypothetically_ok!(CoreFellowship::import(signed(acc))); + assert_ok!(CoreFellowship::import_member(signed(acc), acc)); // Swapping normally works: assert_ok!(Club::exchange_member(RuntimeOrigin::root(), acc, acc + 10)); diff --git a/substrate/frame/core-fellowship/src/tests/unit.rs b/substrate/frame/core-fellowship/src/tests/unit.rs index 11d1ea9fe5b7..f4418ed439d0 100644 --- a/substrate/frame/core-fellowship/src/tests/unit.rs +++ b/substrate/frame/core-fellowship/src/tests/unit.rs @@ -17,6 +17,8 @@ //! The crate's tests. +#![allow(deprecated)] + use std::collections::BTreeMap; use core::cell::RefCell; @@ -222,6 +224,66 @@ fn set_partial_params_works() { }); } +#[test] +fn import_member_works() { + new_test_ext().execute_with(|| { + assert_noop!(CoreFellowship::import_member(signed(0), 0), Error::::Unranked); + assert_noop!(CoreFellowship::import(signed(0)), Error::::Unranked); + + // Make induction work: + set_rank(0, 1); + assert!(!Member::::contains_key(0), "not yet imported"); + + // `import_member` can be used to induct ourselves: + hypothetically!({ + assert_ok!(CoreFellowship::import_member(signed(0), 0)); + assert!(Member::::contains_key(0), "got imported"); + + // Twice does not work: + assert_noop!( + CoreFellowship::import_member(signed(0), 0), + Error::::AlreadyInducted + ); + assert_noop!(CoreFellowship::import(signed(0)), Error::::AlreadyInducted); + }); + + // But we could have also used `import`: + hypothetically!({ + assert_ok!(CoreFellowship::import(signed(0))); + assert!(Member::::contains_key(0), "got imported"); + + // Twice does not work: + assert_noop!( + CoreFellowship::import_member(signed(0), 0), + Error::::AlreadyInducted + ); + assert_noop!(CoreFellowship::import(signed(0)), Error::::AlreadyInducted); + }); + }); +} + +#[test] +fn import_member_same_as_import() { + new_test_ext().execute_with(|| { + for rank in 0..=9 { + set_rank(0, rank); + + let import_root = hypothetically!({ + assert_ok!(CoreFellowship::import(signed(0))); + sp_io::storage::root(sp_runtime::StateVersion::V1) + }); + + let import_member_root = hypothetically!({ + assert_ok!(CoreFellowship::import_member(signed(1), 0)); + sp_io::storage::root(sp_runtime::StateVersion::V1) + }); + + // `import` and `import_member` do exactly the same thing. + assert_eq!(import_root, import_member_root); + } + }); +} + #[test] fn induct_works() { new_test_ext().execute_with(|| { diff --git a/substrate/frame/core-fellowship/src/weights.rs b/substrate/frame/core-fellowship/src/weights.rs index 9bca8cb56094..e6381c854d34 100644 --- a/substrate/frame/core-fellowship/src/weights.rs +++ b/substrate/frame/core-fellowship/src/weights.rs @@ -61,6 +61,7 @@ pub trait WeightInfo { fn promote_fast(r: u32, ) -> Weight; fn offboard() -> Weight; fn import() -> Weight; + fn import_member() -> Weight; fn approve() -> Weight; fn submit_evidence() -> Weight; } @@ -76,7 +77,7 @@ impl WeightInfo for SubstrateWeight { // Estimated: `0` // Minimum execution time: 6_652_000 picoseconds. Weight::from_parts(7_082_000, 0) - .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `CoreFellowship::Params` (r:1 w:1) /// Proof: `CoreFellowship::Params` (`max_values`: Some(1), `max_size`: Some(368), added: 863, mode: `MaxEncodedLen`) @@ -86,8 +87,8 @@ impl WeightInfo for SubstrateWeight { // Estimated: `1853` // Minimum execution time: 12_485_000 picoseconds. Weight::from_parts(12_784_000, 1853) - .saturating_add(T::DbWeight::get().reads(1_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `CoreFellowship::Member` (r:1 w:1) /// Proof: `CoreFellowship::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) @@ -109,8 +110,8 @@ impl WeightInfo for SubstrateWeight { // Estimated: `19894` // Minimum execution time: 61_243_000 picoseconds. Weight::from_parts(63_033_000, 19894) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) + .saturating_add(RocksDbWeight::get().reads(6_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) } /// Storage: `CoreFellowship::Member` (r:1 w:1) /// Proof: `CoreFellowship::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) @@ -132,8 +133,8 @@ impl WeightInfo for SubstrateWeight { // Estimated: `19894` // Minimum execution time: 65_063_000 picoseconds. Weight::from_parts(67_047_000, 19894) - .saturating_add(T::DbWeight::get().reads(6_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) + .saturating_add(RocksDbWeight::get().reads(6_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) } /// Storage: `RankedCollective::Members` (r:1 w:0) /// Proof: `RankedCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) @@ -145,8 +146,8 @@ impl WeightInfo for SubstrateWeight { // Estimated: `3514` // Minimum execution time: 21_924_000 picoseconds. Weight::from_parts(22_691_000, 3514) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } /// Storage: `CoreFellowship::Member` (r:1 w:1) /// Proof: `CoreFellowship::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) @@ -164,8 +165,8 @@ impl WeightInfo for SubstrateWeight { // Estimated: `3514` // Minimum execution time: 24_720_000 picoseconds. Weight::from_parts(25_580_000, 3514) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(5_u64)) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(5_u64)) } /// Storage: `RankedCollective::Members` (r:1 w:1) /// Proof: `RankedCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) @@ -187,8 +188,8 @@ impl WeightInfo for SubstrateWeight { // Estimated: `19894` // Minimum execution time: 58_481_000 picoseconds. Weight::from_parts(59_510_000, 19894) - .saturating_add(T::DbWeight::get().reads(5_u64)) - .saturating_add(T::DbWeight::get().writes(6_u64)) + .saturating_add(RocksDbWeight::get().reads(5_u64)) + .saturating_add(RocksDbWeight::get().writes(6_u64)) } /// Storage: `RankedCollective::Members` (r:1 w:1) /// Proof: `RankedCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) @@ -211,10 +212,10 @@ impl WeightInfo for SubstrateWeight { Weight::from_parts(42_220_685, 19894) // Standard Error: 18_061 .saturating_add(Weight::from_parts(13_858_309, 0).saturating_mul(r.into())) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(r.into()))) - .saturating_add(T::DbWeight::get().writes(3_u64)) - .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(r.into()))) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(r.into()))) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(r.into()))) .saturating_add(Weight::from_parts(0, 2489).saturating_mul(r.into())) } /// Storage: `RankedCollective::Members` (r:1 w:0) @@ -229,8 +230,8 @@ impl WeightInfo for SubstrateWeight { // Estimated: `3514` // Minimum execution time: 17_492_000 picoseconds. Weight::from_parts(18_324_000, 3514) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `CoreFellowship::Member` (r:1 w:1) /// Proof: `CoreFellowship::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) @@ -242,8 +243,18 @@ impl WeightInfo for SubstrateWeight { // Estimated: `3514` // Minimum execution time: 16_534_000 picoseconds. Weight::from_parts(17_046_000, 3514) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + fn import_member() -> Weight { + // Proof Size summary in bytes: + // Measured: `285` + // Estimated: `3514` + // Minimum execution time: 23_239_000 picoseconds. + Weight::from_parts(23_684_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(RocksDbWeight::get().reads(2)) + .saturating_add(RocksDbWeight::get().writes(1)) } /// Storage: `RankedCollective::Members` (r:1 w:0) /// Proof: `RankedCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) @@ -257,8 +268,8 @@ impl WeightInfo for SubstrateWeight { // Estimated: `19894` // Minimum execution time: 42_264_000 picoseconds. Weight::from_parts(43_281_000, 19894) - .saturating_add(T::DbWeight::get().reads(3_u64)) - .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(RocksDbWeight::get().reads(3_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) } /// Storage: `CoreFellowship::Member` (r:1 w:0) /// Proof: `CoreFellowship::Member` (`max_values`: None, `max_size`: Some(49), added: 2524, mode: `MaxEncodedLen`) @@ -270,8 +281,8 @@ impl WeightInfo for SubstrateWeight { // Estimated: `19894` // Minimum execution time: 25_461_000 picoseconds. Weight::from_parts(26_014_000, 19894) - .saturating_add(T::DbWeight::get().reads(2_u64)) - .saturating_add(T::DbWeight::get().writes(1_u64)) + .saturating_add(RocksDbWeight::get().reads(2_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) } } @@ -454,6 +465,16 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(2_u64)) .saturating_add(RocksDbWeight::get().writes(1_u64)) } + fn import_member() -> Weight { + // Proof Size summary in bytes: + // Measured: `285` + // Estimated: `3514` + // Minimum execution time: 23_239_000 picoseconds. + Weight::from_parts(23_684_000, 0) + .saturating_add(Weight::from_parts(0, 3514)) + .saturating_add(RocksDbWeight::get().reads(2)) + .saturating_add(RocksDbWeight::get().writes(1)) + } /// Storage: `RankedCollective::Members` (r:1 w:0) /// Proof: `RankedCollective::Members` (`max_values`: None, `max_size`: Some(42), added: 2517, mode: `MaxEncodedLen`) /// Storage: `CoreFellowship::Member` (r:1 w:1) diff --git a/substrate/frame/election-provider-multi-phase/test-staking-e2e/Cargo.toml b/substrate/frame/election-provider-multi-phase/test-staking-e2e/Cargo.toml index 5009d3d54d56..7a48ae868a5a 100644 --- a/substrate/frame/election-provider-multi-phase/test-staking-e2e/Cargo.toml +++ b/substrate/frame/election-provider-multi-phase/test-staking-e2e/Cargo.toml @@ -26,7 +26,6 @@ sp-io = { workspace = true, default-features = true } sp-npos-elections = { workspace = true } sp-runtime = { workspace = true, default-features = true } sp-staking = { workspace = true, default-features = true } -sp-std = { workspace = true, default-features = true } sp-tracing = { workspace = true, default-features = true } frame-election-provider-support = { workspace = true, default-features = true } diff --git a/substrate/frame/nft-fractionalization/Cargo.toml b/substrate/frame/nft-fractionalization/Cargo.toml index 7f6df86ed0e5..23537b227893 100644 --- a/substrate/frame/nft-fractionalization/Cargo.toml +++ b/substrate/frame/nft-fractionalization/Cargo.toml @@ -30,7 +30,6 @@ sp-runtime = { workspace = true } pallet-balances = { workspace = true, default-features = true } sp-core = { workspace = true, default-features = true } sp-io = { workspace = true, default-features = true } -sp-std = { workspace = true, default-features = true } [features] default = ["std"] diff --git a/substrate/frame/nomination-pools/test-delegate-stake/Cargo.toml b/substrate/frame/nomination-pools/test-delegate-stake/Cargo.toml index fe3743d7e5da..62c2fb625fc4 100644 --- a/substrate/frame/nomination-pools/test-delegate-stake/Cargo.toml +++ b/substrate/frame/nomination-pools/test-delegate-stake/Cargo.toml @@ -23,7 +23,6 @@ sp-core = { workspace = true, default-features = true } sp-io = { workspace = true, default-features = true } sp-runtime = { workspace = true, default-features = true } sp-staking = { workspace = true, default-features = true } -sp-std = { workspace = true, default-features = true } frame-election-provider-support = { workspace = true, default-features = true } frame-support = { features = ["experimental"], workspace = true, default-features = true } diff --git a/substrate/frame/nomination-pools/test-transfer-stake/Cargo.toml b/substrate/frame/nomination-pools/test-transfer-stake/Cargo.toml index 2cdc4c41a083..0b21d5f4e8cf 100644 --- a/substrate/frame/nomination-pools/test-transfer-stake/Cargo.toml +++ b/substrate/frame/nomination-pools/test-transfer-stake/Cargo.toml @@ -23,7 +23,6 @@ sp-core = { workspace = true, default-features = true } sp-io = { workspace = true, default-features = true } sp-runtime = { workspace = true, default-features = true } sp-staking = { workspace = true, default-features = true } -sp-std = { workspace = true, default-features = true } frame-election-provider-support = { workspace = true, default-features = true } frame-support = { workspace = true, default-features = true } diff --git a/substrate/frame/revive/Cargo.toml b/substrate/frame/revive/Cargo.toml index fa008f8e836a..1284f5ee8947 100644 --- a/substrate/frame/revive/Cargo.toml +++ b/substrate/frame/revive/Cargo.toml @@ -46,7 +46,6 @@ sp-arithmetic = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } sp-runtime = { workspace = true } -sp-std = { workspace = true } subxt-signer = { workspace = true, optional = true, features = [ "unstable-eth", ] } @@ -99,7 +98,6 @@ std = [ "sp-io/std", "sp-keystore/std", "sp-runtime/std", - "sp-std/std", "subxt-signer", "xcm-builder/std", "xcm/std", diff --git a/substrate/frame/revive/proc-macro/src/lib.rs b/substrate/frame/revive/proc-macro/src/lib.rs index b6ea1a06d94e..b09bdef14632 100644 --- a/substrate/frame/revive/proc-macro/src/lib.rs +++ b/substrate/frame/revive/proc-macro/src/lib.rs @@ -512,10 +512,9 @@ fn expand_functions(def: &EnvDef) -> TokenStream2 { let result = (|| #body)(); if ::log::log_enabled!(target: "runtime::revive::strace", ::log::Level::Trace) { use core::fmt::Write; - let mut w = sp_std::Writer::default(); - let _ = core::write!(&mut w, #trace_fmt_str, #( #trace_fmt_args, )* result); - let msg = core::str::from_utf8(&w.inner()).unwrap_or_default(); - self.ext().append_debug_buffer(msg); + let mut msg = alloc::string::String::default(); + let _ = core::write!(&mut msg, #trace_fmt_str, #( #trace_fmt_args, )* result); + self.ext().append_debug_buffer(&msg); } result } diff --git a/substrate/frame/revive/src/transient_storage.rs b/substrate/frame/revive/src/transient_storage.rs index 298e0296fe69..d88adc437359 100644 --- a/substrate/frame/revive/src/transient_storage.rs +++ b/substrate/frame/revive/src/transient_storage.rs @@ -22,11 +22,11 @@ use crate::{ storage::WriteOutcome, Config, Error, }; +use alloc::{collections::BTreeMap, vec::Vec}; use codec::Encode; -use core::marker::PhantomData; +use core::{marker::PhantomData, mem}; use frame_support::DefaultNoBound; use sp_runtime::{DispatchError, DispatchResult, Saturating}; -use sp_std::{collections::btree_map::BTreeMap, mem, vec::Vec}; /// Meter entry tracks transaction allocations. #[derive(Default, Debug)] diff --git a/substrate/frame/root-offences/Cargo.toml b/substrate/frame/root-offences/Cargo.toml index dedde9956b6f..c539f1dc4dc1 100644 --- a/substrate/frame/root-offences/Cargo.toml +++ b/substrate/frame/root-offences/Cargo.toml @@ -34,7 +34,6 @@ pallet-timestamp = { workspace = true, default-features = true } sp-core = { workspace = true, default-features = true } sp-io = { workspace = true } -sp-std = { workspace = true, default-features = true } frame-election-provider-support = { workspace = true, default-features = true } diff --git a/substrate/frame/support/procedural/src/pallet/expand/config.rs b/substrate/frame/support/procedural/src/pallet/expand/config.rs index 0a583f1359ba..d39f27672360 100644 --- a/substrate/frame/support/procedural/src/pallet/expand/config.rs +++ b/substrate/frame/support/procedural/src/pallet/expand/config.rs @@ -126,7 +126,7 @@ pub fn expand_config_metadata(def: &Def) -> proc_macro2::TokenStream { ty: #frame_support::__private::scale_info::meta_type::< ::#ident >(), - docs: #frame_support::__private::sp_std::vec![ #( #doc ),* ], + docs: #frame_support::__private::vec![ #( #doc ),* ], } }) }); @@ -136,9 +136,9 @@ pub fn expand_config_metadata(def: &Def) -> proc_macro2::TokenStream { #[doc(hidden)] pub fn pallet_associated_types_metadata() - -> #frame_support::__private::sp_std::vec::Vec<#frame_support::__private::metadata_ir::PalletAssociatedTypeMetadataIR> + -> #frame_support::__private::vec::Vec<#frame_support::__private::metadata_ir::PalletAssociatedTypeMetadataIR> { - #frame_support::__private::sp_std::vec![ #( #types ),* ] + #frame_support::__private::vec![ #( #types ),* ] } } ) diff --git a/substrate/frame/support/src/lib.rs b/substrate/frame/support/src/lib.rs index c64987b17d35..a6969260e6a2 100644 --- a/substrate/frame/support/src/lib.rs +++ b/substrate/frame/support/src/lib.rs @@ -44,6 +44,7 @@ pub mod __private { pub use alloc::{ boxed::Box, rc::Rc, + string::String, vec, vec::{IntoIter, Vec}, }; @@ -502,9 +503,9 @@ macro_rules! runtime_print { ($($arg:tt)+) => { { use core::fmt::Write; - let mut w = $crate::__private::sp_std::Writer::default(); - let _ = core::write!(&mut w, $($arg)+); - $crate::__private::sp_io::misc::print_utf8(&w.inner()) + let mut msg = $crate::__private::String::default(); + let _ = core::write!(&mut msg, $($arg)+); + $crate::__private::sp_io::misc::print_utf8(msg.as_bytes()) } } } diff --git a/substrate/frame/system/Cargo.toml b/substrate/frame/system/Cargo.toml index 1340b2c55c53..8883ebd4c41d 100644 --- a/substrate/frame/system/Cargo.toml +++ b/substrate/frame/system/Cargo.toml @@ -26,7 +26,6 @@ serde = { features = ["alloc", "derive"], workspace = true } sp-core = { features = ["serde"], workspace = true } sp-io = { workspace = true } sp-runtime = { features = ["serde"], workspace = true } -sp-std = { workspace = true } sp-version = { features = ["serde"], workspace = true } sp-weights = { features = ["serde"], workspace = true } @@ -47,7 +46,6 @@ std = [ "sp-externalities/std", "sp-io/std", "sp-runtime/std", - "sp-std/std", "sp-version/std", "sp-weights/std", ] diff --git a/substrate/frame/system/src/lib.rs b/substrate/frame/system/src/lib.rs index 2fdf6ad5b3ca..72e93dd67365 100644 --- a/substrate/frame/system/src/lib.rs +++ b/substrate/frame/system/src/lib.rs @@ -120,8 +120,6 @@ use sp_runtime::{ }, DispatchError, RuntimeDebug, }; -#[cfg(any(feature = "std", test))] -use sp_std::map; use sp_version::RuntimeVersion; use codec::{Decode, Encode, EncodeLike, FullCodec, MaxEncodedLen}; @@ -1993,12 +1991,14 @@ impl Pallet { #[cfg(any(feature = "std", test))] pub fn externalities() -> TestExternalities { TestExternalities::new(sp_core::storage::Storage { - top: map![ - >::hashed_key_for(BlockNumberFor::::zero()) => [69u8; 32].encode(), - >::hashed_key().to_vec() => BlockNumberFor::::one().encode(), - >::hashed_key().to_vec() => [69u8; 32].encode() - ], - children_default: map![], + top: [ + (>::hashed_key_for(BlockNumberFor::::zero()), [69u8; 32].encode()), + (>::hashed_key().to_vec(), BlockNumberFor::::one().encode()), + (>::hashed_key().to_vec(), [69u8; 32].encode()), + ] + .into_iter() + .collect(), + children_default: Default::default(), }) } diff --git a/substrate/frame/uniques/Cargo.toml b/substrate/frame/uniques/Cargo.toml index 135292fb4ecd..a2473c51ee75 100644 --- a/substrate/frame/uniques/Cargo.toml +++ b/substrate/frame/uniques/Cargo.toml @@ -28,7 +28,6 @@ sp-runtime = { workspace = true } pallet-balances = { workspace = true, default-features = true } sp-core = { workspace = true, default-features = true } sp-io = { workspace = true, default-features = true } -sp-std = { workspace = true, default-features = true } [features] default = ["std"] diff --git a/substrate/primitives/runtime/src/generic/unchecked_extrinsic.rs b/substrate/primitives/runtime/src/generic/unchecked_extrinsic.rs index d8510a60a789..6b8471f84846 100644 --- a/substrate/primitives/runtime/src/generic/unchecked_extrinsic.rs +++ b/substrate/primitives/runtime/src/generic/unchecked_extrinsic.rs @@ -683,7 +683,7 @@ mod legacy { Extra: Encode, { fn encode(&self) -> Vec { - let mut tmp = Vec::with_capacity(sp_std::mem::size_of::()); + let mut tmp = Vec::with_capacity(core::mem::size_of::()); // 1 byte version id. match self.signature.as_ref() { diff --git a/substrate/primitives/runtime/src/proving_trie/base16.rs b/substrate/primitives/runtime/src/proving_trie/base16.rs index da05c551c6d9..abdf6ed178bb 100644 --- a/substrate/primitives/runtime/src/proving_trie/base16.rs +++ b/substrate/primitives/runtime/src/proving_trie/base16.rs @@ -26,8 +26,8 @@ use super::{ProofToHashes, ProvingTrie, TrieError}; use crate::{Decode, DispatchError, Encode}; +use alloc::vec::Vec; use codec::MaxEncodedLen; -use sp_std::vec::Vec; use sp_trie::{ trie_types::{TrieDBBuilder, TrieDBMutBuilderV1}, LayoutV1, MemoryDB, Trie, TrieMut, @@ -197,7 +197,7 @@ mod tests { use super::*; use crate::traits::BlakeTwo256; use sp_core::H256; - use sp_std::collections::btree_map::BTreeMap; + use std::collections::BTreeMap; // A trie which simulates a trie of accounts (u32) and balances (u128). type BalanceTrie = BasicProvingTrie; diff --git a/substrate/primitives/runtime/src/proving_trie/base2.rs b/substrate/primitives/runtime/src/proving_trie/base2.rs index 2b14a59ab056..8a7cfaa5149d 100644 --- a/substrate/primitives/runtime/src/proving_trie/base2.rs +++ b/substrate/primitives/runtime/src/proving_trie/base2.rs @@ -22,9 +22,9 @@ use super::{ProofToHashes, ProvingTrie, TrieError}; use crate::{Decode, DispatchError, Encode}; +use alloc::{collections::BTreeMap, vec::Vec}; use binary_merkle_tree::{merkle_proof, merkle_root, MerkleProof}; use codec::MaxEncodedLen; -use sp_std::{collections::btree_map::BTreeMap, vec::Vec}; /// A helper structure for building a basic base-2 merkle trie and creating compact proofs for that /// trie. @@ -161,7 +161,7 @@ mod tests { use super::*; use crate::traits::BlakeTwo256; use sp_core::H256; - use sp_std::collections::btree_map::BTreeMap; + use std::collections::BTreeMap; // A trie which simulates a trie of accounts (u32) and balances (u128). type BalanceTrie = BasicProvingTrie; diff --git a/substrate/primitives/runtime/src/proving_trie/mod.rs b/substrate/primitives/runtime/src/proving_trie/mod.rs index 009aa6d4935f..32b2284b4d79 100644 --- a/substrate/primitives/runtime/src/proving_trie/mod.rs +++ b/substrate/primitives/runtime/src/proving_trie/mod.rs @@ -23,7 +23,7 @@ pub mod base2; use crate::{Decode, DispatchError, Encode, MaxEncodedLen, TypeInfo}; #[cfg(feature = "serde")] use crate::{Deserialize, Serialize}; -use sp_std::vec::Vec; +use alloc::vec::Vec; use sp_trie::{trie_types::TrieError as SpTrieError, VerifyError}; /// A runtime friendly error type for tries. diff --git a/substrate/primitives/runtime/src/runtime_logger.rs b/substrate/primitives/runtime/src/runtime_logger.rs index 79984b135672..ec5251d978f1 100644 --- a/substrate/primitives/runtime/src/runtime_logger.rs +++ b/substrate/primitives/runtime/src/runtime_logger.rs @@ -54,10 +54,10 @@ impl log::Log for RuntimeLogger { fn log(&self, record: &log::Record) { use core::fmt::Write; - let mut w = sp_std::Writer::default(); - let _ = ::core::write!(&mut w, "{}", record.args()); + let mut msg = alloc::string::String::default(); + let _ = ::core::write!(&mut msg, "{}", record.args()); - sp_io::logging::log(record.level().into(), record.target(), w.inner()); + sp_io::logging::log(record.level().into(), record.target(), msg.as_bytes()); } fn flush(&self) {} diff --git a/substrate/primitives/runtime/src/traits/mod.rs b/substrate/primitives/runtime/src/traits/mod.rs index d371152dc40a..5b6cacc7e008 100644 --- a/substrate/primitives/runtime/src/traits/mod.rs +++ b/substrate/primitives/runtime/src/traits/mod.rs @@ -1710,7 +1710,7 @@ pub trait SignedExtension: /// This method provides a default implementation that returns a vec containing a single /// [`TransactionExtensionMetadata`]. fn metadata() -> Vec { - sp_std::vec![TransactionExtensionMetadata { + alloc::vec![TransactionExtensionMetadata { identifier: Self::IDENTIFIER, ty: scale_info::meta_type::(), implicit: scale_info::meta_type::() diff --git a/substrate/primitives/runtime/src/traits/transaction_extension/mod.rs b/substrate/primitives/runtime/src/traits/transaction_extension/mod.rs index 4d95e5e6f3a4..15be1e4c8e0a 100644 --- a/substrate/primitives/runtime/src/traits/transaction_extension/mod.rs +++ b/substrate/primitives/runtime/src/traits/transaction_extension/mod.rs @@ -24,11 +24,12 @@ use crate::{ }, DispatchResult, }; +use alloc::vec::Vec; use codec::{Codec, Decode, Encode}; -use impl_trait_for_tuples::impl_for_tuples; +use core::fmt::Debug; #[doc(hidden)] -pub use sp_std::marker::PhantomData; -use sp_std::{self, fmt::Debug, prelude::*}; +pub use core::marker::PhantomData; +use impl_trait_for_tuples::impl_for_tuples; use sp_weights::Weight; use tuplex::{PopFront, PushBack}; @@ -258,7 +259,7 @@ pub trait TransactionExtension: /// This method provides a default implementation that returns a vec containing a single /// [`TransactionExtensionMetadata`]. fn metadata() -> Vec { - sp_std::vec![TransactionExtensionMetadata { + alloc::vec![TransactionExtensionMetadata { identifier: Self::IDENTIFIER, ty: scale_info::meta_type::(), implicit: scale_info::meta_type::() @@ -668,7 +669,7 @@ impl TransactionExtension for Tuple { impl TransactionExtension for () { const IDENTIFIER: &'static str = "UnitTransactionExtension"; type Implicit = (); - fn implicit(&self) -> sp_std::result::Result { + fn implicit(&self) -> core::result::Result { Ok(()) } type Val = ();