From 284731717c550388ff1694711d26784ca2d8f05e Mon Sep 17 00:00:00 2001 From: Dino Pacandi Date: Mon, 8 Sep 2025 16:58:39 +0200 Subject: [PATCH 1/2] Benchmark script update --- scripts/run_benchmarks.sh | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/scripts/run_benchmarks.sh b/scripts/run_benchmarks.sh index 34c2644ed..c5254608c 100755 --- a/scripts/run_benchmarks.sh +++ b/scripts/run_benchmarks.sh @@ -136,20 +136,24 @@ for chain in ${chains//,/ }; do --heap-pages=4096 ) - # Run benchmarks & generate the weight file as JSON. - OUTPUT=$( - "${BASE_COMMAND[@]}" --json-file="$JSON_WEIGHT_FILE" 2>&1 - ) - if [ $? -ne 0 ]; then - echo "$OUTPUT" >> "$ERR_FILE" - echo "[-] Failed to benchmark $PALLET. Error written to $ERR_FILE; continuing..." - continue - fi + # TODO: Uncomment and reuse output once benchmark command is updated to correctly calculate PoV + # using JSON file as the input. At the moment of updating this script, it doesn't work properly. + # Once it's fixed, uncomment the lines below, and remove the comment '--json-input' from below. + # + # # Run benchmarks & generate the weight file as JSON. + # OUTPUT=$( + # "${BASE_COMMAND[@]}" --json-file="$JSON_WEIGHT_FILE" 2>&1 + # ) + # if [ $? -ne 0 ]; then + # echo "$OUTPUT" >> "$ERR_FILE" + # echo "[-] Failed to benchmark $PALLET. Error written to $ERR_FILE; continuing..." + # continue + # fi OUTPUT=$( "${BASE_COMMAND[@]}" \ - --json-input="$JSON_WEIGHT_FILE" \ - --output="$PALLET_WEIGHT_FILE" \ + #--json-input="$JSON_WEIGHT_FILE" \ + --output="$PALLET_WEIGHT_FILE" \ --template=./scripts/templates/pallet-weight-template.hbs 2>&1 ) if [ $? -ne 0 ]; then @@ -159,7 +163,7 @@ for chain in ${chains//,/ }; do OUTPUT=$( "${BASE_COMMAND[@]}" \ - --json-input="$JSON_WEIGHT_FILE" \ + #--json-input="$JSON_WEIGHT_FILE" \ --output="$RUNTIME_WEIGHT_FILE" \ --template=./scripts/templates/runtime-weight-template.hbs 2>&1 ) From 7f6f203434946f938085efd96ba95742a1074b14 Mon Sep 17 00:00:00 2001 From: Dino Pacandi Date: Mon, 8 Sep 2025 17:19:19 +0200 Subject: [PATCH 2/2] Adjustment --- scripts/run_benchmarks.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/run_benchmarks.sh b/scripts/run_benchmarks.sh index c5254608c..872946da5 100755 --- a/scripts/run_benchmarks.sh +++ b/scripts/run_benchmarks.sh @@ -138,7 +138,7 @@ for chain in ${chains//,/ }; do # TODO: Uncomment and reuse output once benchmark command is updated to correctly calculate PoV # using JSON file as the input. At the moment of updating this script, it doesn't work properly. - # Once it's fixed, uncomment the lines below, and remove the comment '--json-input' from below. + # Once it's fixed, return the '--json-input' to the commands below. # # # Run benchmarks & generate the weight file as JSON. # OUTPUT=$( @@ -152,8 +152,7 @@ for chain in ${chains//,/ }; do OUTPUT=$( "${BASE_COMMAND[@]}" \ - #--json-input="$JSON_WEIGHT_FILE" \ - --output="$PALLET_WEIGHT_FILE" \ + --output="$PALLET_WEIGHT_FILE" \ --template=./scripts/templates/pallet-weight-template.hbs 2>&1 ) if [ $? -ne 0 ]; then @@ -163,7 +162,6 @@ for chain in ${chains//,/ }; do OUTPUT=$( "${BASE_COMMAND[@]}" \ - #--json-input="$JSON_WEIGHT_FILE" \ --output="$RUNTIME_WEIGHT_FILE" \ --template=./scripts/templates/runtime-weight-template.hbs 2>&1 )