Skip to content

Commit

Permalink
Merge branch 'master' into skunert/relay_slot_velocity
Browse files Browse the repository at this point in the history
  • Loading branch information
skunert committed Jan 3, 2025
2 parents a2d5936 + 721f6d9 commit ef2a785
Show file tree
Hide file tree
Showing 774 changed files with 9,433 additions and 8,218 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
7 changes: 7 additions & 0 deletions .config/taplo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,10 @@ keys = ["workspace.dependencies"]

[rule.formatting]
reorder_keys = true

[[rule]]
include = ["**/Cargo.toml"]
keys = ["build-dependencies", "dependencies", "dev-dependencies"]

[rule.formatting]
reorder_keys = true
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/cmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ jobs:
# Push the results to the target branch
git remote add \
github \
"https://token:${{ steps.generate_token_commit.outputs.token }}@github.com/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}.git" || :
"https://x-access-token:${{ steps.generate_token_commit.outputs.token }}@github.com/${{ needs.get-pr-branch.outputs.repo }}.git" || :
push_changes() {
git push github "HEAD:${{ needs.get-pr-branch.outputs.pr-branch }}"
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
2 changes: 1 addition & 1 deletion .github/workflows/publish-check-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
preflight:
uses: ./.github/workflows/reusable-preflight.yml

check-publish:
check-publish-compile:
timeout-minutes: 90
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
Expand Down
Loading

0 comments on commit ef2a785

Please sign in to comment.