mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 13:21:01 +00:00
"Common good" vs "System" parachain clean up (#1406)
## Summary The term "common good parachain" has been abandoned in favor of "system parachain" - e.g. [Joe's speech at Decoded2023](https://youtu.be/CSO-ERHK2gY?t=456). This pull request tries to fix and align code with this vision. ## Impact The important change is implementation of `trait IsSystem` for `Id` [here](https://github.com/paritytech/polkadot-sdk/pull/1406/files#diff-0b7b4f5b962a18ce980354592b55ab2a27b5a2e9f6f8089ec803ca73853e8583R225-R229) where we changed condition from `< 1000` to `<= 1999`, which means that all parachain IDs bellow 1999 (included) are considered as "system parachain" IDs. This change has a direct impact on the following components: #### [ChildSystemParachainAsSuperuser](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-builder/src/origin_conversion.rs#L72-L88) This origin converter is used for allowing to process XCM `Transact` from "system parachain" on the relay chain - e.g. see [configuration for Kusama](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/runtime/kusama/src/xcm_config.rs#L92-L101). Only configured for Kusama, Westend, Rococo runtimes. **No need for this feature anymore.** See [comment](https://github.com/paritytech/polkadot-sdk/pull/1406#issuecomment-1708218715). #### [IsChildSystemParachain](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-builder/src/barriers.rs#L310-L317) `IsChildSystemParachain` is used with `AllowExplicitUnpaidExecutionFrom` barrier for checking XCM programs (they have to start with `UnpaidExecution` instruction). Only configured for Kusama, Westend, Rococo runtimes. **Overall the impact is low or mostly ok because it only allows unpaid execution for "system parachains" (e.g. AssetHub, BridgeHub...) on the relay chain.** #### [SiblingSystemParachainAsSuperuser](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/xcm/xcm-builder/src/origin_conversion.rs#L94-L114) Not used anywhere in `polkadot-sdk` repo. ## Unresolved Questions - [ ] constants `LOWEST_USER_ID` and `LOWEST_PUBLIC_ID` seem to express the same thing now, do we want to keep them both or deprecated one of them? If so, which one? - [x] determine impact for `ChildSystemParachainAsSuperuser` ## TODO - [ ] when merged here, open PR to the `polkadot-fellows` ## Related Material https://youtu.be/CSO-ERHK2gY?t=456 https://forum.polkadot.network/t/polkadot-protocol-and-common-good-parachains/866 https://wiki.polkadot.network/docs/learn-system-chains
This commit is contained in:
@@ -199,13 +199,11 @@ 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);
|
||||
|
||||
/// 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 {
|
||||
@@ -223,7 +221,7 @@ pub trait IsSystem {
|
||||
|
||||
impl IsSystem for Id {
|
||||
fn is_system(&self) -> bool {
|
||||
self.0 < USER_INDEX_START
|
||||
self.0 <= SYSTEM_INDEX_END
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user