Skip to content

Commit

Permalink
Merge branch 'master' into slumber-test-cumulus-find-parents
Browse files Browse the repository at this point in the history
  • Loading branch information
slumber committed Sep 12, 2023
2 parents 06e9168 + e005aef commit 3e6f588
Show file tree
Hide file tree
Showing 969 changed files with 16,152 additions and 16,907 deletions.
210 changes: 210 additions & 0 deletions .github/.markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
# Default state for all rules
default: true

# Path to configuration file to extend
extends: null

# MD001/heading-increment/header-increment - Heading levels should only increment by one level at a time
MD001: true

# MD002/first-heading-h1/first-header-h1 - First heading should be a top-level heading
MD002:
# Heading level
level: 1

# MD003/heading-style/header-style - Heading style
MD003:
# Heading style
style: "consistent"

# MD004/ul-style - Unordered list style
MD004:
# List style
style: "consistent"

# MD005/list-indent - Inconsistent indentation for list items at the same level
MD005: false

# MD006/ul-start-left - Consider starting bulleted lists at the beginning of the line
MD006: false

# MD007/ul-indent - Unordered list indentation
MD007: false

# MD009/no-trailing-spaces - Trailing spaces
MD009:
# Spaces for line break
br_spaces: 2
# Allow spaces for empty lines in list items
list_item_empty_lines: false
# Include unnecessary breaks
strict: false

# MD010/no-hard-tabs - Hard tabs
MD010: false

# MD011/no-reversed-links - Reversed link syntax
MD011: true

# MD012/no-multiple-blanks - Multiple consecutive blank lines
MD012:
# Consecutive blank lines
maximum: 2

# MD013/line-length - Line length
MD013:
# Number of characters
line_length: 120
# Number of characters for headings
heading_line_length: 120
# Number of characters for code blocks
code_block_line_length: 150
# Include code blocks
code_blocks: true
# Include tables
tables: true
# Include headings
headings: true
# Include headings
headers: true
# Strict length checking
strict: false
# Stern length checking
stern: false

# MD014/commands-show-output - Dollar signs used before commands without showing output
MD014: true

# MD018/no-missing-space-atx - No space after hash on atx style heading
MD018: true

# MD019/no-multiple-space-atx - Multiple spaces after hash on atx style heading
MD019: true

# MD020/no-missing-space-closed-atx - No space inside hashes on closed atx style heading
MD020: true

# MD021/no-multiple-space-closed-atx - Multiple spaces inside hashes on closed atx style heading
MD021: true

# MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines
MD022: false

# MD023/heading-start-left/header-start-left - Headings must start at the beginning of the line
MD023: true

# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content
MD024: false

# MD025/single-title/single-h1 - Multiple top-level headings in the same document
MD025: false

# MD026/no-trailing-punctuation - Trailing punctuation in heading
MD026:
# Punctuation characters
punctuation: ".,;:!。,;:!"

# MD027/no-multiple-space-blockquote - Multiple spaces after blockquote symbol
MD027: true

# MD028/no-blanks-blockquote - Blank line inside blockquote
MD028: true

# MD029/ol-prefix - Ordered list item prefix
MD029:
# List style
style: "one_or_ordered"

# MD030/list-marker-space - Spaces after list markers
MD030:
# Spaces for single-line unordered list items
ul_single: 1
# Spaces for single-line ordered list items
ol_single: 1
# Spaces for multi-line unordered list items
ul_multi: 1
# Spaces for multi-line ordered list items
ol_multi: 1

# MD031/blanks-around-fences - Fenced code blocks should be surrounded by blank lines
MD031: false

# MD032/blanks-around-lists - Lists should be surrounded by blank lines
MD032: false

# MD033/no-inline-html - Inline HTML
MD033: false

# MD034/no-bare-urls - Bare URL used
MD034: false

# MD035/hr-style - Horizontal rule style
MD035:
# Horizontal rule style
style: "consistent"

# MD036/no-emphasis-as-heading/no-emphasis-as-header - Emphasis used instead of a heading
MD036: false

# MD037/no-space-in-emphasis - Spaces inside emphasis markers
MD037: true

# MD038/no-space-in-code - Spaces inside code span elements
MD038: true

# MD039/no-space-in-links - Spaces inside link text
MD039: true

# MD040/fenced-code-language - Fenced code blocks should have a language specified
MD040: false

# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading
MD041: false

# MD042/no-empty-links - No empty links
MD042: true

# MD043/required-headings/required-headers - Required heading structure
MD043: false

# MD044/proper-names - Proper names should have the correct capitalization
MD044:
# List of proper names
names: ["Polkadot", "Substrate", "Cumulus", "Parity"]
# Include code blocks
code_blocks: false
# Include HTML elements
html_elements: false

# MD045/no-alt-text - Images should have alternate text (alt text)
MD045: false

# MD046/code-block-style - Code block style
MD046:
# Block style
style: "consistent"

# MD047/single-trailing-newline - Files should end with a single newline character
MD047: true

# MD048/code-fence-style - Code fence style
MD048:
# Code fence style
style: "consistent"

# MD049/emphasis-style - Emphasis style should be consistent
MD049: false

# MD050/strong-style - Strong style should be consistent
MD050:
# Strong style
style: "consistent"

# MD051/link-fragments - Link fragments should be valid
MD051: false

# MD052/reference-links-images - Reference links and images should use a label that is defined
MD052: false

# MD053/link-image-reference-definitions - Link and image reference definitions should be needed
MD053: false
75 changes: 75 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Lists some code owners.
#
# A codeowner just oversees some part of the codebase. If an owned file is changed then the
# corresponding codeowner receives a review request. An approval of the codeowner might be
# required for merging a PR (depends on repository settings).
#
# For details about syntax, see:
# https://help.github.com/en/articles/about-code-owners
# But here are some important notes:
#
# - Glob syntax is git-like, e.g. `/core` means the core directory in the root, unlike `core`
# which can be everywhere.
# - 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.
# - The latest matching rule, if multiple, takes precedence.

# CI
/.github/ @paritytech/ci @paritytech/release-engineering
/.gitlab-ci.yml @paritytech/ci
/.gitlab/ @paritytech/ci

# XCM
/polkadot/xcm/ @paritytech/xcm

# WASM executor, low-level client <-> WASM interface and other WASM-related code
/substrate/client/allocator/ @koute
/substrate/client/executor/ @koute
/substrate/primitives/panic-handler/ @koute
/substrate/primitives/runtime-interface/ @koute
/substrate/primitives/wasm-interface/ @koute
/substrate/utils/wasm-builder/ @koute

# Systems-related bits and bobs on the client side
/substrate/client/sysinfo/ @koute
/substrate/client/tracing/ @koute

# Documentation audit
/substrate/primitives/runtime @paritytech/docs-audit
/substrate/primitives/arithmetic @paritytech/docs-audit
# /primitives/core (to be added later)
# /primitives/io (to be added later)

# FRAME
/substrate/frame/ @paritytech/frame-coders @paritytech/docs-audit
/substrate/frame/nfts/ @jsidorenko @paritytech/docs-audit
/substrate/frame/state-trie-migration/ @paritytech/frame-coders @cheme
/substrate/frame/uniques/ @jsidorenko @paritytech/docs-audit

# GRANDPA, BABE, consensus stuff
/substrate/client/consensus/babe/ @andresilva
/substrate/client/consensus/grandpa/ @andresilva
/substrate/client/consensus/pow/ @sorpaas
/substrate/client/consensus/slots/ @andresilva
/substrate/frame/babe/ @andresilva
/substrate/frame/grandpa/ @andresilva
/substrate/primitives/consensus/pow/ @sorpaas

# BEEFY, MMR
/substrate/frame/beefy/ @acatangiu
/substrate/frame/beefy-mmr/ @acatangiu
/substrate/frame/merkle-mountain-range/ @acatangiu
/substrate/primitives/merkle-mountain-range/ @acatangiu

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

# NPoS and election
/substrate/frame/election-provider-multi-phase/ @paritytech/staking-core @paritytech/docs-audit
/substrate/frame/election-provider-support/ @paritytech/staking-core @paritytech/docs-audit
/substrate/frame/elections-phragmen/ @paritytech/staking-core @paritytech/docs-audit
/substrate/frame/nomination-pools/ @paritytech/staking-core @paritytech/docs-audit
/substrate/frame/staking/ @paritytech/staking-core @paritytech/docs-audit
/substrate/primitives/npos-elections/ @paritytech/staking-core @paritytech/docs-audit
4 changes: 2 additions & 2 deletions .github/pr-custom-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rules:
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|^(?!.*\.dic$|.*spellcheck\.toml$)scripts/ci/.*|^\.github/.*
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/.*
min_approvals: 2
teams:
- core-devs
Expand All @@ -39,7 +39,7 @@ rules:
# if there are any changes in the bridges subtree (in case of backport changes back to bridges repo)
- name: Bridges subtree files
check_type: changed_files
condition: ^cumulus/bridges/.*
condition: ^bridges/.*
min_approvals: 1
teams:
- bridges-core
Expand Down
73 changes: 72 additions & 1 deletion .gitlab/common/lib.sh → .github/scripts/common/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ structure_message() {
# access_token: see https://matrix.org/docs/guides/client-server-api/
# Usage: send_message $body (json formatted) $room_id $access_token
send_message() {
curl -XPOST -d "$1" "https://matrix.parity.io/_matrix/client/r0/rooms/$2/send/m.room.message?access_token=$3"
curl -XPOST -d "$1" "https://m.parity.io/_matrix/client/r0/rooms/$2/send/m.room.message?access_token=$3"
}

# Pretty-printing functions
Expand Down Expand Up @@ -193,3 +193,74 @@ check_bootnode(){
echo " Bootnode appears unreachable"
return 1
}

# Assumes the ENV are set:
# - RELEASE_ID
# - GITHUB_TOKEN
# - REPO in the form paritytech/polkadot
fetch_release_artifacts() {
echo "Release ID : $RELEASE_ID"
echo "Repo : $REPO"
echo "Binary : $BINARY"

curl -L -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${REPO}/releases/${RELEASE_ID} > release.json

# Get Asset ids
ids=($(jq -r '.assets[].id' < release.json ))
count=$(jq '.assets|length' < release.json )

# Fetch artifacts
mkdir -p "./release-artifacts/${BINARY}"
pushd "./release-artifacts/${BINARY}" > /dev/null

iter=1
for id in "${ids[@]}"
do
echo " - $iter/$count: downloading asset id: $id..."
curl -s -OJ -L -H "Accept: application/octet-stream" \
-H "Authorization: Token ${GITHUB_TOKEN}" \
"https://api.github.com/repos/${REPO}/releases/assets/$id"
iter=$((iter + 1))
done

pwd
ls -al --color
popd > /dev/null
}

# Check the checksum for a given binary
function check_sha256() {
echo "Checking SHA256 for $1"
shasum -qc $1.sha256
}

# Import GPG keys of the release team members
# This is done in parallel as it can take a while sometimes
function import_gpg_keys() {
GPG_KEYSERVER=${GPG_KEYSERVER:-"keyserver.ubuntu.com"}
SEC="9D4B2B6EB8F97156D19669A9FF0812D491B96798"
WILL="2835EAF92072BC01D188AF2C4A092B93E97CE1E2"
EGOR="E6FC4D4782EB0FA64A4903CCDB7D3555DD3932D3"
MARA="533C920F40E73A21EEB7E9EBF27AEA7E7594C9CF"
MORGAN="2E92A9D8B15D7891363D1AE8AF9E6C43F7F8C4CF"

echo "Importing GPG keys from $GPG_KEYSERVER in parallel"
for key in $SEC $WILL $EGOR $MARA $MORGAN; do
(
echo "Importing GPG key $key"
gpg --no-tty --quiet --keyserver $GPG_KEYSERVER --recv-keys $key
echo -e "5\ny\n" | gpg --no-tty --command-fd 0 --expert --edit-key $key trust;
) &
done
wait
}

# Check the GPG signature for a given binary
function check_gpg() {
echo "Checking GPG Signature for $1"
gpg --no-tty --verify -q $1.asc $1
}
2 changes: 1 addition & 1 deletion .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- uses: actions/setup-node@v3.8.1
with:
node-version: "18.x"
Expand Down
Loading

0 comments on commit 3e6f588

Please sign in to comment.