Skip to content

Commit

Permalink
Merge branch 'main' into donal-coretime
Browse files Browse the repository at this point in the history
  • Loading branch information
seadanda authored Dec 19, 2023
2 parents 6d079e0 + fcc5ad0 commit 716c6ba
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 21 deletions.
2 changes: 1 addition & 1 deletion commands/bench-all/bench-all.cmd.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
}
},
Expand Down
4 changes: 2 additions & 2 deletions commands/bench-overhead/bench-overhead.cmd.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
}
},
Expand All @@ -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" }
}
},
Expand Down
10 changes: 5 additions & 5 deletions commands/bench/bench.cmd.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
}
Expand All @@ -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" }
Expand All @@ -47,7 +47,7 @@
"repos": ["polkadot-sdk"],
"args": {
"subcommand": { "label": "Subcommand", "type_one_of": ["pallet", "xcm"] },
"runtime": { "label": "Runtime", "type_one_of": ["collectives-polkadot", "collectives-westend"] },
"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" }
Expand All @@ -69,7 +69,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", "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" }
Expand All @@ -91,7 +91,7 @@
"repos": ["polkadot-sdk"],
"args": {
"subcommand": { "label": "Subcommand", "type_one_of": ["pallet"] },
"runtime": { "label": "Runtime", "type_one_of": ["glutton-kusama", "glutton-kusama-dev-1300", "glutton-westend", "glutton-westend-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" }
Expand Down
13 changes: 12 additions & 1 deletion commands/bench/bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@"
7 changes: 1 addition & 6 deletions commands/bench/lib/bench-all-cumulus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,19 @@ 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

# Coretime
run_cumulus_bench coretime coretime-rococo
run_cumulus_bench coretime coretime-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
run_cumulus_bench bridge-hubs bridge-hub-westend

# Glutton
run_cumulus_bench glutton glutton-kusama 1300
run_cumulus_bench glutton glutton-westend 1300
4 changes: 2 additions & 2 deletions commands/bench/lib/bench-all-substrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=(
Expand Down
2 changes: 1 addition & 1 deletion commands/bench/lib/bench-pallet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion commands/fmt/fmt.cmd.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
6 changes: 5 additions & 1 deletion commands/fmt/fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion commands/try-runtime/try-runtime.cmd.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,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"] },
"chain_node": { "label": "Chain Node", "type_string": "polkadot" }
}
},
Expand Down

0 comments on commit 716c6ba

Please sign in to comment.