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

Cleaning "common good" vs "system" #7488

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions parachain/src/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,13 @@ impl From<i32> for Id {
}
}

const USER_INDEX_START: u32 = 1000;
/// System parachain ids are `< 2000`
const SYSTEM_INDEX_END: u32 = 1999;

const USER_INDEX_START: u32 = 2000;
const PUBLIC_INDEX_START: u32 = 2000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since both USER_INDEX_START and PUBLIC_INDEX_START are 2000, is there an actual difference between the two?


// TODO: do we need this?
/// The ID of the first user (non-system) parachain.
pub const LOWEST_USER_ID: Id = Id(USER_INDEX_START);

Expand All @@ -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
}
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ impl pallet_staking::EraPayout<Balance> 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;
Expand Down
2 changes: 1 addition & 1 deletion runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ impl pallet_staking::EraPayout<Balance> 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;
Expand Down