Skip to content

Commit

Permalink
Merge branch 'master' into pg/fix-gas-encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
pgherveou committed Jan 3, 2025
2 parents a1303dd + f3ab385 commit 31a06f2
Show file tree
Hide file tree
Showing 489 changed files with 3,917 additions and 3,133 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
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
107 changes: 107 additions & 0 deletions .github/workflows/networking-benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
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: 80
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/networking-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: networking-bench-${{ 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
13 changes: 2 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bridges/chains/chain-bridge-hub-cumulus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ workspace = true
[dependencies]
# Bridge Dependencies

bp-polkadot-core = { workspace = true }
bp-messages = { workspace = true }
bp-polkadot-core = { workspace = true }
bp-runtime = { workspace = true }

# Substrate Based Dependencies

frame-system = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
sp-api = { workspace = true }
sp-std = { workspace = true }

Expand Down
2 changes: 1 addition & 1 deletion bridges/chains/chain-bridge-hub-kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ workspace = true
# Bridge Dependencies

bp-bridge-hub-cumulus = { workspace = true }
bp-runtime = { workspace = true }
bp-messages = { workspace = true }
bp-runtime = { workspace = true }

# Substrate Based Dependencies

Expand Down
2 changes: 1 addition & 1 deletion bridges/chains/chain-bridge-hub-polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ workspace = true
# Bridge Dependencies

bp-bridge-hub-cumulus = { workspace = true }
bp-runtime = { workspace = true }
bp-messages = { workspace = true }
bp-runtime = { workspace = true }

# Substrate Based Dependencies

Expand Down
2 changes: 1 addition & 1 deletion bridges/chains/chain-bridge-hub-rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ codec = { features = ["derive"], workspace = true }

# Bridge Dependencies
bp-bridge-hub-cumulus = { workspace = true }
bp-runtime = { workspace = true }
bp-messages = { workspace = true }
bp-runtime = { workspace = true }
bp-xcm-bridge-hub = { workspace = true }

# Substrate Based Dependencies
Expand Down
2 changes: 1 addition & 1 deletion bridges/chains/chain-bridge-hub-westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ codec = { features = ["derive"], workspace = true }

# Bridge Dependencies
bp-bridge-hub-cumulus = { workspace = true }
bp-runtime = { workspace = true }
bp-messages = { workspace = true }
bp-runtime = { workspace = true }
bp-xcm-bridge-hub = { workspace = true }

# Substrate Based Dependencies
Expand Down
4 changes: 2 additions & 2 deletions bridges/modules/beefy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ sp-runtime = { workspace = true }
sp-std = { workspace = true }

[dev-dependencies]
sp-consensus-beefy = { workspace = true, default-features = true }
bp-test-utils = { workspace = true, default-features = true }
mmr-lib = { workspace = true }
pallet-beefy-mmr = { workspace = true, default-features = true }
pallet-mmr = { workspace = true, default-features = true }
rand = { workspace = true, default-features = true }
sp-consensus-beefy = { workspace = true, default-features = true }
sp-io = { workspace = true, default-features = true }
bp-test-utils = { workspace = true, default-features = true }

[features]
default = ["std"]
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/grandpa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ scale-info = { features = ["derive"], workspace = true }

# Bridge Dependencies

bp-runtime = { workspace = true }
bp-header-chain = { workspace = true }
bp-runtime = { workspace = true }

# Substrate Dependencies

Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/messages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ bp-runtime = { features = ["test-helpers"], workspace = true }
bp-test-utils = { workspace = true }
pallet-balances = { workspace = true }
pallet-bridge-grandpa = { workspace = true }
sp-io = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }

[features]
default = ["std"]
Expand Down
8 changes: 4 additions & 4 deletions bridges/modules/relayers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ sp-runtime = { workspace = true }
sp-std = { workspace = true }

[dev-dependencies]
bp-runtime = { workspace = true }
pallet-balances = { workspace = true, default-features = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
bp-parachains = { workspace = true }
bp-polkadot-core = { workspace = true }
bp-runtime = { workspace = true }
bp-test-utils = { workspace = true }
pallet-balances = { workspace = true, default-features = true }
pallet-utility = { workspace = true }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }

[features]
default = ["std"]
Expand Down
8 changes: 4 additions & 4 deletions bridges/modules/xcm-bridge-hub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ xcm-builder = { workspace = true }
xcm-executor = { workspace = true }

[dev-dependencies]
pallet-balances = { workspace = true }
sp-io = { workspace = true }
bp-runtime = { workspace = true }
bp-header-chain = { workspace = true }
pallet-xcm-bridge-hub-router = { workspace = true }
bp-runtime = { workspace = true }
bp-xcm-bridge-hub-router = { workspace = true }
pallet-balances = { workspace = true }
pallet-xcm-bridge-hub-router = { workspace = true }
polkadot-parachain-primitives = { workspace = true }
sp-io = { workspace = true }

[features]
default = ["std"]
Expand Down
Loading

0 comments on commit 31a06f2

Please sign in to comment.