Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Runtime: Kusama gets Society v2 #7356

Merged
merged 15 commits into from
Jun 18, 2023
Merged
491 changes: 249 additions & 242 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ jemalloc-allocator = ["polkadot-node-core-pvf-prepare-worker/jemalloc-allocator"






gavofyork marked this conversation as resolved.
Show resolved Hide resolved
# Configuration for building a .deb package - for use with `cargo-deb`
[package.metadata.deb]
name = "polkadot"
Expand Down
2 changes: 1 addition & 1 deletion parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master",
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
polkadot-core-primitives = { path = "../core-primitives", default-features = false }
derive_more = "0.99.11"
bounded-collections = { version = "0.1.7", default-features = false, features = ["serde"] }
bounded-collections = { version = "0.1.8", default-features = false, features = ["serde"] }

# all optional crates.
serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"] }
Expand Down
4 changes: 1 addition & 3 deletions runtime/kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate",
pallet-nomination-pools-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
pallet-election-provider-support-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
hex-literal = { version = "0.4.1", optional = true }
hex-literal = "0.4.1"

runtime-common = { package = "polkadot-runtime-common", path = "../common", default-features = false }
runtime-parachains = { package = "polkadot-runtime-parachains", path = "../parachains", default-features = false }
Expand All @@ -104,7 +104,6 @@ xcm-executor = { package = "xcm-executor", path = "../../xcm/xcm-executor", defa
xcm-builder = { package = "xcm-builder", path = "../../xcm/xcm-builder", default-features = false }

[dev-dependencies]
hex-literal = "0.4.1"
tiny-keccak = { version = "2.0.2", features = ["keccak"] }
keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" }
Expand Down Expand Up @@ -249,7 +248,6 @@ runtime-benchmarks = [
"pallet-whitelist/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"frame-system-benchmarking/runtime-benchmarks",
"hex-literal",
"xcm-builder/runtime-benchmarks",
"frame-election-provider-support/runtime-benchmarks",
"pallet-bags-list/runtime-benchmarks",
Expand Down
39 changes: 20 additions & 19 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -865,33 +865,24 @@ impl pallet_recovery::Config for Runtime {
}

parameter_types! {
pub const CandidateDeposit: Balance = 10 * QUID;
pub const WrongSideDeduction: Balance = 2 * QUID;
pub const MaxStrikes: u32 = 10;
pub const RotationPeriod: BlockNumber = 7 * DAYS;
pub const PeriodSpend: Balance = 500 * QUID;
pub const MaxLockDuration: BlockNumber = 36 * 30 * DAYS;
pub const ChallengePeriod: BlockNumber = 7 * DAYS;
pub const MaxCandidateIntake: u32 = 1;
pub const SocietyPalletId: PalletId = PalletId(*b"py/socie");
}

impl pallet_society::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type Randomness = pallet_babe::RandomnessFromOneEpochAgo<Runtime>;
type CandidateDeposit = CandidateDeposit;
type WrongSideDeduction = WrongSideDeduction;
type MaxStrikes = MaxStrikes;
type PeriodSpend = PeriodSpend;
type MembershipChanged = ();
type RotationPeriod = RotationPeriod;
type MaxLockDuration = MaxLockDuration;
type GraceStrikes = ConstU32<10>;
type PeriodSpend = ConstU128<{ 500 * QUID }>;
type VotingPeriod = ConstU32<{ 5 * DAYS }>;
type ClaimPeriod = ConstU32<{ 2 * DAYS }>;
type MaxLockDuration = ConstU32<{ 36 * 30 * DAYS }>;
type FounderSetOrigin = EnsureRoot<AccountId>;
type SuspensionJudgementOrigin = pallet_society::EnsureFounder<Runtime>;
type ChallengePeriod = ChallengePeriod;
type MaxCandidateIntake = MaxCandidateIntake;
type ChallengePeriod = ConstU32<{ 7 * DAYS }>;
type MaxPayouts = ConstU32<8>;
type MaxBids = ConstU32<512>;
type PalletId = SocietyPalletId;
type WeightInfo = weights::pallet_society::WeightInfo<Runtime>;
}

parameter_types! {
Expand Down Expand Up @@ -1517,6 +1508,8 @@ pub type Migrations = (
pub mod migrations {
use super::*;
use frame_support::traits::{GetStorageVersion, OnRuntimeUpgrade, StorageVersion};
use hex_literal::hex;
use pallet_society::migrations::from_raw_past_payouts;

pub type V0940 = (
pallet_nomination_pools::migration::v4::MigrateToV4<
Expand All @@ -1531,15 +1524,22 @@ pub mod migrations {
pallet_offences::migration::v1::MigrateToV1<Runtime>,
runtime_common::session::migration::ClearOldSessionStorage<Runtime>,
);

pub type V0943 = (
SetStorageVersions,
// Remove UMP dispatch queue <https://github.com/paritytech/polkadot/pull/6271>
parachains_configuration::migration::v6::MigrateToV6<Runtime>,
ump_migrations::UpdateUmpLimits,
);

parameter_types! {
pub PastPayouts: Vec<(AccountId, Balance)> = from_raw_past_payouts::<Runtime, ()>(vec![
(hex!["1234567890123456789012345678901234567890123456789012345678901234"], 0u128),
].into_iter());
}

/// Unreleased migrations. Add new ones here:
pub type Unreleased = ();
pub type Unreleased = (pallet_society::migrations::MigrateToV2<Runtime, (), PastPayouts>,);

/// Migrations that set `StorageVersion`s we missed to set.
pub struct SetStorageVersions;
Expand Down Expand Up @@ -1643,6 +1643,7 @@ mod benches {
[pallet_referenda, FellowshipReferenda]
[pallet_scheduler, Scheduler]
[pallet_session, SessionBench::<Runtime>]
[pallet_society, Society]
[pallet_staking, Staking]
[frame_system, SystemBench::<Runtime>]
[pallet_timestamp, Timestamp]
Expand Down
1 change: 1 addition & 0 deletions runtime/kusama/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub mod pallet_referenda_fellowship_referenda;
pub mod pallet_referenda_referenda;
pub mod pallet_scheduler;
pub mod pallet_session;
pub mod pallet_society;
pub mod pallet_staking;
pub mod pallet_timestamp;
pub mod pallet_tips;
Expand Down
Loading