Skip to content

Commit

Permalink
Merge branch 'master' into max-assets
Browse files Browse the repository at this point in the history
  • Loading branch information
joepetrowski authored Oct 17, 2023
2 parents 5374b59 + a1171e6 commit 8ed5644
Show file tree
Hide file tree
Showing 956 changed files with 27,353 additions and 55,065 deletions.
15 changes: 13 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#
[build]
rustdocflags = [
"-Dwarnings",
"-Arustdoc::redundant_explicit_links", # stylistic
]

# An auto defined `clippy` feature was introduced,
# but it was found to clash with user defined features,
# so was renamed to `cargo-clippy`.
Expand All @@ -10,7 +15,7 @@ rustflags = [
"-Aclippy::all",
"-Dclippy::correctness",
"-Aclippy::if-same-then-else",
"-Aclippy::clone-double-ref",
"-Asuspicious_double_ref_op",
"-Dclippy::complexity",
"-Aclippy::zero-prefixed-literal", # 00_1000_000
"-Aclippy::type_complexity", # raison d'etre
Expand All @@ -30,4 +35,10 @@ rustflags = [
"-Aclippy::derivable_impls", # false positives
"-Aclippy::stable_sort_primitive", # prefer stable sort
"-Aclippy::extra-unused-type-parameters", # stylistic
"-Aclippy::default_constructed_unit_structs", # stylistic
]

[env]
# Needed for musl builds so user doesn't have to install musl-tools.
CC_x86_64_unknown_linux_musl = { value = ".cargo/musl-gcc", force = true, relative = true }
CXX_x86_64_unknown_linux_musl = { value = ".cargo/musl-g++", force = true, relative = true }
7 changes: 7 additions & 0 deletions .cargo/musl-g++
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

# Wrapper for building with musl.
#
# See comments for musl-gcc in this repo.

g++ "$@"
13 changes: 13 additions & 0 deletions .cargo/musl-gcc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

# Wrapper for building with musl.
#
# musl unfortunately requires a musl-enabled C compiler (musl-gcc) to be
# installed, which can be kind of a pain to get installed depending on the
# distro. That's not a very good user experience.
#
# The real musl-gcc wrapper sets the correct system include paths for linking
# with musl libc library. Since this is not actually used to link any binaries
# it should most likely work just fine.

gcc "$@"
50 changes: 50 additions & 0 deletions .config/lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Config file for lychee link checker: <https://github.com/lycheeverse/lychee>
# Run with `lychee -c .config/lychee.toml ./**/*.rs ./**/*.prdoc`

cache = true
max_cache_age = "1d"
max_redirects = 10
max_retries = 6

# Exclude localhost et.al.
exclude_all_private = true

# Treat these codes as success condition:
accept = [
# Ok
200,

# Rate limited - GitHub likes to throw this.
429
]

exclude_path = [ "./target" ]

exclude = [
# Place holders (no need to fix these):
"http://visitme/",
"https://visitme/",

# TODO <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/",
"https://github.com/paritytech/polkadot-sdk/substrate/frame/timestamp",
"https://github.com/paritytech/substrate/frame/fast-unstake",
"https://github.com/zkcrypto/bls12_381/blob/e224ad4ea1babfc582ccd751c2bf128611d10936/src/test-data/mod.rs",
"https://polkadot.network/the-path-of-a-parachain-block/",
"https://research.web3.foundation/en/latest/polkadot/BABE/Babe/#6-practical-results",
"https://research.web3.foundation/en/latest/polkadot/block-production/Babe.html",
"https://research.web3.foundation/en/latest/polkadot/block-production/Babe.html#-6.-practical-results",
"https://research.web3.foundation/en/latest/polkadot/networking/3-avail-valid.html#topology",
"https://research.web3.foundation/en/latest/polkadot/NPoS/3.%20Balancing.html",
"https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html",
"https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html#inflation-model",
"https://research.web3.foundation/en/latest/polkadot/slashing/npos.html",
"https://research.web3.foundation/en/latest/polkadot/Token%20Economics.html#inflation-model",
"https://rpc.polkadot.io/",
"https://w3f.github.io/parachain-implementers-guide/node/approval/approval-distribution.html",
"https://w3f.github.io/parachain-implementers-guide/node/index.html",
"https://w3f.github.io/parachain-implementers-guide/protocol-chain-selection.html",
"https://w3f.github.io/parachain-implementers-guide/runtime/session_info.html",
]
120 changes: 120 additions & 0 deletions .github/review-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
rules:
- name: CI files
condition:
include:
- ^\.gitlab-ci\.yml
- ^docker/.*
- ^\.github/.*
- ^\.gitlab/.*
- ^\.config/nextest.toml
- ^\.cargo/.*
exclude:
- ^./gitlab/pipeline/zombienet.*
minApprovals: 2
type: basic
teams:
- ci
- release-engineering

- name: Audit rules
type: basic
condition:
include:
- ^polkadot/runtime\/(kusama|polkadot|common)\/.*
- ^polkadot/primitives/src\/.+\.rs$
- ^substrate/primitives/.*
- ^substrate/frame/.*
exclude:
- ^polkadot/runtime\/(kusama|polkadot)\/src\/weights\/.+\.rs$
- ^substrate\/frame\/.+\.md$
minApprovals: 1
allowedToSkipRule:
teams:
- core-devs
teams:
- srlabs

- name: Core developers
countAuthor: true
condition:
include:
- .*
# excluding files from 'Runtime files' and 'CI files' rules
exclude:
- ^polkadot/runtime/(kusama|polkadot)/src/[^/]+\.rs$
- ^cumulus/parachains/runtimes/assets/(asset-hub-kusama|asset-hub-polkadot)/src/[^/]+\.rs$
- ^cumulus/parachains/runtimes/bridge-hubs/(bridge-hub-kusama|bridge-hub-polkadot)/src/[^/]+\.rs$
- ^cumulus/parachains/runtimes/collectives/collectives-polkadot/src/[^/]+\.rs$
- ^cumulus/parachains/common/src/[^/]+\.rs$
- ^substrate/frame/(?!.*(nfts/.*|uniques/.*|babe/.*|grandpa/.*|beefy|merkle-mountain-range/.*|contracts/.*|election|nomination-pools/.*|staking/.*|aura/.*))
- ^polkadot/runtime/(kusama|polkadot)/src/[^/]+\.rs$
- ^\.gitlab-ci\.yml
- ^docker/.*
- ^\.github/.*
- ^\.gitlab/.*
- ^\.config/nextest.toml
- ^\.cargo/.*
minApprovals: 2
type: basic
teams:
- core-devs

# cumulus
- name: Runtime files cumulus
countAuthor: true
condition:
include:
- ^cumulus/parachains/runtimes/assets/(asset-hub-kusama|asset-hub-polkadot)/src/[^/]+\.rs$
- ^cumulus/parachains/runtimes/bridge-hubs/(bridge-hub-kusama|bridge-hub-polkadot)/src/[^/]+\.rs$
- ^cumulus/parachains/runtimes/collectives/collectives-polkadot/src/[^/]+\.rs$
- ^cumulus/parachains/common/src/[^/]+\.rs$
type: and-distinct
reviewers:
- minApprovals: 1
teams:
- locks-review
- minApprovals: 1
teams:
- polkadot-review

# if there are any changes in the bridges subtree (in case of backport changes back to bridges repo)
- name: Bridges subtree files
type: basic
condition:
include:
- ^bridges/.*
minApprovals: 1
teams:
- bridges-core

# substrate

- name: FRAME coders substrate
condition:
include:
- ^substrate/frame/(?!.*(nfts/.*|uniques/.*|babe/.*|grandpa/.*|beefy|merkle-mountain-range/.*|contracts/.*|election|nomination-pools/.*|staking/.*|aura/.*))
type: "and"
reviewers:
- minApprovals: 2
teams:
- core-devs
- minApprovals: 1
teams:
- frame-coders

# Protection of THIS file
- name: Review Bot
condition:
include:
- review-bot\.yml
type: "and"
reviewers:
- minApprovals: 1
teams:
- opstooling
- minApprovals: 1
teams:
- locks-review
- minApprovals: 1
teams:
- ci
40 changes: 40 additions & 0 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check links

on:
pull_request:
paths:
- "*.rs"
- "*.prdoc"
- ".github/workflows/check-links.yml"
- ".config/lychee.toml"
types: [opened, synchronize, reopened, ready_for_review]

permissions:
packages: read

jobs:
link-checker:
runs-on: ubuntu-latest
steps:
- name: Restore lychee cache
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 (7. Sep 2023)
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
# This should restore from the most recent one:
restore-keys: cache-lychee-

- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 (22. Sep 2023)

- name: Lychee link checker
uses: lycheeverse/lychee-action@2ac9f030ccdea0033e2510a23a67da2a2da98492 # for v1.8.0 (15. May 2023)
with:
args: >-
--config .config/lychee.toml
--no-progress
'./**/*.rs'
'./**/*.prdoc'
fail: true
env:
# To bypass GitHub rate-limit:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 2 additions & 0 deletions .github/workflows/release-50_publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ jobs:
if: ${{ inputs.binary == 'polkadot-parachain' || inputs.image_type == 'rc' }}
runs-on: ubuntu-latest
needs: fetch-artifacts
environment: master

steps:
- name: Checkout sources
Expand Down Expand Up @@ -237,6 +238,7 @@ jobs:
if: ${{ inputs.binary == 'polkadot' && inputs.image_type == 'release' }}
runs-on: ubuntu-latest
needs: fetch-latest-debian-package-version
environment: master
steps:
- name: Checkout sources
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/review-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Review PR
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- review_requested
- review_request_removed
- ready_for_review
pull_request_review:

permissions:
contents: read

jobs:
review-approvals:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: team_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.REVIEW_APP_ID }}
private_key: ${{ secrets.REVIEW_APP_KEY }}
- name: "Evaluates PR reviews and assigns reviewers"
uses: paritytech/review-bot@v2.0.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
team-token: ${{ steps.team_token.outputs.token }}
checks-token: ${{ steps.team_token.outputs.token }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.env*
.idea
.local
.lycheecache
.vscode
.wasm-binaries
*.adoc
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ variables:
RUSTY_CACHIER_COMPRESSION_METHOD: zstd
NEXTEST_FAILURE_OUTPUT: immediate-final
NEXTEST_SUCCESS_OUTPUT: final
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.68"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.69"
DOCKER_IMAGES_VERSION: "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}"

default:
Expand Down
8 changes: 7 additions & 1 deletion .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ build-linux-stable:
RUN_UI_TESTS: 1
script:
- time cargo build --locked --profile testnet --features pyroscope,fast-runtime --bin polkadot --bin polkadot-prepare-worker --bin polkadot-execute-worker
- time ROCOCO_EPOCH_DURATION=10 ./polkadot/scripts/build-only-wasm.sh rococo-runtime $(pwd)/runtimes/rococo-runtime-10/
- time ROCOCO_EPOCH_DURATION=100 ./polkadot/scripts/build-only-wasm.sh rococo-runtime $(pwd)/runtimes/rococo-runtime-100/
- time ROCOCO_EPOCH_DURATION=600 ./polkadot/scripts/build-only-wasm.sh rococo-runtime $(pwd)/runtimes/rococo-runtime-600/
- pwd
- ls -alR runtimes
# pack artifacts
- mkdir -p ./artifacts
- VERSION="${CI_COMMIT_REF_NAME}" # will be tag or branch name
- mv ./target/testnet/polkadot ./artifacts/.
- mv ./target/testnet/polkadot-prepare-worker ./artifacts/.
- mv ./target/testnet/polkadot-execute-worker ./artifacts/.
- mv ./runtimes/ ./artifacts/.
- pushd artifacts
- sha256sum polkadot | tee polkadot.sha256
- shasum -c polkadot.sha256
Expand Down Expand Up @@ -85,6 +91,7 @@ build-rustdoc:
- .run-immediately
variables:
SKIP_WASM_BUILD: 1
RUSTDOCFLAGS: ""
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
when: on_success
Expand All @@ -93,7 +100,6 @@ build-rustdoc:
- ./crate-docs/
script:
# FIXME: it fails with `RUSTDOCFLAGS="-Dwarnings"` and `--all-features`
# FIXME: return to stable when https://github.com/rust-lang/rust/issues/96937 gets into stable
- time cargo doc --features try-runtime,experimental --workspace --no-deps
- rm -f ./target/doc/.lock
- mv ./target/doc ./crate-docs
Expand Down
Loading

0 comments on commit 8ed5644

Please sign in to comment.