chore: regenerate umbrella crate, fix feature propagation

This commit is contained in:
2025-12-16 11:28:32 +03:00
parent dd6d48f528
commit 620b0e3aa0
1358 changed files with 9464 additions and 7656 deletions
@@ -36,8 +36,8 @@ use crate::shared::{StatSelect, Stats};
use clap::Args;
use codec::Encode;
use log::info;
use serde::Serialize;
use pezsp_trie::proof_size_extension::ProofSizeExt;
use serde::Serialize;
use std::{marker::PhantomData, sync::Arc, time::Instant};
/// Parameters to configure an *overhead* benchmark.
@@ -29,14 +29,16 @@ pub use block::BlockCmd;
pub use extrinsic::{ExtrinsicBuilder, ExtrinsicCmd, ExtrinsicFactory};
pub use machine::{MachineCmd, BIZINIKIWI_REFERENCE_HARDWARE};
pub use overhead::{
remark_builder::{DynamicRemarkBuilder, BizinikiwiRemarkBuilder},
remark_builder::{BizinikiwiRemarkBuilder, DynamicRemarkBuilder},
OpaqueBlock, OverheadCmd,
};
pub use pezpallet::PalletCmd;
pub use pezsc_service::BasePath;
pub use storage::StorageCmd;
use pezsc_cli::{CliConfiguration, DatabaseParams, ImportParams, PruningParams, Result, SharedParams};
use pezsc_cli::{
CliConfiguration, DatabaseParams, ImportParams, PruningParams, Result, SharedParams,
};
/// The root `benchmarking` command.
///
@@ -37,11 +37,11 @@ use crate::{
};
use clap::{error::ErrorKind, Args, CommandFactory, Parser};
use codec::{Decode, Encode};
use pezcumulus_client_teyrchain_inherent::MockValidationDataInherentDataProvider;
use fake_runtime_api::RuntimeApi as FakeRuntimeApi;
use pezframe_support::Deserialize;
use genesis_state::WARN_SPEC_GENESIS_CTOR;
use log::info;
use pezcumulus_client_teyrchain_inherent::MockValidationDataInherentDataProvider;
use pezframe_support::Deserialize;
use pezkuwi_teyrchain_primitives::primitives::Id as ParaId;
use pezsc_block_builder::BlockBuilderApi;
use pezsc_chain_spec::{ChainSpec, ChainSpecExtension, GenesisBlockBuilder};
@@ -51,8 +51,6 @@ use pezsc_client_db::{BlocksPruning, DatabaseSettings};
use pezsc_executor::WasmExecutor;
use pezsc_runtime_utilities::fetch_latest_metadata_from_code_blob;
use pezsc_service::{new_client, new_db_backend, BasePath, ClientConfig, TFullClient, TaskManager};
use serde::Serialize;
use serde_json::{json, Value};
use pezsp_api::{ApiExt, CallApiAt, Core, ProvideRuntimeApi};
use pezsp_blockchain::HeaderBackend;
use pezsp_core::H256;
@@ -64,6 +62,8 @@ use pezsp_runtime::{
};
use pezsp_storage::Storage;
use pezsp_wasm_interface::HostFunctions;
use serde::Serialize;
use serde_json::{json, Value};
use std::{
fmt::{Debug, Display, Formatter},
fs,
@@ -225,7 +225,8 @@ fn create_inherent_data<Client: UsageProvider<Block> + HeaderBackend<Block>, Blo
};
// Timestamp inherent that is very common in bizinikiwi chains.
let timestamp = pezsp_timestamp::InherentDataProvider::new(std::time::Duration::default().into());
let timestamp =
pezsp_timestamp::InherentDataProvider::new(std::time::Duration::default().into());
let _ = futures::executor::block_on(timestamp.provide_inherent_data(&mut inherent_data));
let _ =
@@ -28,12 +28,12 @@ use crate::{
};
use clap::{error::ErrorKind, CommandFactory};
use codec::{Decode, DecodeWithMemTracking, Encode};
use linked_hash_map::LinkedHashMap;
use pezframe_benchmarking::{
Analysis, BenchmarkBatch, BenchmarkBatchSplitResults, BenchmarkList, BenchmarkParameter,
BenchmarkResult, BenchmarkSelector,
};
use pezframe_support::traits::StorageInfo;
use linked_hash_map::LinkedHashMap;
use pezsc_cli::{execution_method_from_cli, ChainSpec, CliConfiguration, Result, SharedParams};
use pezsc_client_db::BenchmarkingState;
use pezsc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY};
@@ -117,9 +117,8 @@ fn combine_batches(
let mut all_benchmarks =
LinkedHashMap::<_, (Vec<BenchmarkResult>, Vec<BenchmarkResult>)>::new();
db_batches
.into_iter()
.for_each(|BenchmarkBatch { pezpallet, instance, benchmark, results }| {
db_batches.into_iter().for_each(
|BenchmarkBatch { pezpallet, instance, benchmark, results }| {
// We use this key to uniquely identify a benchmark among batches.
let key = (pezpallet, instance, benchmark);
@@ -131,11 +130,11 @@ fn combine_batches(
all_benchmarks.insert(key, (Vec::new(), results));
},
}
});
},
);
time_batches
.into_iter()
.for_each(|BenchmarkBatch { pezpallet, instance, benchmark, results }| {
time_batches.into_iter().for_each(
|BenchmarkBatch { pezpallet, instance, benchmark, results }| {
// We use this key to uniquely identify a benchmark among batches.
let key = (pezpallet, instance, benchmark);
@@ -144,7 +143,8 @@ fn combine_batches(
Some(x) => x.0.extend(results),
None => panic!("all benchmark keys should have been populated by db batches"),
}
});
},
);
all_benchmarks
.into_iter()
@@ -582,19 +582,21 @@ impl PalletCmd {
fn select_benchmarks_to_run(&self, list: Vec<BenchmarkList>) -> Result<Vec<SelectedBenchmark>> {
// Use the benchmark list and the user input to determine the set of benchmarks to run.
let mut benchmarks_to_run = Vec::new();
list.iter().filter(|item| self.pezpallet_selected(&item.pezpallet)).for_each(|item| {
for benchmark in &item.benchmarks {
if self.extrinsic_selected(&item.pezpallet, &benchmark.name) {
benchmarks_to_run.push((
item.pezpallet.clone(),
item.instance.clone(),
benchmark.name.clone(),
benchmark.components.clone(),
benchmark.pov_modes.clone(),
))
list.iter()
.filter(|item| self.pezpallet_selected(&item.pezpallet))
.for_each(|item| {
for benchmark in &item.benchmarks {
if self.extrinsic_selected(&item.pezpallet, &benchmark.name) {
benchmarks_to_run.push((
item.pezpallet.clone(),
item.instance.clone(),
benchmark.name.clone(),
benchmark.components.clone(),
benchmark.pov_modes.clone(),
))
}
}
}
});
});
// Convert `Vec<u8>` to `String` for better readability.
let benchmarks_to_run: Vec<_> = benchmarks_to_run
.into_iter()
@@ -841,7 +843,8 @@ impl PalletCmd {
) {
for batch in batches.iter() {
// Print benchmark metadata
let pezpallet = String::from_utf8(batch.pezpallet.clone()).expect("Encoded from String; qed");
let pezpallet =
String::from_utf8(batch.pezpallet.clone()).expect("Encoded from String; qed");
let benchmark =
String::from_utf8(batch.benchmark.clone()).expect("Encoded from String; qed");
println!(
@@ -1163,7 +1166,15 @@ mod tests {
"--genesis-builder",
"none",
])?;
cli_succeed(&["test", "--extrinsic", "", "--pezpallet", "", "--runtime", "path/to/runtime"])?;
cli_succeed(&[
"test",
"--extrinsic",
"",
"--pezpallet",
"",
"--runtime",
"path/to/runtime",
])?;
cli_succeed(&[
"test",
"--extrinsic",
@@ -56,7 +56,8 @@ pub fn init(arg: Option<String>) {
});
}
/// Alternative implementation to `pezsp_runtime_interface::logging::HostFunctions` for benchmarking.
/// Alternative implementation to `pezsp_runtime_interface::logging::HostFunctions` for
/// benchmarking.
#[runtime_interface]
pub trait Logging {
#[allow(dead_code)]
@@ -32,8 +32,8 @@ use std::{fmt::Debug, path::PathBuf};
/// Logging target
const LOG_TARGET: &'static str = "frame::benchmark::pezpallet";
// Add a more relaxed parsing for pezpallet names by allowing pezpallet directory names with `-` to be
// used like crate names with `_`
// Add a more relaxed parsing for pezpallet names by allowing pezpallet directory names with `-` to
// be used like crate names with `_`
fn parse_pallet_name(pezpallet: &str) -> std::result::Result<String, String> {
Ok(pezpallet.replace("-", "_"))
}
@@ -169,7 +169,8 @@ fn map_results(
worst_case_map_values,
additional_trie_layers,
);
let pezpallet_benchmarks = all_benchmarks.entry((pezpallet_name, instance_name)).or_default();
let pezpallet_benchmarks =
all_benchmarks.entry((pezpallet_name, instance_name)).or_default();
pezpallet_benchmarks.push(benchmark_data);
}
Ok(all_benchmarks)
@@ -287,7 +288,10 @@ fn get_benchmark_data(
// We add additional comments showing which storage items were touched.
// We find the worst case proof size, and use that as the final proof size result.
let mut storage_per_prefix = HashMap::<Vec<u8>, Vec<BenchmarkResult>>::new();
let pov_mode = pov_modes.get(&(pezpallet.clone(), benchmark.clone())).cloned().unwrap_or_default();
let pov_mode = pov_modes
.get(&(pezpallet.clone(), benchmark.clone()))
.cloned()
.unwrap_or_default();
let comments = process_storage_results(
&mut storage_per_prefix,
&batch.db_results,
@@ -579,7 +583,8 @@ pub(crate) fn process_storage_results(
let mut prefix_result = result.clone();
let key_info = storage_info_map.get(&prefix);
let pezpallet_name = match key_info {
Some(k) => String::from_utf8(k.pezpallet_name.clone()).expect("encoded from string"),
Some(k) =>
String::from_utf8(k.pezpallet_name.clone()).expect("encoded from string"),
None => "".to_string(),
};
let storage_name = match key_info {
@@ -18,9 +18,9 @@
use crate::overhead::command::TeyrchainExtension;
use pezsc_chain_spec::{ChainSpec, GenericChainSpec, GenesisConfigBuilderRuntimeCaller};
use pezsc_cli::Result;
use serde_json::Value;
use pezsp_storage::{well_known_keys::CODE, Storage};
use pezsp_wasm_interface::HostFunctions;
use serde_json::Value;
use std::{borrow::Cow, path::PathBuf};
/// When the runtime could not build the genesis storage.
@@ -27,8 +27,8 @@ pub use stats::{StatSelect, Stats};
pub use weight_params::WeightParams;
use clap::Args;
use rand::prelude::*;
use pezsc_sysinfo::gather_sysinfo;
use rand::prelude::*;
use serde::Serialize;
/// A Handlebars helper to add an underscore after every 3rd character,
@@ -28,9 +28,9 @@ use pezsp_storage::{ChildInfo, ChildType, PrefixedStorageKey, StateVersion};
use clap::{Args, Parser, ValueEnum};
use log::info;
use pezsp_runtime::generic::BlockId;
use rand::prelude::*;
use serde::Serialize;
use pezsp_runtime::generic::BlockId;
use std::{fmt::Debug, path::PathBuf, sync::Arc};
use super::template::TemplateData;
@@ -39,7 +39,8 @@ pub(crate) fn get_wasm_module() -> Box<dyn pezsc_executor_common::wasm_runtime::
heap_alloc_strategy: pezsc_executor_common::wasm_runtime::HeapAllocStrategy::Dynamic {
maximum_pages: Some(4096),
},
instantiation_strategy: pezsc_executor::WasmtimeInstantiationStrategy::PoolingCopyOnWrite,
instantiation_strategy:
pezsc_executor::WasmtimeInstantiationStrategy::PoolingCopyOnWrite,
deterministic_stack_limit: None,
canonicalize_nans: false,
parallel_compilation: false,
@@ -18,7 +18,6 @@
use codec::Encode;
use frame_storage_access_test_runtime::StorageAccessParams;
use log::{debug, info};
use rand::prelude::*;
use pezsc_cli::{Error, Result};
use pezsc_client_api::{Backend as ClientBackend, StorageProvider, UsageProvider};
use pezsp_api::CallApiAt;
@@ -26,6 +25,7 @@ use pezsp_runtime::traits::{Block as BlockT, HashingFor, Header as HeaderT};
use pezsp_state_machine::{backend::AsTrieBackend, Backend};
use pezsp_storage::ChildInfo;
use pezsp_trie::StorageProof;
use rand::prelude::*;
use std::{fmt::Debug, sync::Arc, time::Instant};
use super::{cmd::StorageCmd, get_wasm_module, MAX_BATCH_SIZE_FOR_BLOCK_VALIDATION};
@@ -18,7 +18,6 @@
use codec::Encode;
use frame_storage_access_test_runtime::StorageAccessParams;
use log::{debug, info, trace, warn};
use rand::prelude::*;
use pezsc_cli::Result;
use pezsc_client_api::{Backend as ClientBackend, StorageProvider, UsageProvider};
use pezsc_client_db::{DbHash, DbState, DbStateBuilder};
@@ -28,6 +27,7 @@ use pezsp_runtime::traits::{Block as BlockT, HashingFor, Header as HeaderT};
use pezsp_state_machine::Backend as StateBackend;
use pezsp_storage::{ChildInfo, StateVersion};
use pezsp_trie::{recorder::Recorder, PrefixedMemoryDB};
use rand::prelude::*;
use std::{
fmt::Debug,
sync::Arc,
@@ -23,10 +23,10 @@ use pezsp_runtime::traits::BlakeTwo256;
/// # Pezkuwi Omni Benchmarking CLI
///
/// The Pezkuwi Omni benchmarker allows to benchmark the extrinsics of any Pezkuwi runtime. It is
/// meant to replace the current manual integration of the `benchmark pezpallet` into every teyrchain
/// node. This reduces duplicate code and makes maintenance for builders easier. The CLI is
/// currently only able to benchmark extrinsics. In the future it is planned to extend this to some
/// other areas.
/// meant to replace the current manual integration of the `benchmark pezpallet` into every
/// teyrchain node. This reduces duplicate code and makes maintenance for builders easier. The CLI
/// is currently only able to benchmark extrinsics. In the future it is planned to extend this to
/// some other areas.
///
/// General FRAME runtimes could also be used with this benchmarker, as long as they don't utilize
/// any host functions that are not part of the Pezkuwi host specification.
@@ -78,8 +78,8 @@ use pezsp_runtime::traits::BlakeTwo256;
///
/// ## Backwards Compatibility
///
/// The exposed pezpallet sub-command is identical as the node-integrated CLI. The only difference is
/// that it needs to be prefixed with a `v1` to ensure drop-in compatibility.
/// The exposed pezpallet sub-command is identical as the node-integrated CLI. The only difference
/// is that it needs to be prefixed with a `v1` to ensure drop-in compatibility.
#[derive(Parser, Debug)]
#[clap(author, version, about, verbatim_doc_comment)]
pub struct Command {
@@ -26,7 +26,8 @@ use std::{
fn benchmark_overhead_runtime_works() -> std::result::Result<(), String> {
let tmp_dir = tempfile::tempdir().expect("Should be able to create tmp dir.");
let base_path = tmp_dir.path();
let wasm = pezcumulus_test_runtime::WASM_BINARY.ok_or("WASM binary not available".to_string())?;
let wasm =
pezcumulus_test_runtime::WASM_BINARY.ok_or("WASM binary not available".to_string())?;
let runtime_path = base_path.join("runtime.wasm");
let _ =
fs::write(&runtime_path, wasm).map_err(|e| format!("Unable to write runtime file: {}", e));
@@ -118,7 +119,8 @@ fn setup_chain_spec(tmp_dir: &Path, raw: bool) -> Result<(PathBuf, PathBuf), Str
let base_path = tmp_dir.to_path_buf();
let chain_spec_path = base_path.join("chain_spec.json");
let wasm = pezcumulus_test_runtime::WASM_BINARY.ok_or("WASM binary not available".to_string())?;
let wasm =
pezcumulus_test_runtime::WASM_BINARY.ok_or("WASM binary not available".to_string())?;
let mut properties = pezsc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "UNIT".into());
@@ -22,11 +22,11 @@
mod logging;
use bizinikiwi_rpc_client::{rpc_params, BatchRequestBuilder, ChainApi, ClientT, StateApi};
use codec::{Compact, Decode, Encode};
use indicatif::{ProgressBar, ProgressStyle};
use jsonrpsee::{core::params::ArrayParams, http_client::HttpClient};
use log::*;
use serde::de::DeserializeOwned;
use pezsp_core::{
hexdisplay::HexDisplay,
storage::{
@@ -39,6 +39,7 @@ use pezsp_runtime::{
StateVersion,
};
use pezsp_state_machine::TestExternalities;
use serde::de::DeserializeOwned;
use std::{
cmp::{max, min},
fs,
@@ -47,7 +48,6 @@ use std::{
sync::Arc,
time::{Duration, Instant},
};
use bizinikiwi_rpc_client::{rpc_params, BatchRequestBuilder, ChainApi, ClientT, StateApi};
use tokio_retry::{strategy::FixedInterval, Retry};
type Result<T, E = &'static str> = std::result::Result<T, E>;
@@ -105,8 +105,8 @@ impl<B: BlockT> Snapshot<B> {
}
}
/// An externalities that acts exactly the same as [`pezsp_io::TestExternalities`] but has a few extra
/// bits and pieces to it, and can be loaded remotely.
/// An externalities that acts exactly the same as [`pezsp_io::TestExternalities`] but has a few
/// extra bits and pieces to it, and can be loaded remotely.
pub struct RemoteExternalities<B: BlockT> {
/// The inner externalities.
pub inner_ext: TestExternalities<HashingFor<B>>,
@@ -38,8 +38,8 @@
//! ```
use async_trait::async_trait;
use serde::de::DeserializeOwned;
use pezsp_runtime::traits::{Block as BlockT, Header as HeaderT};
use serde::de::DeserializeOwned;
use std::collections::VecDeque;
pub use jsonrpsee::{
@@ -25,8 +25,8 @@ use jsonrpsee::{
};
use pezsc_client_api::TrieCacheContext;
use pezsc_rpc_api::check_if_safe;
use serde::{Deserialize, Serialize};
use pezsp_runtime::traits::Block as BlockT;
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use pezsp_core::{
@@ -88,7 +88,8 @@ where
// get all child trie roots
for key_value in trie.iter().map_err(|e| format!("TrieDB node iterator error: {}", e))? {
let (key, value) = key_value.map_err(|e| format!("TrieDB node iterator error: {}", e))?;
if key[..].starts_with(pezsp_core::storage::well_known_keys::DEFAULT_CHILD_STORAGE_KEY_PREFIX)
if key[..]
.starts_with(pezsp_core::storage::well_known_keys::DEFAULT_CHILD_STORAGE_KEY_PREFIX)
{
let prefixed_key = PrefixedStorageKey::new(key);
let (_type, unprefixed) = ChildType::from_prefixed_key(&prefixed_key).unwrap();
@@ -15,18 +15,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Combines [pezsc_rpc_api::state::StateApiClient] with [pezframe_support::storage::generator] traits
//! to provide strongly typed chain state queries over rpc.
//! Combines [pezsc_rpc_api::state::StateApiClient] with [pezframe_support::storage::generator]
//! traits to provide strongly typed chain state queries over rpc.
#![warn(missing_docs)]
use codec::{DecodeAll, FullCodec, FullEncode};
use core::marker::PhantomData;
use pezframe_support::storage::generator::{StorageDoubleMap, StorageMap, StorageValue};
use jsonrpsee::core::ClientError as RpcError;
use pezframe_support::storage::generator::{StorageDoubleMap, StorageMap, StorageValue};
use pezsc_rpc_api::state::StateApiClient;
use serde::{de::DeserializeOwned, Serialize};
use pezsp_storage::{StorageData, StorageKey};
use serde::{de::DeserializeOwned, Serialize};
/// A typed query on chain state usable from an RPC client.
///
@@ -217,6 +217,7 @@ mod tests {
use super::*;
use assert_matches::assert_matches;
use bizinikiwi_test_runtime_client::{runtime::Transfer, Sr25519Keyring};
use futures::executor::block_on;
use pezsc_rpc_api::DenyUnsafe;
use pezsc_transaction_pool::BasicPool;
@@ -224,7 +225,6 @@ mod tests {
transaction_validity::{InvalidTransaction, TransactionValidityError},
ApplyExtrinsicResult,
};
use bizinikiwi_test_runtime_client::{runtime::Transfer, Sr25519Keyring};
fn deny_unsafe() -> Extensions {
let mut ext = Extensions::new();