Refactoring Checkpoint: (WIP)

This commit is contained in:
2025-12-14 10:29:31 +03:00
parent 09735eb97a
commit c89d7cac55
1424 changed files with 6415 additions and 6064 deletions
+2 -2
View File
@@ -24,8 +24,8 @@ use crate::service::{create_extrinsic, FullClient};
use pezkuwi_sdk::*;
use kitchensink_runtime::{BalancesCall, SystemCall};
use node_primitives::{AccountId, Balance};
use pez_kitchensink_runtime::{BalancesCall, SystemCall};
use pez_node_primitives::{AccountId, Balance};
use pezsc_cli::Result;
use pezsp_inherents::{InherentData, InherentDataProvider};
use pezsp_keyring::Sr25519Keyring;
+8 -8
View File
@@ -21,7 +21,7 @@
use pezkuwi_sdk::*;
use crate::chain_spec::pezsc_service::Properties;
use kitchensink_runtime::{
use pez_kitchensink_runtime::{
genesis_config_presets::{Staker, ENDOWMENT, STASH},
wasm_binary_unwrap, Block, MaxNominations, StakerStatus,
};
@@ -38,8 +38,8 @@ use pezsp_consensus_grandpa::AuthorityId as GrandpaId;
use pezsp_core::crypto::UncheckedInto;
use pezsp_mixnet::types::AuthorityId as MixnetId;
pub use kitchensink_runtime::RuntimeGenesisConfig;
pub use node_primitives::{AccountId, Balance, Signature};
pub use pez_kitchensink_runtime::RuntimeGenesisConfig;
pub use pez_node_primitives::{AccountId, Balance, Signature};
const STAGING_TELEMETRY_URL: &str = "wss://telemetry.pezkuwichain.io/submit/";
@@ -82,15 +82,15 @@ fn configure_accounts_for_staging_testnet() -> (
#[rustfmt::skip]
// stash, controller, session-key, beefy id
// generated with secret:
// for i in 1 2 3 4 ; do for j in stash controller; do subkey inspect "$secret"/fir/$j/$i; done; done
// for i in 1 2 3 4 ; do for j in stash controller; do pez_subkey inspect "$secret"/fir/$j/$i; done; done
//
// and
//
// for i in 1 2 3 4 ; do for j in session; do subkey inspect --scheme ed25519 "$secret"//fir//$j//$i; done; done
// for i in 1 2 3 4 ; do for j in session; do pez_subkey inspect --scheme ed25519 "$secret"//fir//$j//$i; done; done
//
// and
//
// for i in 1 2 3 4 ; do for j in session; do subkey inspect --scheme ecdsa "$secret"//fir//$j//$i; done; done
// for i in 1 2 3 4 ; do for j in session; do pez_subkey inspect --scheme ecdsa "$secret"//fir//$j//$i; done; done
let initial_authorities: Vec<(
AccountId,
@@ -200,7 +200,7 @@ fn configure_accounts_for_staging_testnet() -> (
),
];
// generated with secret: subkey inspect "$secret"/fir
// generated with secret: pez_subkey inspect "$secret"/fir
let root_key: AccountId = array_bytes::hex_n_into_unchecked(
// 5Ff3iXP75ruzroPWRP2FYBHWnmGGBSb63857BgnzCoXNxfPo
"9ee5e5bdc0ec239eb164f865ecc345ce4c88e76ee002e0f7e318097347471809",
@@ -430,7 +430,7 @@ pub fn local_testnet_config() -> ChainSpec {
pub(crate) mod tests {
use super::*;
use crate::service::{new_full_base, NewFullBase};
use kitchensink_runtime::genesis_config_presets::well_known_including_eth_accounts;
use pez_kitchensink_runtime::genesis_config_presets::well_known_including_eth_accounts;
use pezsc_service_test;
use pezsp_runtime::{AccountId32, BuildStorage};
+2 -2
View File
@@ -25,8 +25,8 @@ use crate::{
Cli, Subcommand,
};
use pezframe_benchmarking_cli::*;
use kitchensink_runtime::{ExistentialDeposit, RuntimeApi};
use node_primitives::Block;
use pez_kitchensink_runtime::{ExistentialDeposit, RuntimeApi};
use pez_node_primitives::Block;
use pezsc_cli::{Result, BizinikiwiCli};
use pezsc_service::PartialComponents;
use pezsp_keyring::Sr25519Keyring;
+32 -32
View File
@@ -31,8 +31,8 @@ use codec::Encode;
use pezframe_benchmarking_cli::BIZINIKIWI_REFERENCE_HARDWARE;
use pezframe_system_rpc_runtime_api::AccountNonceApi;
use futures::prelude::*;
use kitchensink_runtime::RuntimeApi;
use node_primitives::Block;
use pez_kitchensink_runtime::RuntimeApi;
use pez_node_primitives::Block;
use pezsc_client_api::{Backend, BlockBackend};
use pezsc_consensus_babe::{self, SlotProportion};
use pezsc_network::{
@@ -107,51 +107,51 @@ pub fn fetch_nonce(client: &FullClient, account: pezsp_core::sr25519::Pair) -> u
pub fn create_extrinsic(
client: &FullClient,
sender: pezsp_core::sr25519::Pair,
function: impl Into<kitchensink_runtime::RuntimeCall>,
function: impl Into<pez_kitchensink_runtime::RuntimeCall>,
nonce: Option<u32>,
) -> kitchensink_runtime::UncheckedExtrinsic {
) -> pez_kitchensink_runtime::UncheckedExtrinsic {
let function = function.into();
let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed");
let best_hash = client.chain_info().best_hash;
let best_block = client.chain_info().best_number;
let nonce = nonce.unwrap_or_else(|| fetch_nonce(client, sender.clone()));
let period = kitchensink_runtime::BlockHashCount::get()
let period = pez_kitchensink_runtime::BlockHashCount::get()
.checked_next_power_of_two()
.map(|c| c / 2)
.unwrap_or(2) as u64;
let tip = 0;
let tx_ext: kitchensink_runtime::TxExtension =
let tx_ext: pez_kitchensink_runtime::TxExtension =
(
pezframe_system::AuthorizeCall::<kitchensink_runtime::Runtime>::new(),
pezframe_system::CheckNonZeroSender::<kitchensink_runtime::Runtime>::new(),
pezframe_system::CheckSpecVersion::<kitchensink_runtime::Runtime>::new(),
pezframe_system::CheckTxVersion::<kitchensink_runtime::Runtime>::new(),
pezframe_system::CheckGenesis::<kitchensink_runtime::Runtime>::new(),
pezframe_system::CheckEra::<kitchensink_runtime::Runtime>::from(generic::Era::mortal(
pezframe_system::AuthorizeCall::<pez_kitchensink_runtime::Runtime>::new(),
pezframe_system::CheckNonZeroSender::<pez_kitchensink_runtime::Runtime>::new(),
pezframe_system::CheckSpecVersion::<pez_kitchensink_runtime::Runtime>::new(),
pezframe_system::CheckTxVersion::<pez_kitchensink_runtime::Runtime>::new(),
pezframe_system::CheckGenesis::<pez_kitchensink_runtime::Runtime>::new(),
pezframe_system::CheckEra::<pez_kitchensink_runtime::Runtime>::from(generic::Era::mortal(
period,
best_block.saturated_into(),
)),
pezframe_system::CheckNonce::<kitchensink_runtime::Runtime>::from(nonce),
pezframe_system::CheckWeight::<kitchensink_runtime::Runtime>::new(),
pezframe_system::CheckNonce::<pez_kitchensink_runtime::Runtime>::from(nonce),
pezframe_system::CheckWeight::<pez_kitchensink_runtime::Runtime>::new(),
pezpallet_skip_feeless_payment::SkipCheckIfFeeless::from(
pezpallet_asset_conversion_tx_payment::ChargeAssetTxPayment::<
kitchensink_runtime::Runtime,
pez_kitchensink_runtime::Runtime,
>::from(tip, None),
),
pezframe_metadata_hash_extension::CheckMetadataHash::new(false),
pezpallet_revive::evm::tx_extension::SetOrigin::<kitchensink_runtime::Runtime>::default(),
pezframe_system::WeightReclaim::<kitchensink_runtime::Runtime>::new(),
pezpallet_revive::evm::tx_extension::SetOrigin::<pez_kitchensink_runtime::Runtime>::default(),
pezframe_system::WeightReclaim::<pez_kitchensink_runtime::Runtime>::new(),
);
let raw_payload = kitchensink_runtime::SignedPayload::from_raw(
let raw_payload = pez_kitchensink_runtime::SignedPayload::from_raw(
function.clone(),
tx_ext.clone(),
(
(),
(),
kitchensink_runtime::VERSION.spec_version,
kitchensink_runtime::VERSION.transaction_version,
pez_kitchensink_runtime::VERSION.spec_version,
pez_kitchensink_runtime::VERSION.transaction_version,
genesis_hash,
best_hash,
(),
@@ -167,7 +167,7 @@ pub fn create_extrinsic(
generic::UncheckedExtrinsic::new_signed(
function,
pezsp_runtime::AccountId32::from(sender.public()).into(),
kitchensink_runtime::Signature::Sr25519(signature),
pez_kitchensink_runtime::Signature::Sr25519(signature),
tx_ext,
)
.into()
@@ -331,24 +331,24 @@ pub fn new_partial(
let rpc_backend = backend.clone();
let rpc_statement_store = statement_store.clone();
let rpc_extensions_builder =
move |subscription_executor: node_rpc::SubscriptionTaskExecutor| {
let deps = node_rpc::FullDeps {
move |subscription_executor: pez_node_rpc::SubscriptionTaskExecutor| {
let deps = pez_node_rpc::FullDeps {
client: client.clone(),
pool: pool.clone(),
select_chain: select_chain.clone(),
chain_spec: chain_spec.cloned_box(),
babe: node_rpc::BabeDeps {
babe: pez_node_rpc::BabeDeps {
keystore: keystore.clone(),
babe_worker_handle: babe_worker_handle.clone(),
},
grandpa: node_rpc::GrandpaDeps {
grandpa: pez_node_rpc::GrandpaDeps {
shared_voter_state: shared_voter_state.clone(),
shared_authority_set: shared_authority_set.clone(),
justification_stream: justification_stream.clone(),
subscription_executor: subscription_executor.clone(),
finality_provider: finality_proof_provider.clone(),
},
beefy: node_rpc::BeefyDeps::<beefy_primitives::ecdsa_crypto::AuthorityId> {
beefy: pez_node_rpc::BeefyDeps::<beefy_primitives::ecdsa_crypto::AuthorityId> {
beefy_finality_proof_stream: beefy_rpc_links
.from_voter_justif_stream
.clone(),
@@ -362,7 +362,7 @@ pub fn new_partial(
mixnet_api: mixnet_api.as_ref().cloned(),
};
node_rpc::create_full(deps).map_err(Into::into)
pez_node_rpc::create_full(deps).map_err(Into::into)
};
(rpc_extensions_builder, shared_voter_state2)
@@ -722,9 +722,9 @@ pub fn new_full_base<N: NetworkBackend<Block, <Block as BlockT>::Hash>>(
// When offchain indexing is enabled, MMR gadget should also run.
if is_offchain_indexing_enabled {
task_manager.spawn_essential_handle().spawn_blocking(
"mmr-gadget",
"pezmmr-gadget",
None,
mmr_gadget::MmrGadget::start(
pezmmr_gadget::MmrGadget::start(
client.clone(),
backend.clone(),
pezsp_mmr_primitives::INDEXING_PREFIX.to_vec(),
@@ -870,11 +870,11 @@ pub fn new_full(config: Configuration, cli: Cli) -> Result<TaskManager, ServiceE
mod tests {
use crate::service::{new_full_base, NewFullBase};
use codec::Encode;
use kitchensink_runtime::{
use pez_kitchensink_runtime::{
constants::{currency::CENTS, time::SLOT_DURATION},
Address, BalancesCall, RuntimeCall, TxExtension,
};
use node_primitives::{Block, DigestItem, Signature};
use pez_node_primitives::{Block, DigestItem, Signature};
use pezkuwi_sdk::{pezsc_transaction_pool_api::MaintainedTransactionPool, *};
use pezsc_client_api::BlockBackend;
use pezsc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy};
@@ -1118,7 +1118,7 @@ mod tests {
let signature = raw_payload.using_encoded(|payload| signer.sign(payload));
let (function, tx_ext, _) = raw_payload.deconstruct();
index += 1;
let utx: kitchensink_runtime::UncheckedExtrinsic =
let utx: pez_kitchensink_runtime::UncheckedExtrinsic =
generic::UncheckedExtrinsic::new_signed(
function,
from.into(),