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
+8 -8
View File
@@ -1,5 +1,5 @@
[package]
name = "node-bench"
name = "pez-node-bench"
version = "0.9.0-dev"
authors.workspace = true
description = "Bizinikiwi node integration benchmarks."
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage.workspace = true
repository.workspace = true
publish = false
documentation = "https://docs.rs/node-bench"
documentation = "https://docs.rs/pez-node-bench"
[lints]
workspace = true
@@ -23,12 +23,12 @@ derive_more = { features = ["display"], workspace = true }
fs_extra = { workspace = true }
futures = { features = ["thread-pool"], workspace = true }
hash-db = { workspace = true, default-features = true }
kitchensink-runtime = { workspace = true }
pez-kitchensink-runtime = { workspace = true }
kvdb = { workspace = true }
kvdb-rocksdb = { workspace = true }
log = { workspace = true, default-features = true }
node-primitives = { workspace = true, default-features = true }
node-testing = { workspace = true }
pez-node-primitives = { workspace = true, default-features = true }
pez-node-testing = { workspace = true }
parity-db = { workspace = true }
rand = { features = ["small_rng"], workspace = true, default-features = true }
pezsc-basic-authorship = { workspace = true, default-features = true }
@@ -49,9 +49,9 @@ tempfile = { workspace = true }
[features]
runtime-benchmarks = [
"kitchensink-runtime/runtime-benchmarks",
"node-primitives/runtime-benchmarks",
"node-testing/runtime-benchmarks",
"pez-kitchensink-runtime/runtime-benchmarks",
"pez-node-primitives/runtime-benchmarks",
"pez-node-testing/runtime-benchmarks",
"pezsc-basic-authorship/runtime-benchmarks",
"pezsc-client-api/runtime-benchmarks",
"pezsc-transaction-pool-api/runtime-benchmarks",
+7 -7
View File
@@ -27,8 +27,8 @@
use std::{borrow::Cow, collections::HashMap, pin::Pin, sync::Arc};
use async_trait::async_trait;
use node_primitives::Block;
use node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes};
use pez_node_primitives::Block;
use pez_node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes};
use pezsc_transaction_pool_api::{
ImportNotificationStream, PoolStatus, ReadyTransactions, TransactionFor, TransactionSource,
TransactionStatusStreamFor, TxHash, TxInvalidityReportMap,
@@ -167,18 +167,18 @@ impl core::Benchmark for ConstructionBenchmark {
#[derive(Clone, Debug)]
pub struct PoolTransaction {
data: Arc<OpaqueExtrinsic>,
hash: node_primitives::Hash,
hash: pez_node_primitives::Hash,
}
impl From<OpaqueExtrinsic> for PoolTransaction {
fn from(e: OpaqueExtrinsic) -> Self {
PoolTransaction { data: Arc::from(e), hash: node_primitives::Hash::zero() }
PoolTransaction { data: Arc::from(e), hash: pez_node_primitives::Hash::zero() }
}
}
impl pezsc_transaction_pool_api::InPoolTransaction for PoolTransaction {
type Transaction = Arc<OpaqueExtrinsic>;
type Hash = node_primitives::Hash;
type Hash = pez_node_primitives::Hash;
fn data(&self) -> &Self::Transaction {
&self.data
@@ -228,7 +228,7 @@ impl ReadyTransactions for TransactionsIterator {
#[async_trait]
impl pezsc_transaction_pool_api::TransactionPool for Transactions {
type Block = Block;
type Hash = node_primitives::Hash;
type Hash = pez_node_primitives::Hash;
type InPoolTransaction = PoolTransaction;
type Error = pezsc_transaction_pool_api::error::Error;
@@ -238,7 +238,7 @@ impl pezsc_transaction_pool_api::TransactionPool for Transactions {
_at: Self::Hash,
_source: TransactionSource,
_xts: Vec<TransactionFor<Self>>,
) -> Result<Vec<Result<node_primitives::Hash, Self::Error>>, Self::Error> {
) -> Result<Vec<Result<pez_node_primitives::Hash, Self::Error>>, Self::Error> {
unimplemented!()
}
+1 -1
View File
@@ -19,7 +19,7 @@
use std::{collections::HashMap, sync::Arc};
use kvdb::KeyValueDB;
use node_primitives::Hash;
use pez_node_primitives::Hash;
use pezsp_trie::{trie_types::TrieDBMutBuilderV1, TrieMut};
use crate::simple_trie::SimpleTrie;
+2 -2
View File
@@ -32,8 +32,8 @@
use std::borrow::Cow;
use node_primitives::Block;
use node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes};
use pez_node_primitives::Block;
use pez_node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes};
use pezsc_client_api::backend::Backend;
use crate::{
+2 -2
View File
@@ -30,7 +30,7 @@ mod txpool;
use clap::Parser;
use node_testing::bench::{BlockType, DatabaseType as BenchDataBaseType, KeyTypes};
use pez_node_testing::bench::{BlockType, DatabaseType as BenchDataBaseType, KeyTypes};
use crate::{
common::SizeType,
@@ -43,7 +43,7 @@ use crate::{
};
#[derive(Debug, Parser)]
#[command(name = "node-bench", about = "Node integration benchmarks")]
#[command(name = "pez-node-bench", about = "Node integration benchmarks")]
struct Opt {
/// Show list of all available benchmarks.
///
+1 -1
View File
@@ -20,7 +20,7 @@ use std::{collections::HashMap, sync::Arc};
use hash_db::{AsHashDB, HashDB, Hasher as _, Prefix};
use kvdb::KeyValueDB;
use node_primitives::Hash;
use pez_node_primitives::Hash;
use pezsp_trie::DBValue;
pub type Hasher = pezsp_core::Blake2Hasher;
+1 -1
View File
@@ -29,7 +29,7 @@ use std::{
sync::{Arc, LazyLock},
};
use node_primitives::Hash;
use pez_node_primitives::Hash;
use crate::{
core::{self, Mode, Path},
+1 -1
View File
@@ -23,7 +23,7 @@
use std::borrow::Cow;
use node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes};
use pez_node_testing::bench::{BenchDb, BlockType, DatabaseType, KeyTypes};
use pezsc_transaction_pool::BasicPool;
use pezsc_transaction_pool_api::{TransactionPool, TransactionSource};
+15 -15
View File
@@ -63,13 +63,13 @@ subxt-signer = { workspace = true, features = ["unstable-eth"] }
# The Pezkuwi-SDK:
pezkuwi-sdk = { features = [
"fork-tree",
"pez-fork-tree",
"pezframe-benchmarking-cli",
"frame-remote-externalities",
"pezframe-support-procedural-tools",
"generate-bags",
"mmr-gadget",
"mmr-rpc",
"pez-generate-bags",
"pezmmr-gadget",
"pezmmr-rpc",
"pezpallet-transaction-payment-rpc",
"pezsc-allocator",
"pezsc-authority-discovery",
@@ -135,7 +135,7 @@ pezkuwi-sdk = { features = [
"pezstaging-node-inspect",
"pezstaging-tracking-allocator",
"std",
"subkey",
"pez-subkey",
"bizinikiwi-build-script-utils",
"bizinikiwi-frame-rpc-support",
"bizinikiwi-frame-rpc-system",
@@ -143,14 +143,14 @@ pezkuwi-sdk = { features = [
"bizinikiwi-rpc-client",
"bizinikiwi-state-trie-migration-rpc",
"bizinikiwi-wasm-builder",
"tracing-gum",
"pez-tracing-gum",
], workspace = true, default-features = true }
# Shared code between the staging node and kitchensink runtime:
kitchensink-runtime = { workspace = true }
pez-kitchensink-runtime = { workspace = true }
node-inspect = { optional = true, workspace = true, default-features = true }
node-primitives = { workspace = true, default-features = true }
node-rpc = { workspace = true }
pez-node-primitives = { workspace = true, default-features = true }
pez-node-rpc = { workspace = true }
[dev-dependencies]
assert_cmd = { workspace = true }
@@ -176,7 +176,7 @@ tokio-util = { features = ["compat"], workspace = true }
wat = { workspace = true }
# These testing-only dependencies are not exported by the Pezkuwi-SDK crate:
node-testing = { workspace = true }
pez-node-testing = { workspace = true }
pezsc-service-test = { workspace = true }
bizinikiwi-cli-test-utils = { workspace = true }
@@ -197,18 +197,18 @@ pezkuwi-sdk = { features = [
default = ["cli"]
cli = ["clap", "clap_complete", "node-inspect", "pezkuwi-sdk"]
runtime-benchmarks = [
"kitchensink-runtime/runtime-benchmarks",
"pez-kitchensink-runtime/runtime-benchmarks",
"node-inspect?/runtime-benchmarks",
"node-primitives/runtime-benchmarks",
"node-rpc/runtime-benchmarks",
"node-testing/runtime-benchmarks",
"pez-node-primitives/runtime-benchmarks",
"pez-node-rpc/runtime-benchmarks",
"pez-node-testing/runtime-benchmarks",
"pezkuwi-sdk/runtime-benchmarks",
"pezsc-service-test/runtime-benchmarks",
"pezsp-keyring/runtime-benchmarks",
"bizinikiwi-cli-test-utils/runtime-benchmarks",
]
try-runtime = [
"kitchensink-runtime/try-runtime",
"pez-kitchensink-runtime/try-runtime",
"pezkuwi-sdk/try-runtime",
"bizinikiwi-cli-test-utils/try-runtime",
]
@@ -20,7 +20,7 @@ use pezkuwi_sdk::*;
use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput};
use kitchensink_runtime::{constants::currency::*, BalancesCall};
use pez_kitchensink_runtime::{constants::currency::*, BalancesCall};
use node_cli::service::{create_extrinsic, FullClient};
use pezkuwi_sdk::pezsc_service::config::{ExecutorConfiguration, RpcConfiguration};
use pezsc_block_builder::{BlockBuilderBuilder, BuiltBlock};
@@ -123,14 +123,14 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
}
fn extrinsic_set_time(now: u64) -> OpaqueExtrinsic {
let utx: kitchensink_runtime::UncheckedExtrinsic = generic::UncheckedExtrinsic::new_bare(
kitchensink_runtime::RuntimeCall::Timestamp(pezpallet_timestamp::Call::set { now }),
let utx: pez_kitchensink_runtime::UncheckedExtrinsic = generic::UncheckedExtrinsic::new_bare(
pez_kitchensink_runtime::RuntimeCall::Timestamp(pezpallet_timestamp::Call::set { now }),
)
.into();
utx.into()
}
fn import_block(client: &FullClient, built: BuiltBlock<node_primitives::Block>) {
fn import_block(client: &FullClient, built: BuiltBlock<pez_node_primitives::Block>) {
let mut params = BlockImportParams::new(BlockOrigin::File, built.block.header);
params.state_action =
StateAction::ApplyChanges(pezsc_consensus::StorageChanges::Changes(built.storage_changes));
+8 -8
View File
@@ -21,12 +21,12 @@ use pezkuwi_sdk::*;
use codec::{Decode, Encode};
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
use pezframe_support::Hashable;
use kitchensink_runtime::{
use pez_kitchensink_runtime::{
constants::currency::*, Block, BuildStorage, CheckedExtrinsic, Header, RuntimeCall,
RuntimeGenesisConfig, UncheckedExtrinsic,
};
use node_primitives::{BlockNumber, Hash};
use node_testing::keyring::*;
use pez_node_primitives::{BlockNumber, Hash};
use pez_node_testing::keyring::*;
use pezsc_executor::{Externalities, RuntimeVersionOf};
use pezsp_core::{
storage::well_known_keys,
@@ -41,7 +41,7 @@ criterion_main!(benches);
/// The wasm runtime code.
pub fn compact_code_unwrap() -> &'static [u8] {
kitchensink_runtime::WASM_BINARY.expect(
pez_kitchensink_runtime::WASM_BINARY.expect(
"Development wasm binary is not available. Testing is only supported with the flag \
disabled.",
)
@@ -49,16 +49,16 @@ pub fn compact_code_unwrap() -> &'static [u8] {
const GENESIS_HASH: [u8; 32] = [69u8; 32];
const TRANSACTION_VERSION: u32 = kitchensink_runtime::VERSION.transaction_version;
const TRANSACTION_VERSION: u32 = pez_kitchensink_runtime::VERSION.transaction_version;
const SPEC_VERSION: u32 = kitchensink_runtime::VERSION.spec_version;
const SPEC_VERSION: u32 = pez_kitchensink_runtime::VERSION.spec_version;
const HEAP_PAGES: u64 = 20;
type TestExternalities<H> = CoreTestExternalities<H>;
fn sign(xt: CheckedExtrinsic) -> UncheckedExtrinsic {
node_testing::keyring::sign(xt, SPEC_VERSION, TRANSACTION_VERSION, GENESIS_HASH, None)
pez_node_testing::keyring::sign(xt, SPEC_VERSION, TRANSACTION_VERSION, GENESIS_HASH, None)
}
fn new_test_ext(genesis_config: &RuntimeGenesisConfig) -> TestExternalities<BlakeTwo256> {
@@ -167,7 +167,7 @@ fn bench_execute_block(c: &mut Criterion) {
let mut group = c.benchmark_group("execute blocks");
group.bench_function("wasm", |b| {
let genesis_config = node_testing::genesis::config();
let genesis_config = pez_node_testing::genesis::config();
let executor = RuntimeExecutor::builder().build();
let runtime_code = RuntimeCode {
@@ -18,9 +18,9 @@
use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput};
use futures::{future, StreamExt};
use kitchensink_runtime::{constants::currency::*, BalancesCall, SudoCall};
use pez_kitchensink_runtime::{constants::currency::*, BalancesCall, SudoCall};
use node_cli::service::{create_extrinsic, fetch_nonce, FullClient, TransactionPool};
use node_primitives::AccountId;
use pez_node_primitives::AccountId;
use pezkuwi_sdk::{
pezsc_service::config::{ExecutorConfiguration, RpcConfiguration},
pezsc_transaction_pool_api::TransactionPool as _,
+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(),
+6 -6
View File
@@ -29,13 +29,13 @@ use pezsp_runtime::{
traits::Hash as HashT, transaction_validity::InvalidTransaction, ApplyExtrinsicResult,
};
use kitchensink_runtime::{
use pez_kitchensink_runtime::{
constants::{currency::*, time::SLOT_DURATION},
Balances, CheckedExtrinsic, Header, Runtime, RuntimeCall, RuntimeEvent, System,
TransactionPayment, Treasury, UncheckedExtrinsic,
};
use node_primitives::{Balance, Hash};
use node_testing::keyring::*;
use pez_node_primitives::{Balance, Hash};
use pez_node_testing::keyring::*;
use pretty_assertions::assert_eq;
use wat;
@@ -48,7 +48,7 @@ use self::common::{sign, *};
/// have to execute provided wasm code instead of the native equivalent. This trick is used to
/// test code paths that differ between native and wasm versions.
pub fn bloaty_code_unwrap() -> &'static [u8] {
kitchensink_runtime::WASM_BINARY_BLOATY.expect(
pez_kitchensink_runtime::WASM_BINARY_BLOATY.expect(
"Development wasm binary is not available. \
Testing is only supported with the flag disabled.",
)
@@ -857,14 +857,14 @@ fn successful_execution_gives_ok() {
#[test]
fn should_import_block_with_test_client() {
use node_testing::client::{
use pez_node_testing::client::{
pezsp_consensus::BlockOrigin, ClientBlockImportExt, TestClientBuilder, TestClientBuilderExt,
};
let client = TestClientBuilder::new().build();
let block1 = changes_trie_block();
let block_data = block1.0;
let block = node_primitives::Block::decode(&mut &block_data[..]).unwrap();
let block = pez_node_primitives::Block::decode(&mut &block_data[..]).unwrap();
futures::executor::block_on(client.import(BlockOrigin::Own, block)).unwrap();
}
+8 -8
View File
@@ -36,12 +36,12 @@ use pezsp_runtime::{
};
use pezsp_state_machine::TestExternalities as CoreTestExternalities;
use kitchensink_runtime::{
use pez_kitchensink_runtime::{
constants::currency::*, Block, BuildStorage, CheckedExtrinsic, Header, Runtime,
UncheckedExtrinsic,
};
use node_primitives::{BlockNumber, Hash};
use node_testing::keyring::*;
use pez_node_primitives::{BlockNumber, Hash};
use pez_node_testing::keyring::*;
use pezsp_externalities::Externalities;
use pezstaging_node_cli::service::RuntimeExecutor;
@@ -70,7 +70,7 @@ impl AppCrypto<MultiSigner, MultiSignature> for TestAuthorityId {
/// making the binary slimmer. There is a convention to use compact version of the runtime
/// as canonical.
pub fn compact_code_unwrap() -> &'static [u8] {
kitchensink_runtime::WASM_BINARY.expect(
pez_kitchensink_runtime::WASM_BINARY.expect(
"Development wasm binary is not available. Testing is only supported with the flag \
disabled.",
)
@@ -78,14 +78,14 @@ pub fn compact_code_unwrap() -> &'static [u8] {
pub const GENESIS_HASH: [u8; 32] = [69u8; 32];
pub const SPEC_VERSION: u32 = kitchensink_runtime::VERSION.spec_version;
pub const SPEC_VERSION: u32 = pez_kitchensink_runtime::VERSION.spec_version;
pub const TRANSACTION_VERSION: u32 = kitchensink_runtime::VERSION.transaction_version;
pub const TRANSACTION_VERSION: u32 = pez_kitchensink_runtime::VERSION.transaction_version;
pub type TestExternalities<H> = CoreTestExternalities<H>;
pub fn sign(xt: CheckedExtrinsic) -> UncheckedExtrinsic {
node_testing::keyring::sign(xt, SPEC_VERSION, TRANSACTION_VERSION, GENESIS_HASH, None)
pez_node_testing::keyring::sign(xt, SPEC_VERSION, TRANSACTION_VERSION, GENESIS_HASH, None)
}
pub fn default_transfer_call() -> pezpallet_balances::Call<Runtime> {
@@ -125,7 +125,7 @@ pub fn new_test_ext(code: &[u8]) -> TestExternalities<BlakeTwo256> {
pezsp_tracing::try_init_simple();
let ext = TestExternalities::new_with_code(
code,
node_testing::genesis::config().build_storage().unwrap(),
pez_node_testing::genesis::config().build_storage().unwrap(),
);
ext
}
+3 -3
View File
@@ -22,13 +22,13 @@ use pezframe_support::{
traits::Currency,
weights::{constants::ExtrinsicBaseWeight, IdentityFee, WeightToFee},
};
use kitchensink_runtime::{
use pez_kitchensink_runtime::{
constants::{currency::*, time::SLOT_DURATION},
Balances, CheckedExtrinsic, Multiplier, Runtime, RuntimeCall, TransactionByteFee,
TransactionPayment,
};
use node_primitives::Balance;
use node_testing::keyring::*;
use pez_node_primitives::Balance;
use pez_node_testing::keyring::*;
use pezkuwi_sdk::*;
use pezsp_runtime::{traits::One, Perbill};
@@ -18,7 +18,7 @@
use codec::Decode;
use pezframe_system::offchain::{SendSignedTransaction, Signer, SubmitTransaction};
use kitchensink_runtime::{Executive, ExistentialDeposit, Indices, Runtime, UncheckedExtrinsic};
use pez_kitchensink_runtime::{Executive, ExistentialDeposit, Indices, Runtime, UncheckedExtrinsic};
use pezkuwi_sdk::*;
use pezsp_application_crypto::AppCrypto;
use pezsp_core::offchain::{testing::TestTransactionPoolExt, TransactionPoolExt};
+2 -2
View File
@@ -1,5 +1,5 @@
[package]
name = "node-primitives"
name = "pez-node-primitives"
version = "2.0.0"
authors.workspace = true
description = "Bizinikiwi node low-level primitives."
@@ -8,7 +8,7 @@ license = "Apache-2.0"
homepage.workspace = true
repository.workspace = true
publish = false
documentation = "https://docs.rs/node-primitives"
documentation = "https://docs.rs/pez-node-primitives"
[lints]
workspace = true
+6 -6
View File
@@ -1,5 +1,5 @@
[package]
name = "node-rpc"
name = "pez-node-rpc"
version = "3.0.0-dev"
authors.workspace = true
description = "Bizinikiwi node rpc methods."
@@ -8,7 +8,7 @@ license = "Apache-2.0"
homepage.workspace = true
repository.workspace = true
publish = false
documentation = "https://docs.rs/node-rpc"
documentation = "https://docs.rs/pez-node-rpc"
[lints]
workspace = true
@@ -18,8 +18,8 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
jsonrpsee = { features = ["server"], workspace = true }
mmr-rpc = { workspace = true, default-features = true }
node-primitives = { workspace = true, default-features = true }
pezmmr-rpc = { workspace = true, default-features = true }
pez-node-primitives = { workspace = true, default-features = true }
pezpallet-transaction-payment-rpc = { workspace = true, default-features = true }
pezsc-chain-spec = { workspace = true, default-features = true }
pezsc-client-api = { workspace = true, default-features = true }
@@ -48,8 +48,8 @@ bizinikiwi-state-trie-migration-rpc = { workspace = true, default-features = tru
[features]
runtime-benchmarks = [
"mmr-rpc/runtime-benchmarks",
"node-primitives/runtime-benchmarks",
"pezmmr-rpc/runtime-benchmarks",
"pez-node-primitives/runtime-benchmarks",
"pezpallet-transaction-payment-rpc/runtime-benchmarks",
"pezsc-chain-spec/runtime-benchmarks",
"pezsc-client-api/runtime-benchmarks",
+3 -3
View File
@@ -34,7 +34,7 @@
use std::sync::Arc;
use jsonrpsee::RpcModule;
use node_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Nonce};
use pez_node_primitives::{AccountId, Balance, Block, BlockNumber, Hash, Nonce};
use pezsc_client_api::AuxStore;
use pezsc_consensus_babe::BabeWorkerHandle;
use pezsc_consensus_beefy::communication::notification::{
@@ -135,7 +135,7 @@ where
+ Send
+ 'static,
C::Api: bizinikiwi_frame_rpc_system::AccountNonceApi<Block, AccountId, Nonce>,
C::Api: mmr_rpc::MmrRuntimeApi<Block, <Block as pezsp_runtime::traits::Block>::Hash, BlockNumber>,
C::Api: pezmmr_rpc::MmrRuntimeApi<Block, <Block as pezsp_runtime::traits::Block>::Hash, BlockNumber>,
C::Api: pezpallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
C::Api: BabeApi<Block>,
C::Api: BlockBuilder<Block>,
@@ -146,7 +146,7 @@ where
AuthorityId: AuthorityIdBound,
<AuthorityId as RuntimeAppPublic>::Signature: Send + Sync,
{
use mmr_rpc::{Mmr, MmrApiServer};
use pezmmr_rpc::{Mmr, MmrApiServer};
use pezpallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
use pezsc_consensus_babe_rpc::{Babe, BabeApiServer};
use pezsc_consensus_beefy_rpc::{Beefy, BeefyApiServer};
+5 -5
View File
@@ -1,5 +1,5 @@
[package]
name = "kitchensink-runtime"
name = "pez-kitchensink-runtime"
version = "3.0.0-dev"
authors.workspace = true
description = "Bizinikiwi node kitchensink runtime."
@@ -9,7 +9,7 @@ license = "Apache-2.0"
homepage.workspace = true
repository.workspace = true
publish = false
documentation = "https://docs.rs/kitchensink-runtime"
documentation = "https://docs.rs/pez-kitchensink-runtime"
[lints]
workspace = true
@@ -39,7 +39,7 @@ primitive-types = { features = [
pezkuwi-sdk = { features = ["runtime-full", "tuples-96"], workspace = true }
# shared code between runtime and node
node-primitives = { workspace = true }
pez-node-primitives = { workspace = true }
# Example pallets that are not published:
pezpallet-example-mbm = { workspace = true }
@@ -54,7 +54,7 @@ with-tracing = ["pezkuwi-sdk/with-tracing"]
std = [
"codec/std",
"log/std",
"node-primitives/std",
"pez-node-primitives/std",
"pezpallet-example-mbm/std",
"pezpallet-example-tasks/std",
"pezkuwi-sdk/std",
@@ -66,7 +66,7 @@ std = [
"bizinikiwi-wasm-builder",
]
runtime-benchmarks = [
"node-primitives/runtime-benchmarks",
"pez-node-primitives/runtime-benchmarks",
"pezpallet-example-mbm/runtime-benchmarks",
"pezpallet-example-tasks/runtime-benchmarks",
"pezkuwi-sdk/runtime-benchmarks",
+2 -2
View File
@@ -19,7 +19,7 @@
/// Money matters.
pub mod currency {
use node_primitives::Balance;
use pez_node_primitives::Balance;
pub const MILLICENTS: Balance = 1_000_000_000;
pub const CENTS: Balance = 1_000 * MILLICENTS; // assume this is worth about a cent.
@@ -32,7 +32,7 @@ pub mod currency {
/// Time.
pub mod time {
use node_primitives::{BlockNumber, Moment};
use pez_node_primitives::{BlockNumber, Moment};
/// Since BABE is probabilistic this is the average expected block time that
/// we are targeting. Blocks will be produced at a minimum duration defined
+2 -2
View File
@@ -76,8 +76,8 @@ use pezframe_system::{
limits::{BlockLength, BlockWeights},
EnsureRoot, EnsureRootWithSuccess, EnsureSigned, EnsureSignedBy, EnsureWithSuccess,
};
pub use node_primitives::{AccountId, Signature};
use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Moment, Nonce};
pub use pez_node_primitives::{AccountId, Signature};
use pez_node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Moment, Nonce};
use pezpallet_asset_conversion::{AccountIdConverter, Ascending, Chain, WithFirstAsset};
use pezpallet_asset_conversion_tx_payment::SwapAssetAdapter;
use pezpallet_assets_precompiles::{InlineIdConfig, ERC20};
+6 -6
View File
@@ -1,5 +1,5 @@
[package]
name = "node-testing"
name = "pez-node-testing"
version = "3.0.0-dev"
authors.workspace = true
description = "Test utilities for Bizinikiwi node."
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage.workspace = true
repository.workspace = true
publish = false
documentation = "https://docs.rs/node-testing"
documentation = "https://docs.rs/pez-node-testing"
[lints]
workspace = true
@@ -22,10 +22,10 @@ pezframe-metadata-hash-extension = { workspace = true, default-features = true }
pezframe-system = { workspace = true, default-features = true }
fs_extra = { workspace = true }
futures = { workspace = true }
kitchensink-runtime = { workspace = true }
pez-kitchensink-runtime = { workspace = true }
log = { workspace = true, default-features = true }
node-cli = { workspace = true }
node-primitives = { workspace = true, default-features = true }
pez-node-primitives = { workspace = true, default-features = true }
pezpallet-asset-conversion = { workspace = true, default-features = true }
pezpallet-asset-conversion-tx-payment = { workspace = true, default-features = true }
pezpallet-revive = { workspace = true, default-features = true }
@@ -57,9 +57,9 @@ tempfile = { workspace = true }
runtime-benchmarks = [
"pezframe-metadata-hash-extension/runtime-benchmarks",
"pezframe-system/runtime-benchmarks",
"kitchensink-runtime/runtime-benchmarks",
"pez-kitchensink-runtime/runtime-benchmarks",
"node-cli/runtime-benchmarks",
"node-primitives/runtime-benchmarks",
"pez-node-primitives/runtime-benchmarks",
"pezpallet-asset-conversion-tx-payment/runtime-benchmarks",
"pezpallet-asset-conversion/runtime-benchmarks",
"pezpallet-revive/runtime-benchmarks",
+8 -8
View File
@@ -34,11 +34,11 @@ use crate::{
};
use codec::{Decode, Encode};
use futures::executor;
use kitchensink_runtime::{
use pez_kitchensink_runtime::{
constants::currency::DOLLARS, AccountId, BalancesCall, CheckedExtrinsic, MinimumPeriod,
RuntimeCall, Signature, SystemCall, UncheckedExtrinsic,
};
use node_primitives::Block;
use pez_node_primitives::Block;
use pezsc_block_builder::BlockBuilderBuilder;
use pezsc_client_api::{execution_extensions::ExecutionExtensions, UsageProvider};
use pezsc_client_db::PruningMode;
@@ -267,7 +267,7 @@ pub struct BlockContentIterator<'a> {
iteration: usize,
content: BlockContent,
runtime_version: pezsc_executor::RuntimeVersion,
genesis_hash: node_primitives::Hash,
genesis_hash: pez_node_primitives::Hash,
keyring: &'a BenchKeyring,
}
@@ -301,13 +301,13 @@ impl<'a> Iterator for BlockContentIterator<'a> {
CheckedExtrinsic {
format: ExtrinsicFormat::Signed(
sender,
tx_ext(0, kitchensink_runtime::ExistentialDeposit::get() + 1),
tx_ext(0, pez_kitchensink_runtime::ExistentialDeposit::get() + 1),
),
function: match self.content.block_type {
BlockType::RandomTransfersKeepAlive =>
RuntimeCall::Balances(BalancesCall::transfer_keep_alive {
dest: pezsp_runtime::MultiAddress::Id(receiver),
value: kitchensink_runtime::ExistentialDeposit::get() + 1,
value: pez_kitchensink_runtime::ExistentialDeposit::get() + 1,
}),
BlockType::RandomTransfersReaping => {
RuntimeCall::Balances(BalancesCall::transfer_allow_death {
@@ -315,7 +315,7 @@ impl<'a> Iterator for BlockContentIterator<'a> {
// Transfer so that ending balance would be 1 less than existential
// deposit so that we kill the sender account.
value: 100 * DOLLARS -
(kitchensink_runtime::ExistentialDeposit::get() - 1),
(pez_kitchensink_runtime::ExistentialDeposit::get() - 1),
})
},
BlockType::Noop =>
@@ -610,7 +610,7 @@ impl BenchKeyring {
}
/// Generate genesis with accounts from this keyring endowed with some balance and
/// kitchensink_runtime code blob.
/// pez_kitchensink_runtime code blob.
pub fn as_storage_builder(&self) -> &dyn pezsp_runtime::BuildStorage {
self
}
@@ -620,7 +620,7 @@ impl pezsp_runtime::BuildStorage for BenchKeyring {
fn assimilate_storage(&self, storage: &mut pezsp_core::storage::Storage) -> Result<(), String> {
storage.top.insert(
pezsp_core::storage::well_known_keys::CODE.to_vec(),
kitchensink_runtime::wasm_binary_unwrap().into(),
pez_kitchensink_runtime::wasm_binary_unwrap().into(),
);
crate::genesis::config_endowed(self.collect_account_ids()).assimilate_storage(storage)
}
+9 -9
View File
@@ -16,24 +16,24 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//! Utilities to build a `TestClient` for `kitchensink-runtime`.
//! Utilities to build a `TestClient` for `pez-kitchensink-runtime`.
use pezsp_runtime::BuildStorage;
/// Re-export test-client utilities.
pub use bizinikiwi_test_client::*;
/// Call executor for `kitchensink-runtime` `TestClient`.
/// Call executor for `pez-kitchensink-runtime` `TestClient`.
use node_cli::service::RuntimeExecutor;
/// Default backend type.
pub type Backend = pezsc_client_db::Backend<node_primitives::Block>;
pub type Backend = pezsc_client_db::Backend<pez_node_primitives::Block>;
/// Test client type.
pub type Client = client::Client<
Backend,
client::LocalCallExecutor<node_primitives::Block, Backend, RuntimeExecutor>,
node_primitives::Block,
kitchensink_runtime::RuntimeApi,
client::LocalCallExecutor<pez_node_primitives::Block, Backend, RuntimeExecutor>,
pez_node_primitives::Block,
pez_kitchensink_runtime::RuntimeApi,
>;
/// Genesis configuration parameters for `TestClient`.
@@ -45,7 +45,7 @@ impl bizinikiwi_test_client::GenesisInit for GenesisParameters {
let mut storage = crate::genesis::config().build_storage().unwrap();
storage.top.insert(
pezsp_core::storage::well_known_keys::CODE.to_vec(),
kitchensink_runtime::wasm_binary_unwrap().into(),
pez_kitchensink_runtime::wasm_binary_unwrap().into(),
);
storage
}
@@ -62,8 +62,8 @@ pub trait TestClientBuilderExt: Sized {
impl TestClientBuilderExt
for bizinikiwi_test_client::TestClientBuilder<
node_primitives::Block,
client::LocalCallExecutor<node_primitives::Block, Backend, RuntimeExecutor>,
pez_node_primitives::Block,
client::LocalCallExecutor<pez_node_primitives::Block, Backend, RuntimeExecutor>,
Backend,
GenesisParameters,
>
+1 -1
View File
@@ -19,7 +19,7 @@
//! Genesis Configuration.
use crate::keyring::*;
use kitchensink_runtime::{
use pez_kitchensink_runtime::{
constants::currency::*, AccountId, AssetsConfig, BalancesConfig, IndicesConfig,
RuntimeGenesisConfig, SessionConfig, SocietyConfig, StakerStatus, StakingConfig,
};
+2 -2
View File
@@ -19,8 +19,8 @@
//! Test accounts.
use codec::Encode;
use kitchensink_runtime::{CheckedExtrinsic, SessionKeys, TxExtension, UncheckedExtrinsic};
use node_primitives::{AccountId, Balance, Nonce};
use pez_kitchensink_runtime::{CheckedExtrinsic, SessionKeys, TxExtension, UncheckedExtrinsic};
use pez_node_primitives::{AccountId, Balance, Nonce};
use pezsp_core::{crypto::get_public_from_string_or_panic, ecdsa, ed25519, sr25519};
use pezsp_crypto_hashing::blake2_256;
use pezsp_keyring::Sr25519Keyring;