feat: Rebrand Polkadot/Substrate references to PezkuwiChain

This commit systematically rebrands various references from Parity Technologies'
Polkadot/Substrate ecosystem to PezkuwiChain within the kurdistan-sdk.

Key changes include:
- Updated external repository URLs (zombienet-sdk, parity-db, parity-scale-codec, wasm-instrument) to point to pezkuwichain forks.
- Modified internal documentation and code comments to reflect PezkuwiChain naming and structure.
- Replaced direct references to  with  or specific paths within the  for XCM, Pezkuwi, and other modules.
- Cleaned up deprecated  issue and PR references in various  and  files, particularly in  and  modules.
- Adjusted image and logo URLs in documentation to point to PezkuwiChain assets.
- Removed or rephrased comments related to external Polkadot/Substrate PRs and issues.

This is a significant step towards fully customizing the SDK for the PezkuwiChain ecosystem.
This commit is contained in:
2025-12-14 00:04:10 +03:00
parent e4778b4576
commit 379cb741ed
9082 changed files with 997824 additions and 997542 deletions
@@ -17,13 +17,13 @@
use super::*;
use crate::configuration::HostConfiguration;
use alloc::vec;
use frame_benchmarking::v2::*;
use frame_support::traits::fungible::Mutate;
use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin};
use pezframe_benchmarking::v2::*;
use pezframe_support::traits::fungible::Mutate;
use pezframe_system::{pezpallet_prelude::BlockNumberFor, RawOrigin};
use pezkuwi_primitives::{
HeadData, Id as ParaId, ValidationCode, MAX_CODE_SIZE, MAX_HEAD_DATA_SIZE,
};
use sp_runtime::traits::{One, Saturating};
use pezsp_runtime::traits::{One, Saturating};
pub mod mmr_setup;
mod pvf_check;
@@ -37,10 +37,10 @@ use self::pvf_check::{VoteCause, VoteOutcome};
const SAMPLE_SIZE: u32 = 1024;
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
let events = frame_system::Pallet::<T>::events();
let system_event: <T as frame_system::Config>::RuntimeEvent = generic_event.into();
let events = pezframe_system::Pallet::<T>::events();
let system_event: <T as pezframe_system::Config>::RuntimeEvent = generic_event.into();
// compare to the last event record
let frame_system::EventRecord { event, .. } = &events[events.len() - 1];
let pezframe_system::EventRecord { event, .. } = &events[events.len() - 1];
assert_eq!(event, &system_event);
}
@@ -141,10 +141,10 @@ mod benchmarks {
let new_head = HeadData(vec![0; s as usize]);
let old_code_hash = ValidationCode(vec![0]).hash();
CurrentCodeHash::<T>::insert(&para_id, old_code_hash);
frame_system::Pallet::<T>::set_block_number(10u32.into());
pezframe_system::Pallet::<T>::set_block_number(10u32.into());
// schedule an expired code upgrade for this `para_id` so that force_note_new_head would use
// the worst possible code path
let expired = frame_system::Pallet::<T>::block_number().saturating_sub(One::one());
let expired = pezframe_system::Pallet::<T>::block_number().saturating_sub(One::one());
let config = HostConfiguration::<BlockNumberFor<T>>::default();
generate_disordered_pruning::<T>();
Pallet::<T>::schedule_code_upgrade(
@@ -256,8 +256,8 @@ mod benchmarks {
let para_id = ParaId::from(1000);
let old_code_hash = ValidationCode(vec![0]).hash();
CurrentCodeHash::<T>::insert(&para_id, old_code_hash);
frame_system::Pallet::<T>::set_block_number(10u32.into());
let inclusion = frame_system::Pallet::<T>::block_number().saturating_add(10u32.into());
pezframe_system::Pallet::<T>::set_block_number(10u32.into());
let inclusion = pezframe_system::Pallet::<T>::block_number().saturating_add(10u32.into());
let config = HostConfiguration::<BlockNumberFor<T>>::default();
Pallet::<T>::schedule_code_upgrade(
para_id,
@@ -297,7 +297,7 @@ mod benchmarks {
Event::CodeAuthorized {
para_id,
code_hash: new_code_hash,
expire_at: frame_system::Pallet::<T>::block_number().saturating_add(valid_period),
expire_at: pezframe_system::Pallet::<T>::block_number().saturating_add(valid_period),
}
.into(),
);
@@ -308,7 +308,7 @@ mod benchmarks {
let code = ValidationCode(vec![0; c as usize]);
let para_id = ParaId::from(1000);
let expire_at =
frame_system::Pallet::<T>::block_number().saturating_add(BlockNumberFor::<T>::from(c));
pezframe_system::Pallet::<T>::block_number().saturating_add(BlockNumberFor::<T>::from(c));
AuthorizedCodeHash::<T>::insert(
&para_id,
AuthorizedCodeHashAndExpiry::from((code.hash(), expire_at)),
@@ -17,8 +17,8 @@
//! Implements benchmarking setup for the `merkle-mountain-range` pallet.
use crate::paras::*;
use pallet_mmr::BenchmarkHelper;
use sp_std::vec;
use pezpallet_mmr::BenchmarkHelper;
use pezsp_std::vec;
/// Struct to setup benchmarks for the `merkle-mountain-range` pallet.
pub struct MmrSetup<T>(core::marker::PhantomData<T>);
@@ -18,10 +18,10 @@
use crate::{configuration, paras::*, shared::Pallet as ParasShared};
use alloc::{vec, vec::Vec};
use frame_support::assert_ok;
use frame_system::RawOrigin;
use pezframe_support::assert_ok;
use pezframe_system::RawOrigin;
use pezkuwi_primitives::{HeadData, Id as ParaId, ValidationCode, ValidatorId, ValidatorIndex};
use sp_application_crypto::RuntimeAppPublic;
use pezsp_application_crypto::RuntimeAppPublic;
// Constants for the benchmarking
const SESSION_INDEX: SessionIndex = 1;
+29 -29
View File
@@ -117,19 +117,19 @@ use alloc::{collections::btree_set::BTreeSet, vec::Vec};
use bitvec::{order::Lsb0 as BitOrderLsb0, vec::BitVec};
use codec::{Decode, Encode};
use core::{cmp, mem};
use frame_support::{
pallet_prelude::*,
use pezframe_support::{
pezpallet_prelude::*,
traits::{EnsureOriginWithArg, EstimateNextSessionRotation},
DefaultNoBound,
};
use frame_system::pallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
use pezkuwi_primitives::{
ConsensusLog, HeadData, Id as ParaId, PvfCheckStatement, SessionIndex, UpgradeGoAhead,
UpgradeRestriction, ValidationCode, ValidationCodeHash, ValidatorSignature, MIN_CODE_SIZE,
};
use scale_info::{Type, TypeInfo};
use sp_core::RuntimeDebug;
use sp_runtime::{
use pezsp_core::RuntimeDebug;
use pezsp_runtime::{
traits::{AppVerify, One, Saturating},
DispatchResult, SaturatedConversion,
};
@@ -398,7 +398,7 @@ pub(crate) enum PvfCheckCause<BlockNumber> {
/// instead of its relay parent -- in order to keep PVF available in case of chain
/// reversions.
///
/// See https://github.com/paritytech/polkadot/issues/4601 for detailed explanation.
/// See https://github.com/pezkuwichain/kurdistan-sdk/issues/151 for detailed explanation.
included_at: BlockNumber,
/// Whether or not the upgrade should be enacted directly.
///
@@ -638,14 +638,14 @@ impl WeightInfo for TestWeightInfo {
}
}
#[frame_support::pallet]
#[pezframe_support::pallet]
pub mod pallet {
use super::*;
use frame_support::traits::{
use pezframe_support::traits::{
fungible::{Inspect, Mutate},
tokens::{Fortitude, Precision, Preservation},
};
use sp_runtime::transaction_validity::{
use pezsp_runtime::transaction_validity::{
InvalidTransaction, TransactionPriority, TransactionSource, TransactionValidity,
ValidTransaction,
};
@@ -658,13 +658,13 @@ pub mod pallet {
#[pallet::config]
pub trait Config:
frame_system::Config
pezframe_system::Config
+ configuration::Config
+ shared::Config
+ frame_system::offchain::CreateBare<Call<Self>>
+ pezframe_system::offchain::CreateBare<Call<Self>>
{
#[allow(deprecated)]
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
#[pallet::constant]
type UnsignedPriority: Get<TransactionPriority>;
@@ -1037,7 +1037,7 @@ pub mod pallet {
new_head: HeadData,
) -> DispatchResult {
ensure_root(origin)?;
let now = frame_system::Pallet::<T>::block_number();
let now = pezframe_system::Pallet::<T>::block_number();
Self::note_new_head(para, new_head, now);
Self::deposit_event(Event::NewHeadNoted(para));
Ok(())
@@ -1094,7 +1094,7 @@ pub mod pallet {
let cfg = configuration::ActiveConfig::<T>::get();
Self::enact_pvf_accepted(
frame_system::Pallet::<T>::block_number(),
pezframe_system::Pallet::<T>::block_number(),
&code_hash,
&vote.causes,
vote.age,
@@ -1204,7 +1204,7 @@ pub mod pallet {
PvfCheckOutcome::Accepted => {
let cfg = configuration::ActiveConfig::<T>::get();
Self::enact_pvf_accepted(
frame_system::Pallet::<T>::block_number(),
pezframe_system::Pallet::<T>::block_number(),
&stmt.subject,
&active_vote.causes,
active_vote.age,
@@ -1302,7 +1302,7 @@ pub mod pallet {
// The requested para must be a valid para (neither onboarding nor offboarding).
ensure!(Self::is_valid_para(para), Error::<T>::NotRegistered);
let now = frame_system::Pallet::<T>::block_number();
let now = pezframe_system::Pallet::<T>::block_number();
let expire_at = now.saturating_add(valid_period);
// Insert the authorized code hash and ensure it overwrites the existing one for a para.
@@ -1347,7 +1347,7 @@ pub mod pallet {
cooldown_until: BlockNumberFor<T>,
) -> BalanceOf<T> {
let time_left =
cooldown_until.saturating_sub(frame_system::Pallet::<T>::block_number());
cooldown_until.saturating_sub(pezframe_system::Pallet::<T>::block_number());
BalanceOf::<T>::from(time_left).saturating_mul(T::CooldownRemovalMultiplier::get())
}
@@ -1420,7 +1420,7 @@ pub mod pallet {
Call::apply_authorized_force_set_current_code { para, new_code } =>
match Self::validate_code_is_authorized(new_code, para) {
Ok(authorized_code) => {
let now = frame_system::Pallet::<T>::block_number();
let now = pezframe_system::Pallet::<T>::block_number();
let longevity = authorized_code.expire_at.saturating_sub(now);
ValidTransaction::with_tag_prefix("ApplyAuthorizedForceSetCurrentCode")
@@ -1482,7 +1482,7 @@ impl<T: Config> Pallet<T> {
ensure!(new_code.0.len() >= MIN_CODE_SIZE as usize, Error::<T>::InvalidCode);
ensure!(new_code.0.len() <= config.max_code_size as usize, Error::<T>::InvalidCode);
let current_block = frame_system::Pallet::<T>::block_number();
let current_block = pezframe_system::Pallet::<T>::block_number();
// Schedule the upgrade with a delay just like if a teyrchain triggered the upgrade.
let upgrade_block = current_block.saturating_add(config.validation_upgrade_delay);
Self::schedule_code_upgrade(id, new_code, upgrade_block, &config, upgrade_strategy);
@@ -1556,7 +1556,7 @@ impl<T: Config> Pallet<T> {
fn apply_actions_queue(session: SessionIndex) -> Vec<ParaId> {
let actions = ActionsQueue::<T>::take(session);
let mut teyrchains = TeyrchainsCache::new();
let now = frame_system::Pallet::<T>::block_number();
let now = pezframe_system::Pallet::<T>::block_number();
let mut outgoing = Vec::new();
for para in actions {
@@ -1977,7 +1977,7 @@ impl<T: Config> Pallet<T> {
let expected_at = expected_at.saturated_into();
let log = ConsensusLog::ParaScheduleUpgradeCode(id, *code_hash, expected_at);
frame_system::Pallet::<T>::deposit_log(log.into());
pezframe_system::Pallet::<T>::deposit_log(log.into());
weight
}
@@ -2078,7 +2078,7 @@ impl<T: Config> Pallet<T> {
//
// This is only an intermediate solution and should be fixed in foreseeable future.
//
// [soaking issue]: https://github.com/paritytech/polkadot/issues/3918
// [soaking issue]: https://github.com/pezkuwichain/kurdistan-sdk/issues/146
let validation_code =
mem::replace(&mut genesis_data.validation_code, ValidationCode(Vec::new()));
UpcomingParasGenesis::<T>::insert(&id, genesis_data);
@@ -2307,13 +2307,13 @@ impl<T: Config> Pallet<T> {
// The code is known and there is no active PVF vote for it meaning it is
// already checked -- fast track the PVF checking into the accepted state.
weight += T::DbWeight::get().reads(1);
let now = frame_system::Pallet::<T>::block_number();
let now = pezframe_system::Pallet::<T>::block_number();
weight += Self::enact_pvf_accepted(now, &code_hash, &[cause], 0, cfg);
} else {
// PVF is not being pre-checked and it is not known. Start a new pre-checking
// process.
weight += T::DbWeight::get().reads_writes(3, 2);
let now = frame_system::Pallet::<T>::block_number();
let now = pezframe_system::Pallet::<T>::block_number();
let n_validators = shared::ActiveValidatorKeys::<T>::get().len();
PvfActiveVoteMap::<T>::insert(
&code_hash,
@@ -2401,10 +2401,10 @@ impl<T: Config> Pallet<T> {
CurrentCodeHash::<T>::insert(&id, &new_code_hash);
let log = ConsensusLog::ParaUpgradeCode(id, new_code_hash);
<frame_system::Pallet<T>>::deposit_log(log.into());
<pezframe_system::Pallet<T>>::deposit_log(log.into());
// `now` is only used for registering pruning as part of `fn note_past_code`
let now = <frame_system::Pallet<T>>::block_number();
let now = <pezframe_system::Pallet<T>>::block_number();
let weight = if let Some(prior_code_hash) = maybe_prior_code_hash {
Self::note_past_code(id, at, now, prior_code_hash)
@@ -2420,7 +2420,7 @@ impl<T: Config> Pallet<T> {
fn do_force_set_current_code_update(para: ParaId, new_code: ValidationCode) {
let new_code_hash = new_code.hash();
Self::increase_code_ref(&new_code_hash, &new_code);
Self::set_current_code(para, new_code_hash, frame_system::Pallet::<T>::block_number());
Self::set_current_code(para, new_code_hash, pezframe_system::Pallet::<T>::block_number());
Self::deposit_event(Event::CurrentCodeUpdated(para));
}
@@ -2440,7 +2440,7 @@ impl<T: Config> Pallet<T> {
stmt: PvfCheckStatement,
signature: ValidatorSignature,
) {
use frame_system::offchain::SubmitTransaction;
use pezframe_system::offchain::SubmitTransaction;
let xt = T::create_bare(Call::include_pvf_check_statement { stmt, signature }.into());
if let Err(e) = SubmitTransaction::<T, Call<T>>::submit_transaction(xt) {
@@ -2601,7 +2601,7 @@ impl<T: Config> Pallet<T> {
para: &ParaId,
) -> Result<AuthorizedCodeHashAndExpiry<BlockNumberFor<T>>, Error<T>> {
let authorized = AuthorizedCodeHash::<T>::get(para).ok_or(Error::<T>::NothingAuthorized)?;
let now = frame_system::Pallet::<T>::block_number();
let now = pezframe_system::Pallet::<T>::block_number();
ensure!(authorized.expire_at > now, Error::<T>::InvalidBlockNumber);
ensure!(authorized.code_hash == code.hash(), Error::<T>::Unauthorized);
Ok(authorized)
+22 -22
View File
@@ -15,15 +15,15 @@
// along with Pezkuwi. If not, see <http://www.gnu.org/licenses/>.
use super::*;
use frame_support::{
use pezframe_support::{
assert_err, assert_noop, assert_ok, assert_storage_noop, traits::UnfilteredDispatchable,
};
use pezkuwi_primitives::{BlockNumber, SchedulerParams, TEYRCHAIN_KEY_TYPE_ID};
use pezkuwi_primitives_test_helpers::{dummy_head_data, dummy_validation_code, validator_pubkeys};
use sc_keystore::LocalKeystore;
use sp_keyring::Sr25519Keyring;
use sp_keystore::{Keystore, KeystorePtr};
use sp_runtime::TokenError;
use pezsc_keystore::LocalKeystore;
use pezsp_keyring::Sr25519Keyring;
use pezsp_keystore::{Keystore, KeystorePtr};
use pezsp_runtime::TokenError;
use std::sync::Arc;
use crate::{
@@ -140,8 +140,8 @@ fn check_code_is_not_stored(validation_code: &ValidationCode) {
/// An utility for checking that certain events were deposited.
struct EventValidator {
events: Vec<
frame_system::EventRecord<
<Test as frame_system::Config>::RuntimeEvent,
pezframe_system::EventRecord<
<Test as pezframe_system::Config>::RuntimeEvent,
pezkuwi_primitives::Hash,
>,
>,
@@ -153,8 +153,8 @@ impl EventValidator {
}
fn started(&mut self, code: &ValidationCode, id: ParaId) -> &mut Self {
self.events.push(frame_system::EventRecord {
phase: frame_system::Phase::Initialization,
self.events.push(pezframe_system::EventRecord {
phase: pezframe_system::Phase::Initialization,
event: Event::PvfCheckStarted(code.hash(), id).into(),
topics: vec![],
});
@@ -162,8 +162,8 @@ impl EventValidator {
}
fn rejected(&mut self, code: &ValidationCode, id: ParaId) -> &mut Self {
self.events.push(frame_system::EventRecord {
phase: frame_system::Phase::Initialization,
self.events.push(pezframe_system::EventRecord {
phase: pezframe_system::Phase::Initialization,
event: Event::PvfCheckRejected(code.hash(), id).into(),
topics: vec![],
});
@@ -171,8 +171,8 @@ impl EventValidator {
}
fn accepted(&mut self, code: &ValidationCode, id: ParaId) -> &mut Self {
self.events.push(frame_system::EventRecord {
phase: frame_system::Phase::Initialization,
self.events.push(pezframe_system::EventRecord {
phase: pezframe_system::Phase::Initialization,
event: Event::PvfCheckAccepted(code.hash(), id).into(),
topics: vec![],
});
@@ -180,7 +180,7 @@ impl EventValidator {
}
fn check(&self) {
assert_eq!(&frame_system::Pallet::<Test>::events(), &self.events);
assert_eq!(&pezframe_system::Pallet::<Test>::events(), &self.events);
}
}
@@ -943,7 +943,7 @@ fn full_teyrchain_cleanup_storage() {
// For that run to block #7 and submit a new head.
assert_eq!(expected_at, 7);
run_to_block(7, None);
assert_eq!(frame_system::Pallet::<Test>::block_number(), 7);
assert_eq!(pezframe_system::Pallet::<Test>::block_number(), 7);
Paras::note_new_head(para_id, Default::default(), expected_at);
AuthorizedCodeHash::<Test>::insert(
&para_id,
@@ -1829,10 +1829,10 @@ fn verify_upgrade_go_ahead_signal_is_externally_accessible() {
let a = ParaId::from(2020);
new_test_ext(Default::default()).execute_with(|| {
assert!(sp_io::storage::get(&well_known_keys::upgrade_go_ahead_signal(a)).is_none());
assert!(pezsp_io::storage::get(&well_known_keys::upgrade_go_ahead_signal(a)).is_none());
UpgradeGoAheadSignal::<Test>::insert(&a, UpgradeGoAhead::GoAhead);
assert_eq!(
sp_io::storage::get(&well_known_keys::upgrade_go_ahead_signal(a)).unwrap(),
pezsp_io::storage::get(&well_known_keys::upgrade_go_ahead_signal(a)).unwrap(),
vec![1u8],
);
});
@@ -1845,10 +1845,10 @@ fn verify_upgrade_restriction_signal_is_externally_accessible() {
let a = ParaId::from(2020);
new_test_ext(Default::default()).execute_with(|| {
assert!(sp_io::storage::get(&well_known_keys::upgrade_restriction_signal(a)).is_none());
assert!(pezsp_io::storage::get(&well_known_keys::upgrade_restriction_signal(a)).is_none());
UpgradeRestrictionSignal::<Test>::insert(&a, UpgradeRestriction::Present);
assert_eq!(
sp_io::storage::get(&well_known_keys::upgrade_restriction_signal(a)).unwrap(),
pezsp_io::storage::get(&well_known_keys::upgrade_restriction_signal(a)).unwrap(),
vec![0],
);
});
@@ -1863,7 +1863,7 @@ fn verify_para_head_is_externally_accessible() {
new_test_ext(Default::default()).execute_with(|| {
Heads::<Test>::insert(&a, expected_head_data.clone());
let encoded = sp_io::storage::get(&well_known_keys::para_head(a)).unwrap();
let encoded = pezsp_io::storage::get(&well_known_keys::para_head(a)).unwrap();
let head_data = HeadData::decode(&mut encoded.as_ref());
assert_eq!(head_data, Ok(expected_head_data));
});
@@ -2308,7 +2308,7 @@ fn apply_authorized_force_set_current_code_works() {
);
// cannot apply obsolete authorization
frame_system::Pallet::<Test>::set_block_number(valid_period + 5 + 10);
pezframe_system::Pallet::<Test>::set_block_number(valid_period + 5 + 10);
assert_eq!(
apply_code(RuntimeOrigin::signed(1), para_a, code_1.clone(),),
(
@@ -2316,7 +2316,7 @@ fn apply_authorized_force_set_current_code_works() {
Err(Error::<Test>::InvalidBlockNumber.into())
),
);
frame_system::Pallet::<Test>::set_block_number(5);
pezframe_system::Pallet::<Test>::set_block_number(5);
// ok - can apply authorized code
let (validate_unsigned, dispatch_result) =