From 47990741590c572185c705f0fa923e1e80e70fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=B3nal=20Murray?= Date: Mon, 9 Oct 2023 00:15:02 +0200 Subject: [PATCH 1/6] Remove native (+SP) runtimes --- commands/bench-all/bench-all.cmd.json | 2 +- commands/bench-overhead/bench-overhead.cmd.json | 4 ++-- commands/bench/bench.cmd.json | 10 +++++----- commands/bench/lib/bench-all-cumulus.sh | 8 ++------ commands/bench/lib/bench-pallet.sh | 2 +- commands/try-runtime/try-runtime.cmd.json | 4 ++-- 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/commands/bench-all/bench-all.cmd.json b/commands/bench-all/bench-all.cmd.json index fb8fdfa..035a1a8 100644 --- a/commands/bench-all/bench-all.cmd.json +++ b/commands/bench-all/bench-all.cmd.json @@ -24,7 +24,7 @@ "description": "Pallet + Overhead Benchmark for Polkadot", "repos": ["polkadot-sdk"], "args": { - "runtime": { "label": "Runtime", "type_one_of": ["kusama", "polkadot", "rococo", "westend"] }, + "runtime": { "label": "Runtime", "type_one_of": ["rococo", "westend"] }, "target_dir": { "label": "Target Directory", "type_string":"polkadot" } } }, diff --git a/commands/bench-overhead/bench-overhead.cmd.json b/commands/bench-overhead/bench-overhead.cmd.json index a83cb14..bcfb85c 100644 --- a/commands/bench-overhead/bench-overhead.cmd.json +++ b/commands/bench-overhead/bench-overhead.cmd.json @@ -17,7 +17,7 @@ "description": "Runs `benchmark overhead` and commits back to PR the updated `extrinsic_weights.rs` files", "repos": ["polkadot-sdk"], "args": { - "runtime": { "label": "Runtime", "type_one_of": ["polkadot", "kusama", "rococo", "westend"] }, + "runtime": { "label": "Runtime", "type_one_of": ["rococo", "westend"] }, "target_dir": { "label": "Target Directory", "type_string": "polkadot" } } }, @@ -32,7 +32,7 @@ "description": "Runs `benchmark overhead` and commits back to PR the updated `extrinsic_weights.rs` files", "repos": ["polkadot-sdk"], "args": { - "runtime": { "label": "Runtime", "type_one_of": ["asset-hub-polkadot", "asset-hub-kusama", "asset-hub-westend", "asset-hub-rococo"] }, + "runtime": { "label": "Runtime", "type_one_of": ["asset-hub-westend", "asset-hub-rococo"] }, "target_dir": { "label": "Target Directory", "type_string": "cumulus" } } }, diff --git a/commands/bench/bench.cmd.json b/commands/bench/bench.cmd.json index c0ff029..3af7629 100644 --- a/commands/bench/bench.cmd.json +++ b/commands/bench/bench.cmd.json @@ -26,7 +26,7 @@ "repos": ["command-bot-test", "polkadot-sdk"], "args": { "subcommand": { "label": "Subcommand", "type_one_of": ["runtime", "xcm"] }, - "runtime": { "label": "Runtime", "type_one_of": ["polkadot", "kusama", "rococo", "westend"] }, + "runtime": { "label": "Runtime", "type_one_of": ["rococo", "westend"] }, "pallet": { "label": "Pallet", "type_rule": "^([a-z_]+)([:]{2}[a-z_]+)?$", "example": "pallet_name" }, "target_dir": { "label": "Target Directory", "type_string": "polkadot" } } @@ -36,7 +36,7 @@ "repos": ["polkadot-sdk"], "args": { "subcommand": { "label": "Subcommand", "type_one_of": ["pallet", "xcm"] }, - "runtime": { "label": "Runtime", "type_one_of": ["asset-hub-polkadot", "asset-hub-kusama", "asset-hub-westend", "asset-hub-rococo"] }, + "runtime": { "label": "Runtime", "type_one_of": ["asset-hub-westend", "asset-hub-rococo"] }, "pallet": { "label": "Pallet", "type_rule": "^([a-z_]+)([:]{2}[a-z_]+)?$", "example": "pallet_name" }, "runtime_dir": { "label": "Runtime Dir", "type_string": "assets" }, "target_dir": { "label": "Target Directory", "type_string": "cumulus" } @@ -47,7 +47,7 @@ "repos": ["polkadot-sdk"], "args": { "subcommand": { "label": "Subcommand", "type_one_of": ["pallet", "xcm"] }, - "runtime": { "label": "Runtime", "type_one_of": ["collectives-polkadot"] }, + "runtime": { "label": "Runtime", "type_one_of": ["collectives-westend"] }, "pallet": { "label": "Pallet", "type_rule": "^([a-z_]+)([:]{2}[a-z_]+)?$", "example": "pallet_name" }, "runtime_dir": { "label": "Runtime Dir", "type_string": "collectives" }, "target_dir": { "label": "Target Directory", "type_string": "cumulus" } @@ -58,7 +58,7 @@ "repos": ["polkadot-sdk"], "args": { "subcommand": { "label": "Subcommand", "type_one_of": ["pallet", "xcm"] }, - "runtime": { "label": "Runtime", "type_one_of": ["bridge-hub-polkadot", "bridge-hub-kusama", "bridge-hub-rococo"] }, + "runtime": { "label": "Runtime", "type_one_of": ["bridge-hub-rococo"] }, "pallet": { "label": "Pallet", "type_rule": "^([a-z_]+)([:]{2}[a-z_]+)?$", "example": "pallet_name" }, "runtime_dir": { "label": "Runtime Dir", "type_string": "bridge-hubs" }, "target_dir": { "label": "Target Directory", "type_string": "cumulus" } @@ -80,7 +80,7 @@ "repos": ["polkadot-sdk"], "args": { "subcommand": { "label": "Subcommand", "type_one_of": ["pallet"] }, - "runtime": { "label": "Runtime", "type_one_of": ["glutton-kusama", "glutton-kusama-dev-1300"] }, + "runtime": { "label": "Runtime", "type_one_of": ["glutton-westend", "glutton-westend-dev-1300"] }, "pallet": { "label": "Pallet", "type_rule": "^([a-z_]+)([:]{2}[a-z_]+)?$", "example": "pallet_name" }, "runtime_dir": { "label": "Runtime Dir", "type_string": "glutton" }, "target_dir": { "label": "Target Directory", "type_string": "cumulus" } diff --git a/commands/bench/lib/bench-all-cumulus.sh b/commands/bench/lib/bench-all-cumulus.sh index 99dbc62..bd42b6d 100755 --- a/commands/bench/lib/bench-all-cumulus.sh +++ b/commands/bench/lib/bench-all-cumulus.sh @@ -75,18 +75,14 @@ echo "[+] Compiling benchmarks..." cargo build --profile $profile --locked --features=runtime-benchmarks -p polkadot-parachain-bin # Assets -run_cumulus_bench assets asset-hub-kusama -run_cumulus_bench assets asset-hub-polkadot run_cumulus_bench assets asset-hub-westend run_cumulus_bench assets asset-hub-rococo # Collectives -run_cumulus_bench collectives collectives-polkadot +run_cumulus_bench collectives collectives-westend # Bridge Hubs -run_cumulus_bench bridge-hubs bridge-hub-polkadot -run_cumulus_bench bridge-hubs bridge-hub-kusama run_cumulus_bench bridge-hubs bridge-hub-rococo # Glutton -run_cumulus_bench glutton glutton-kusama 1300 +run_cumulus_bench glutton glutton-westend 1300 diff --git a/commands/bench/lib/bench-pallet.sh b/commands/bench/lib/bench-pallet.sh index 11631a7..df05a7b 100644 --- a/commands/bench/lib/bench-pallet.sh +++ b/commands/bench/lib/bench-pallet.sh @@ -104,7 +104,7 @@ bench_pallet() { local runtime_dir="${out:-""}" local chain="$runtime" - # to support specifying parachain id from runtime name (e.g. ["glutton-kusama", "glutton-kusama-dev-1300"]) + # to support specifying parachain id from runtime name (e.g. ["glutton-westend", "glutton-westend-dev-1300"]) # If runtime ends with "-dev" or "-dev-\d+", leave as it is, otherwise concat "-dev" at the end of $chain if [[ ! "$runtime" =~ -dev(-[0-9]+)?$ ]]; then chain="${runtime}-dev" diff --git a/commands/try-runtime/try-runtime.cmd.json b/commands/try-runtime/try-runtime.cmd.json index c952313..4e192ed 100644 --- a/commands/try-runtime/try-runtime.cmd.json +++ b/commands/try-runtime/try-runtime.cmd.json @@ -8,7 +8,7 @@ "description": "Run try-runtime with specified runtime for Polkadot repo", "repos": ["polkadot", "command-bot-test"], "args": { - "chain": { "label": "Chain", "type_one_of": ["polkadot", "kusama", "westend", "rococo"] }, + "chain": { "label": "Chain", "type_one_of": ["westend", "rococo"] }, "target_path":{ "label": "Target Path", "type_string": "." }, "chain_node": { "label": "Chain Node", "type_string": "polkadot" } } @@ -17,7 +17,7 @@ "description": "Run try-runtime with specified runtime for monorepo Polkadot SDK", "repos": ["polkadot-sdk"], "args": { - "chain": { "label": "Chain", "type_one_of": ["polkadot", "kusama", "westend", "rococo"] }, + "chain": { "label": "Chain", "type_one_of": ["westend", "rococo"] }, "target_path":{ "label": "Target Path", "type_string": "./polkadot" }, "chain_node": { "label": "Chain Node", "type_string": "polkadot" } } From 8e730c279aadb735b273bdc08717a5b387292823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=B3nal=20Murray?= Date: Wed, 29 Nov 2023 11:39:06 +0000 Subject: [PATCH 2/6] Undo merge regression --- commands/try-runtime/try-runtime.cmd.json | 1 - 1 file changed, 1 deletion(-) diff --git a/commands/try-runtime/try-runtime.cmd.json b/commands/try-runtime/try-runtime.cmd.json index 6457d3f..4d7a645 100644 --- a/commands/try-runtime/try-runtime.cmd.json +++ b/commands/try-runtime/try-runtime.cmd.json @@ -9,7 +9,6 @@ "repos": ["polkadot-sdk"], "args": { "chain": { "label": "Chain", "type_one_of": ["westend", "rococo"] }, - "target_path":{ "label": "Target Path", "type_string": "./polkadot" }, "chain_node": { "label": "Chain Node", "type_string": "polkadot" } } }, From 4f86d0268f2310c81510c8c486010829ca6743ee Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 29 Nov 2023 15:32:10 +0100 Subject: [PATCH 3/6] Added bridge-hub-westend to the commands --- commands/bench/bench.cmd.json | 2 +- commands/bench/lib/bench-all-cumulus.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/bench/bench.cmd.json b/commands/bench/bench.cmd.json index 3af7629..26239f6 100644 --- a/commands/bench/bench.cmd.json +++ b/commands/bench/bench.cmd.json @@ -58,7 +58,7 @@ "repos": ["polkadot-sdk"], "args": { "subcommand": { "label": "Subcommand", "type_one_of": ["pallet", "xcm"] }, - "runtime": { "label": "Runtime", "type_one_of": ["bridge-hub-rococo"] }, + "runtime": { "label": "Runtime", "type_one_of": ["bridge-hub-rococo", "bridge-hub-westend"] }, "pallet": { "label": "Pallet", "type_rule": "^([a-z_]+)([:]{2}[a-z_]+)?$", "example": "pallet_name" }, "runtime_dir": { "label": "Runtime Dir", "type_string": "bridge-hubs" }, "target_dir": { "label": "Target Directory", "type_string": "cumulus" } diff --git a/commands/bench/lib/bench-all-cumulus.sh b/commands/bench/lib/bench-all-cumulus.sh index bd42b6d..b9e0841 100755 --- a/commands/bench/lib/bench-all-cumulus.sh +++ b/commands/bench/lib/bench-all-cumulus.sh @@ -83,6 +83,7 @@ run_cumulus_bench collectives collectives-westend # Bridge Hubs run_cumulus_bench bridge-hubs bridge-hub-rococo +run_cumulus_bench bridge-hubs bridge-hub-westend # Glutton run_cumulus_bench glutton glutton-westend 1300 From 997e93b660b5c4606fd991418d90d15333eb0c4f Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Mon, 4 Dec 2023 17:18:05 +0100 Subject: [PATCH 4/6] Fix bench bot (#55) * Comment out collectives-westend and glutton-westend * Fix Substrate build command --------- Signed-off-by: Oliver Tale-Yazdi --- commands/bench/lib/bench-all-substrate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/bench/lib/bench-all-substrate.sh b/commands/bench/lib/bench-all-substrate.sh index 3379f53..9d3522d 100644 --- a/commands/bench/lib/bench-all-substrate.sh +++ b/commands/bench/lib/bench-all-substrate.sh @@ -37,10 +37,10 @@ set -E export RUST_LOG="${RUST_LOG:-error}" echo "[+] Compiling Substrate benchmarks..." -cargo build --profile=$profile --locked --features=runtime-benchmarks -p node-cli +cargo build --profile=$profile --locked --features=runtime-benchmarks -p staging-node-cli # The executable to use. -SUBSTRATE="./target/$profile/substrate" +SUBSTRATE="./target/$profile/substrate-node" # Manually exclude some pallets. EXCLUDED_PALLETS=( From a2a6c94ee1b3fd3d1e16b7ff117195517fc5cfdb Mon Sep 17 00:00:00 2001 From: Maksym H <1177472+mordamax@users.noreply.github.com> Date: Mon, 4 Dec 2023 17:53:56 +0000 Subject: [PATCH 5/6] add taplo (#61) * add taplo * Update fmt.cmd.json * Update commands/fmt/fmt.sh Co-authored-by: Oliver Tale-Yazdi --------- Co-authored-by: Oliver Tale-Yazdi --- commands/fmt/fmt.cmd.json | 2 +- commands/fmt/fmt.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/commands/fmt/fmt.cmd.json b/commands/fmt/fmt.cmd.json index e22eb25..bd2e805 100644 --- a/commands/fmt/fmt.cmd.json +++ b/commands/fmt/fmt.cmd.json @@ -1,7 +1,7 @@ { "$schema": "../../node_modules/command-bot/src/schema/schema.cmd.json", "command": { - "description": "RustFMT. Formatting Rust code according to style guidelines and commits to your PR.", + "description": "FMT. Formatting Rust code + Toml according to style guidelines and commits to your PR.", "configuration": { "gitlab": { "job": { diff --git a/commands/fmt/fmt.sh b/commands/fmt/fmt.sh index 84368eb..26beca5 100755 --- a/commands/fmt/fmt.sh +++ b/commands/fmt/fmt.sh @@ -9,9 +9,13 @@ main() { # setup. cmd_runner_setup - # format. + # format rust code. cargo +nightly fmt + # format toml. + # since paritytech/ci-unified:bullseye-1.73.0-2023-11-01-v20231204 includes taplo-cli + taplo format --config .config/taplo.toml + # commit. git add . git commit -m "$COMMIT_MESSAGE" From fcc5ad07fba759527562a2bb86c700acd2cbe758 Mon Sep 17 00:00:00 2001 From: Maksym H <1177472+mordamax@users.noreply.github.com> Date: Tue, 5 Dec 2023 18:12:34 +0000 Subject: [PATCH 6/6] pull rebase if push failed (#62) --- commands/bench/bench.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/commands/bench/bench.sh b/commands/bench/bench.sh index 6f5c635..e9ced0e 100755 --- a/commands/bench/bench.sh +++ b/commands/bench/bench.sh @@ -127,7 +127,18 @@ main() { git remote add \ github \ "https://token:${GITHUB_TOKEN}@github.com/${GH_CONTRIBUTOR}/${GH_CONTRIBUTOR_REPO}.git" - git push github "HEAD:${GH_CONTRIBUTOR_BRANCH}" + + push_changes() { + git push github "HEAD:${GH_CONTRIBUTOR_BRANCH}" + } + + # Attempt to push changes + if ! push_changes; then + echo "Push failed, trying to rebase..." + git pull --rebase github "${GH_CONTRIBUTOR_BRANCH}" + # After successful rebase, try pushing again + push_changes + fi } main "$@"