Skip to content

Commit

Permalink
"Common good" vs "System" parachain nits
Browse files Browse the repository at this point in the history
  • Loading branch information
bkontur committed Sep 5, 2023
1 parent 3369168 commit 9fc696f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//!
//! ### Governance
//!
//! As a common good parachain, Collectives defers its governance (namely, its `Root` origin), to
//! As a system parachain, Collectives defers its governance (namely, its `Root` origin), to
//! its Relay Chain parent, Polkadot.
//!
//! ### Collator Selection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub type Barrier = TrailingSetTopicAsId<
// If the message is one that immediately attemps to pay for execution, then
// allow it.
AllowTopLevelPaidExecutionFrom<Everything>,
// Common Good Assets parachain, parent and its exec plurality get free
// System Assets parachain, parent and its exec plurality get free
// execution
AllowExplicitUnpaidExecutionFrom<(
CommonGoodAssetsParachain,
Expand Down
9 changes: 5 additions & 4 deletions polkadot/parachain/src/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,14 @@ impl From<i32> for Id {
}
}

const USER_INDEX_START: u32 = 1000;
// System parachain ID is considered `< 2000`
const SYSTEM_INDEX_END: u32 = 1999;
const PUBLIC_INDEX_START: u32 = 2000;

/// The ID of the first user (non-system) parachain.
pub const LOWEST_USER_ID: Id = Id(USER_INDEX_START);
pub const LOWEST_USER_ID: Id = Id(PUBLIC_INDEX_START);

/// The ID of the first publicly registerable parachain.
/// The ID of the first publicly registrable parachain.
pub const LOWEST_PUBLIC_ID: Id = Id(PUBLIC_INDEX_START);

impl Id {
Expand All @@ -223,7 +224,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 polkadot/runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,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 polkadot/runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,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

0 comments on commit 9fc696f

Please sign in to comment.