Skip to content

Commit

Permalink
Phase 2 of People Chain Launch (polkadot-fellows#246)
Browse files Browse the repository at this point in the history
Do not merge until after the 1.2.0 release. These runtimes should be
applied first to the Kusama Relay Chain (after People genesis) and then
to the People Chain (after migration is complete).

See details:
https://forum.polkadot.network/t/people-chain-launch-and-identity-migration-plan/5930
  • Loading branch information
joepetrowski authored Apr 10, 2024
1 parent bb42c6b commit 5cd9e70
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 19 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Changelog for the runtimes governed by the Polkadot Fellowship.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [1.2.1] 09.04.2024

### Changed

- Modify runtimes for phase two of People Chain launch (Kusama) ([polkadot-fellows/runtimes#246](https://github.com/polkadot-fellows/runtimes/pull/246))

## [1.2.0] 28.03.2024

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,7 @@ fn assert_reap_id_relay(total_deposit: Balance, id: &Identity) {

assert_ok!(KusamaIdentityMigrator::reap_identity(
// Note: Root for launch testing, Signed once we open migrations.
KusamaOrigin::root(),
// KusamaOrigin::signed(KusamaRelaySender::get()),
KusamaOrigin::signed(KusamaRelaySender::get()),
KusamaRelaySender::get()
));

Expand Down
7 changes: 3 additions & 4 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ use frame_support::{
weights::{ConstantMultiplier, WeightMeter},
PalletId,
};
use frame_system::EnsureRoot;
use frame_system::{EnsureRoot, EnsureSigned};
use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId};
use pallet_identity::legacy::IdentityInfo;
use pallet_session::historical as session_historical;
Expand Down Expand Up @@ -160,7 +160,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2,
spec_version: 1_002_000,
spec_version: 1_002_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 25,
Expand Down Expand Up @@ -1000,8 +1000,7 @@ impl pallet_identity::Config for Runtime {

impl identity_migrator::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
// To be updated to `EnsureSigned` once the parachain is producing blocks.
type Reaper = EnsureRoot<AccountId>;
type Reaper = EnsureSigned<AccountId>;
type ReapIdentityHandler = impls::ToParachainIdentityReaper<Runtime, Self::AccountId>;
type WeightInfo = weights::runtime_common_identity_migrator::WeightInfo<Runtime>;
}
Expand Down
17 changes: 4 additions & 13 deletions system-parachains/people/people-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ use frame_support::{
genesis_builder_helper::{build_config, create_default_config},
parameter_types,
traits::{
ConstBool, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse, EverythingBut,
InstanceFilter, TransformOrigin,
ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, Everything, InstanceFilter,
TransformOrigin,
},
weights::{ConstantMultiplier, Weight},
PalletId,
Expand Down Expand Up @@ -128,7 +128,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("people-kusama"),
impl_name: create_runtime_str!("people-kusama"),
authoring_version: 1,
spec_version: 1_002_000,
spec_version: 1_002_001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 0,
Expand Down Expand Up @@ -166,18 +166,9 @@ parameter_types! {
pub const SS58Prefix: u8 = 2;
}

/// A type to identify calls to the Identity pallet. These will be filtered to prevent invocation,
/// locking the state of the pallet and preventing updates to identities until the chain is stable.
pub struct IsIdentityCall;
impl Contains<RuntimeCall> for IsIdentityCall {
fn contains(c: &RuntimeCall) -> bool {
matches!(c, RuntimeCall::Identity(_))
}
}

#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type BaseCallFilter = EverythingBut<IsIdentityCall>;
type BaseCallFilter = Everything;
type AccountId = AccountId;
type Nonce = Nonce;
type Hash = Hash;
Expand Down

0 comments on commit 5cd9e70

Please sign in to comment.