refactor(benchmarking): rebrand pallet → pezpallet in CLI and scripts

- Rename CLI argument --pallet to --pezpallet (with --pallet as alias)
- Rename --pallets to --pezpallet, --exclude-pallets to --exclude-pezpallets
- Update benchmark subcommand from 'pallet' to 'pezpallet'
- Rename check-frame-omni-bencher.yml to check-pezframe-omni-bencher.yml
- Update all benchmark scripts to use new argument names
- Update cmd.py to use pezframe-omni-bencher and --pezpallet
This commit is contained in:
2025-12-25 03:33:32 +03:00
parent 3ddf58cef9
commit 3d55bfbcd9
9 changed files with 37 additions and 37 deletions
+19 -19
View File
@@ -189,22 +189,22 @@ bench_example = '''**Examples**:
%(prog)s %(prog)s
Runs benchmarks for pallet_balances and pallet_multisig for all runtimes which have these pallets. **--quiet** makes it to output nothing to PR but reactions Runs benchmarks for pallet_balances and pallet_multisig for all runtimes which have these pallets. **--quiet** makes it to output nothing to PR but reactions
%(prog)s --pallet pallet_balances pallet_xcm_benchmarks::generic --quiet %(prog)s --pezpallet pallet_balances pallet_xcm_benchmarks::generic --quiet
Runs bench for all pallets for zagros runtime and fails fast on first failed benchmark Runs bench for all pallets for zagros runtime and fails fast on first failed benchmark
%(prog)s --runtime zagros --fail-fast %(prog)s --runtime zagros --fail-fast
Does not output anything and cleans up the previous bot's & author command triggering comments in PR Does not output anything and cleans up the previous bot's & author command triggering comments in PR
%(prog)s --runtime zagros pezkuwichain --pallet pallet_balances pallet_multisig --quiet --clean %(prog)s --runtime zagros pezkuwichain --pezpallet pallet_balances pallet_multisig --quiet --clean
''' '''
parser_bench = subparsers.add_parser('bench', aliases=['bench-omni'], help='Runs benchmarks (frame omni bencher)', epilog=bench_example, formatter_class=argparse.RawDescriptionHelpFormatter) parser_bench = subparsers.add_parser('bench', aliases=['bench-omni'], help='Runs benchmarks (pezframe omni bencher)', epilog=bench_example, formatter_class=argparse.RawDescriptionHelpFormatter)
for arg, config in common_args.items(): for arg, config in common_args.items():
parser_bench.add_argument(arg, **config) parser_bench.add_argument(arg, **config)
parser_bench.add_argument('--runtime', help='Runtime(s) space separated', choices=runtimeNames, nargs='*', default=runtimeNames) parser_bench.add_argument('--runtime', help='Runtime(s) space separated', choices=runtimeNames, nargs='*', default=runtimeNames)
parser_bench.add_argument('--pallet', help='Pallet(s) space separated', nargs='*', default=[]) parser_bench.add_argument('--pezpallet', help='Pezpallet(s) space separated', nargs='*', default=[])
parser_bench.add_argument('--fail-fast', help='Fail fast on first failed benchmark', action='store_true') parser_bench.add_argument('--fail-fast', help='Fail fast on first failed benchmark', action='store_true')
@@ -382,26 +382,26 @@ def main():
print(f'\n') print(f'\n')
# filter out only the specified pallets from collected runtimes/pallets # filter out only the specified pezpallets from collected runtimes/pezpallets
if args.pallet: if args.pezpallet:
print(f'Pallets: {args.pallet}') print(f'Pezpallets: {args.pezpallet}')
new_pallets_map = {} new_pallets_map = {}
# keep only specified pallets if they exist in the runtime # keep only specified pezpallets if they exist in the runtime
for runtime in runtime_pallets_map: for runtime in runtime_pallets_map:
if set(args.pallet).issubset(set(runtime_pallets_map[runtime])): if set(args.pezpallet).issubset(set(runtime_pallets_map[runtime])):
new_pallets_map[runtime] = args.pallet new_pallets_map[runtime] = args.pezpallet
runtime_pallets_map = new_pallets_map runtime_pallets_map = new_pallets_map
print(f'Filtered out runtimes & pallets: {runtime_pallets_map}\n') print(f'Filtered out runtimes & pezpallets: {runtime_pallets_map}\n')
if not runtime_pallets_map: if not runtime_pallets_map:
if args.pallet and not args.runtime: if args.pezpallet and not args.runtime:
print(f"No pallets {args.pallet} found in any runtime") print(f"No pezpallets {args.pezpallet} found in any runtime")
elif args.runtime and not args.pallet: elif args.runtime and not args.pezpallet:
print(f"{args.runtime} runtime does not have any pallets") print(f"{args.runtime} runtime does not have any pezpallets")
elif args.runtime and args.pallet: elif args.runtime and args.pezpallet:
print(f"No pallets {args.pallet} found in {args.runtime}") print(f"No pezpallets {args.pezpallet} found in {args.runtime}")
else: else:
print('No runtimes found') print('No runtimes found')
sys.exit(1) sys.exit(1)
@@ -448,10 +448,10 @@ def main():
output_path = xcm_path output_path = xcm_path
print(f'-- benchmarking {pallet} in {runtime} into {output_path}') print(f'-- benchmarking {pallet} in {runtime} into {output_path}')
cmd = f"frame-omni-bencher v1 benchmark pallet " \ cmd = f"pezframe-omni-bencher v1 benchmark pezpallet " \
f"--extrinsic=* " \ f"--extrinsic=* " \
f"--runtime=target/{profile}/wbuild/{config['package']}/{config['package'].replace('-', '_')}.wasm " \ f"--runtime=target/{profile}/wbuild/{config['package']}/{config['package'].replace('-', '_')}.wasm " \
f"--pallet={pallet} " \ f"--pezpallet={pallet} " \
f"--header={header_path} " \ f"--header={header_path} " \
f"--output={output_path} " \ f"--output={output_path} " \
f"--wasm-execution=compiled " \ f"--wasm-execution=compiled " \
@@ -44,7 +44,7 @@ jobs:
id: required id: required
run: | run: |
cargo build --locked --quiet --release -p asset-hub-zagros-runtime --features runtime-benchmarks cargo build --locked --quiet --release -p asset-hub-zagros-runtime --features runtime-benchmarks
cargo run --locked --release -p pezframe-omni-bencher --quiet -- v1 benchmark pallet --runtime target/release/wbuild/asset-hub-zagros-runtime/asset_hub_zagros_runtime.compact.compressed.wasm --all --steps 2 --repeat 1 --quiet cargo run --locked --release -p pezframe-omni-bencher --quiet -- v1 benchmark pezpallet --runtime target/release/wbuild/asset-hub-zagros-runtime/asset_hub_zagros_runtime.compact.compressed.wasm --all --steps 2 --repeat 1 --quiet
runtime-matrix: runtime-matrix:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -98,7 +98,7 @@ jobs:
ls -lrt $RUNTIME_BLOB_PATH ls -lrt $RUNTIME_BLOB_PATH
if [[ "$BENCH_CMD" == "pallet" ]]; then if [[ "$BENCH_CMD" == "pallet" ]]; then
cmd="./target/release/pezframe-omni-bencher v1 benchmark pallet --runtime $RUNTIME_BLOB_PATH --all --steps 2 --repeat 1 $FLAGS" cmd="./target/release/pezframe-omni-bencher v1 benchmark pezpallet --runtime $RUNTIME_BLOB_PATH --all --steps 2 --repeat 1 $FLAGS"
elif [[ "$BENCH_CMD" == "overhead" ]]; then elif [[ "$BENCH_CMD" == "overhead" ]]; then
cmd="./target/release/pezframe-omni-bencher v1 benchmark overhead --runtime $RUNTIME_BLOB_PATH" cmd="./target/release/pezframe-omni-bencher v1 benchmark overhead --runtime $RUNTIME_BLOB_PATH"
else else
+1 -1
View File
@@ -35,7 +35,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: script - name: script
run: cargo run --locked --release -p pezstaging-node-cli --bin bizinikiwi-node --features runtime-benchmarks --quiet -- benchmark pallet --chain dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1 --quiet run: cargo run --locked --release -p pezstaging-node-cli --bin bizinikiwi-node --features runtime-benchmarks --quiet -- benchmark pezpallet --chain dev --pezpallet "*" --extrinsic "*" --steps 2 --repeat 1 --quiet
# cf https://github.com/pezkuwichain/pezkuwi-sdk/issues/1652 # cf https://github.com/pezkuwichain/pezkuwi-sdk/issues/1652
test-syscalls: test-syscalls:
@@ -29,8 +29,8 @@ run_benchmark() {
echo "Outputting to '$output_file'" echo "Outputting to '$output_file'"
WASMTIME_BACKTRACE_DETAILS=1 RUST_LOG=${LOG} \ WASMTIME_BACKTRACE_DETAILS=1 RUST_LOG=${LOG} \
../../../../../target/release/pezframe-omni-bencher v1 benchmark pallet \ ../../../../../target/release/pezframe-omni-bencher v1 benchmark pezpallet \
--pallet "$pallet_name" \ --pezpallet "$pallet_name" \
--extrinsic "*" \ --extrinsic "*" \
--runtime "$WASM_BLOB_PATH" \ --runtime "$WASM_BLOB_PATH" \
--steps "$STEPS" \ --steps "$STEPS" \
+2 -2
View File
@@ -133,11 +133,11 @@ for PALLET in "${PALLETS[@]}"; do
echo "[+] Benchmarking $PALLET with weight file $WEIGHT_FILE"; echo "[+] Benchmarking $PALLET with weight file $WEIGHT_FILE";
OUTPUT=$( OUTPUT=$(
$BIZINIKIWI benchmark pallet \ $BIZINIKIWI benchmark pezpallet \
--chain=dev \ --chain=dev \
--steps=50 \ --steps=50 \
--repeat=20 \ --repeat=20 \
--pallet="$PALLET" \ --pezpallet="$PALLET" \
--extrinsic="*" \ --extrinsic="*" \
--wasm-execution=compiled \ --wasm-execution=compiled \
--heap-pages=4096 \ --heap-pages=4096 \
@@ -633,13 +633,13 @@ impl PalletCmd {
/// Whether this pezpallet should be run. /// Whether this pezpallet should be run.
fn pezpallet_selected(&self, pezpallet: &Vec<u8>) -> bool { fn pezpallet_selected(&self, pezpallet: &Vec<u8>) -> bool {
let include = self.pallets.clone(); let include = self.pezpallet.clone();
let included = include.is_empty() let included = include.is_empty()
|| include.iter().any(|p| p.as_bytes() == pezpallet) || include.iter().any(|p| p.as_bytes() == pezpallet)
|| include.iter().any(|p| p == "*") || include.iter().any(|p| p == "*")
|| include.iter().any(|p| p == "all"); || include.iter().any(|p| p == "all");
let excluded = self.exclude_pallets.iter().any(|p| p.as_bytes() == pezpallet); let excluded = self.exclude_pezpallets.iter().any(|p| p.as_bytes() == pezpallet);
included && !excluded included && !excluded
} }
@@ -50,18 +50,18 @@ pub enum ListOutput {
/// Benchmark the extrinsic weight of FRAME Pallets. /// Benchmark the extrinsic weight of FRAME Pallets.
#[derive(Debug, clap::Parser)] #[derive(Debug, clap::Parser)]
pub struct PalletCmd { pub struct PalletCmd {
/// Select a FRAME Pallets to benchmark, or `*` for all (in which case `extrinsic` must be /// Select a FRAME Pezpallets to benchmark, or `*` for all (in which case `extrinsic` must be
/// `*`). /// `*`).
#[arg(short, long, alias = "pezpallet", num_args = 1.., value_delimiter = ',', value_parser = parse_pallet_name, required_unless_present_any = ["list", "json_input", "all"], default_value_if("all", "true", Some("*".into())))] #[arg(short, long, alias = "pallet", num_args = 1.., value_delimiter = ',', value_parser = parse_pallet_name, required_unless_present_any = ["list", "json_input", "all"], default_value_if("all", "true", Some("*".into())))]
pub pallets: Vec<String>, pub pezpallet: Vec<String>,
/// Select an extrinsic inside the pezpallet to benchmark, or `*` or 'all' for all. /// Select an extrinsic inside the pezpallet to benchmark, or `*` or 'all' for all.
#[arg(short, long, required_unless_present_any = ["list", "json_input", "all"], default_value_if("all", "true", Some("*".into())))] #[arg(short, long, required_unless_present_any = ["list", "json_input", "all"], default_value_if("all", "true", Some("*".into())))]
pub extrinsic: Option<String>, pub extrinsic: Option<String>,
/// Comma separated list of pallets that should be excluded from the benchmark. /// Comma separated list of pezpallets that should be excluded from the benchmark.
#[arg(long, value_parser, num_args = 1.., value_delimiter = ',')] #[arg(long, value_parser, num_args = 1.., value_delimiter = ',')]
pub exclude_pallets: Vec<String>, pub exclude_pezpallets: Vec<String>,
/// Comma separated list of `pezpallet::extrinsic` combinations that should not be run. /// Comma separated list of `pezpallet::extrinsic` combinations that should not be run.
/// ///
@@ -5,9 +5,9 @@ pushd ../pezcumulus
cargo run --release --bin pezkuwi-teyrchain \ cargo run --release --bin pezkuwi-teyrchain \
--features runtime-benchmarks \ --features runtime-benchmarks \
-- \ -- \
benchmark pallet \ benchmark pezpallet \
--chain=bridge-hub-pezkuwichain-dev \ --chain=bridge-hub-pezkuwichain-dev \
--pallet=snowbridge_pallet_ethereum_client \ --pezpallet=snowbridge_pallet_ethereum_client \
--extrinsic="*" \ --extrinsic="*" \
--execution=wasm --wasm-execution=compiled \ --execution=wasm --wasm-execution=compiled \
--steps 50 --repeat 20 \ --steps 50 --repeat 20 \
+2 -2
View File
@@ -38,11 +38,11 @@ do
output_dir="xcm/" output_dir="xcm/"
extra_args="--template=./templates/xcm-bench-template.hbs" extra_args="--template=./templates/xcm-bench-template.hbs"
fi fi
$artifactsDir/pezkuwi-teyrchain benchmark pallet \ $artifactsDir/pezkuwi-teyrchain benchmark pezpallet \
$extra_args \ $extra_args \
--chain=$benchmarkRuntimeName \ --chain=$benchmarkRuntimeName \
--wasm-execution=compiled \ --wasm-execution=compiled \
--pallet=$pallet \ --pezpallet=$pallet \
--extrinsic='*' \ --extrinsic='*' \
--steps=$steps \ --steps=$steps \
--repeat=$repeat \ --repeat=$repeat \