Skip to content

Commit

Permalink
[core-fellowship] Add permissionless import_member (#7030)
Browse files Browse the repository at this point in the history
Changes:
- Add call `import_member` to the core-fellowship pallet.
- Move common logic between `import` and `import_member` into
`do_import`.

## `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.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: command-bot <>
  • Loading branch information
ggwpez and bkchr authored Jan 6, 2025
1 parent 1dcff3d commit 568231a
Show file tree
Hide file tree
Showing 8 changed files with 448 additions and 175 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: `<UNKNOWN>`
//! 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)]
Expand All @@ -48,70 +52,75 @@ use core::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_core_fellowship::WeightInfo for WeightInfo<T> {
/// 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)
/// 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_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`)
Expand All @@ -121,8 +130,8 @@ impl<T: frame_system::Config> 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))
Expand All @@ -141,8 +150,8 @@ impl<T: frame_system::Config> 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))
Expand All @@ -152,7 +161,7 @@ impl<T: frame_system::Config> 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)
Expand All @@ -163,25 +172,40 @@ impl<T: frame_system::Config> 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()))
}
Expand All @@ -193,10 +217,10 @@ impl<T: frame_system::Config> 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))
Expand All @@ -209,8 +233,22 @@ impl<T: frame_system::Config> 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))
Expand All @@ -225,8 +263,8 @@ impl<T: frame_system::Config> 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))
Expand All @@ -239,8 +277,8 @@ impl<T: frame_system::Config> 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))
Expand Down
Loading

0 comments on commit 568231a

Please sign in to comment.