From b3615ed3aa5f0f04a38c928689bdd00c1509e201 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 11 Jul 2023 12:23:19 +0200 Subject: [PATCH 1/2] Cleaning "common good" vs "system" --- parachain/src/primitives.rs | 2 +- runtime/kusama/src/lib.rs | 2 +- runtime/polkadot/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parachain/src/primitives.rs b/parachain/src/primitives.rs index 18da89aa97a1..346e4777294e 100644 --- a/parachain/src/primitives.rs +++ b/parachain/src/primitives.rs @@ -198,7 +198,7 @@ impl From for Id { } } -const USER_INDEX_START: u32 = 1000; +const USER_INDEX_START: u32 = 2000; const PUBLIC_INDEX_START: u32 = 2000; /// The ID of the first user (non-system) parachain. diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 361602dbb32f..a9ec84c72014 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -523,7 +523,7 @@ impl pallet_staking::EraPayout for EraPayout { // all para-ids that are currently active. let auctioned_slots = Paras::parachains() .into_iter() - // all active para-ids that do not belong to a system or common good chain is the number + // all active para-ids that do not belong to a system chain is the number // of parachains that we should take into account for inflation. .filter(|i| *i >= LOWEST_PUBLIC_ID) .count() as u64; diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index da0c28b9c92a..7644e13ff5e5 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -553,7 +553,7 @@ impl pallet_staking::EraPayout for EraPayout { // all para-ids that are not active. let auctioned_slots = Paras::parachains() .into_iter() - // all active para-ids that do not belong to a system or common good chain is the number + // all active para-ids that do not belong to a system chain is the number // of parachains that we should take into account for inflation. .filter(|i| *i >= LOWEST_PUBLIC_ID) .count() as u64; From 54cf0ce78585ef47cfa5975f6db4f8a3c2661cb7 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Tue, 11 Jul 2023 23:07:30 +0200 Subject: [PATCH 2/2] Added SYSTEM_INDEX_END --- parachain/src/primitives.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/parachain/src/primitives.rs b/parachain/src/primitives.rs index 346e4777294e..f686b760d2b4 100644 --- a/parachain/src/primitives.rs +++ b/parachain/src/primitives.rs @@ -198,9 +198,13 @@ impl From for Id { } } +/// System parachain ids are `< 2000` +const SYSTEM_INDEX_END: u32 = 1999; + const USER_INDEX_START: u32 = 2000; const PUBLIC_INDEX_START: u32 = 2000; +// TODO: do we need this? /// The ID of the first user (non-system) parachain. pub const LOWEST_USER_ID: Id = Id(USER_INDEX_START); @@ -222,7 +226,7 @@ pub trait IsSystem { impl IsSystem for Id { fn is_system(&self) -> bool { - self.0 < USER_INDEX_START + self.0 <= SYSTEM_INDEX_END } }