FAZ 1 Complete: Workspace compile fixes, warning cleanup, version bumps
- Fixed is_using_frame_crate() macro to check for pezframe/pezkuwi_sdk - Removed disable_pezframe_system_supertrait_check temporary bypasses - Feature-gated storage-benchmark and teyrchain-benchmarks code - Fixed dead_code warnings with underscore prefix (_Header) - Removed unused imports and shadowing use statements - Version bumps: procedural-tools 10.0.1, benchmarking-cli 32.0.1, docs 0.0.2, minimal-runtime 0.0.1, yet-another-teyrchain 0.6.1, umbrella 0.1.2 - Updated MAINNET_ROADMAP.md with FAZ 1 completion status
This commit is contained in:
@@ -23,6 +23,7 @@ mod machine;
|
||||
mod overhead;
|
||||
mod pezpallet;
|
||||
mod shared;
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
mod storage;
|
||||
|
||||
pub use block::BlockCmd;
|
||||
@@ -34,6 +35,7 @@ pub use overhead::{
|
||||
};
|
||||
pub use pezpallet::PalletCmd;
|
||||
pub use pezsc_service::BasePath;
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
pub use storage::StorageCmd;
|
||||
|
||||
use pezsc_cli::{
|
||||
@@ -46,6 +48,7 @@ use pezsc_cli::{
|
||||
#[derive(Debug, clap::Subcommand)]
|
||||
pub enum BenchmarkCmd {
|
||||
Pezpallet(PalletCmd),
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
Storage(StorageCmd),
|
||||
Overhead(OverheadCmd),
|
||||
Block(BlockCmd),
|
||||
@@ -62,6 +65,7 @@ macro_rules! unwrap_cmd {
|
||||
} => {
|
||||
match $self {
|
||||
BenchmarkCmd::Pezpallet($cmd) => $code,
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
BenchmarkCmd::Storage($cmd) => $code,
|
||||
BenchmarkCmd::Overhead($cmd) => $code,
|
||||
BenchmarkCmd::Block($cmd) => $code,
|
||||
|
||||
@@ -36,13 +36,18 @@ use crate::{
|
||||
},
|
||||
};
|
||||
use clap::{error::ErrorKind, Args, CommandFactory, Parser};
|
||||
use codec::{Decode, Encode};
|
||||
use codec::Decode;
|
||||
#[cfg(feature = "teyrchain-benchmarks")]
|
||||
use codec::Encode;
|
||||
use fake_runtime_api::RuntimeApi as FakeRuntimeApi;
|
||||
use genesis_state::WARN_SPEC_GENESIS_CTOR;
|
||||
use log::info;
|
||||
// MockValidationDataInherentDataProvider is feature-gated because it requires pezcumulus-test-relay-sproof-builder
|
||||
#[cfg(feature = "teyrchain-benchmarks")]
|
||||
use pezcumulus_client_teyrchain_inherent::MockValidationDataInherentDataProvider;
|
||||
use pezframe_support::Deserialize;
|
||||
use pezkuwi_subxt::{client::RuntimeVersion, ext::futures, Metadata};
|
||||
#[cfg(feature = "teyrchain-benchmarks")]
|
||||
use pezkuwi_teyrchain_primitives::primitives::Id as ParaId;
|
||||
use pezsc_block_builder::BlockBuilderApi;
|
||||
use pezsc_chain_spec::{ChainSpec, ChainSpecExtension, GenesisBlockBuilder};
|
||||
@@ -73,7 +78,7 @@ use std::{
|
||||
};
|
||||
|
||||
const DEFAULT_PARA_ID: u32 = 100;
|
||||
const LOG_TARGET: &'static str = "pezkuwi_sdk_frame::benchmark::overhead";
|
||||
const LOG_TARGET: &'static str = "pezframe::benchmark::overhead";
|
||||
|
||||
/// Benchmark the execution overhead per-block and per-extrinsic.
|
||||
#[derive(Debug, Parser)]
|
||||
@@ -204,6 +209,8 @@ fn create_inherent_data<Client: UsageProvider<Block> + HeaderBackend<Block>, Blo
|
||||
let mut inherent_data = InherentData::new();
|
||||
|
||||
// Para inherent can only makes sense when we are handling a teyrchain.
|
||||
// This requires the teyrchain-benchmarks feature which depends on pezcumulus-test-relay-sproof-builder
|
||||
#[cfg(feature = "teyrchain-benchmarks")]
|
||||
if let Teyrchain(para_id) = chain_type {
|
||||
let teyrchain_validation_data_provider = MockValidationDataInherentDataProvider::<()> {
|
||||
para_id: ParaId::from(*para_id),
|
||||
@@ -215,6 +222,10 @@ fn create_inherent_data<Client: UsageProvider<Block> + HeaderBackend<Block>, Blo
|
||||
teyrchain_validation_data_provider.provide_inherent_data(&mut inherent_data),
|
||||
);
|
||||
}
|
||||
#[cfg(not(feature = "teyrchain-benchmarks"))]
|
||||
if let Teyrchain(_) = chain_type {
|
||||
log::warn!("Teyrchain benchmark inherents not available. Enable the 'teyrchain-benchmarks' feature.");
|
||||
}
|
||||
|
||||
// Teyrchain inherent that is used on relay chains to perform teyrchain validation.
|
||||
let para_inherent = pezkuwi_primitives::InherentData {
|
||||
|
||||
@@ -30,7 +30,7 @@ use pezsc_cli::{
|
||||
use std::{fmt::Debug, path::PathBuf};
|
||||
|
||||
/// Logging target
|
||||
const LOG_TARGET: &'static str = "frame::benchmark::pezpallet";
|
||||
const LOG_TARGET: &'static str = "pezframe::benchmark::pezpallet";
|
||||
|
||||
// Add a more relaxed parsing for pezpallet names by allowing pezpallet directory names with `-` to
|
||||
// be used like crate names with `_`
|
||||
|
||||
@@ -22,12 +22,14 @@ pub mod record;
|
||||
pub mod stats;
|
||||
pub mod weight_params;
|
||||
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
pub use record::BenchRecord;
|
||||
pub use stats::{StatSelect, Stats};
|
||||
pub use weight_params::WeightParams;
|
||||
|
||||
use clap::Args;
|
||||
use pezsc_sysinfo::gather_sysinfo;
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
use rand::prelude::*;
|
||||
use serde::Serialize;
|
||||
|
||||
@@ -73,6 +75,7 @@ where
|
||||
/// Returns an rng and the seed that was used to create it.
|
||||
///
|
||||
/// Uses a random seed if none is provided.
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
pub fn new_rng(seed: Option<u64>) -> (impl rand::Rng, u64) {
|
||||
let seed = seed.unwrap_or(rand::thread_rng().gen::<u64>());
|
||||
(rand_pcg::Pcg64::seed_from_u64(seed), seed)
|
||||
|
||||
@@ -17,13 +17,18 @@
|
||||
|
||||
//! Defines the [`BenchRecord`] and its facilities for computing [`super::Stats`].
|
||||
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
use pezsc_cli::Result;
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
use pezsc_service::Configuration;
|
||||
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
use log::info;
|
||||
use serde::Serialize;
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
use std::{fs, path::PathBuf, time::Duration};
|
||||
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
use super::Stats;
|
||||
|
||||
/// Raw output of a Storage benchmark.
|
||||
@@ -35,6 +40,7 @@ pub struct BenchRecord {
|
||||
|
||||
impl BenchRecord {
|
||||
/// Appends a new record. Uses safe casts.
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
pub fn append(&mut self, size: usize, d: Duration) -> Result<()> {
|
||||
let size: u64 = size.try_into().map_err(|e| format!("Size overflow u64: {}", e))?;
|
||||
let ns: u64 = d
|
||||
@@ -46,6 +52,7 @@ impl BenchRecord {
|
||||
}
|
||||
|
||||
/// Returns the statistics for *time* and *value size*.
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
pub fn calculate_stats(self) -> Result<(Stats, Stats)> {
|
||||
let (size, time): (Vec<_>, Vec<_>) = self.ns_per_size.into_iter().unzip();
|
||||
let size = Stats::new(&size)?;
|
||||
@@ -55,6 +62,7 @@ impl BenchRecord {
|
||||
|
||||
/// Unless a path is specified, saves the raw results in a json file in the current directory.
|
||||
/// Prefixes it with the DB name and suffixed with `path_suffix`.
|
||||
#[cfg(feature = "storage-benchmark")]
|
||||
pub fn save_json(&self, cfg: &Configuration, out_path: &PathBuf, suffix: &str) -> Result<()> {
|
||||
let mut path = PathBuf::from(out_path);
|
||||
if path.is_dir() || path.as_os_str().is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user