Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into muharem-meta-tx-pallet
Browse files Browse the repository at this point in the history
  • Loading branch information
muharem committed Oct 23, 2024
2 parents 8407cd0 + b4732ad commit 6bf6b24
Show file tree
Hide file tree
Showing 4,392 changed files with 339,909 additions and 131,049 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ rustdocflags = [
# 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 }
CARGO_WORKSPACE_ROOT_DIR = { value = "", relative = true }
17 changes: 11 additions & 6 deletions .config/lychee.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Run with `lychee -c .config/lychee.toml ./**/*.rs ./**/*.prdoc`

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

# Exclude localhost et.al.
exclude_all_private = true
Expand All @@ -18,7 +18,10 @@ accept = [
"429",
]

exclude_path = ["./target"]
exclude_path = [
"./prdoc",
"./target",
]

exclude = [
# Place holders (no need to fix these):
Expand All @@ -33,16 +36,14 @@ exclude = [
"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/NPoS/3.%20Balancing.html",
"https://research.web3.foundation/en/latest/polkadot/Token%20Economics.html#inflation-model",
"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/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://rpc.polkadot.io/",
"https://try-runtime.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",
Expand All @@ -51,4 +52,8 @@ exclude = [
# Behind a captcha (code 403):
"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/",
"https://substrate.stackexchange.com/.*",
]
7 changes: 7 additions & 0 deletions .config/taplo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ keys = ["build"]

[rule.formatting]
reorder_arrays = false

[[rule]]
include = ["Cargo.toml"]
keys = ["workspace.dependencies"]

[rule.formatting]
reorder_keys = true
6 changes: 5 additions & 1 deletion .config/zepter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ workflows:
'--show-path',
'--quiet',
]
# Same as `check`, but with the `--fix` flag.
# The umbrella crate uses more features, so we to check those too:
check_umbrella:
- [ $check.0, '--features=serde,experimental,riscv,runtime,with-tracing,tuples-96,with-tracing', '-p=polkadot-sdk' ]
# Same as `check_*`, but with the `--fix` flag.
default:
- [ $check.0, '--fix' ]
- [ $check_umbrella.0, '--fix' ]

# Will be displayed when any workflow fails:
help:
Expand Down
33 changes: 33 additions & 0 deletions .forklift/config-gitlab.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[compression]
type = "zstd"

[compression.zstd]
compressionLevel = 3

[general]
jobNameVariable = "CI_JOB_NAME"
jobsBlackList = []
logLevel = "warn"
threadsCount = 6

[cache]
extraEnv = ["RUNTIME_METADATA_HASH"]

[metrics]
enabled = true
pushEndpoint = "placeholder"

[metrics.extraLabels]
environment = "production"
job_name = "$CI_JOB_NAME"
project_name = "$CI_PROJECT_PATH"

[storage]
type = "s3"

[storage.s3]
accessKeyId = "placeholder"
bucketName = "placeholder"
concurrency = 10
endpointUrl = "placeholder"
secretAccessKey = "placeholder"
29 changes: 29 additions & 0 deletions .forklift/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[compression]
type = "zstd"

[compression.zstd]
compressionLevel = 3

[general]
jobNameVariable = "CI_JOB_NAME"
jobsBlackList = []
logLevel = "warn"
threadsCount = 6

[cache]
extraEnv = ["RUNTIME_METADATA_HASH"]

[metrics]
enabled = true
pushEndpoint = "placeholder"

[metrics.extraLabels]
environment = "production"
job_name = "$CI_JOB_NAME"
project_name = "$CI_PROJECT_PATH"

[storage]
type = "gcs"

[storage.gcs]
bucketName = "parity-ci-forklift"
5 changes: 3 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# - Multiple owners are supported.
# - Either handle (e.g, @github_user or @github/team) or email can be used. Keep in mind,
# that handles might work better because they are more recognizable on GitHub,
# eyou can use them for mentioning unlike an email.
# you can use them for mentioning unlike an email.
# - The latest matching rule, if multiple, takes precedence.

# CI
Expand Down Expand Up @@ -64,7 +64,8 @@
/substrate/primitives/merkle-mountain-range/ @acatangiu

# Contracts
/substrate/frame/contracts/ @athei @paritytech/docs-audit
/substrate/frame/contracts/ @paritytech/smart-contracts @paritytech/docs-audit
/substrate/frame/revive/ @paritytech/smart-contracts @paritytech/docs-audit

# NPoS and election
/substrate/frame/election-provider-multi-phase/ @paritytech/staking-core @paritytech/docs-audit
Expand Down
47 changes: 47 additions & 0 deletions .github/actions/build-push-image/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 'build and push image'
inputs:
dockerfile:
description: "dockerfile to build"
required: true
image-name:
description: ""
required: true
outputs:
branch:
description: 'Branch name for the PR'
value: ${{ steps.branch.outputs.branch }}


runs:
using: "composite"
steps:

# gcloud
# https://github.com/paritytech/ci_cd/wiki/GitHub:-Push-Docker-image-to-GCP-Registry
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
- name: "gcloud info"
shell: bash
run: "gcloud info"
- name: "Auth in gcloud registry"
shell: bash
run: "gcloud auth configure-docker europe-docker.pkg.dev --quiet"

- name: build
shell: bash
env:
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.105"
run: |
export BRANCH_NAME=${{ github.head_ref || github.ref_name }}
export DOCKER_IMAGES_VERSION=${BRANCH_NAME/\//-}
if [[ ${{ github.event_name }} == "merge_group" ]]; then export DOCKER_IMAGES_VERSION="${GITHUB_SHA::8}"; fi
docker build \
--build-arg VCS_REF="${GITHUB_SHA}" \
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \
--build-arg IMAGE_NAME="${{ inputs.image-name }}" \
--build-arg ZOMBIENET_IMAGE="${ZOMBIENET_IMAGE}" \
-t "${{ inputs.image-name }}:$DOCKER_IMAGES_VERSION" \
-f ${{ inputs.dockerfile }} \
.
docker push "${{ inputs.image-name }}:$DOCKER_IMAGES_VERSION"
22 changes: 22 additions & 0 deletions .github/actions/cargo-check-runtimes/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'cargo check runtimes'
description: 'Runs `cargo check` for every directory in provided root.'
inputs:
root:
description: "Root directory. Expected to contain several cargo packages inside."
required: true
runs:
using: "composite"
steps:
- name: Check
shell: bash
run: |
mkdir -p ~/.forklift
cp .forklift/config.toml ~/.forklift/config.toml
cd ${{ inputs.root }}
for directory in $(echo */); do
echo "_____Running cargo check for ${directory} ______";
cd ${directory};
pwd;
SKIP_WASM_BUILD=1 forklift cargo check --locked;
cd ..;
done
28 changes: 28 additions & 0 deletions .github/actions/set-up-gh/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "install gh"
description: "Install the gh cli in a debian based distro and switches to the PR branch."
inputs:
pr-number:
description: "Number of the PR"
required: true
GH_TOKEN:
description: "GitHub token"
required: true
outputs:
branch:
description: "Branch name for the PR"
value: ${{ steps.branch.outputs.branch }}
runs:
using: "composite"
steps:
- name: Set up git
shell: bash
# Here it would get the script from previous step
run: git config --global --add safe.directory '*'
- run: gh pr checkout ${{ inputs.pr-number }}
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.GH_TOKEN }}
- name: Export branch name
shell: bash
run: echo "branch=$(git rev-parse --abbrev-ref HEAD)" >> "$GITHUB_OUTPUT"
id: branch
15 changes: 15 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
coverage:
precision: 2
round: down
range: "1...100"
status:
project:
default:
target: 1.0
threshold: 2.0

comment:
behavior: new

fixes:
- "/__w/polkadot-sdk/polkadot-sdk/::"
8 changes: 6 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ updates:
directory: '/'
labels: ["A1-insubstantial", "R0-silent"]
schedule:
interval: daily
interval: weekly
groups:
ci_dependencies:
patterns:
- "*"
# Update Rust dependencies:
- package-ecosystem: "cargo"
directory: "/"
labels: ["A1-insubstantial", "R0-silent"]
schedule:
interval: "daily"
interval: "weekly"
groups:
# We assume these crates to be semver abiding and can therefore group them together.
known_good_semver:
Expand Down
1 change: 1 addition & 0 deletions .github/env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IMAGE="docker.io/paritytech/ci-unified:bullseye-1.81.0-2024-09-11-v202409111034"
1 change: 1 addition & 0 deletions .github/pull_request_template.md
17 changes: 15 additions & 2 deletions .github/review-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ rules:
- ^\.gitlab/.*
- ^\.config/nextest.toml
- ^\.cargo/.*
- ^\.forklift/.*
exclude:
- ^\.gitlab/pipeline/zombienet.*
type: "or"
Expand All @@ -28,11 +29,12 @@ rules:
# excluding files from 'Runtime files' and 'CI files' rules
exclude:
- ^cumulus/parachains/common/src/[^/]+\.rs$
- ^substrate/frame/(?!.*(nfts/.*|uniques/.*|babe/.*|grandpa/.*|beefy|merkle-mountain-range/.*|contracts/.*|election|nomination-pools/.*|staking/.*|aura/.*))
- ^substrate/frame/(?!.*(nfts/.*|uniques/.*|babe/.*|grandpa/.*|beefy|merkle-mountain-range/.*|contracts/.*|revive/.*|election|nomination-pools/.*|staking/.*|aura/.*))
- ^\.gitlab-ci\.yml
- ^docker/.*
- ^\.github/.*
- ^\.gitlab/.*
- ^\.forklift/.*
- ^\.config/nextest.toml
- ^\.cargo/.*
minApprovals: 2
Expand All @@ -54,7 +56,7 @@ rules:
- name: FRAME coders substrate
condition:
include:
- ^substrate/frame/(?!.*(nfts/.*|uniques/.*|babe/.*|grandpa/.*|beefy|merkle-mountain-range/.*|contracts/.*|election|nomination-pools/.*|staking/.*|aura/.*))
- ^substrate/frame/(?!.*(nfts/.*|uniques/.*|babe/.*|grandpa/.*|beefy|merkle-mountain-range/.*|contracts/.*|revive/.*|election|nomination-pools/.*|staking/.*|aura/.*))
type: "and"
reviewers:
- minApprovals: 2
Expand All @@ -64,6 +66,17 @@ rules:
teams:
- frame-coders

# Smart Contracts
- name: Smart Contracts
type: basic
condition:
include:
- ^substrate/frame/contracts/.*
- ^substrate/frame/revive/.*
minApprovals: 2
teams:
- smart-contracts

# Protection of THIS file
- name: Review Bot
countAuthor: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#
# - `target_group`: Integer starting from 1, the group this script should execute.
# - `groups_total`: Integer starting from 1, total number of groups.
# - `disable_forklift`: Boolean, whether to disable forklift or not.

import subprocess, sys

Expand All @@ -31,6 +32,9 @@

target_group = int(sys.argv[1]) - 1
groups_total = int(sys.argv[2])
disable_forklift = bool(sys.argv[3] if len(sys.argv) > 3 else False)

print(f"Target group: {target_group}, Total groups: {groups_total}, Disable forklift: {disable_forklift}", file=sys.stderr)

if len(crates) == 0:
print("No crates detected!", file=sys.stderr)
Expand All @@ -55,7 +59,11 @@

print(f"Checking {crates[crate][0]}", file=sys.stderr)

res = subprocess.run(["forklift", "cargo", "check", "--locked"], cwd = crates[crate][1])
cmd = ["cargo", "check", "--locked"]

cmd.insert(0, 'forklift') if not disable_forklift else None

res = subprocess.run(cmd, cwd = crates[crate][1])

if res.returncode != 0:
sys.exit(1)
Loading

0 comments on commit 6bf6b24

Please sign in to comment.