Rococo & Westend People Chain (#2281)

Rococo and Westend runtimes for the "People Chain". This chain contains
the Identity pallet with plans to migrate all related data from the
Relay Chain.

Changes `IdentityInfo` to:

- Remove `additional_fields`.
- Add `github` and `discord` as first class fields. From scraping chain
data, these were the only two additional fields used (for the Fellowship
and Ambassador Program, respectively).
- Rename `riot` to `matrix`.

Note: This will use the script in
https://github.com/paritytech/polkadot-sdk/pull/2025 to generate the
genesis state.

TODO:

- [x] https://github.com/paritytech/polkadot-sdk/pull/1814 and
integration of the Identity Migrator pallet for migration.
- [x] Tests: https://github.com/paritytech/polkadot-sdk/pull/2373

---------

Co-authored-by: Muharem <ismailov.m.h@gmail.com>
Co-authored-by: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com>
Co-authored-by: Dónal Murray <donal.murray@parity.io>
Co-authored-by: Richard Melkonian <35300528+0xmovses@users.noreply.github.com>
Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
This commit is contained in:
joe petrowski
2023-12-22 21:28:09 +01:00
committed by GitHub
parent 4c0e0e0713
commit ecbbb5a736
111 changed files with 12730 additions and 258 deletions
@@ -271,7 +271,8 @@ mod benchmarks {
let _ = Identity::<T>::set_identity_no_deposit(&target, info.clone());
let sub_account: T::AccountId = account("sub", 0, SEED);
let _ = Identity::<T>::set_sub_no_deposit(&target, sub_account.clone());
let name = Data::Raw(b"benchsub".to_vec().try_into().unwrap());
let _ = Identity::<T>::set_subs_no_deposit(&target, vec![(sub_account.clone(), name)]);
// expected deposits
let expected_id_deposit = <T as pallet_identity::Config>::BasicDeposit::get()
+13 -2
View File
@@ -25,7 +25,7 @@ use crate::governance::StakingAdmin;
use frame_support::{
match_types, parameter_types,
traits::{Everything, Nothing},
traits::{Equals, Everything, Nothing},
weights::Weight,
};
use frame_system::EnsureRoot;
@@ -50,6 +50,7 @@ use xcm_builder::{
use xcm_executor::XcmExecutor;
parameter_types! {
pub const RootLocation: MultiLocation = MultiLocation::here();
pub const TokenLocation: MultiLocation = Here.into_location();
pub const ThisNetwork: NetworkId = NetworkId::Rococo;
pub UniversalLocation: InteriorMultiLocation = ThisNetwork::get().into();
@@ -120,6 +121,7 @@ parameter_types! {
pub const Contracts: MultiLocation = Parachain(CONTRACTS_ID).into_location();
pub const Encointer: MultiLocation = Parachain(ENCOINTER_ID).into_location();
pub const BridgeHub: MultiLocation = Parachain(BRIDGE_HUB_ID).into_location();
pub const People: MultiLocation = Parachain(PEOPLE_ID).into_location();
pub const Broker: MultiLocation = Parachain(BROKER_ID).into_location();
pub const Tick: MultiLocation = Parachain(100).into_location();
pub const Trick: MultiLocation = Parachain(110).into_location();
@@ -131,6 +133,7 @@ parameter_types! {
pub const RocForContracts: (MultiAssetFilter, MultiLocation) = (Roc::get(), Contracts::get());
pub const RocForEncointer: (MultiAssetFilter, MultiLocation) = (Roc::get(), Encointer::get());
pub const RocForBridgeHub: (MultiAssetFilter, MultiLocation) = (Roc::get(), BridgeHub::get());
pub const RocForPeople: (MultiAssetFilter, MultiLocation) = (Roc::get(), People::get());
pub const RocForBroker: (MultiAssetFilter, MultiLocation) = (Roc::get(), Broker::get());
pub const MaxInstructions: u32 = 100;
pub const MaxAssetsIntoHolding: u32 = 64;
@@ -143,6 +146,7 @@ pub type TrustedTeleporters = (
xcm_builder::Case<RocForContracts>,
xcm_builder::Case<RocForEncointer>,
xcm_builder::Case<RocForBridgeHub>,
xcm_builder::Case<RocForPeople>,
xcm_builder::Case<RocForBroker>,
);
@@ -150,6 +154,9 @@ match_types! {
pub type OnlyParachains: impl Contains<MultiLocation> = {
MultiLocation { parents: 0, interior: X1(Parachain(_)) }
};
pub type LocalPlurality: impl Contains<MultiLocation> = {
MultiLocation { parents: 0, interior: X1(Plurality { .. }) }
};
}
/// The barriers one of which must be passed for an XCM message to be executed.
@@ -172,6 +179,10 @@ pub type Barrier = TrailingSetTopicAsId<(
>,
)>;
/// Locations that will not be charged fees in the executor, neither for execution nor delivery.
/// We only waive fees for system functions, which these locations represent.
pub type WaivedLocations = (SystemParachains, Equals<RootLocation>, LocalPlurality);
pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type RuntimeCall = RuntimeCall;
@@ -198,7 +209,7 @@ impl xcm_executor::Config for XcmConfig {
type PalletInstancesInfo = AllPalletsWithSystem;
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
type FeeManager = XcmFeeManagerFromComponents<
SystemParachains,
WaivedLocations,
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
>;
type MessageExporter = ();
@@ -107,6 +107,8 @@ pub mod system_parachain {
pub const COLLECTIVES_ID: u32 = 1001;
/// BridgeHub parachain ID.
pub const BRIDGE_HUB_ID: u32 = 1002;
/// People Chain parachain ID.
pub const PEOPLE_ID: u32 = 1004;
/// Brokerage parachain ID.
pub const BROKER_ID: u32 = 1005;
+13 -2
View File
@@ -24,7 +24,7 @@ use super::{
use crate::governance::pallet_custom_origins::Treasurer;
use frame_support::{
match_types, parameter_types,
traits::{Everything, Nothing},
traits::{Equals, Everything, Nothing},
};
use frame_system::EnsureRoot;
use pallet_xcm::XcmPassthrough;
@@ -53,6 +53,7 @@ use xcm_builder::{
use xcm_executor::XcmExecutor;
parameter_types! {
pub const RootLocation: MultiLocation = MultiLocation::here();
pub const TokenLocation: MultiLocation = Here.into_location();
pub const ThisNetwork: NetworkId = Westend;
pub const UniversalLocation: InteriorMultiLocation = X1(GlobalConsensus(ThisNetwork::get()));
@@ -116,10 +117,12 @@ parameter_types! {
pub const AssetHub: MultiLocation = Parachain(ASSET_HUB_ID).into_location();
pub const Collectives: MultiLocation = Parachain(COLLECTIVES_ID).into_location();
pub const BridgeHub: MultiLocation = Parachain(BRIDGE_HUB_ID).into_location();
pub const People: MultiLocation = Parachain(PEOPLE_ID).into_location();
pub const Wnd: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(TokenLocation::get()) });
pub const WndForAssetHub: (MultiAssetFilter, MultiLocation) = (Wnd::get(), AssetHub::get());
pub const WndForCollectives: (MultiAssetFilter, MultiLocation) = (Wnd::get(), Collectives::get());
pub const WndForBridgeHub: (MultiAssetFilter, MultiLocation) = (Wnd::get(), BridgeHub::get());
pub const WndForPeople: (MultiAssetFilter, MultiLocation) = (Wnd::get(), People::get());
pub const MaxInstructions: u32 = 100;
pub const MaxAssetsIntoHolding: u32 = 64;
}
@@ -128,6 +131,7 @@ pub type TrustedTeleporters = (
xcm_builder::Case<WndForAssetHub>,
xcm_builder::Case<WndForCollectives>,
xcm_builder::Case<WndForBridgeHub>,
xcm_builder::Case<WndForPeople>,
);
match_types! {
@@ -138,6 +142,9 @@ match_types! {
MultiLocation { parents: 0, interior: X1(Parachain(COLLECTIVES_ID)) } |
MultiLocation { parents: 0, interior: X2(Parachain(COLLECTIVES_ID), Plurality { id: BodyId::Technical, .. }) }
};
pub type LocalPlurality: impl Contains<MultiLocation> = {
MultiLocation { parents: 0, interior: X1(Plurality { .. }) }
};
}
/// The barriers one of which must be passed for an XCM message to be executed.
@@ -160,6 +167,10 @@ pub type Barrier = TrailingSetTopicAsId<(
>,
)>;
/// Locations that will not be charged fees in the executor, neither for execution nor delivery.
/// We only waive fees for system functions, which these locations represent.
pub type WaivedLocations = (SystemParachains, Equals<RootLocation>, LocalPlurality);
pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
type RuntimeCall = RuntimeCall;
@@ -186,7 +197,7 @@ impl xcm_executor::Config for XcmConfig {
type PalletInstancesInfo = AllPalletsWithSystem;
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
type FeeManager = XcmFeeManagerFromComponents<
SystemParachains,
WaivedLocations,
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
>;
type MessageExporter = ();