Skip to content

Commit

Permalink
Merge branch 'master' into replace-lazy-with-oncelock
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr authored Sep 29, 2024
2 parents d2ce287 + df12fd3 commit cbe75dd
Show file tree
Hide file tree
Showing 508 changed files with 13,937 additions and 6,146 deletions.
2 changes: 1 addition & 1 deletion .github/env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
IMAGE="docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v202407161507"
IMAGE="docker.io/paritytech/ci-unified:bullseye-1.81.0-2024-09-11-v202409111034"
2 changes: 1 addition & 1 deletion .github/scripts/cmd/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def main():

# loop over remaining runtimes to collect available pallets
for runtime in runtimesMatrix.values():
os.system(f"forklift cargo build -p {runtime['package']} --profile {profile} --features runtime-benchmarks")
os.system(f"forklift cargo build -p {runtime['package']} --profile {profile} --features={runtime['bench_features']}")
print(f'-- listing pallets for benchmark for {runtime["name"]}')
wasm_file = f"target/{profile}/wbuild/{runtime['package']}/{runtime['package'].replace('-', '_')}.wasm"
output = os.popen(
Expand Down
30 changes: 15 additions & 15 deletions .github/scripts/cmd/test_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

# Mock data for runtimes-matrix.json
mock_runtimes_matrix = [
{"name": "dev", "package": "kitchensink-runtime", "path": "substrate/frame", "header": "substrate/HEADER-APACHE2", "template": "substrate/.maintain/frame-weight-template.hbs"},
{"name": "westend", "package": "westend-runtime", "path": "polkadot/runtime/westend", "header": "polkadot/file_header.txt", "template": "polkadot/xcm/pallet-xcm-benchmarks/template.hbs"},
{"name": "rococo", "package": "rococo-runtime", "path": "polkadot/runtime/rococo", "header": "polkadot/file_header.txt", "template": "polkadot/xcm/pallet-xcm-benchmarks/template.hbs"},
{"name": "asset-hub-westend", "package": "asset-hub-westend-runtime", "path": "cumulus/parachains/runtimes/assets/asset-hub-westend", "header": "cumulus/file_header.txt", "template": "cumulus/templates/xcm-bench-template.hbs"},
{"name": "dev", "package": "kitchensink-runtime", "path": "substrate/frame", "header": "substrate/HEADER-APACHE2", "template": "substrate/.maintain/frame-weight-template.hbs", "bench_features": "runtime-benchmarks,riscv"},
{"name": "westend", "package": "westend-runtime", "path": "polkadot/runtime/westend", "header": "polkadot/file_header.txt", "template": "polkadot/xcm/pallet-xcm-benchmarks/template.hbs", "bench_features": "runtime-benchmarks"},
{"name": "rococo", "package": "rococo-runtime", "path": "polkadot/runtime/rococo", "header": "polkadot/file_header.txt", "template": "polkadot/xcm/pallet-xcm-benchmarks/template.hbs", "bench_features": "runtime-benchmarks"},
{"name": "asset-hub-westend", "package": "asset-hub-westend-runtime", "path": "cumulus/parachains/runtimes/assets/asset-hub-westend", "header": "cumulus/file_header.txt", "template": "cumulus/templates/xcm-bench-template.hbs", "bench_features": "runtime-benchmarks"},
]

def get_mock_bench_output(runtime, pallets, output_path, header, template = None):
Expand Down Expand Up @@ -84,10 +84,10 @@ def test_bench_command_normal_execution_all_runtimes(self):

expected_calls = [
# Build calls
call("forklift cargo build -p kitchensink-runtime --profile release --features runtime-benchmarks"),
call("forklift cargo build -p westend-runtime --profile release --features runtime-benchmarks"),
call("forklift cargo build -p rococo-runtime --profile release --features runtime-benchmarks"),
call("forklift cargo build -p asset-hub-westend-runtime --profile release --features runtime-benchmarks"),
call("forklift cargo build -p kitchensink-runtime --profile release --features=runtime-benchmarks,riscv"),
call("forklift cargo build -p westend-runtime --profile release --features=runtime-benchmarks"),
call("forklift cargo build -p rococo-runtime --profile release --features=runtime-benchmarks"),
call("forklift cargo build -p asset-hub-westend-runtime --profile release --features=runtime-benchmarks"),

call(get_mock_bench_output('kitchensink', 'pallet_balances', './substrate/frame/balances/src/weights.rs', os.path.abspath('substrate/HEADER-APACHE2'), "substrate/.maintain/frame-weight-template.hbs")),
call(get_mock_bench_output('westend', 'pallet_balances', './polkadot/runtime/westend/src/weights', os.path.abspath('polkadot/file_header.txt'))),
Expand Down Expand Up @@ -118,7 +118,7 @@ def test_bench_command_normal_execution(self):

expected_calls = [
# Build calls
call("forklift cargo build -p westend-runtime --profile release --features runtime-benchmarks"),
call("forklift cargo build -p westend-runtime --profile release --features=runtime-benchmarks"),

# Westend runtime calls
call(get_mock_bench_output('westend', 'pallet_balances', './polkadot/runtime/westend/src/weights', header_path)),
Expand Down Expand Up @@ -149,7 +149,7 @@ def test_bench_command_normal_execution_xcm(self):

expected_calls = [
# Build calls
call("forklift cargo build -p westend-runtime --profile release --features runtime-benchmarks"),
call("forklift cargo build -p westend-runtime --profile release --features=runtime-benchmarks"),

# Westend runtime calls
call(get_mock_bench_output(
Expand Down Expand Up @@ -185,8 +185,8 @@ def test_bench_command_two_runtimes_two_pallets(self):

expected_calls = [
# Build calls
call("forklift cargo build -p westend-runtime --profile release --features runtime-benchmarks"),
call("forklift cargo build -p rococo-runtime --profile release --features runtime-benchmarks"),
call("forklift cargo build -p westend-runtime --profile release --features=runtime-benchmarks"),
call("forklift cargo build -p rococo-runtime --profile release --features=runtime-benchmarks"),
# Westend runtime calls
call(get_mock_bench_output('westend', 'pallet_staking', './polkadot/runtime/westend/src/weights', header_path)),
call(get_mock_bench_output('westend', 'pallet_balances', './polkadot/runtime/westend/src/weights', header_path)),
Expand Down Expand Up @@ -220,7 +220,7 @@ def test_bench_command_one_dev_runtime(self):

expected_calls = [
# Build calls
call("forklift cargo build -p kitchensink-runtime --profile release --features runtime-benchmarks"),
call("forklift cargo build -p kitchensink-runtime --profile release --features=runtime-benchmarks,riscv"),
# Westend runtime calls
call(get_mock_bench_output(
'kitchensink',
Expand Down Expand Up @@ -254,7 +254,7 @@ def test_bench_command_one_cumulus_runtime(self):

expected_calls = [
# Build calls
call("forklift cargo build -p asset-hub-westend-runtime --profile release --features runtime-benchmarks"),
call("forklift cargo build -p asset-hub-westend-runtime --profile release --features=runtime-benchmarks"),
# Asset-hub-westend runtime calls
call(get_mock_bench_output(
'asset-hub-westend',
Expand Down Expand Up @@ -288,7 +288,7 @@ def test_bench_command_one_cumulus_runtime_xcm(self):

expected_calls = [
# Build calls
call("forklift cargo build -p asset-hub-westend-runtime --profile release --features runtime-benchmarks"),
call("forklift cargo build -p asset-hub-westend-runtime --profile release --features=runtime-benchmarks"),
# Asset-hub-westend runtime calls
call(get_mock_bench_output(
'asset-hub-westend',
Expand Down
6 changes: 1 addition & 5 deletions .github/scripts/generate-prdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def create_prdoc(pr, audience, title, description, patch, bump, force):
# Go up until we find a Cargo.toml
p = os.path.join(workspace.path, p)
while not os.path.exists(os.path.join(p, "Cargo.toml")):
print(f"Could not find Cargo.toml in {p}")
if p == '/':
exit(1)
p = os.path.dirname(p)
Expand All @@ -76,7 +75,6 @@ def create_prdoc(pr, audience, title, description, patch, bump, force):
manifest = toml.load(f)

if not "package" in manifest:
print(f"File was not in any crate: {p}")
continue

crate_name = manifest["package"]["name"]
Expand All @@ -85,8 +83,6 @@ def create_prdoc(pr, audience, title, description, patch, bump, force):
else:
print(f"Skipping unpublished crate: {crate_name}")

print(f"Modified crates: {modified_crates.keys()}")

for crate_name in modified_crates.keys():
entry = { "name": crate_name }

Expand Down Expand Up @@ -137,4 +133,4 @@ def main(args):

if __name__ == "__main__":
args = setup_parser().parse_args()
main(args)
main(args)
4 changes: 2 additions & 2 deletions .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
- uses: actions/[email protected].3
- uses: actions/[email protected].4
with:
node-version: "18.x"
registry-url: "https://npm.pkg.github.com"
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
- uses: actions/[email protected].3
- uses: actions/[email protected].4
with:
node-version: "18.x"
registry-url: "https://npm.pkg.github.com"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-runtime-migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ concurrency:
cancel-in-progress: true

jobs:

preflight:
uses: ./.github/workflows/reusable-preflight.yml

# More info can be found here: https://github.com/paritytech/polkadot/pull/5865
check-runtime-migration:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
# We need to set this to rather long to allow the snapshot to be created, but the average time
# should be much lower.
timeout-minutes: 60
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks-quick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
- name: Checkout sources
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
- name: Setup Node.js
uses: actions/[email protected].3
uses: actions/[email protected].4
with:
node-version: "18.x"
registry-url: "https://npm.pkg.github.com"
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ concurrency:
permissions: {}

jobs:

preflight:
uses: ./.github/workflows/reusable-preflight.yml

cargo-clippy:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
needs: [preflight]
# if: ${{ needs.preflight.outputs.changes_rust }}
if: ${{ needs.preflight.outputs.changes_rust }}
timeout-minutes: 40
container:
image: ${{ needs.preflight.outputs.IMAGE }}
Expand All @@ -33,31 +32,31 @@ jobs:
- uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
- name: script
run: |
forklift cargo clippy --all-targets --locked --workspace
forklift cargo clippy --all-targets --all-features --locked --workspace
forklift cargo clippy --all-targets --locked --workspace --quiet
forklift cargo clippy --all-targets --all-features --locked --workspace --quiet
check-try-runtime:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
needs: [preflight]
# if: ${{ needs.preflight.outputs.changes_rust }}
if: ${{ needs.preflight.outputs.changes_rust }}
timeout-minutes: 40
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7
- name: script
run: |
forklift cargo check --locked --all --features try-runtime
forklift cargo check --locked --all --features try-runtime --quiet
# this is taken from cumulus
# Check that parachain-template will compile with `try-runtime` feature flag.
forklift cargo check --locked -p parachain-template-node --features try-runtime
# add after https://github.com/paritytech/substrate/pull/14502 is merged
# experimental code may rely on try-runtime and vice-versa
forklift cargo check --locked --all --features try-runtime,experimental
forklift cargo check --locked --all --features try-runtime,experimental --quiet
# check-core-crypto-features works fast without forklift
check-core-crypto-features:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
needs: [preflight]
# if: ${{ needs.preflight.outputs.changes_rust }}
if: ${{ needs.preflight.outputs.changes_rust }}
timeout-minutes: 30
container:
image: ${{ needs.preflight.outputs.IMAGE }}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/cmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,9 @@ jobs:

- name: Install dependencies for bench
if: startsWith(steps.get-pr-comment.outputs.group2, 'bench')
run: cargo install subweight frame-omni-bencher --locked
run: |
cargo install subweight --locked
cargo install --path substrate/utils/frame/omni-bencher --locked
- name: Run cmd
id: cmd
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/command-prdoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on:
- "Runtime Dev"
- "Runtime User"
- "Node Dev"
- "Node User"
- "Node Operator"
overwrite:
type: choice
description: Overwrite existing PrDoc
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ on:
merge_group:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
preflight:
if: contains(github.event.label.name, 'GHA-migration')
uses: ./.github/workflows/reusable-preflight.yml

test-rustdoc:
runs-on: arc-runners-polkadot-sdk-beefy
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
Expand All @@ -38,7 +40,8 @@ jobs:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"

build-rustdoc:
runs-on: arc-runners-polkadot-sdk-beefy
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
needs: [preflight, test-rustdoc]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/misc-sync-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
timeout-minutes: 90
- name: Create PR on failure
if: failure() && steps.check-compilation.outcome == 'failure'
uses: peter-evans/create-pull-request@8867c4aba1b742c39f8d0ba35429c2dfa4b6cb20 # v5
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v5
with:
path: "${{ env.template-path }}"
token: ${{ steps.app_token.outputs.token }}
Expand All @@ -167,7 +167,7 @@ jobs:
body: "The template has NOT been successfully built and needs to be inspected."
branch: "update-template/${{ github.event.inputs.stable_release_branch }}"
- name: Create PR on success
uses: peter-evans/create-pull-request@8867c4aba1b742c39f8d0ba35429c2dfa4b6cb20 # v5
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v5
with:
path: "${{ env.template-path }}"
token: ${{ steps.app_token.outputs.token }}
Expand Down
Loading

0 comments on commit cbe75dd

Please sign in to comment.