Skip to content

Commit

Permalink
Merge branch 'master' into alistair/support-eth
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr authored Jan 7, 2025
2 parents 60f65a9 + 1059be7 commit 124e313
Show file tree
Hide file tree
Showing 219 changed files with 5,665 additions and 1,683 deletions.
4 changes: 3 additions & 1 deletion .config/lychee.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exclude = [
"http://visitme/",
"https://visitme/",

# TODO <https://github.com/paritytech/polkadot-sdk/issues/134>
# TODO meta issue: <https://github.com/paritytech/polkadot-sdk/issues/134>
"https://docs.substrate.io/main-docs/build/custom-rpc/#public-rpcs",
"https://docs.substrate.io/rustdocs/latest/sp_api/macro.decl_runtime_apis.html",
"https://github.com/ipfs/js-ipfs-bitswap/blob/",
Expand All @@ -50,8 +50,10 @@ exclude = [
"https://w3f.github.io/parachain-implementers-guide/runtime/session_info.html",

# Behind a captcha (code 403):
"https://chainlist.org/chain/*",
"https://iohk.io/en/blog/posts/2023/11/03/partner-chains-are-coming-to-cardano/",
"https://www.reddit.com/r/rust/comments/3spfh1/does_collect_allocate_more_than_once_while/",

# 403 rate limited:
"https://etherscan.io/block/11090290",
"https://subscan.io/",
Expand Down
18 changes: 17 additions & 1 deletion .github/scripts/generate-prdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ def from_pr_number(n, audience, bump, force):

create_prdoc(n, audience, pr.title, pr.body, patch, bump, force)

def translate_audience(audience):
aliases = {
'runtime_dev': 'Runtime Dev',
'runtime_user': 'Runtime Operator',
'node_dev': 'Node Dev',
'node_user': 'Node User',
}

if audience in aliases:
to = aliases[audience]
print(f"Translated audience '{audience}' to '{to}'")
audience = to

return audience

def create_prdoc(pr, audience, title, description, patch, bump, force):
path = f"prdoc/pr_{pr}.prdoc"

Expand All @@ -49,6 +64,7 @@ def create_prdoc(pr, audience, title, description, patch, bump, force):
print(f"No preexisting PrDoc for PR {pr}")

prdoc = { "title": title, "doc": [{}], "crates": [] }
audience = translate_audience(audience)

prdoc["doc"][0]["audience"] = audience
prdoc["doc"][0]["description"] = description
Expand Down Expand Up @@ -117,7 +133,7 @@ def setup_parser(parser=None, pr_required=True):
parser = argparse.ArgumentParser()
parser.add_argument("--pr", type=int, required=pr_required, help="The PR number to generate the PrDoc for.")
parser.add_argument("--audience", type=str, nargs='*', choices=allowed_audiences, default=["todo"], help="The audience of whom the changes may concern. Example: --audience runtime_dev node_dev")
parser.add_argument("--bump", type=str, default="major", choices=["patch", "minor", "major", "silent", "ignore", "no_change"], help="A default bump level for all crates. Example: --bump patch")
parser.add_argument("--bump", type=str, default="major", choices=["patch", "minor", "major", "silent", "ignore", "none"], help="A default bump level for all crates. Example: --bump patch")
parser.add_argument("--force", action="store_true", help="Whether to overwrite any existing PrDoc.")
return parser

Expand Down
109 changes: 109 additions & 0 deletions .github/workflows/benchmarks-networking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Networking Benchmarks

on:
push:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

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

build:
timeout-minutes: 50
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER_BENCHMARK }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
strategy:
fail-fast: false
matrix:
features:
[
{ bench: "notifications_protocol" },
{ bench: "request_response_protocol" },
]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run Benchmarks
id: run-benchmarks
run: |
mkdir -p ./charts
forklift cargo bench -p sc-network --bench ${{ matrix.features.bench }} -- --output-format bencher | grep "^test" | tee ./charts/${{ matrix.features.bench }}.txt || echo "Benchmarks failed"
ls -lsa ./charts
- name: Upload artifacts
uses: actions/[email protected]
with:
name: ${{ matrix.features.bench }}-${{ github.sha }}
path: ./charts

publish-benchmarks:
timeout-minutes: 60
needs: [build]
if: github.ref == 'refs/heads/master'
environment: subsystem-benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: gh-pages
fetch-depth: 0

- run: git checkout master --

- name: Download artifacts
uses: actions/[email protected]
with:
name: notifications_protocol-${{ github.sha }}
path: ./charts

- name: Download artifacts
uses: actions/[email protected]
with:
name: request_response_protocol-${{ github.sha }}
path: ./charts

- name: Setup git
run: |
# Fixes "detected dubious ownership" error in the ci
git config --global --add safe.directory '*'
ls -lsR ./charts
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.POLKADOTSDK_GHPAGES_APP_ID }}
private-key: ${{ secrets.POLKADOTSDK_GHPAGES_APP_KEY }}

- name: Generate ${{ env.BENCH }}
env:
BENCH: notifications_protocol
uses: benchmark-action/github-action-benchmark@v1
with:
tool: "cargo"
output-file-path: ./charts/${{ env.BENCH }}.txt
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
github-token: ${{ steps.app-token.outputs.token }}
auto-push: true

- name: Generate ${{ env.BENCH }}
env:
BENCH: request_response_protocol
uses: benchmark-action/github-action-benchmark@v1
with:
tool: "cargo"
output-file-path: ./charts/${{ env.BENCH }}.txt
benchmark-data-dir-path: ./bench/${{ env.BENCH }}
github-token: ${{ steps.app-token.outputs.token }}
auto-push: true
File renamed without changes.
10 changes: 9 additions & 1 deletion .github/workflows/check-semver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Check semver

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
workflow_dispatch:
merge_group:

Expand Down Expand Up @@ -62,21 +62,29 @@ jobs:
echo "PRDOC_EXTRA_ARGS=--max-bump minor" >> $GITHUB_ENV
- name: Echo Skip
if: ${{ contains(github.event.pull_request.labels.*.name, 'R0-silent') }}
run: echo "Skipping this PR because it is labeled as R0-silent."

- name: Rust Cache
if: ${{ !contains(github.event.pull_request.labels.*.name, 'R0-silent') }}
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
with:
cache-on-failure: true

- name: Rust compilation prerequisites
if: ${{ !contains(github.event.pull_request.labels.*.name, 'R0-silent') }}
run: |
rustup default $TOOLCHAIN
rustup component add rust-src --toolchain $TOOLCHAIN
- name: install parity-publish
if: ${{ !contains(github.event.pull_request.labels.*.name, 'R0-silent') }}
# Set the target dir to cache the build.
run: CARGO_TARGET_DIR=./target/ cargo install [email protected] --locked -q

- name: check semver
if: ${{ !contains(github.event.pull_request.labels.*.name, 'R0-silent') }}
run: |
if [ -z "$PR" ]; then
echo "Skipping master/merge queue"
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 @@ -14,7 +14,7 @@ on:
required: true
options:
- "TODO"
- "no_change"
- "none"
- "patch"
- "minor"
- "major"
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/misc-sync-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ on:
stable_release_branch:
description: 'Stable release branch, e.g. stable2407'
required: true
debug:
description: Enable runner debug logging
required: false
default: false

jobs:
sync-templates:
Expand Down Expand Up @@ -86,7 +90,7 @@ jobs:
EOF
[ ${{ matrix.template }} != "solochain" ] && echo "# Leave out the node compilation from regular template usage." \
&& echo "\"default-members\" = [\"pallets/template\", \"runtime\"]" >> Cargo.toml
&& echo "default-members = [\"pallets/template\", \"runtime\"]" >> Cargo.toml
[ ${{ matrix.template }} == "solochain" ] && echo "# The node isn't yet replaceable by Omni Node."
cat << EOF >> Cargo.toml
members = [
Expand Down Expand Up @@ -115,8 +119,9 @@ jobs:
toml set templates/${{ matrix.template }}/Cargo.toml 'workspace.package.edition' "$(toml get --raw Cargo.toml 'workspace.package.edition')" > Cargo.temp
mv Cargo.temp ./templates/${{ matrix.template }}/Cargo.toml
working-directory: polkadot-sdk

- name: Print the result Cargo.tomls for debugging
if: runner.debug == '1'
if: ${{ github.event.inputs.debug }}
run: find . -type f -name 'Cargo.toml' -exec cat {} \;
working-directory: polkadot-sdk/templates/${{ matrix.template }}/

Expand All @@ -142,6 +147,12 @@ jobs:
done;
working-directory: "${{ env.template-path }}"

- name: Print the result Cargo.tomls for debugging after copying required workspace dependencies
if: ${{ github.event.inputs.debug }}
run: find . -type f -name 'Cargo.toml' -exec cat {} \;
working-directory: polkadot-sdk/templates/${{ matrix.template }}/


# 3. Verify the build. Push the changes or create a PR.

# We've run into out-of-disk error when compiling in the next step, so we free up some space this way.
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-preflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ jobs:
echo $( substrate-contracts-node --version | awk 'NF' )
estuary --version
cargo-contract --version
taplo --version
- name: Info forklift
run: forklift version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/runtimes-matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
{
"name": "glutton-westend",
"package": "glutton-westend-runtime",
"path": "cumulus/parachains/runtimes/gluttons/glutton-westend",
"path": "cumulus/parachains/runtimes/glutton/glutton-westend",
"header": "cumulus/file_header.txt",
"template": "cumulus/templates/xcm-bench-template.hbs",
"bench_features": "runtime-benchmarks",
Expand Down
Loading

0 comments on commit 124e313

Please sign in to comment.