Skip to content

Commit d305a1a

Browse files
committed
Merge branch 'master' into ao-fix-parainclusion-weight-overestimation
* master: (51 commits) Remove unused feature gated code from the minimal template (#5237) make polkadot-parachain startup errors pretty (#5214) Coretime auto-renew (#4424) network/strategy: Backoff and ban overloaded peers to avoid submitting the same request multiple times (#5029) Fix frame crate usage doc (#5222) beefy: Tolerate pruned state on runtime API call (#5197) rpc: Enable ChainSpec for polkadot-parachain (#5205) Add an adapter for configuring AssetExchanger (#5130) Replace env_logger with sp_tracing (#5065) Adjust sync templates flow to use new release branch (#5182) litep2p/discovery: Publish authority records with external addresses only (#5176) Run UI tests in CI for some other crates (#5167) Remove `pallet::getter` usage from the pallet-balances (#4967) pallet-timestamp: `UnixTime::now` implementation logs error only if called at genesis (#5055) [CI] Cache try-runtime check (#5179) [Backport] version bumps and the prdocs reordering from stable2407 (#5178) [subsystem-benchmark] Update availability-distribution-regression-bench baseline after recent subsystem changes (#5180) Remove pallet::getter usage from proxy (#4963) Remove pallet::getter macro usage from pallet-election-provider-multi-phase (#4487) [email protected] (#5177) ...
2 parents 64b367c + 035211d commit d305a1a

File tree

608 files changed

+12679
-3402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

608 files changed

+12679
-3402
lines changed

.config/zepter.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ workflows:
2727
]
2828
# The umbrella crate uses more features, so we to check those too:
2929
check_umbrella:
30-
- [ $check.0, '--features=serde,experimental,with-tracing,tuples-96,with-tracing', '-p=polkadot-sdk' ]
30+
- [ $check.0, '--features=serde,experimental,runtime,with-tracing,tuples-96,with-tracing', '-p=polkadot-sdk' ]
3131
# Same as `check_*`, but with the `--fix` flag.
3232
default:
3333
- [ $check.0, '--fix' ]

.github/dependabot.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ updates:
55
directory: '/'
66
labels: ["A1-insubstantial", "R0-silent"]
77
schedule:
8-
interval: daily
8+
interval: weekly
9+
groups:
10+
ci_dependencies:
11+
patterns:
12+
- "*"
913
# Update Rust dependencies:
1014
- package-ecosystem: "cargo"
1115
directory: "/"
1216
labels: ["A1-insubstantial", "R0-silent"]
1317
schedule:
14-
interval: "daily"
18+
interval: "weekly"
1519
groups:
1620
# We assume these crates to be semver abiding and can therefore group them together.
1721
known_good_semver:

.github/workflows/check-licenses.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1717
steps:
1818
- name: Checkout sources
19-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
19+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2020
- uses: actions/[email protected]
2121
with:
2222
node-version: "18.x"

.github/workflows/check-links.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Restore lychee cache
21-
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3.3.2 (7. Sep 2023)
21+
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v3.3.2 (7. Sep 2023)
2222
with:
2323
path: .lycheecache
2424
key: cache-lychee-${{ github.sha }}
2525
# This should restore from the most recent one:
2626
restore-keys: cache-lychee-
2727

28-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.0 (22. Sep 2023)
28+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.0 (22. Sep 2023)
2929

3030
- name: Lychee link checker
3131
uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621 # for v1.9.1 (10. Jan 2024)

.github/workflows/check-prdoc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
if: github.event.pull_request.number != ''
2121
steps:
2222
- name: Checkout repo
23-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
23+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7
2424
# we cannot show the version in this step (ie before checking out the repo)
2525
# due to https://github.com/paritytech/prdoc/issues/15
2626
- name: Check if PRdoc is required

.github/workflows/check-runtime-migration.yml

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
pull_request:
88
types: [opened, synchronize, reopened, ready_for_review]
99
merge_group:
10+
workflow_dispatch:
11+
1012
concurrency:
1113
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1214
cancel-in-progress: true
@@ -27,7 +29,9 @@ jobs:
2729
# rococo and westend are disabled for now (no access to parity-chains.parity.io)
2830
check-runtime-migration:
2931
runs-on: arc-runners-polkadot-sdk-beefy
30-
timeout-minutes: 40
32+
# We need to set this to rather long to allow the snapshot to be created, but the average time
33+
# should be much lower.
34+
timeout-minutes: 60
3135
needs: [set-image]
3236
container:
3337
image: ${{ needs.set-image.outputs.IMAGE }}
@@ -94,22 +98,45 @@ jobs:
9498
steps:
9599
- name: Checkout
96100
uses: actions/checkout@v4
97-
- name: script
98-
run: |
99-
echo "Running ${{ matrix.network }} runtime migration check"
100-
export RUST_LOG=remote-ext=debug,runtime=debug
101101

102-
echo "---------- Downloading try-runtime CLI ----------"
103-
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.5.4/try-runtime-x86_64-unknown-linux-musl -o try-runtime
102+
- name: Download CLI
103+
run: |
104+
curl -sL https://github.com/paritytech/try-runtime-cli/releases/download/v0.7.0/try-runtime-x86_64-unknown-linux-musl -o try-runtime
104105
chmod +x ./try-runtime
105106
echo "Using try-runtime-cli version:"
106107
./try-runtime --version
107108
109+
- name: Get Date
110+
id: get-date
111+
run: |
112+
echo "today=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT
113+
shell: bash
114+
115+
- name: Download Snapshot
116+
uses: actions/cache@v4
117+
with:
118+
path: snapshot.raw
119+
key: try-runtime-snapshot-${{ matrix.network }}-${{ steps.get-date.outputs.today }}
120+
save-always: true
121+
122+
- name: Create Snapshot If Stale
123+
if: ${{ hashFiles('snapshot.raw') == '' }}
124+
run: |
125+
echo "Creating new snapshot for today (${{ steps.get-date.outputs.today }})"
126+
./try-runtime create-snapshot --uri ${{ matrix.uri }} snapshot.raw
127+
128+
- name: Build Runtime
129+
run: |
108130
echo "---------- Building ${{ matrix.package }} runtime ----------"
109-
time forklift cargo build --release --locked -p ${{ matrix.package }} --features try-runtime
131+
time forklift cargo build --release --locked -p ${{ matrix.package }} --features try-runtime -q
132+
133+
- name: Run Check
134+
run: |
135+
echo "Running ${{ matrix.network }} runtime migration check"
136+
export RUST_LOG=remote-ext=debug,runtime=debug
110137
111138
echo "---------- Executing on-runtime-upgrade for ${{ matrix.network }} ----------"
112139
time ./try-runtime ${{ matrix.command_extra_args }} \
113140
--runtime ./target/release/wbuild/${{ matrix.package }}/${{ matrix.wasm }} \
114-
on-runtime-upgrade --disable-spec-version-check --checks=all ${{ matrix.subcommand_extra_args }} live --uri ${{ matrix.uri }}
141+
on-runtime-upgrade --disable-spec-version-check --checks=all ${{ matrix.subcommand_extra_args }} snap -p snapshot.raw
115142
sleep 5

.github/workflows/check-semver.yml

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,85 @@ on:
55
types: [opened, synchronize, reopened, ready_for_review]
66
paths:
77
- prdoc/*.prdoc
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: check-semver-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
814
env:
915
TOOLCHAIN: nightly-2024-06-01
1016

17+
1118
jobs:
1219
check-semver:
1320
runs-on: ubuntu-latest
1421
container:
1522
image: docker.io/paritytech/ci-unified:bullseye-1.77.0-2024-04-10-v20240408
1623
steps:
17-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
24+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
25+
26+
- name: extra git setup
27+
run: |
28+
git config --global --add safe.directory '*'
29+
git fetch --no-tags --no-recurse-submodules --depth=1 origin master
30+
git branch old origin/master
31+
32+
- name: Comment If Backport
33+
if: ${{ startsWith(github.event.pull_request.base.ref, 'stable') }}
34+
env:
35+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
PR: ${{ github.event.pull_request.number }}
37+
run: |
38+
echo "This is a backport into stable."
39+
40+
wget -q https://github.com/cli/cli/releases/download/v2.51.0/gh_2.51.0_linux_amd64.tar.gz -O gh.tar.gz && \
41+
tar -xzf gh.tar.gz && mv gh_2.51.0_linux_amd64/bin/gh /usr/local/bin/gh && rm gh.tar.gz
42+
chmod +x /usr/local/bin/gh
43+
44+
cat > msg.txt <<EOF
45+
This pull request is amending an existing release. Please proceed with extreme caution,
46+
as to not impact downstream teams that rely on the stability of it. Some things to consider:
47+
- Backports are only for 'patch' or 'minor' changes. No 'major' or other breaking change.
48+
- Should be a legit *fix* for some bug, not adding tons of new features.
49+
- Must either be already audited or trivial (not sure audit).
50+
51+
<details><summary><i>Emergency Bypass</i></summary>
52+
<p>
53+
54+
If you really need to bypass this check: add <code>validate: false</code> to each crate
55+
in the Prdoc where a breaking change is introduced. This will release a new major
56+
version of that crate and all its reverse dependencies and basically break the release.
57+
58+
</p>
59+
</details>
60+
EOF
61+
gh issue comment $PR --edit-last -F msg.txt || gh issue comment $PR -F msg.txt
62+
63+
echo "PRDOC_EXTRA_ARGS=--max-bump minor" >> $GITHUB_ENV
1864
1965
- name: Rust Cache
2066
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
2167
with:
2268
cache-on-failure: true
2369

24-
- name: install parity-publish
25-
run: cargo install [email protected]
26-
2770
- name: Rust compilation prerequisites
2871
run: |
2972
rustup default $TOOLCHAIN
30-
rustup target add wasm32-unknown-unknown --toolchain $TOOLCHAIN
3173
rustup component add rust-src --toolchain $TOOLCHAIN
3274
33-
- name: extra git setup
34-
run: |
35-
git config --global --add safe.directory '*'
36-
git fetch --no-tags --no-recurse-submodules --depth=1 origin master
37-
git branch old origin/master
75+
- name: install parity-publish
76+
# Set the target dir to cache the build.
77+
run: CARGO_TARGET_DIR=./target/ cargo install parity-publish -q
3878

3979
- name: check semver
4080
run: |
4181
export CARGO_TARGET_DIR=target
4282
export RUSTFLAGS='-A warnings -A missing_docs'
4383
export SKIP_WASM_BUILD=1
44-
if ! parity-publish --color always prdoc --since old --validate prdoc/pr_$PR.prdoc -v --toolchain $TOOLCHAIN; then
84+
85+
if ! parity-publish --color always prdoc --since old --validate prdoc/pr_$PR.prdoc $PRDOC_EXTRA_ARGS -v --toolchain $TOOLCHAIN; then
86+
4587
cat <<EOF
4688
👋 Hello developer! The SemVer information that you declared in the prdoc file did not match what the CI detected.
4789
@@ -56,3 +98,4 @@ jobs:
5698
fi
5799
env:
58100
PR: ${{ github.event.pull_request.number }}
101+
PRDOC_EXTRA_ARGS: ${{ env.PRDOC_EXTRA_ARGS }}

.github/workflows/checks-quick.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ jobs:
3535
container:
3636
image: ${{ needs.set-image.outputs.IMAGE }}
3737
steps:
38-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
38+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
3939
- name: Cargo fmt
4040
run: cargo +nightly fmt --all -- --check
4141
check-dependency-rules:
4242
runs-on: ubuntu-latest
4343
timeout-minutes: 20
4444
steps:
45-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
45+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
4646
- name: check dependency rules
4747
run: |
4848
cd substrate/
@@ -54,7 +54,7 @@ jobs:
5454
container:
5555
image: ${{ needs.set-image.outputs.IMAGE }}
5656
steps:
57-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
57+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
5858
- name: fetch deps
5959
run: |
6060
# Pull all dependencies eagerly:
@@ -70,7 +70,7 @@ jobs:
7070
container:
7171
image: ${{ needs.set-image.outputs.IMAGE }}
7272
steps:
73-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
73+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
7474
- name: run rust features
7575
run: bash .gitlab/rust-features.sh .
7676
check-toml-format:
@@ -80,7 +80,7 @@ jobs:
8080
container:
8181
image: ${{ needs.set-image.outputs.IMAGE }}
8282
steps:
83-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
83+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
8484
- name: check toml format
8585
run: |
8686
taplo format --check --config .config/taplo.toml
@@ -89,7 +89,7 @@ jobs:
8989
runs-on: ubuntu-latest
9090
timeout-minutes: 20
9191
steps:
92-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.0 (22. Sep 2023)
92+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.0 (22. Sep 2023)
9393
- name: install python deps
9494
run: |
9595
sudo apt-get update && sudo apt-get install -y python3-pip python3
@@ -107,7 +107,7 @@ jobs:
107107
timeout-minutes: 20
108108
steps:
109109
- name: Checkout sources
110-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
110+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
111111
- name: Setup Node.js
112112
uses: actions/[email protected]
113113
with:
@@ -132,7 +132,7 @@ jobs:
132132
container:
133133
image: ${{ needs.set-image.outputs.IMAGE }}
134134
steps:
135-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.0 (22. Sep 2023)
135+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.0 (22. Sep 2023)
136136
- name: install python deps
137137
run: pip3 install "cargo-workspace>=1.2.4" toml
138138
- name: check umbrella correctness

.github/workflows/misc-sync-templates.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ on:
1818
# A manual dispatch for now - automatic on releases later.
1919
workflow_dispatch:
2020
inputs:
21-
crate_release_version:
22-
description: 'A release version to use, e.g. 1.9.0'
21+
stable_release_branch:
22+
description: 'Stable release branch, e.g. stable2407'
2323
required: true
2424

25-
2625
jobs:
2726
sync-templates:
2827
runs-on: ubuntu-latest
@@ -41,10 +40,10 @@ jobs:
4140
run: |
4241
git config --global user.name "Template Bot"
4342
git config --global user.email "163342540+paritytech-polkadotsdk-templatebot[bot]@users.noreply.github.com"
44-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
4544
with:
4645
path: polkadot-sdk
47-
ref: "release-crates-io-v${{ github.event.inputs.crate_release_version }}"
46+
ref: "${{ github.event.inputs.stable_release_branch }}"
4847
- name: Generate a token for the template repository
4948
id: app_token
5049
uses: actions/[email protected]
@@ -53,7 +52,7 @@ jobs:
5352
repositories: "polkadot-sdk-${{ matrix.template }}-template"
5453
app-id: ${{ secrets.TEMPLATE_APP_ID }}
5554
private-key: ${{ secrets.TEMPLATE_APP_KEY }}
56-
- uses: actions/checkout@v3
55+
- uses: actions/checkout@v4
5756
with:
5857
repository: "paritytech/polkadot-sdk-${{ matrix.template }}-template"
5958
path: "${{ env.template-path }}"
@@ -69,19 +68,19 @@ jobs:
6968
protobuf-compiler
7069
rustup target add wasm32-unknown-unknown
7170
rustup component add rustfmt clippy rust-src
72-
71+
7372
# 2. Yanking the template out of the monorepo workspace.
7473

75-
- name: Use psvm to replace git references with released creates.
76-
run: find . -type f -name 'Cargo.toml' -exec psvm -o -v ${{ github.event.inputs.crate_release_version }} -p {} \;
74+
- name: Replace dev-dependencies path references with workspace references
75+
run: find . -type f -name 'Cargo.toml' -exec sed -i'' -E "s/path = \"\.\.\/.*\"/workspace = true/g" {} \;
7776
working-directory: polkadot-sdk/templates/${{ matrix.template }}/
7877
- name: Create a new workspace Cargo.toml
7978
run: |
8079
cat << EOF > Cargo.toml
8180
[workspace.package]
8281
license = "MIT-0"
8382
authors = ["Parity Technologies <[email protected]>"]
84-
homepage = "https://substrate.io"
83+
homepage = "https://paritytech.github.io/polkadot-sdk/"
8584
8685
[workspace]
8786
members = [
@@ -123,7 +122,7 @@ jobs:
123122
cp -r polkadot-sdk/templates/${{ matrix.template }}/* "${{ env.template-path }}/"
124123
125124
- name: Run psvm on monorepo workspace dependencies
126-
run: psvm -o -v ${{ github.event.inputs.crate_release_version }} -p ./Cargo.toml
125+
run: psvm -o -v ${{ github.event.inputs.stable_release_branch }} -p ./Cargo.toml
127126
working-directory: polkadot-sdk/
128127
- name: Copy over required workspace dependencies
129128
run: |
@@ -164,12 +163,12 @@ jobs:
164163
token: ${{ steps.app_token.outputs.token }}
165164
add-paths: |
166165
./*
167-
title: "[Don't merge] Update the ${{ matrix.template }} template to ${{ github.event.inputs.crate_release_version }}"
166+
title: "[Don't merge] Update the ${{ matrix.template }} template to ${{ github.event.inputs.stable_release_branch }}"
168167
body: "The template has NOT been successfully built and needs to be inspected."
169-
branch: "update-template/${{ github.event.inputs.crate_release_version }}"
168+
branch: "update-template/${{ github.event.inputs.stable_release_branch }}"
170169
- name: Push changes
171170
run: |
172171
git add -A .
173-
git commit --allow-empty -m "Update to ${{ github.event.inputs.crate_release_version }} triggered by ${{ github.event_name }}"
172+
git commit --allow-empty -m "Update to ${{ github.event.inputs.stable_release_branch }} triggered by ${{ github.event_name }}"
174173
git push
175174
working-directory: "${{ env.template-path }}"

0 commit comments

Comments
 (0)