diff --git a/.github/scripts/cmd/cmd.py b/.github/scripts/cmd/cmd.py index 611aeb0e..e086ac4d 100755 --- a/.github/scripts/cmd/cmd.py +++ b/.github/scripts/cmd/cmd.py @@ -189,22 +189,22 @@ bench_example = '''**Examples**: %(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 - %(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 %(prog)s --runtime zagros --fail-fast 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(): 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('--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') @@ -382,26 +382,26 @@ def main(): print(f'\n') - # filter out only the specified pallets from collected runtimes/pallets - if args.pallet: - print(f'Pallets: {args.pallet}') + # filter out only the specified pezpallets from collected runtimes/pezpallets + if args.pezpallet: + print(f'Pezpallets: {args.pezpallet}') 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: - if set(args.pallet).issubset(set(runtime_pallets_map[runtime])): - new_pallets_map[runtime] = args.pallet + if set(args.pezpallet).issubset(set(runtime_pallets_map[runtime])): + new_pallets_map[runtime] = args.pezpallet 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 args.pallet and not args.runtime: - print(f"No pallets {args.pallet} found in any runtime") - elif args.runtime and not args.pallet: - print(f"{args.runtime} runtime does not have any pallets") - elif args.runtime and args.pallet: - print(f"No pallets {args.pallet} found in {args.runtime}") + if args.pezpallet and not args.runtime: + print(f"No pezpallets {args.pezpallet} found in any runtime") + elif args.runtime and not args.pezpallet: + print(f"{args.runtime} runtime does not have any pezpallets") + elif args.runtime and args.pezpallet: + print(f"No pezpallets {args.pezpallet} found in {args.runtime}") else: print('No runtimes found') sys.exit(1) @@ -448,10 +448,10 @@ def main(): output_path = xcm_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"--runtime=target/{profile}/wbuild/{config['package']}/{config['package'].replace('-', '_')}.wasm " \ - f"--pallet={pallet} " \ + f"--pezpallet={pallet} " \ f"--header={header_path} " \ f"--output={output_path} " \ f"--wasm-execution=compiled " \ diff --git a/.github/workflows/check-frame-omni-bencher.yml b/.github/workflows/check-pezframe-omni-bencher.yml similarity index 94% rename from .github/workflows/check-frame-omni-bencher.yml rename to .github/workflows/check-pezframe-omni-bencher.yml index 7c5cfeec..9816bcfb 100644 --- a/.github/workflows/check-frame-omni-bencher.yml +++ b/.github/workflows/check-pezframe-omni-bencher.yml @@ -44,7 +44,7 @@ jobs: id: required run: | 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: runs-on: ubuntu-latest @@ -98,7 +98,7 @@ jobs: ls -lrt $RUNTIME_BLOB_PATH 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 cmd="./target/release/pezframe-omni-bencher v1 benchmark overhead --runtime $RUNTIME_BLOB_PATH" else diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f242ca36..109a77da 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,7 +35,7 @@ jobs: - name: Checkout uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - 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 test-syscalls: diff --git a/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/bench_all.sh b/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/bench_all.sh index 7ad1a95c..ce8d0a6c 100755 --- a/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/bench_all.sh +++ b/bizinikiwi/pezframe/staking-async/runtimes/teyrchain/bench_all.sh @@ -29,8 +29,8 @@ run_benchmark() { echo "Outputting to '$output_file'" WASMTIME_BACKTRACE_DETAILS=1 RUST_LOG=${LOG} \ - ../../../../../target/release/pezframe-omni-bencher v1 benchmark pallet \ - --pallet "$pallet_name" \ + ../../../../../target/release/pezframe-omni-bencher v1 benchmark pezpallet \ + --pezpallet "$pallet_name" \ --extrinsic "*" \ --runtime "$WASM_BLOB_PATH" \ --steps "$STEPS" \ diff --git a/bizinikiwi/scripts/run_all_benchmarks.sh b/bizinikiwi/scripts/run_all_benchmarks.sh index 915312cb..94397b45 100755 --- a/bizinikiwi/scripts/run_all_benchmarks.sh +++ b/bizinikiwi/scripts/run_all_benchmarks.sh @@ -133,11 +133,11 @@ for PALLET in "${PALLETS[@]}"; do echo "[+] Benchmarking $PALLET with weight file $WEIGHT_FILE"; OUTPUT=$( - $BIZINIKIWI benchmark pallet \ + $BIZINIKIWI benchmark pezpallet \ --chain=dev \ --steps=50 \ --repeat=20 \ - --pallet="$PALLET" \ + --pezpallet="$PALLET" \ --extrinsic="*" \ --wasm-execution=compiled \ --heap-pages=4096 \ diff --git a/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/command.rs b/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/command.rs index 4e5db32f..ad9b1509 100644 --- a/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/command.rs +++ b/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/command.rs @@ -633,13 +633,13 @@ impl PalletCmd { /// Whether this pezpallet should be run. fn pezpallet_selected(&self, pezpallet: &Vec) -> bool { - let include = self.pallets.clone(); + let include = self.pezpallet.clone(); let included = include.is_empty() || include.iter().any(|p| p.as_bytes() == pezpallet) || include.iter().any(|p| p == "*") || 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 } diff --git a/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/mod.rs b/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/mod.rs index a38c328f..386ab1b8 100644 --- a/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/mod.rs +++ b/bizinikiwi/utils/pezframe/benchmarking-cli/src/pezpallet/mod.rs @@ -50,18 +50,18 @@ pub enum ListOutput { /// Benchmark the extrinsic weight of FRAME Pallets. #[derive(Debug, clap::Parser)] 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())))] - pub pallets: Vec, + #[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 pezpallet: Vec, /// 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())))] pub extrinsic: Option, - /// 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 = ',')] - pub exclude_pallets: Vec, + pub exclude_pezpallets: Vec, /// Comma separated list of `pezpallet::extrinsic` combinations that should not be run. /// diff --git a/pezbridges/pezsnowbridge/scripts/benchmark.sh b/pezbridges/pezsnowbridge/scripts/benchmark.sh index f7a55b01..d705c465 100755 --- a/pezbridges/pezsnowbridge/scripts/benchmark.sh +++ b/pezbridges/pezsnowbridge/scripts/benchmark.sh @@ -5,9 +5,9 @@ pushd ../pezcumulus cargo run --release --bin pezkuwi-teyrchain \ --features runtime-benchmarks \ -- \ -benchmark pallet \ +benchmark pezpallet \ --chain=bridge-hub-pezkuwichain-dev \ ---pallet=snowbridge_pallet_ethereum_client \ +--pezpallet=snowbridge_pallet_ethereum_client \ --extrinsic="*" \ --execution=wasm --wasm-execution=compiled \ --steps 50 --repeat 20 \ diff --git a/pezcumulus/scripts/benchmarks-ci.sh b/pezcumulus/scripts/benchmarks-ci.sh index 3ce72622..14e748ba 100755 --- a/pezcumulus/scripts/benchmarks-ci.sh +++ b/pezcumulus/scripts/benchmarks-ci.sh @@ -38,11 +38,11 @@ do output_dir="xcm/" extra_args="--template=./templates/xcm-bench-template.hbs" fi - $artifactsDir/pezkuwi-teyrchain benchmark pallet \ + $artifactsDir/pezkuwi-teyrchain benchmark pezpallet \ $extra_args \ --chain=$benchmarkRuntimeName \ --wasm-execution=compiled \ - --pallet=$pallet \ + --pezpallet=$pallet \ --extrinsic='*' \ --steps=$steps \ --repeat=$repeat \