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,