Files
pezkuwi-subxt/scripts/benchmarks-ci.sh
T
Sergej Sakac fcf1b67964 Glutton Parachain (#2294)
* Glutton Parachain

* implement collator stuff

* add glutton

* implement missing api calls

* small changes

* use shell-runtime as starting point

* update docs

* Glutton chain configurations

* successfully build

* add local chain config

* chain spec

* update Cargo.lock

* Update parachains/runtimes/glutton/glutton-kusama/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update parachains/runtimes/glutton/glutton-kusama/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update parachains/runtimes/glutton/glutton-kusama/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update parachains/runtimes/glutton/glutton-kusama/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* explicit indices

* update para_id

* irrelevant docs

* update glutton.json

* para_id as cli argument

* expect

* merge

* update

* fixes

* xcm-builder/runtime-benchmarks added

* benchmarks enabled

* add glutton to bench scripts + nitpick

* remove local bootnode

* ".git/.scripts/commands/fmt/fmt.sh"

* make clippy happy

* fix clippy

* fix chain_spec

* fix chain_spec 2

* fix chain_spec 3

* ".git/.scripts/commands/bench/bench.sh" pallet glutton-kusama-dev-1300 glutton pallet_glutton

* Update polkadot-parachain/src/chain_spec/glutton.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update parachains/runtimes/glutton/glutton-kusama/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

---------

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: NachoPal <ignacio.palacios.santos@gmail.com>
Co-authored-by: command-bot <>
2023-05-17 09:49:18 +00:00

54 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
category=$1
runtimeName=$2
artifactsDir=$3
steps=${4:-50}
repeat=${5:-20}
benchmarkOutput=./parachains/runtimes/$category/$runtimeName/src/weights
benchmarkRuntimeName="$runtimeName-dev"
if [ $category = "glutton" ]; then
benchmarkRuntimeName="$runtimeName-dev-1300"
fi
# Load all pallet names in an array.
pallets=($(
${artifactsDir}/polkadot-parachain benchmark pallet --list --chain="${benchmarkRuntimeName}" |\
tail -n+2 |\
cut -d',' -f1 |\
sort |\
uniq
))
if [ ${#pallets[@]} -ne 0 ]; then
echo "[+] Benchmarking ${#pallets[@]} pallets for runtime $runtime"
else
echo "$runtimeName pallet list not found in benchmarks-ci.sh"
exit 1
fi
for pallet in ${pallets[@]}
do
output_file="${pallet//::/_}"
extra_args=""
# a little hack for pallet_xcm_benchmarks - we want to force custom implementation for XcmWeightInfo
if [[ "$pallet" == "pallet_xcm_benchmarks::generic" ]] || [[ "$pallet" == "pallet_xcm_benchmarks::fungible" ]]; then
output_file="xcm/$output_file"
extra_args="--template=./templates/xcm-bench-template.hbs"
fi
$artifactsDir/polkadot-parachain benchmark pallet \
$extra_args \
--chain=$benchmarkRuntimeName \
--execution=wasm \
--wasm-execution=compiled \
--pallet=$pallet \
--extrinsic='*' \
--steps=$steps \
--repeat=$repeat \
--json \
--header=./file_header.txt \
--output="${benchmarkOutput}/${output_file}.rs" >> $artifactsDir/${pallet}_benchmark.json
done