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 286de54384
commit 1c0e57d984
9084 changed files with 997839 additions and 997557 deletions
@@ -0,0 +1,94 @@
// This file is part of Bizinikiwi.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Benchmarks for Verify Signature Pallet
#![cfg(feature = "runtime-benchmarks")]
extern crate alloc;
use super::*;
#[allow(unused)]
use crate::{extension::VerifySignature, Config, Pallet as VerifySignaturePallet};
use alloc::vec;
use pezframe_benchmarking::{v2::*, BenchmarkError};
use pezframe_support::{
dispatch::{DispatchInfo, GetDispatchInfo},
pezpallet_prelude::TransactionSource,
};
use pezframe_system::{Call as SystemCall, RawOrigin};
use pezsp_io::{
crypto::{sr25519_generate, sr25519_sign},
hashing::blake2_256,
};
use pezsp_runtime::{
generic::ExtensionVersion,
traits::{AsTransactionAuthorizedOrigin, DispatchTransaction, Dispatchable, IdentifyAccount},
AccountId32, MultiSignature, MultiSigner,
};
pub trait BenchmarkHelper<Signature, Signer> {
fn create_signature(entropy: &[u8], msg: &[u8]) -> (Signature, Signer);
}
impl BenchmarkHelper<MultiSignature, AccountId32> for () {
fn create_signature(_entropy: &[u8], msg: &[u8]) -> (MultiSignature, AccountId32) {
let public = sr25519_generate(0.into(), None);
let who_account: AccountId32 = MultiSigner::Sr25519(public).into_account().into();
let signature = MultiSignature::Sr25519(sr25519_sign(0.into(), &public, msg).unwrap());
(signature, who_account)
}
}
#[benchmarks(where
T: Config + Send + Sync,
T::RuntimeCall: Dispatchable<Info = DispatchInfo> + GetDispatchInfo,
T::RuntimeOrigin: AsTransactionAuthorizedOrigin,
)]
mod benchmarks {
use super::*;
#[benchmark]
fn verify_signature() -> Result<(), BenchmarkError> {
let entropy = [42u8; 256];
let call: T::RuntimeCall = SystemCall::remark { remark: vec![] }.into();
let ext_version: ExtensionVersion = 0;
let info = call.get_dispatch_info();
let msg = (ext_version, &call).using_encoded(blake2_256).to_vec();
let (signature, signer) = T::BenchmarkHelper::create_signature(&entropy, &msg[..]);
let ext = VerifySignature::<T>::new_with_signature(signature, signer);
#[block]
{
assert!(ext
.validate_only(
RawOrigin::None.into(),
&call,
&info,
0,
TransactionSource::External,
ext_version
)
.is_ok());
}
Ok(())
}
impl_benchmark_test_suite!(Pallet, crate::tests::new_test_ext(), crate::tests::Test);
}
@@ -0,0 +1,158 @@
// This file is part of Bizinikiwi.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Transaction extension which validates a signature against a payload constructed from a call and
//! the rest of the transaction extension pipeline.
use crate::{Config, WeightInfo};
use codec::{Decode, DecodeWithMemTracking, Encode};
use pezframe_support::{pezpallet_prelude::TransactionSource, traits::OriginTrait};
use scale_info::TypeInfo;
use pezsp_io::hashing::blake2_256;
use pezsp_runtime::{
impl_tx_ext_default,
traits::{
transaction_extension::TransactionExtension, AsTransactionAuthorizedOrigin, DispatchInfoOf,
Dispatchable, Verify,
},
transaction_validity::{InvalidTransaction, TransactionValidityError, ValidTransaction},
};
use pezsp_weights::Weight;
/// Extension that, if enabled, validates a signature type against the payload constructed from the
/// call and the rest of the transaction extension pipeline. This extension provides the
/// functionality that traditionally signed transactions had with the implicit signature checking
/// implemented in [`Checkable`](pezsp_runtime::traits::Checkable). It is meant to be placed ahead of
/// any other extensions that do authorization work in the [`TransactionExtension`] pipeline.
#[derive(Encode, Decode, DecodeWithMemTracking, Clone, Eq, PartialEq, TypeInfo)]
#[scale_info(skip_type_params(T))]
pub enum VerifySignature<T>
where
T: Config + Send + Sync,
{
/// The extension will verify the signature and, if successful, authorize a traditionally
/// signed transaction.
Signed {
/// The signature provided by the transaction submitter.
signature: T::Signature,
/// The account that signed the payload.
account: T::AccountId,
},
/// The extension is disabled and will be passthrough.
Disabled,
}
impl<T> core::fmt::Debug for VerifySignature<T>
where
T: Config + Send + Sync,
{
#[cfg(feature = "std")]
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
write!(f, "VerifySignature")
}
#[cfg(not(feature = "std"))]
fn fmt(&self, _: &mut core::fmt::Formatter) -> core::fmt::Result {
Ok(())
}
}
impl<T> VerifySignature<T>
where
T: Config + Send + Sync,
{
/// Create a new extension instance that will validate the provided signature.
pub fn new_with_signature(signature: T::Signature, account: T::AccountId) -> Self {
Self::Signed { signature, account }
}
/// Create a new passthrough extension instance.
pub fn new_disabled() -> Self {
Self::Disabled
}
}
impl<T> TransactionExtension<T::RuntimeCall> for VerifySignature<T>
where
T: Config + Send + Sync,
<T::RuntimeCall as Dispatchable>::RuntimeOrigin: AsTransactionAuthorizedOrigin,
{
const IDENTIFIER: &'static str = "VerifyMultiSignature";
type Implicit = ();
type Val = ();
type Pre = ();
fn weight(&self, _call: &T::RuntimeCall) -> Weight {
match &self {
// The benchmarked weight of the payload construction and signature checking.
Self::Signed { .. } => T::WeightInfo::verify_signature(),
// When the extension is passthrough, it consumes no weight.
Self::Disabled => Weight::zero(),
}
}
fn validate(
&self,
mut origin: <T::RuntimeCall as Dispatchable>::RuntimeOrigin,
_call: &T::RuntimeCall,
_info: &DispatchInfoOf<T::RuntimeCall>,
_len: usize,
_: (),
inherited_implication: &impl Encode,
_source: TransactionSource,
) -> Result<
(ValidTransaction, Self::Val, <T::RuntimeCall as Dispatchable>::RuntimeOrigin),
TransactionValidityError,
> {
// If the extension is disabled, return early.
let (signature, account) = match &self {
Self::Signed { signature, account } => (signature, account),
Self::Disabled => return Ok((Default::default(), (), origin)),
};
// This extension must receive an unauthorized origin as it is meant to headline the
// authorization extension pipeline. Any extensions that precede this one must not authorize
// any origin and serve some other functional purpose.
if origin.is_transaction_authorized() {
return Err(InvalidTransaction::BadSigner.into());
}
// Construct the payload that the signature will be validated against. The inherited
// implication contains the encoded bytes of the call and all of the extension data of the
// extensions that follow in the `TransactionExtension` pipeline.
//
// In other words:
// - extensions that precede this extension are ignored in terms of signature validation;
// - extensions that follow this extension are included in the payload to be signed (as if
// they were the entire `SignedExtension` pipeline in the traditional signed transaction
// model).
//
// The encoded bytes of the payload are then hashed using `blake2_256`.
let msg = inherited_implication.using_encoded(blake2_256);
// The extension was enabled, so the signature must match.
if !signature.verify(&msg[..], account) {
Err(InvalidTransaction::BadProof)?
}
// Return the signer as the transaction origin.
origin.set_caller_from_signed(account.clone());
Ok((ValidTransaction::default(), (), origin))
}
impl_tx_ext_default!(T::RuntimeCall; prepare);
}
@@ -0,0 +1,68 @@
// This file is part of Bizinikiwi.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Transaction extension which validates a signature against a payload constructed from a call and
//! the rest of the transaction extension pipeline.
// Ensure we're `no_std` when compiling for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
pub mod extension;
#[cfg(test)]
mod tests;
pub mod weights;
extern crate alloc;
#[cfg(feature = "runtime-benchmarks")]
pub use benchmarking::BenchmarkHelper;
use codec::{Decode, Encode};
pub use extension::VerifySignature;
use pezframe_support::Parameter;
pub use weights::WeightInfo;
pub use pallet::*;
#[pezframe_support::pallet]
pub mod pallet {
use super::*;
use pezsp_runtime::traits::{IdentifyAccount, Verify};
#[pallet::pallet]
pub struct Pallet<T>(_);
/// Configuration trait.
#[pallet::config]
pub trait Config: pezframe_system::Config {
/// Signature type that the extension of this pallet can verify.
type Signature: Verify<Signer = Self::AccountIdentifier>
+ Parameter
+ Encode
+ Decode
+ Send
+ Sync;
/// The account identifier used by this pallet's signature type.
type AccountIdentifier: IdentifyAccount<AccountId = Self::AccountId>;
/// Weight information for extrinsics in this pallet.
type WeightInfo: WeightInfo;
/// Helper to create a signature to be benchmarked.
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper: BenchmarkHelper<Self::Signature, Self::AccountId>;
}
}
@@ -0,0 +1,150 @@
// This file is part of Bizinikiwi.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Tests for Utility Pallet
#![cfg(test)]
use super::*;
use extension::VerifySignature;
use pezframe_support::{
derive_impl,
dispatch::GetDispatchInfo,
pezpallet_prelude::{InvalidTransaction, TransactionSource, TransactionValidityError},
traits::OriginTrait,
};
use pezframe_system::Call as SystemCall;
use pezsp_io::hashing::blake2_256;
use pezsp_runtime::{
generic::ExtensionVersion,
testing::{TestSignature, UintAuthorityId},
traits::DispatchTransaction,
};
type Block = pezframe_system::mocking::MockBlock<Test>;
pezframe_support::construct_runtime!(
pub enum Test
{
System: pezframe_system,
VerifySignaturePallet: crate,
}
);
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Test {
type Block = Block;
}
#[cfg(feature = "runtime-benchmarks")]
pub struct BenchmarkHelper;
#[cfg(feature = "runtime-benchmarks")]
impl crate::BenchmarkHelper<TestSignature, u64> for BenchmarkHelper {
fn create_signature(_entropy: &[u8], msg: &[u8]) -> (TestSignature, u64) {
(TestSignature(0, msg.to_vec()), 0)
}
}
impl crate::Config for Test {
type Signature = TestSignature;
type AccountIdentifier = UintAuthorityId;
type WeightInfo = ();
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = BenchmarkHelper;
}
#[cfg(feature = "runtime-benchmarks")]
pub fn new_test_ext() -> pezsp_io::TestExternalities {
use pezsp_runtime::BuildStorage;
let t = pezframe_system::GenesisConfig::<Test>::default().build_storage().unwrap();
let mut ext = pezsp_io::TestExternalities::new(t);
ext.execute_with(|| System::set_block_number(1));
ext
}
#[test]
fn verification_works() {
let who = 0;
let call: RuntimeCall = SystemCall::remark { remark: vec![] }.into();
let ext_version: ExtensionVersion = 0;
let sig = TestSignature(0, (ext_version, &call).using_encoded(blake2_256).to_vec());
let info = call.get_dispatch_info();
let (_, _, origin) = VerifySignature::<Test>::new_with_signature(sig, who)
.validate_only(None.into(), &call, &info, 0, TransactionSource::External, 0)
.unwrap();
assert_eq!(origin.as_signer().unwrap(), &who)
}
#[test]
fn bad_inherited_implication() {
let who = 0;
let call: RuntimeCall = SystemCall::remark { remark: vec![] }.into();
// Inherited implication should include extension version byte.
let sig = TestSignature(0, call.using_encoded(blake2_256).to_vec());
let info = call.get_dispatch_info();
assert_eq!(
VerifySignature::<Test>::new_with_signature(sig, who)
.validate_only(None.into(), &call, &info, 0, TransactionSource::External, 0)
.unwrap_err(),
TransactionValidityError::Invalid(InvalidTransaction::BadProof)
);
}
#[test]
fn bad_signature() {
let who = 0;
let call: RuntimeCall = SystemCall::remark { remark: vec![] }.into();
let sig = TestSignature(0, b"bogus message".to_vec());
let info = call.get_dispatch_info();
assert_eq!(
VerifySignature::<Test>::new_with_signature(sig, who)
.validate_only(None.into(), &call, &info, 0, TransactionSource::External, 0)
.unwrap_err(),
TransactionValidityError::Invalid(InvalidTransaction::BadProof)
);
}
#[test]
fn bad_starting_origin() {
let who = 0;
let call: RuntimeCall = SystemCall::remark { remark: vec![] }.into();
let sig = TestSignature(0, b"bogus message".to_vec());
let info = call.get_dispatch_info();
assert_eq!(
VerifySignature::<Test>::new_with_signature(sig, who)
.validate_only(Some(42).into(), &call, &info, 0, TransactionSource::External, 0)
.unwrap_err(),
TransactionValidityError::Invalid(InvalidTransaction::BadSigner)
);
}
#[test]
fn disabled_extension_works() {
let who = 42;
let call: RuntimeCall = SystemCall::remark { remark: vec![] }.into();
let info = call.get_dispatch_info();
let (_, _, origin) = VerifySignature::<Test>::new_disabled()
.validate_only(Some(who).into(), &call, &info, 0, TransactionSource::External, 0)
.unwrap();
assert_eq!(origin.as_signer().unwrap(), &who)
}
@@ -0,0 +1,99 @@
// This file is part of Bizinikiwi.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This file is part of Bizinikiwi.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Autogenerated weights for `pezpallet_verify_signature`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 32.0.0
//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `4563561839a5`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
// Executed Command:
// frame-omni-bencher
// v1
// benchmark
// pallet
// --extrinsic=*
// --runtime=target/production/wbuild/kitchensink-runtime/kitchensink_runtime.wasm
// --pallet=pezpallet_verify_signature
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/verify-signature/src/weights.rs
// --wasm-execution=compiled
// --steps=50
// --repeat=20
// --heap-pages=4096
// --template=bizinikiwi/.maintain/frame-weight-template.hbs
// --no-storage-info
// --no-min-squares
// --no-median-slopes
// --genesis-builder-policy=none
// --exclude-pallets=pezpallet_xcm,pezpallet_xcm_benchmarks::fungible,pezpallet_xcm_benchmarks::generic,pezpallet_nomination_pools,pezpallet_remark,pezpallet_transaction_storage,pezpallet_election_provider_multi_block,pezpallet_election_provider_multi_block::signed,pezpallet_election_provider_multi_block::unsigned,pezpallet_election_provider_multi_block::verifier
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
#![allow(dead_code)]
use pezframe_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use core::marker::PhantomData;
/// Weight functions needed for `pezpallet_verify_signature`.
pub trait WeightInfo {
fn verify_signature() -> Weight;
}
/// Weights for `pezpallet_verify_signature` using the Bizinikiwi node and recommended hardware.
pub struct BizinikiwiWeight<T>(PhantomData<T>);
impl<T: pezframe_system::Config> WeightInfo for BizinikiwiWeight<T> {
fn verify_signature() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 41_977_000 picoseconds.
Weight::from_parts(42_814_000, 0)
}
}
// For backwards compatibility and tests.
impl WeightInfo for () {
fn verify_signature() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 41_977_000 picoseconds.
Weight::from_parts(42_814_000, 0)
}
}