diff --git a/.github/.markdownlint.yaml b/.github/.markdownlint.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..6a93d89c46ad4601505dd75ac252816fa4af5c40
--- /dev/null
+++ b/.github/.markdownlint.yaml
@@ -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
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 0000000000000000000000000000000000000000..fdaa0c8628f766e241ba9043698b611a0bd78811
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -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
diff --git a/cumulus/.github/ISSUE_TEMPLATE/blank.md b/.github/ISSUE_TEMPLATE/blank.md
similarity index 100%
rename from cumulus/.github/ISSUE_TEMPLATE/blank.md
rename to .github/ISSUE_TEMPLATE/blank.md
diff --git a/substrate/.github/ISSUE_TEMPLATE/bug.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml
similarity index 92%
rename from substrate/.github/ISSUE_TEMPLATE/bug.yaml
rename to .github/ISSUE_TEMPLATE/bug_report.yaml
index ae40df08eca761dc75a4a66cd3912666ba457912..f828a5d9d8931580713ba49a25c83643a74cf090 100644
--- a/substrate/.github/ISSUE_TEMPLATE/bug.yaml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yaml
@@ -1,6 +1,7 @@
name: Bug Report
description: Let us know about an issue you experienced with this software
-# labels: ["some existing label","another one"]
+labels: [ I2-bug, I10-unconfirmed ]
+
body:
- type: checkboxes
attributes:
@@ -20,7 +21,7 @@ body:
id: bug
attributes:
label: Description of bug
- # description: What seems to be the problem?
+ description: What seems to be the problem?
# placeholder: Describe the problem.
validations:
required: true
diff --git a/substrate/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
similarity index 100%
rename from substrate/.github/ISSUE_TEMPLATE/config.yml
rename to .github/ISSUE_TEMPLATE/config.yml
diff --git a/substrate/.github/ISSUE_TEMPLATE/feature.yaml b/.github/ISSUE_TEMPLATE/feature.yaml
similarity index 98%
rename from substrate/.github/ISSUE_TEMPLATE/feature.yaml
rename to .github/ISSUE_TEMPLATE/feature.yaml
index 6a59522ab4b4829fae056fcadf006393cbd58a1a..828e8b461ccc85179a2e71511a08f60f9d7588a8 100644
--- a/substrate/.github/ISSUE_TEMPLATE/feature.yaml
+++ b/.github/ISSUE_TEMPLATE/feature.yaml
@@ -1,6 +1,6 @@
name: Feature Request
description: Submit your requests and suggestions to improve!
-labels: ["J0-enhancement"]
+labels: [ I5-enhancement ]
body:
- type: checkboxes
id: existing
diff --git a/.github/pr-custom-review.yml b/.github/pr-custom-review.yml
index d37ea4cf0958e60cf4701f897af7581cae54b9f5..ac13d862a4ac2aee487de33de56fe34d6507c0dc 100644
--- a/.github/pr-custom-review.yml
+++ b/.github/pr-custom-review.yml
@@ -8,7 +8,7 @@ rules:
check_type: changed_files
condition:
include: ^\.gitlab-ci\.yml|^docker/.*|^\.github/.*|^\.gitlab/.*|^\.config/nextest.toml|^\.cargo/.*
- exclude: ^./gitlab/pipeline/zombienet.yml$
+ exclude: ^\.gitlab/pipeline/zombienet.*
min_approvals: 2
teams:
- ci
@@ -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
@@ -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
diff --git a/.gitlab/common/lib.sh b/.github/scripts/common/lib.sh
similarity index 76%
rename from .gitlab/common/lib.sh
rename to .github/scripts/common/lib.sh
index ba5b171487288928f779f2db034f8d989213c647..b0f9cb32063a43cda58d2e6e8f25e0ff66a134eb 100755
--- a/.gitlab/common/lib.sh
+++ b/.github/scripts/common/lib.sh
@@ -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
@@ -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
+}
diff --git a/.github/workflows/check-licenses.yml b/.github/workflows/check-licenses.yml
index 3da699a354f69cf31ecd4c2870a39741abd255d1..4d0afefc47aace08bff9af796f9fb9c30dee99a7 100644
--- a/.github/workflows/check-licenses.yml
+++ b/.github/workflows/check-licenses.yml
@@ -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"
diff --git a/.github/workflows/check-markdown.yml b/.github/workflows/check-markdown.yml
new file mode 100644
index 0000000000000000000000000000000000000000..f1e46ca273515d9081f9c5a7f6b8b4ff902c444a
--- /dev/null
+++ b/.github/workflows/check-markdown.yml
@@ -0,0 +1,33 @@
+name: Check Markdown
+
+on:
+ pull_request:
+ types: [opened, synchronize, reopened, ready_for_review]
+
+permissions:
+ packages: read
+
+jobs:
+ lint-markdown:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout sources
+ uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
+
+ - uses: actions/setup-node@v3.8.1
+ with:
+ node-version: "18.x"
+ registry-url: "https://npm.pkg.github.com"
+ scope: "@paritytech"
+
+ - name: Install tooling
+ run: |
+ npm install -g markdownlint-cli
+ markdownlint --version
+
+ - name: Check Markdown
+ env:
+ CONFIG: .github/.markdownlint.yaml
+ run: |
+ markdownlint --config "$CONFIG" --ignore target .
diff --git a/.github/workflows/check-prdoc.yml b/.github/workflows/check-prdoc.yml
new file mode 100644
index 0000000000000000000000000000000000000000..d153184941ac1e05f341ae49c4c8d4e212c0d85b
--- /dev/null
+++ b/.github/workflows/check-prdoc.yml
@@ -0,0 +1,49 @@
+name: Check PRdoc
+
+on:
+ pull_request:
+ types: [labeled, opened, synchronize, unlabeled]
+
+env:
+ IMAGE: paritytech/prdoc:latest
+ API_BASE: https://api.github.com/repos
+ REPO: ${{ github.repository }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ GITHUB_PR: ${{ github.event.pull_request.number }}
+ MOUNT: /prdoc
+ ENGINE: docker
+
+jobs:
+ check-prdoc:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Pull image
+ run: |
+ echo "Pulling $IMAGE"
+ docker pull $IMAGE
+ docker run --rm $IMAGE --version
+
+ - name: Check if PRdoc is required
+ id: get-labels
+ run: |
+ # Fetch the labels for the PR under test
+ echo "Fetch the labels for $API_BASE/${REPO}/pulls/${GITHUB_PR}"
+ labels=$( curl -H "Authorization: token ${GITHUB_TOKEN}" -s "$API_BASE/${REPO}/pulls/${GITHUB_PR}" | jq '.labels | .[] | .name' | tr "\n" ",")
+ echo "Labels: ${labels}"
+ echo "labels=${labels}" >> "$GITHUB_OUTPUT"
+
+ - name: No PRdoc required
+ if: ${{ contains(steps.get-labels.outputs.labels, 'R0') }}
+ run: |
+ echo "PR detected as silent, no PRdoc is required, exiting..."
+ exit 0
+
+ - name: Checkout repo
+ if: ${{ !contains(steps.get-labels.outputs.labels, 'R0') }}
+ uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac #v4.0.0
+
+ - name: PRdoc check for PR#${{ github.event.pull_request.number }}
+ if: ${{ !contains(steps.get-labels.outputs.labels, 'R0') }}
+ run: |
+ echo "Checking for PR#${GITHUB_PR} in $MOUNT"
+ $ENGINE run --rm -v $PWD/prdoc:/doc $IMAGE check -n ${GITHUB_PR} || true
diff --git a/.github/workflows/fmt-check.yml b/.github/workflows/fmt-check.yml
index fd4b72061b925dfb3f6e4193a6b1fb97c0de75d8..df785404036e138c78cf1818620dd9db8c30a243 100644
--- a/.github/workflows/fmt-check.yml
+++ b/.github/workflows/fmt-check.yml
@@ -16,7 +16,7 @@ jobs:
container:
image: paritytech/ci-unified:bullseye-1.70.0-2023-05-23-v20230706
steps:
- - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
+ - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Cargo fmt
run: cargo +nightly fmt --all -- --check
diff --git a/.github/workflows/release-50_publish-docker.yml b/.github/workflows/release-50_publish-docker.yml
new file mode 100644
index 0000000000000000000000000000000000000000..d01d78631e19b71cef7f450808ea707b061b8d82
--- /dev/null
+++ b/.github/workflows/release-50_publish-docker.yml
@@ -0,0 +1,285 @@
+name: Release - Publish Docker Image
+
+# This workflow listens to published releases or can be triggered manually.
+# It builds and published releases and rc candidates.
+
+on:
+ #TODO: activate automated run later
+ # release:
+ # types:
+ # - published
+ workflow_dispatch:
+ inputs:
+ image_type:
+ description: Type of the image to be published
+ required: true
+ default: rc
+ type: choice
+ options:
+ - rc
+ - release
+
+ binary:
+ description: Binary to be published
+ required: true
+ default: polkadot
+ type: choice
+ options:
+ - polkadot
+ - polkadot-parachain
+
+ release_id:
+ description: |
+ Release ID.
+ You can find it using the command:
+ curl -s \
+ -H "Authorization: Bearer ${GITHUB_TOKEN}" https://api.github.com/repos/$OWNER/$REPO/releases | \
+ jq '.[] | { name: .name, id: .id }'
+ required: true
+ type: string
+
+ registry:
+ description: Container registry
+ required: true
+ type: string
+ default: docker.io
+
+ # The owner is often the same than the Docker Hub username but does ont have to be.
+ # In our case, it is not.
+ owner:
+ description: Owner of the container image repo
+ required: true
+ type: string
+ default: parity
+
+ version:
+ description: version to build/release
+ default: v0.9.18
+ required: true
+
+permissions:
+ contents: write
+
+env:
+ RELEASE_ID: ${{ inputs.release_id }}
+ ENGINE: docker
+ REGISTRY: ${{ inputs.registry }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ DOCKER_OWNER: ${{ inputs.owner || github.repository_owner }}
+ REPO: ${{ github.repository }}
+ BINARY: ${{ inputs.binary }}
+ # EVENT_ACTION: ${{ github.event.action }}
+ EVENT_NAME: ${{ github.event_name }}
+ IMAGE_TYPE: ${{ inputs.image_type }}
+
+jobs:
+ fetch-artifacts: # this job will be triggered for the polkadot-parachain rc and release or polkadot rc image build
+ if: ${{ inputs.binary == 'polkadot-parachain' || inputs.image_type == 'rc' }}
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout sources
+ uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
+
+ #TODO: this step will be needed when automated triggering will work
+ #this step runs only if the workflow is triggered automatically when new release is published
+ # if: ${{ env.EVENT_NAME == 'release' && env.EVENT_ACTION != '' && env.EVENT_ACTION == 'published' }}
+ # run: |
+ # mkdir -p release-artifacts && cd release-artifacts
+
+ # for f in $BINARY $BINARY.asc $BINARY.sha256; do
+ # URL="https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ github.event.release.tag_name }}/$f"
+ # echo " - Fetching $f from $URL"
+ # wget "$URL" -O "$f"
+ # done
+ # chmod a+x $BINARY
+ # ls -al
+
+ - name: Fetch rc artifacts or release artifacts based on release id
+ #this step runs only if the workflow is triggered manually
+ if: ${{ env.EVENT_NAME == 'workflow_dispatch' }}
+ run: |
+ . ./.github/scripts/common/lib.sh
+
+ fetch_release_artifacts
+
+ - name: Cache the artifacts
+ uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
+ with:
+ key: artifacts-${{ env.BINARY }}-${{ github.sha }}
+ path: |
+ ./release-artifacts/${{ env.BINARY }}/**/*
+
+ build-container: # this job will be triggered for the polkadot-parachain rc and release or polkadot rc image build
+ if: ${{ inputs.binary == 'polkadot-parachain' || inputs.image_type == 'rc' }}
+ runs-on: ubuntu-latest
+ needs: fetch-artifacts
+
+ steps:
+ - name: Checkout sources
+ uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
+
+ - name: Get artifacts from cache
+ uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
+ with:
+ key: artifacts-${{ env.BINARY }}-${{ github.sha }}
+ fail-on-cache-miss: true
+ path: |
+ ./release-artifacts/${{ env.BINARY }}/**/*
+
+ - name: Check sha256 ${{ env.BINARY }}
+ working-directory: ./release-artifacts/${{ env.BINARY }}
+ run: |
+ . ../../.github/scripts/common/lib.sh
+
+ echo "Checking binary $BINARY"
+ check_sha256 $BINARY && echo "OK" || echo "ERR"
+
+ - name: Check GPG ${{ env.BINARY }}
+ working-directory: ./release-artifacts/${{ env.BINARY }}
+ run: |
+ . ../../.github/scripts/common/lib.sh
+ import_gpg_keys
+ check_gpg $BINARY
+
+ - name: Fetch rc commit and tag
+ if: ${{ env.IMAGE_TYPE == 'rc' }}
+ id: fetch_rc_refs
+ run: |
+ release=release-${{ inputs.release_id }} && \
+ echo "release=${release}" >> $GITHUB_OUTPUT
+
+ commit=$(git rev-parse --short HEAD) && \
+ echo "commit=${commit}" >> $GITHUB_OUTPUT
+
+ tag=$(git name-rev --tags --name-only $(git rev-parse HEAD)) && \
+ [ "${tag}" != "undefined" ] && echo "tag=${tag}" >> $GITHUB_OUTPUT || \
+ echo "No tag, doing without"
+
+ - name: Fetch release tags
+ working-directory: ./release-artifacts/${{ env.BINARY }}
+ if: ${{ env.IMAGE_TYPE == 'release'}}
+ id: fetch_release_refs
+ run: |
+ chmod a+rx $BINARY
+ VERSION=$(./$BINARY --version | awk '{ print $2 }' )
+ release=$( echo $VERSION | cut -f1 -d- )
+ echo "tag=latest" >> $GITHUB_OUTPUT
+ echo "release=${release}" >> $GITHUB_OUTPUT
+
+ - name: Build Injected Container image for polkadot rc
+ if: ${{ env.BINARY == 'polkadot' }}
+ env:
+ ARTIFACTS_FOLDER: ./release-artifacts
+ IMAGE_NAME: ${{ env.BINARY }}
+ OWNER: ${{ env.DOCKER_OWNER }}
+ TAGS: ${{ join(steps.fetch_rc_refs.outputs.*, ',') || join(steps.fetch_release_refs.outputs.*, ',') }}
+ run: |
+ ls -al
+ echo "Building container for $BINARY"
+ ./docker/scripts/build-injected.sh
+
+ - name: Build Injected Container image for polkadot-parachain
+ if: ${{ env.BINARY == 'polkadot-parachain' }}
+ env:
+ ARTIFACTS_FOLDER: ./release-artifacts
+ IMAGE_NAME: ${{ env.BINARY }}
+ OWNER: ${{ env.DOCKER_OWNER }}
+ DOCKERFILE: docker/dockerfiles/polkadot-parachain/polkadot-parachain_injected.Dockerfile
+ TAGS: ${{ join(steps.fetch_rc_refs.outputs.*, ',') || join(steps.fetch_release_refs.outputs.*, ',') }}
+ run: |
+ ls -al
+ mkdir -p $ARTIFACTS_FOLDER/specs
+ cp cumulus/parachains/chain-specs/*.json $ARTIFACTS_FOLDER/specs
+
+ echo "Building container for $BINARY"
+ ./docker/scripts/build-injected.sh
+
+ - name: Login to Dockerhub
+ uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
+ with:
+ username: ${{ secrets.CUMULUS_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CUMULUS_DOCKERHUB_TOKEN }}
+
+ - name: Push Container image for ${{ env.BINARY }}
+ id: docker_push
+ run: |
+ $ENGINE images | grep ${BINARY}
+ $ENGINE push --all-tags ${REGISTRY}/${DOCKER_OWNER}/${BINARY}
+
+ - name: Check version for the published image for ${{ env.BINARY }}
+ env:
+ RELEASE_TAG: ${{ steps.fetch_rc_refs.outputs.release || steps.fetch_release_refs.outputs.release }}
+ run: |
+ echo "Checking tag ${RELEASE_TAG} for image ${REGISTRY}/${DOCKER_OWNER}/${BINARY}"
+ $ENGINE run -i ${REGISTRY}/${DOCKER_OWNER}/${BINARY}:${RELEASE_TAG} --version
+
+ fetch-latest-debian-package-version: # this job will be triggered for polkadot release build
+ if: ${{ inputs.binary == 'polkadot' && inputs.image_type == 'release' }}
+ runs-on: ubuntu-latest
+ outputs:
+ polkadot_apt_version: ${{ steps.fetch-latest-apt.outputs.polkadot_apt_version }}
+ container:
+ image: paritytech/parity-keyring
+ options: --user root
+ steps:
+ - name: Get version
+ id: fetch-latest-apt
+ run: |
+ apt update
+ apt show polkadot
+ version=$(apt show polkadot 2>/dev/null | grep "Version:" | awk '{print $2}')
+ echo "polkadot_apt_version=v$version" >> $GITHUB_OUTPUT
+ echo "You passed ${{ inputs.version }} but this is ignored"
+ echo "We use the version from the Debian Package: $version"
+
+ build-polkadot-release-container: # this job will be triggered for polkadot release build
+ if: ${{ inputs.binary == 'polkadot' && inputs.image_type == 'release' }}
+ runs-on: ubuntu-latest
+ needs: fetch-latest-debian-package-version
+ steps:
+ - name: Checkout sources
+ uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
+
+ - name: Cache Docker layers
+ uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
+ with:
+ path: /tmp/.buildx-cache
+ key: ${{ runner.os }}-buildx-${{ github.sha }}
+ restore-keys: |
+ ${{ runner.os }}-buildx-
+
+ - name: Login to Docker Hub
+ uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
+ with:
+ username: ${{ secrets.POLKADOT_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.POLKADOT_DOCKERHUB_TOKEN }}
+
+ - name: Fetch values
+ id: fetch-data
+ run: |
+ date=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
+ echo "date=$date" >> $GITHUB_OUTPUT
+
+ - name: Build and push
+ id: docker_build
+ uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
+ with:
+ push: true
+ file: docker/dockerfiles/polkadot/polkadot_injected_debian.Dockerfile
+ # TODO: The owner should be used below but buildx does not resolve the VARs
+ # TODO: It would be good to get rid of this GHA that we don't really need.
+ tags: |
+ parity/polkadot:latest
+ parity/polkadot:${{ needs.fetch-latest-debian-package-version.outputs.polkadot_apt_version }}
+ build-args: |
+ VCS_REF=${{ github.ref }}
+ POLKADOT_VERSION=${{ needs.fetch-latest-debian-package-version.outputs.polkadot_apt_version }}
+ BUILD_DATE=${{ steps.fetch-data.outputs.date }}
+ cache-from: type=local,src=/tmp/.buildx-cache
+ cache-to: type=local,dest=/tmp/.buildx-cache
+ - name: Image digest
+ run: echo ${{ steps.docker_build.outputs.digest }}
diff --git a/.gitignore b/.gitignore
index bd7f34b481041163b45c4c75ad4757d28ec0ca20..35e02e706b4261dcac2a3f9c6686245a01de9a8a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@
.local
.vscode
.wasm-binaries
+*.adoc
*.bin
*.iml
*.orig
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2e0465ba1eb1b350e105a67703bd51ce13f544ae..10dd69f12a77c27a7d3de083f5063bd9f6a0e931 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -21,7 +21,7 @@ workflow:
- if: $CI_COMMIT_BRANCH
variables:
- CI_IMAGE: "paritytech/ci-unified:bullseye-1.70.0-2023-05-23-v20230706"
+ CI_IMAGE: !reference [.ci-unified, variables, CI_IMAGE]
# BUILDAH_IMAGE is defined in group variables
BUILDAH_COMMAND: "buildah --storage-driver overlay2"
RELENG_SCRIPTS_BRANCH: "master"
@@ -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.65"
+ ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.67"
DOCKER_IMAGES_VERSION: "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}"
default:
@@ -114,7 +114,7 @@ default:
- !reference [.rust-info-script, script]
- !reference [.rusty-cachier, before_script]
tags:
- - linux-docker-vm-c2
+ - linux-docker
# rusty-cachier's hidden job. Parts of this job are used to instrument the pipeline's other real jobs with rusty-cachier
# rusty-cachier's commands are described here: https://gitlab.parity.io/parity/infrastructure/ci_cd/rusty-cachier/client#description
@@ -197,8 +197,6 @@ default:
extends: .build-refs
include:
- # weights jobs
- # - gitlab/pipeline/weights.yml
# check jobs
- .gitlab/pipeline/check.yml
# test jobs
@@ -211,11 +209,14 @@ include:
- .gitlab/pipeline/publish.yml
# zombienet jobs
- .gitlab/pipeline/zombienet.yml
- # # timestamp handler
+ # timestamp handler
- project: parity/infrastructure/ci_cd/shared
ref: v0.2
file: /common/timestamp.yml
-
+ # ci image
+ - project: parity/infrastructure/ci_cd/shared
+ ref: main
+ file: /common/ci-unified.yml
# This job cancels the whole pipeline if any of provided jobs fail.
# In a DAG, every jobs chain is executed independently of others. The `fail_fast` principle suggests
# to fail the pipeline as soon as possible to shorten the feedback loop.
diff --git a/.gitlab/pipeline/build.yml b/.gitlab/pipeline/build.yml
index 636f7e47afad81fb9b99ada0eeaad768ec17bedf..5b53798c403dd3ad82d908f7d7fe32956bcd6838 100644
--- a/.gitlab/pipeline/build.yml
+++ b/.gitlab/pipeline/build.yml
@@ -77,26 +77,6 @@ build-malus:
- echo "polkadot-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
- cp -r ./docker/* ./artifacts
-build-staking-miner:
- stage: build
- extends:
- - .docker-env
- - .common-refs
- # - .collect-artifacts
- # DAG
- needs:
- - job: build-malus
- artifacts: false
- script:
- - time cargo build -q --locked --release --package staging-staking-miner
- # # pack artifacts
- # - mkdir -p ./artifacts
- # - mv ./target/release/staking-miner ./artifacts/.
- # - echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION
- # - echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG
- # - echo "staking-miner = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
- # - cp -r ./scripts/* ./artifacts
-
build-rustdoc:
stage: build
extends:
@@ -105,20 +85,40 @@ build-rustdoc:
- .run-immediately
variables:
SKIP_WASM_BUILD: 1
- # artifacts:
- # name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
- # when: on_success
- # expire_in: 1 days
- # paths:
- # - ./crate-docs/
+ artifacts:
+ name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
+ when: on_success
+ expire_in: 1 days
+ paths:
+ - ./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 --workspace --no-deps
+ - time cargo doc --features try-runtime,experimental --workspace --no-deps
- rm -f ./target/doc/.lock
- mv ./target/doc ./crate-docs
- # FIXME: remove me after CI image gets nonroot
- - chown -R nonroot:nonroot ./crate-docs
+ # Inject Simple Analytics (https://www.simpleanalytics.com/) privacy preserving tracker into
+ # all .html files
+ - |
+ inject_simple_analytics() {
+ local path="$1"
+ local script_content=""
+
+ # Function that inject script into the head of an html file using sed.
+ process_file() {
+ local file="$1"
+ echo "Adding Simple Analytics script to $file"
+ sed -i "s||$script_content|" "$file"
+ }
+ export -f process_file
+ # xargs runs process_file in seperate shells without access to outer variables.
+ # to make script_content available inside process_file, export it as an env var here.
+ export script_content
+
+ # Modify .html files in parallel using xargs, otherwise it can take a long time.
+ find "$path" -name '*.html' | xargs -I {} -P "$(nproc)" bash -c 'process_file "$@"' _ {}
+ }
+ inject_simple_analytics "./crate-docs"
- echo "" > ./crate-docs/index.html
build-implementers-guide:
@@ -127,7 +127,7 @@ build-implementers-guide:
- .kubernetes-env
- .common-refs
- .run-immediately
- # - .collect-artifacts
+ - .collect-artifacts
# git depth is set on purpose: https://github.com/paritytech/polkadot/issues/6284
variables:
GIT_STRATEGY: clone
@@ -146,7 +146,7 @@ build-short-benchmark:
- .run-immediately
- .collect-artifacts
script:
- - cargo build --profile release --locked --features=runtime-benchmarks --bin polkadot
+ - cargo build --profile release --locked --features=runtime-benchmarks,on-chain-release-build --bin polkadot --workspace
- mkdir -p artifacts
- target/release/polkadot --version
- cp ./target/release/polkadot ./artifacts/
@@ -166,7 +166,7 @@ build-linux-stable-cumulus:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- echo "___Building a binary, please refrain from using it in production since it goes with the debug assertions.___"
- - time cargo build --release --locked --bin polkadot-parachain
+ - time cargo build --release --locked -p polkadot-parachain-bin --bin polkadot-parachain
- echo "___Packing the artifacts___"
- mkdir -p ./artifacts
- mv ./target/release/polkadot-parachain ./artifacts/.
@@ -186,7 +186,7 @@ build-test-parachain:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- echo "___Building a binary, please refrain from using it in production since it goes with the debug assertions.___"
- - time cargo build --release --locked --bin test-parachain
+ - time cargo build --release --locked -p cumulus-test-service --bin test-parachain
- echo "___Packing the artifacts___"
- mkdir -p ./artifacts
- mv ./target/release/test-parachain ./artifacts/.
@@ -273,7 +273,7 @@ build-short-benchmark-cumulus:
- .run-immediately
- .collect-artifacts
script:
- - cargo build --profile release --locked --features=runtime-benchmarks --bin polkadot-parachain
+ - cargo build --profile release --locked --features=runtime-benchmarks,on-chain-release-build -p polkadot-parachain-bin --bin polkadot-parachain --workspace
- mkdir -p artifacts
- target/release/polkadot-parachain --version
- cp ./target/release/polkadot-parachain ./artifacts/
@@ -299,7 +299,7 @@ build-linux-substrate:
# see https://github.com/paritytech/ci_cd/issues/682#issuecomment-1340953589
- git checkout -B "$CI_COMMIT_REF_NAME" "$CI_COMMIT_SHA"
script:
- - WASM_BUILD_NO_COLOR=1 time cargo build --locked --release
+ - WASM_BUILD_NO_COLOR=1 time cargo build --locked --release -p node-cli
- mv $CARGO_TARGET_DIR/release/substrate-node ./artifacts/substrate/substrate
- echo -n "Substrate version = "
- if [ "${CI_COMMIT_TAG}" ]; then
@@ -309,7 +309,7 @@ build-linux-substrate:
cut -d ' ' -f 2 | tee ./artifacts/substrate/VERSION;
fi
- sha256sum ./artifacts/substrate/substrate | tee ./artifacts/substrate/substrate.sha256
- - cp -r ./docker/substrate_injected.Dockerfile ./artifacts/substrate/
+ - cp -r ./docker/dockerfiles/substrate_injected.Dockerfile ./artifacts/substrate/
# - printf '\n# building node-template\n\n'
# - ./scripts/ci/node-template-release.sh ./artifacts/substrate/substrate-node-template.tar.gz
@@ -341,7 +341,7 @@ build-subkey-linux:
extends: .build-subkey
# DAG
needs:
- - job: build-staking-miner
+ - job: build-malus
artifacts: false
# tbd
# build-subkey-macos:
diff --git a/.gitlab/pipeline/check.yml b/.gitlab/pipeline/check.yml
index f88f5808637b89f452fdc77fb3031d40788cc0ba..5cc2337bf40978ea704aed262ca2f296e028f645 100644
--- a/.gitlab/pipeline/check.yml
+++ b/.gitlab/pipeline/check.yml
@@ -19,7 +19,7 @@ check-try-runtime:
- time cargo check --locked -p parachain-template-node --features try-runtime
# add after https://github.com/paritytech/substrate/pull/14502 is merged
# experimental code may rely on try-runtime and vice-versa
- - time cargo check --locked --features try-runtime,experimental
+ - time cargo check --locked --all --features try-runtime,experimental
cargo-fmt-manifest:
stage: check
@@ -103,7 +103,6 @@ test-rust-feature-propagation:
- zepter lint propagate-feature --feature try-runtime --left-side-feature-missing=ignore --workspace --feature-enables-dep="try-runtime:frame-try-runtime" --locked
- zepter lint propagate-feature --feature runtime-benchmarks --left-side-feature-missing=ignore --workspace --feature-enables-dep="runtime-benchmarks:frame-benchmarking" --locked
- zepter lint propagate-feature --feature std --left-side-feature-missing=ignore --workspace --locked
- allow_failure: true # Experimental
# More info can be found here: https://github.com/paritytech/polkadot/pull/5865
.check-runtime-migration:
diff --git a/.gitlab/pipeline/publish.yml b/.gitlab/pipeline/publish.yml
index ed18082344f02b719471e50b21d8db0765343a5e..a03d407c040904a6a1a4fd7095052a039d0019e0 100644
--- a/.gitlab/pipeline/publish.yml
+++ b/.gitlab/pipeline/publish.yml
@@ -1,6 +1,68 @@
# This file is part of .gitlab-ci.yml
# Here are all jobs that are executed during "publish" stage
+publish-rustdoc:
+ stage: publish
+ extends: .kubernetes-env
+ variables:
+ CI_IMAGE: node:18
+ GIT_DEPTH: 100
+ RUSTDOCS_DEPLOY_REFS: "master"
+ rules:
+ - if: $CI_PIPELINE_SOURCE == "pipeline"
+ when: never
+ - if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_REF_NAME == "master"
+ - if: $CI_COMMIT_REF_NAME == "master"
+ needs:
+ - job: build-rustdoc
+ artifacts: true
+ - job: build-implementers-guide
+ artifacts: true
+ script:
+ # If $CI_COMMIT_REF_NAME doesn't match one of $RUSTDOCS_DEPLOY_REFS space-separated values, we
+ # exit immediately.
+ # Putting spaces at the front and back to ensure we are not matching just any substring, but the
+ # whole space-separated value.
+ # setup ssh
+ - eval $(ssh-agent)
+ - ssh-add - <<< ${GITHUB_SSH_PRIV_KEY}
+ - mkdir ~/.ssh && touch ~/.ssh/known_hosts
+ - ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
+ # Set git config
+ - git config user.email "devops-team@parity.io"
+ - git config user.name "${GITHUB_USER}"
+ - git config remote.origin.url "git@github.com:/paritytech/${CI_PROJECT_NAME}.git"
+ - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
+ - git fetch origin gh-pages
+ # Save README and docs
+ - cp -r ./crate-docs/ /tmp/doc/
+ - cp -r ./artifacts/book/ /tmp/
+ - cp README.md /tmp/doc/
+ # we don't need to commit changes because we copy docs to /tmp
+ - git checkout gh-pages --force
+ # Enable if docs needed for other refs
+ # Install `index-tpl-crud` and generate index.html based on RUSTDOCS_DEPLOY_REFS
+ # - which index-tpl-crud &> /dev/null || yarn global add @substrate/index-tpl-crud
+ # - index-tpl-crud upsert ./index.html ${CI_COMMIT_REF_NAME}
+ # Ensure the destination dir doesn't exist.
+ - rm -rf ${CI_COMMIT_REF_NAME}
+ - rm -rf book/
+ - mv -f /tmp/doc ${CI_COMMIT_REF_NAME}
+ # dir for implementors guide
+ - mkdir -p book
+ - mv /tmp/book/html/* book/
+ # Upload files
+ - git add --all
+ # `git commit` has an exit code of > 0 if there is nothing to commit.
+ # This causes GitLab to exit immediately and marks this job failed.
+ # We don't want to mark the entire job failed if there's nothing to
+ # publish though, hence the `|| true`.
+ - git commit -m "___Updated docs for ${CI_COMMIT_REF_NAME}___" ||
+ echo "___Nothing to commit___"
+ - git push origin gh-pages --force
+ after_script:
+ - rm -rf .git/ ./*
+
# cumulus
.build-push-image:
@@ -35,7 +97,7 @@ build-push-image-polkadot-parachain-debug:
- job: build-linux-stable-cumulus
artifacts: true
variables:
- DOCKERFILE: "docker/polkadot-parachain-debug_unsigned_injected.Dockerfile"
+ DOCKERFILE: "docker/dockerfiles/polkadot-parachain/polkadot-parachain-debug_unsigned_injected.Dockerfile"
IMAGE_NAME: "docker.io/paritypr/polkadot-parachain-debug"
build-push-image-test-parachain:
@@ -48,7 +110,7 @@ build-push-image-test-parachain:
- job: build-test-parachain
artifacts: true
variables:
- DOCKERFILE: "docker/test-parachain_injected.Dockerfile"
+ DOCKERFILE: "docker/dockerfiles/test-parachain_injected.Dockerfile"
IMAGE_NAME: "docker.io/paritypr/test-parachain"
# publish-s3:
# stage: publish
@@ -114,7 +176,7 @@ build-push-image-polkadot-debug:
- job: build-linux-stable
artifacts: true
variables:
- DOCKERFILE: "docker/polkadot_injected_debug.Dockerfile"
+ DOCKERFILE: "docker/dockerfiles/polkadot/polkadot_injected_debug.Dockerfile"
IMAGE_NAME: "docker.io/paritypr/polkadot-debug"
build-push-image-colander:
@@ -127,7 +189,7 @@ build-push-image-colander:
- job: build-test-collators
artifacts: true
variables:
- DOCKERFILE: "docker/collator_injected.Dockerfile"
+ DOCKERFILE: "docker/dockerfiles/collator_injected.Dockerfile"
IMAGE_NAME: "docker.io/paritypr/colander"
build-push-image-malus:
@@ -140,7 +202,7 @@ build-push-image-malus:
- job: build-malus
artifacts: true
variables:
- DOCKERFILE: "docker/malus_injected.Dockerfile"
+ DOCKERFILE: "docker/dockerfiles/malus_injected.Dockerfile"
IMAGE_NAME: "docker.io/paritypr/malus"
build-push-image-substrate-pr:
@@ -153,7 +215,7 @@ build-push-image-substrate-pr:
- job: build-linux-substrate
artifacts: true
variables:
- DOCKERFILE: "docker/substrate_injected.Dockerfile"
+ DOCKERFILE: "docker/dockerfiles/substrate_injected.Dockerfile"
IMAGE_NAME: "docker.io/paritypr/substrate"
# old way
@@ -201,7 +263,7 @@ build-push-image-substrate-pr:
# GIT_STRATEGY: none
# DOCKER_USER: ${PARITYPR_USER}
# DOCKER_PASS: ${PARITYPR_PASS}
-# # scripts/ci/dockerfiles/polkadot_injected_debug.Dockerfile
+# # docker/dockerfiles/polkadot/polkadot_injected_debug.Dockerfile
# DOCKERFILE: polkadot_injected_debug.Dockerfile
# IMAGE_NAME: docker.io/paritypr/polkadot-debug
# needs:
@@ -230,7 +292,7 @@ build-push-image-substrate-pr:
# GIT_STRATEGY: none
# DOCKER_USER: ${PARITYPR_USER}
# DOCKER_PASS: ${PARITYPR_PASS}
-# # scripts/ci/dockerfiles/collator_injected.Dockerfile
+# # docker/dockerfiles/collator_injected.Dockerfile
# DOCKERFILE: collator_injected.Dockerfile
# IMAGE_NAME: docker.io/paritypr/colander
# needs:
@@ -258,7 +320,7 @@ build-push-image-substrate-pr:
# GIT_STRATEGY: none
# DOCKER_USER: ${PARITYPR_USER}
# DOCKER_PASS: ${PARITYPR_PASS}
-# # scripts/ci/dockerfiles/malus_injected.Dockerfile
+# # docker/dockerfiles/malus_injected.Dockerfile
# DOCKERFILE: malus_injected.Dockerfile
# IMAGE_NAME: docker.io/paritypr/malus
# needs:
@@ -274,24 +336,6 @@ build-push-image-substrate-pr:
# # this artifact is used in zombienet-tests job
# dotenv: ./artifacts/malus.env
-# publish-staking-miner-image:
-# stage: publish
-# extends:
-# - .kubernetes-env
-# - .build-push-image
-# - .publish-refs
-# variables:
-# CI_IMAGE: ${BUILDAH_IMAGE}
-# # scripts/ci/dockerfiles/staking-miner/staking-miner_injected.Dockerfile
-# DOCKERFILE: ci/dockerfiles/staking-miner/staking-miner_injected.Dockerfile
-# IMAGE_NAME: docker.io/paritytech/staking-miner
-# GIT_STRATEGY: none
-# DOCKER_USER: ${Docker_Hub_User_Parity}
-# DOCKER_PASS: ${Docker_Hub_Pass_Parity}
-# needs:
-# - job: build-staking-miner
-# artifacts: true
-
# substrate
# publish-substrate-image-pr:
diff --git a/.gitlab/pipeline/short-benchmarks.yml b/.gitlab/pipeline/short-benchmarks.yml
index 81601fba32acfcc57415d1da57bb7b5a7c724956..5b0ea276773dd28e5e86a18a6b3c10b3bd103cde 100644
--- a/.gitlab/pipeline/short-benchmarks.yml
+++ b/.gitlab/pipeline/short-benchmarks.yml
@@ -5,7 +5,7 @@
# run short-benchmarks for relay chain runtimes from polkadot
-short-benchmark-polkadot: &short-bench
+short-benchmark-westend: &short-bench
stage: short-benchmarks
extends:
- .docker-env
@@ -14,21 +14,11 @@ short-benchmark-polkadot: &short-bench
- job: build-short-benchmark
artifacts: true
variables:
- RUNTIME: polkadot
+ RUNTIME: westend
tags:
- benchmark
script:
- - ./artifacts/polkadot benchmark pallet --execution wasm --wasm-execution compiled --chain $RUNTIME-dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1
-
-short-benchmark-kusama:
- <<: *short-bench
- variables:
- RUNTIME: kusama
-
-short-benchmark-westend:
- <<: *short-bench
- variables:
- RUNTIME: westend
+ - ./artifacts/polkadot benchmark pallet --chain $RUNTIME-dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1
# run short-benchmarks for system parachain runtimes from cumulus
@@ -45,7 +35,7 @@ short-benchmark-westend:
tags:
- benchmark
script:
- - ./artifacts/polkadot-parachain benchmark pallet --wasm-execution compiled --chain $RUNTIME_CHAIN --pallet "*" --extrinsic "*" --steps 2 --repeat 1
+ - ./artifacts/polkadot-parachain benchmark pallet --chain $RUNTIME_CHAIN --pallet "*" --extrinsic "*" --steps 2 --repeat 1
short-benchmark-asset-hub-polkadot:
<<: *short-bench-cumulus
diff --git a/.gitlab/pipeline/test.yml b/.gitlab/pipeline/test.yml
index c81750d49f9295063378ccfb724af467bcb3c630..3a4f5e71247ca33fa1d3655d1f1a01fd0dffb3bf 100644
--- a/.gitlab/pipeline/test.yml
+++ b/.gitlab/pipeline/test.yml
@@ -23,28 +23,53 @@ test-linux-stable:
- echo "Node index - ${CI_NODE_INDEX}. Total amount - ${CI_NODE_TOTAL}"
# add experimental to features after https://github.com/paritytech/substrate/pull/14502 is merged
# "upgrade_version_checks_should_work" is currently failing
- # "receive_rate_limit_is_enforced"and "benchmark_block_works" can be found in test-linux-stable-additional-tests
- # they fail if run with other tests
- # "rx::tests::sent_views_include_finalized_number_update", "follow_chain_works", "create_snapshot_works" and "block_execution_works"
- # can be found in test-linux-stable-slow
- |
time cargo nextest run \
- -E 'all() & !test(upgrade_version_checks_should_work) & !test(receive_rate_limit_is_enforced) & !test(benchmark_block_works) & !test(rx::tests::sent_views_include_finalized_number_update) & !test(follow_chain_works) & !test(create_snapshot_works) & !test(block_execution_works)' \
--workspace \
--locked \
--release \
--no-fail-fast \
- --features runtime-benchmarks,try-runtime,experimental \
+ --features try-runtime,experimental \
--partition count:${CI_NODE_INDEX}/${CI_NODE_TOTAL}
+ # Upload tests results to Elasticsearch
+ - echo "Upload test results to Elasticsearch"
+ - cat target/nextest/default/junit.xml | xq . > target/nextest/default/junit.json
+ - |
+ curl -v -XPOST --http1.1 \
+ -u ${ELASTIC_USERNAME}:${ELASTIC_PASSWORD} \
+ https://elasticsearch.parity-build.parity.io/unit-tests/_doc/${CI_JOB_ID} \
+ -H 'Content-Type: application/json' \
+ -d @target/nextest/default/junit.json || echo "failed to upload junit report"
# run runtime-api tests with `enable-staging-api` feature on the 1st node
- if [ ${CI_NODE_INDEX} == 1 ]; then time cargo nextest run -p sp-api-test --features enable-staging-api; fi
- # todo: add flacky-test collector
+ artifacts:
+ when: always
+ paths:
+ - target/nextest/default/junit.xml
+ reports:
+ junit: target/nextest/default/junit.xml
test-linux-oldkernel-stable:
extends: test-linux-stable
tags:
- oldkernel-vm
+# https://github.com/paritytech/ci_cd/issues/864
+test-linux-stable-runtime-benchmarks:
+ stage: test
+ extends:
+ - .docker-env
+ - .common-refs
+ - .run-immediately
+ - .pipeline-stopper-artifacts
+ variables:
+ RUST_TOOLCHAIN: stable
+ # Enable debug assertions since we are running optimized builds for testing
+ # but still want to have debug assertions.
+ RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
+ script:
+ - time cargo nextest run --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet
+
# can be used to run all tests
# test-linux-stable-all:
# stage: test
@@ -71,7 +96,7 @@ test-linux-oldkernel-stable:
# --partition count:${CI_NODE_INDEX}/${CI_NODE_TOTAL}
# # todo: add flacky-test collector
-# for some reasons these tests fail if run with all tests
+# TODO: remove me
test-linux-stable-additional-tests:
stage: test
extends:
@@ -85,16 +110,11 @@ test-linux-stable-additional-tests:
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- - |
- time cargo nextest run \
- -E 'test(receive_rate_limit_is_enforced) + test(benchmark_block_works)' \
- --workspace \
- --locked \
- --release \
- --features runtime-benchmarks,try-runtime
- allow_failure: true
+ # tests were moved to test-linux-stable
+ # the jobs should be removed
+ - exit 0
-# these ones can be really slow so it's better to run them separately
+# TODO: remove me
test-linux-stable-slow:
stage: test
# remove after cache is setup
@@ -110,14 +130,9 @@ test-linux-stable-slow:
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- - |
- time cargo nextest run \
- -E 'test(rx::tests::sent_views_include_finalized_number_update) + test(follow_chain_works) + test(create_snapshot_works) + test(block_execution_works)' \
- --workspace \
- --locked \
- --release \
- --features runtime-benchmarks,try-runtime
- allow_failure: true
+ # tests were moved to test-linux-stable
+ # the jobs should be removed
+ - exit 0
# takes about 1,5h without cache
# can be used to check that nextest works correctly
@@ -156,7 +171,7 @@ test-doc:
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- - time cargo test --doc
+ - time cargo test --doc --workspace
test-rustdoc:
stage: test
@@ -202,8 +217,6 @@ test-node-metrics:
- time cargo test --profile testnet
--locked
--features=runtime-metrics -p polkadot-node-metrics > artifacts/log.txt
- # FIXME!
- allow_failure: true
test-deterministic-wasm:
stage: test
@@ -215,7 +228,15 @@ test-deterministic-wasm:
- job: test-frame-ui
artifacts: false
script:
- - .gitlab/test_deterministic_wasm.sh
+ # build runtime
+ - WASM_BUILD_NO_COLOR=1 cargo build -q --locked --release -p staging-kusama-runtime -p polkadot-runtime -p westend-runtime
+ # make checksum
+ - sha256sum target/release/wbuild/*-runtime/target/wasm32-unknown-unknown/release/*.wasm > checksum.sha256
+ - cargo clean
+ # build again
+ - WASM_BUILD_NO_COLOR=1 cargo build -q --locked --release -p staging-kusama-runtime -p polkadot-runtime -p westend-runtime
+ # confirm checksum
+ - sha256sum -c checksum.sha256
cargo-check-benches:
stage: test
@@ -333,7 +354,7 @@ quick-benchmarks:
WASM_BUILD_NO_COLOR: 1
WASM_BUILD_RUSTFLAGS: "-C debug-assertions -D warnings"
script:
- - time cargo run --locked --release --features runtime-benchmarks -- benchmark pallet --execution wasm --wasm-execution compiled --chain dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1
+ - time cargo run --locked --release -p node-cli --bin substrate-node --features runtime-benchmarks -- benchmark pallet --execution wasm --wasm-execution compiled --chain dev --pallet "*" --extrinsic "*" --steps 2 --repeat 1
test-frame-examples-compile-to-wasm:
# into one job
diff --git a/.gitlab/pipeline/zombienet/polkadot.yml b/.gitlab/pipeline/zombienet/polkadot.yml
index 87b821742c675b39294c8bfccead1058cf3f9e33..e420baf486aa9bd3fa22c4127f1d773e44b98d8c 100644
--- a/.gitlab/pipeline/zombienet/polkadot.yml
+++ b/.gitlab/pipeline/zombienet/polkadot.yml
@@ -7,15 +7,25 @@
- export BUILD_RELEASE_VERSION="$(cat ./artifacts/BUILD_RELEASE_VERSION)" # from build-linux-stable job
- export DEBUG=zombie,zombie::network-node
- export ZOMBIENET_INTEGRATION_TEST_IMAGE="${POLKADOT_IMAGE}":${PIPELINE_IMAGE_TAG}
- - export ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE="docker.io/parity/polkadot:${BUILD_RELEASE_VERSION}"
- export COL_IMAGE="${COLANDER_IMAGE}":${PIPELINE_IMAGE_TAG}
+ - export CUMULUS_IMAGE="docker.io/paritypr/polkadot-parachain-debug:${DOCKER_IMAGES_VERSION}"
- export MALUS_IMAGE="${MALUS_IMAGE}":${PIPELINE_IMAGE_TAG}
+ - IMAGE_AVAILABLE=$(curl -o /dev/null -w "%{http_code}" -I -L -s https://registry.hub.docker.com/v2/repositories/parity/polkadot/tags/${BUILD_RELEASE_VERSION})
+ - if [ $IMAGE_AVAILABLE -eq 200 ]; then
+ export ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE="docker.io/parity/polkadot:${BUILD_RELEASE_VERSION}";
+ else
+ echo "Getting the image to use as SECONDARY, using ${BUILD_RELEASE_VERSION} as base";
+ VERSIONS=$(curl -L -s 'https://registry.hub.docker.com/v2/repositories/parity/polkadot/tags/' | jq -r '.results[].name'| grep -E "v[0-9]" |grep -vE "[0-9]-");
+ VERSION_TO_USE=$(echo "${BUILD_RELEASE_VERSION}\n$VERSIONS"|sort -r|grep -A1 "${BUILD_RELEASE_VERSION}"|tail -1);
+ export ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE="docker.io/parity/polkadot:${VERSION_TO_USE}";
+ fi
- echo "Zombienet Tests Config"
- echo "gh-dir ${GH_DIR}"
- echo "local-dir ${LOCAL_DIR}"
- echo "polkadot image ${ZOMBIENET_INTEGRATION_TEST_IMAGE}"
- echo "polkadot secondary image ${ZOMBIENET_INTEGRATION_TEST_SECONDARY_IMAGE}"
- echo "colander image ${COL_IMAGE}"
+ - echo "cumulus image ${CUMULUS_IMAGE}"
- echo "malus image ${MALUS_IMAGE}"
stage: zombienet
image: "${ZOMBIENET_IMAGE}"
@@ -28,6 +38,8 @@
artifacts: true
- job: build-push-image-colander
artifacts: true
+ - job: build-push-image-polkadot-parachain-debug
+ artifacts: true
extends:
- .kubernetes-env
- .zombienet-refs
diff --git a/.gitlab/test_deterministic_wasm.sh b/.gitlab/test_deterministic_wasm.sh
deleted file mode 100755
index 4f1d2981ff2b4535b7fba056f9f67500965a9359..0000000000000000000000000000000000000000
--- a/.gitlab/test_deterministic_wasm.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env bash
-set -e
-
-#shellcheck source=../common/lib.sh
-source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/common/lib.sh"
-
-# build runtime
-WASM_BUILD_NO_COLOR=1 cargo build -q --locked --release -p staging-kusama-runtime -p polkadot-runtime -p westend-runtime
-# make checksum
-sha256sum target/release/wbuild/*-runtime/target/wasm32-unknown-unknown/release/*.wasm > checksum.sha256
-
-cargo clean
-
-# build again
-WASM_BUILD_NO_COLOR=1 cargo build -q --locked --release -p staging-kusama-runtime -p polkadot-runtime -p westend-runtime
-# confirm checksum
-sha256sum -c checksum.sha256
diff --git a/cumulus/BRIDGES.md b/BRIDGES.md
similarity index 74%
rename from cumulus/BRIDGES.md
rename to BRIDGES.md
index 8766de92c17e3b5b0d4596453cbf6bfce1893297..a6f00aec09283e10d1a697bcef3f523881941663 100644
--- a/cumulus/BRIDGES.md
+++ b/BRIDGES.md
@@ -1,13 +1,13 @@
-# Using Parity Bridges Common dependency (`git subtree`).
+# Using Parity Bridges Common dependency (`git subtree`)
In `./bridges` sub-directory you can find a `git subtree` imported version of:
-[parity-bridges-common](https://github.com/paritytech/parity-bridges-common/) repository.
+[`parity-bridges-common`](https://github.com/paritytech/parity-bridges-common/) repository.
(For regular Cumulus contributor 1. is relevant) \
(For Cumulus maintainer 1. and 2. are relevant) \
(For Bridges team 1. and 2. and 3. are relevant)
-# 1. How to fix broken Bridges code?
+## How to fix broken Bridges code?
To fix Bridges code simply create a commit in current (`Cumulus`) repo. Best if
the commit is isolated to changes in `./bridges` sub-directory, because it makes
@@ -16,7 +16,7 @@ it easier to import that change back to upstream repo.
(Any changes to `bridges` subtree require Bridges team approve and they should manage backport to Bridges repo)
-# 2. How to pull latest Bridges code to the `bridges` subtree
+## How to pull latest Bridges code to the `bridges` subtree
(in practice)
The `bridges` repo has a stabilized branch `polkadot-staging` dedicated for releasing.
@@ -25,7 +25,7 @@ The `bridges` repo has a stabilized branch `polkadot-staging` dedicated for rele
cd
# this will update new git branches from bridges repo
-# there could be unresolved conflicts, but dont worry,
+# there could be unresolved conflicts, but don't worry,
# lots of them are caused because of removed unneeded files with patch step,
BRANCH=polkadot-staging ./scripts/bridges_update_subtree.sh fetch
@@ -45,9 +45,9 @@ BRANCH=polkadot-staging ./scripts/bridges_update_subtree.sh fetch
# so after all conflicts are solved and patch passes and compiles,
# then we need to finish merge with:
git merge --continue
-````
+```
-# 3. How to pull latest Bridges code or contribute back?
+## How to pull latest Bridges code or contribute back?
(in theory)
Note that it's totally fine to ping the **Bridges Team** to do that for you. The point
@@ -58,34 +58,34 @@ If you still would like to either update the code to match latest code from the
or create an upstream PR read below. The following commands should be run in the
current (`polkadot`) repo.
-1. Add Bridges repo as a local remote:
+### Add Bridges repo as a local remote
```
-$ git remote add -f bridges git@github.com:paritytech/parity-bridges-common.git
+git remote add -f bridges git@github.com:paritytech/parity-bridges-common.git
```
If you plan to contribute back, consider forking the repository on Github and adding
your personal fork as a remote as well.
```
-$ git remote add -f my-bridges git@github.com:tomusdrw/parity-bridges-common.git
+git remote add -f my-bridges git@github.com:tomusdrw/parity-bridges-common.git
```
-2. To update Bridges:
+### To update Bridges
+```
+git fetch bridges polkadot-staging
+git subtree pull --prefix=bridges bridges polkadot-staging --squash
```
-$ git fetch bridges polkadot-staging
-$ git subtree pull --prefix=bridges bridges polkadot-staging --squash
-````
We use `--squash` to avoid adding individual commits and rather squashing them
all into one.
-3. Clean unneeded files here:
+### Clean unneeded files here
```
./bridges/scripts/verify-pallets-build.sh --ignore-git-state --no-revert
```
-4. Contributing back to Bridges (creating upstream PR)
+### Contributing back to Bridges (creating upstream PR)
```
-$ git subtree push --prefix=bridges my-bridges polkadot-staging
+git subtree push --prefix=bridges my-bridges polkadot-staging
```
This command will push changes to your personal fork of Bridges repo, from where
you can simply create a PR to the main repo.
diff --git a/Cargo.lock b/Cargo.lock
index 8af7f4f872173104165b415a38fc48e340cbca44..ddb19c24e1f6a1cc962566dcaa68620df3dd22fe 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -494,7 +494,7 @@ dependencies = [
"ark-ff",
"ark-std",
"tracing",
- "tracing-subscriber 0.2.25",
+ "tracing-subscriber",
]
[[package]]
@@ -513,7 +513,7 @@ dependencies = [
[[package]]
name = "ark-secret-scalar"
version = "0.0.2"
-source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1"
+source = "git+https://github.com/w3f/ring-vrf?rev=f4fe253#f4fe2534ccc6d916cd10d9c16891e673728ec8b4"
dependencies = [
"ark-ec",
"ark-ff",
@@ -561,7 +561,7 @@ dependencies = [
[[package]]
name = "ark-transcript"
version = "0.0.2"
-source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1"
+source = "git+https://github.com/w3f/ring-vrf?rev=f4fe253#f4fe2534ccc6d916cd10d9c16891e673728ec8b4"
dependencies = [
"ark-ff",
"ark-serialize",
@@ -617,7 +617,7 @@ dependencies = [
"num-traits",
"rusticata-macros",
"thiserror",
- "time 0.3.27",
+ "time",
]
[[package]]
@@ -633,7 +633,7 @@ dependencies = [
"num-traits",
"rusticata-macros",
"thiserror",
- "time 0.3.27",
+ "time",
]
[[package]]
@@ -737,7 +737,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"kusama-runtime-constants",
"log",
"pallet-asset-conversion",
@@ -833,7 +833,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"log",
"pallet-asset-tx-payment",
"pallet-assets",
@@ -926,7 +926,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"log",
"pallet-asset-conversion",
"pallet-asset-conversion-tx-payment",
@@ -990,7 +990,7 @@ dependencies = [
"cumulus-test-relay-sproof-builder",
"frame-support",
"frame-system",
- "hex-literal 0.4.1",
+ "hex-literal",
"pallet-assets",
"pallet-balances",
"pallet-collator-selection",
@@ -1138,7 +1138,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -1160,7 +1160,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -1177,7 +1177,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -1240,13 +1240,12 @@ dependencies = [
[[package]]
name = "bandersnatch_vrfs"
version = "0.0.1"
-source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1"
+source = "git+https://github.com/w3f/ring-vrf?rev=f4fe253#f4fe2534ccc6d916cd10d9c16891e673728ec8b4"
dependencies = [
"ark-bls12-381",
"ark-ec",
"ark-ed-on-bls12-381-bandersnatch",
"ark-ff",
- "ark-scale",
"ark-serialize",
"ark-std",
"dleq_vrf",
@@ -1352,7 +1351,7 @@ dependencies = [
"regex",
"rustc-hash",
"shlex",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -1636,7 +1635,7 @@ dependencies = [
"finality-grandpa",
"frame-support",
"hex",
- "hex-literal 0.4.1",
+ "hex-literal",
"parity-scale-codec",
"scale-info",
"serde",
@@ -1666,7 +1665,7 @@ dependencies = [
"bp-runtime",
"frame-support",
"hex",
- "hex-literal 0.4.1",
+ "hex-literal",
"parity-scale-codec",
"scale-info",
"serde",
@@ -1728,7 +1727,7 @@ dependencies = [
"bp-runtime",
"frame-support",
"hex",
- "hex-literal 0.4.1",
+ "hex-literal",
"parity-scale-codec",
"scale-info",
"sp-runtime",
@@ -1754,7 +1753,7 @@ dependencies = [
"frame-support",
"frame-system",
"hash-db",
- "hex-literal 0.4.1",
+ "hex-literal",
"impl-trait-for-tuples",
"log",
"num-traits",
@@ -1778,7 +1777,7 @@ dependencies = [
"bp-parachains",
"bp-polkadot-core",
"bp-runtime",
- "ed25519-dalek 1.0.1",
+ "ed25519-dalek",
"finality-grandpa",
"parity-scale-codec",
"sp-application-crypto",
@@ -1832,7 +1831,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"kusama-runtime-constants",
"log",
"pallet-aura",
@@ -1895,7 +1894,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"log",
"pallet-aura",
"pallet-authorship",
@@ -1990,7 +1989,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"log",
"pallet-aura",
"pallet-authorship",
@@ -2274,9 +2273,9 @@ dependencies = [
[[package]]
name = "cfg-expr"
-version = "0.15.4"
+version = "0.15.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b40ccee03b5175c18cde8f37e7d2a33bcef6f8ec8f7cc0d81090d1bb380949c9"
+checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3"
dependencies = [
"smallvec",
]
@@ -2334,7 +2333,7 @@ name = "chain-spec-builder"
version = "2.0.0"
dependencies = [
"ansi_term",
- "clap 4.4.2",
+ "clap 4.4.4",
"node-cli",
"rand 0.8.5",
"sc-chain-spec",
@@ -2345,15 +2344,14 @@ dependencies = [
[[package]]
name = "chrono"
-version = "0.4.27"
+version = "0.4.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f56b4c72906975ca04becb8a30e102dfecddd0c06181e3e95ddc444be28881f8"
+checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877"
dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
- "time 0.1.45",
"wasm-bindgen",
"windows-targets 0.48.5",
]
@@ -2465,9 +2463,9 @@ dependencies = [
[[package]]
name = "clap"
-version = "4.4.2"
+version = "4.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6"
+checksum = "b1d7b8d5ec32af0fadc644bf1fd509a688c2103b185644bb1e29d164e0703136"
dependencies = [
"clap_builder",
"clap_derive 4.4.2",
@@ -2475,9 +2473,9 @@ dependencies = [
[[package]]
name = "clap_builder"
-version = "4.4.2"
+version = "4.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08"
+checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56"
dependencies = [
"anstream",
"anstyle",
@@ -2491,7 +2489,7 @@ version = "4.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "586a385f7ef2f8b4d86bddaa0c094794e7ccbfe5ffef1f434fe928143fc783a5"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
]
[[package]]
@@ -2516,7 +2514,7 @@ dependencies = [
"heck",
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -2566,6 +2564,7 @@ dependencies = [
"frame-support",
"integration-tests-common",
"pallet-assets",
+ "pallet-balances",
"pallet-core-fellowship",
"pallet-salary",
"pallet-xcm",
@@ -2600,7 +2599,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"log",
"pallet-alliance",
"pallet-aura",
@@ -2608,6 +2607,7 @@ dependencies = [
"pallet-balances",
"pallet-collator-selection",
"pallet-collective",
+ "pallet-collective-content",
"pallet-core-fellowship",
"pallet-multisig",
"pallet-preimage",
@@ -2705,7 +2705,7 @@ dependencies = [
[[package]]
name = "common"
version = "0.1.0"
-source = "git+https://github.com/w3f/ring-proof?rev=0e948f3#0e948f3c28cbacecdd3020403c4841c0eb339213"
+source = "git+https://github.com/w3f/ring-proof?rev=8657210#86572101f4210647984ab4efedba6b3fcc890895"
dependencies = [
"ark-ec",
"ark-ff",
@@ -2714,6 +2714,7 @@ dependencies = [
"ark-std",
"fflonk",
"merlin 3.0.0",
+ "rand_chacha 0.3.1",
]
[[package]]
@@ -2815,7 +2816,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"kusama-runtime-constants",
"log",
"pallet-aura",
@@ -3086,7 +3087,7 @@ dependencies = [
"anes",
"cast",
"ciborium",
- "clap 4.4.2",
+ "clap 4.4.4",
"criterion-plot",
"futures",
"is-terminal",
@@ -3251,7 +3252,7 @@ dependencies = [
name = "cumulus-client-cli"
version = "0.1.0"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"parity-scale-codec",
"sc-chain-spec",
"sc-cli",
@@ -3545,7 +3546,7 @@ dependencies = [
"environmental",
"frame-support",
"frame-system",
- "hex-literal 0.4.1",
+ "hex-literal",
"impl-trait-for-tuples",
"lazy_static",
"log",
@@ -3575,7 +3576,7 @@ dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -3900,14 +3901,6 @@ dependencies = [
"sp-trie",
]
-[[package]]
-name = "cumulus-test-relay-validation-worker-provider"
-version = "0.1.0"
-dependencies = [
- "polkadot-node-core-pvf",
- "toml 0.7.6",
-]
-
[[package]]
name = "cumulus-test-runtime"
version = "0.1.0"
@@ -3944,7 +3937,7 @@ name = "cumulus-test-service"
version = "0.1.0"
dependencies = [
"async-trait",
- "clap 4.4.2",
+ "clap 4.4.4",
"criterion 0.5.1",
"cumulus-client-cli",
"cumulus-client-consensus-common",
@@ -3959,7 +3952,6 @@ dependencies = [
"cumulus-relay-chain-minimal-node",
"cumulus-test-client",
"cumulus-test-relay-sproof-builder",
- "cumulus-test-relay-validation-worker-provider",
"cumulus-test-runtime",
"frame-system",
"frame-system-rpc-runtime-api",
@@ -4067,7 +4059,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -4107,7 +4099,7 @@ dependencies = [
"proc-macro2",
"quote",
"scratch",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -4124,7 +4116,7 @@ checksum = "50c49547d73ba8dcfd4ad7325d64c6d5391ff4224d498fc39a6f3f49825a530d"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -4422,7 +4414,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -4434,7 +4426,7 @@ checksum = "86e3bdc80eee6e16b2b6b0f87fbc98c04bee3455e35174c0de1a125d0688c632"
[[package]]
name = "dleq_vrf"
version = "0.0.2"
-source = "git+https://github.com/w3f/ring-vrf?rev=3119f51#3119f51b54b69308abfb0671f6176cb125ae1bf1"
+source = "git+https://github.com/w3f/ring-vrf?rev=f4fe253#f4fe2534ccc6d916cd10d9c16891e673728ec8b4"
dependencies = [
"ark-ec",
"ark-ff",
@@ -4465,18 +4457,18 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
[[package]]
name = "docify"
-version = "0.2.1"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "029de870d175d11969524d91a3fb2cbf6d488b853bff99d41cf65e533ac7d9d2"
+checksum = "76ee528c501ddd15d5181997e9518e59024844eac44fd1e40cb20ddb2a8562fa"
dependencies = [
"docify_macros",
]
[[package]]
name = "docify_macros"
-version = "0.2.1"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cac43324656a1b05eb0186deb51f27d2d891c704c37f34de281ef6297ba193e5"
+checksum = "0ca01728ab2679c464242eca99f94e2ce0514b52ac9ad950e2ed03fca991231c"
dependencies = [
"common-path",
"derive-syn-parse",
@@ -4484,7 +4476,7 @@ dependencies = [
"proc-macro2",
"quote",
"regex",
- "syn 2.0.31",
+ "syn 2.0.37",
"termcolor",
"toml 0.7.6",
"walkdir",
@@ -4561,15 +4553,6 @@ dependencies = [
"spki 0.7.2",
]
-[[package]]
-name = "ed25519"
-version = "1.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7"
-dependencies = [
- "signature 1.6.4",
-]
-
[[package]]
name = "ed25519"
version = "2.2.2"
@@ -4580,20 +4563,6 @@ dependencies = [
"signature 2.1.0",
]
-[[package]]
-name = "ed25519-dalek"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d"
-dependencies = [
- "curve25519-dalek 3.2.0",
- "ed25519 1.5.3",
- "rand 0.7.3",
- "serde",
- "sha2 0.9.9",
- "zeroize",
-]
-
[[package]]
name = "ed25519-dalek"
version = "2.0.0"
@@ -4601,7 +4570,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980"
dependencies = [
"curve25519-dalek 4.0.0",
- "ed25519 2.2.2",
+ "ed25519",
"rand_core 0.6.4",
"serde",
"sha2 0.10.7",
@@ -4629,7 +4598,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e83e509bcd060ca4b54b72bde5bb306cb2088cb01e14797ebae90a24f70f5f7"
dependencies = [
"curve25519-dalek 4.0.0",
- "ed25519 2.2.2",
+ "ed25519",
"hashbrown 0.14.0",
"hex",
"rand_core 0.6.4",
@@ -4728,18 +4697,18 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
name = "enumn"
-version = "0.1.11"
+version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b893c4eb2dc092c811165f84dc7447fae16fb66521717968c34c509b39b1a5c5"
+checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -4862,12 +4831,6 @@ dependencies = [
"futures",
]
-[[package]]
-name = "exitcode"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "de853764b47027c2e862a995c34978ffa63c1501f2e15f987ba11bd4f9bba193"
-
[[package]]
name = "expander"
version = "0.0.4"
@@ -4880,18 +4843,6 @@ dependencies = [
"quote",
]
-[[package]]
-name = "expander"
-version = "0.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3774182a5df13c3d1690311ad32fbe913feef26baba609fa2dd5f72042bd2ab6"
-dependencies = [
- "blake2",
- "fs-err",
- "proc-macro2",
- "quote",
-]
-
[[package]]
name = "expander"
version = "2.0.0"
@@ -4902,7 +4853,7 @@ dependencies = [
"fs-err",
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -5192,7 +5143,7 @@ dependencies = [
"Inflector",
"array-bytes",
"chrono",
- "clap 4.4.2",
+ "clap 4.4.4",
"comfy-table",
"frame-benchmarking",
"frame-support",
@@ -5258,7 +5209,7 @@ dependencies = [
"quote",
"scale-info",
"sp-arithmetic",
- "syn 2.0.31",
+ "syn 2.0.37",
"trybuild",
]
@@ -5284,7 +5235,7 @@ dependencies = [
name = "frame-election-solution-type-fuzzer"
version = "2.0.0-alpha.5"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"frame-election-provider-solution-type",
"frame-election-provider-support",
"frame-support",
@@ -5410,7 +5361,7 @@ dependencies = [
"proc-macro-warning",
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -5421,7 +5372,7 @@ dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -5430,7 +5381,7 @@ version = "3.0.0"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -5653,7 +5604,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -5839,9 +5790,11 @@ dependencies = [
name = "glutton-runtime"
version = "1.0.0"
dependencies = [
+ "cumulus-pallet-aura-ext",
"cumulus-pallet-parachain-system",
"cumulus-pallet-xcm",
"cumulus-primitives-core",
+ "cumulus-primitives-timestamp",
"frame-benchmarking",
"frame-executive",
"frame-support",
@@ -5849,14 +5802,17 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
+ "pallet-aura",
"pallet-glutton",
"pallet-sudo",
+ "pallet-timestamp",
"parachain-info",
"parachains-common",
"parity-scale-codec",
"scale-info",
"sp-api",
"sp-block-builder",
+ "sp-consensus-aura",
"sp-core",
"sp-inherents",
"sp-offchain",
@@ -6004,12 +5960,6 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
-[[package]]
-name = "hex-literal"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0"
-
[[package]]
name = "hex-literal"
version = "0.4.1"
@@ -6941,6 +6891,15 @@ dependencies = [
"thiserror",
]
+[[package]]
+name = "layout-rs"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1164ef87cb9607c2d887216eca79f0fc92895affe1789bba805dd38d829584e0"
+dependencies = [
+ "log",
+]
+
[[package]]
name = "lazy_static"
version = "1.4.0"
@@ -7130,7 +7089,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce"
dependencies = [
"bs58 0.4.0",
- "ed25519-dalek 2.0.0",
+ "ed25519-dalek",
"log",
"multiaddr",
"multihash",
@@ -7660,7 +7619,7 @@ dependencies = [
"macro_magic_core",
"macro_magic_macros",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -7674,7 +7633,7 @@ dependencies = [
"macro_magic_core_macros",
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -7685,7 +7644,7 @@ checksum = "c12469fc165526520dff2807c2975310ab47cf7190a45b99b49a7dc8befab17b"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -7696,7 +7655,7 @@ checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a"
dependencies = [
"macro_magic_core",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -7720,15 +7679,6 @@ dependencies = [
"regex-automata 0.1.10",
]
-[[package]]
-name = "matchers"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
-dependencies = [
- "regex-automata 0.1.10",
-]
-
[[package]]
name = "matches"
version = "0.1.10"
@@ -8192,7 +8142,7 @@ name = "node-bench"
version = "0.9.0-dev"
dependencies = [
"array-bytes",
- "clap 4.4.2",
+ "clap 4.4.4",
"derive_more",
"fs_extra",
"futures",
@@ -8229,7 +8179,7 @@ version = "3.0.0-dev"
dependencies = [
"array-bytes",
"assert_cmd",
- "clap 4.4.2",
+ "clap 4.4.4",
"clap_complete",
"criterion 0.4.0",
"frame-benchmarking-cli",
@@ -8355,7 +8305,7 @@ dependencies = [
name = "node-inspect"
version = "0.9.0-dev"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"parity-scale-codec",
"sc-cli",
"sc-client-api",
@@ -8409,7 +8359,7 @@ dependencies = [
name = "node-runtime-generate-bags"
version = "3.0.0"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"generate-bags",
"kitchensink-runtime",
]
@@ -8418,7 +8368,7 @@ dependencies = [
name = "node-template"
version = "4.0.0-dev"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"frame-benchmarking",
"frame-benchmarking-cli",
"frame-system",
@@ -8461,7 +8411,7 @@ dependencies = [
name = "node-template-release"
version = "3.0.0"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"flate2",
"fs_extra",
"glob",
@@ -8572,16 +8522,6 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
-[[package]]
-name = "nu-ansi-term"
-version = "0.46.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
-dependencies = [
- "overload",
- "winapi",
-]
-
[[package]]
name = "num"
version = "0.4.1"
@@ -8756,9 +8696,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "orchestra"
-version = "0.0.5"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "227585216d05ba65c7ab0a0450a3cf2cbd81a98862a54c4df8e14d5ac6adb015"
+checksum = "46d78e1deb2a8d54fc1f063a544130db4da31dfe4d5d3b493186424910222a76"
dependencies = [
"async-trait",
"dyn-clonable",
@@ -8773,12 +8713,16 @@ dependencies = [
[[package]]
name = "orchestra-proc-macro"
-version = "0.0.5"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2871aadd82a2c216ee68a69837a526dfe788ecbe74c4c5038a6acdbff6653066"
+checksum = "d035b1f968d91a826f2e34a9d6d02cb2af5aa7ca39ebd27922d850ab4b2dd2c6"
dependencies = [
- "expander 0.0.6",
- "itertools 0.10.5",
+ "anyhow",
+ "expander 2.0.0",
+ "fs-err",
+ "indexmap 2.0.0",
+ "itertools 0.11.0",
+ "layout-rs",
"petgraph",
"proc-macro-crate",
"proc-macro2",
@@ -8801,12 +8745,6 @@ version = "6.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac"
-[[package]]
-name = "overload"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
-
[[package]]
name = "owo-colors"
version = "3.5.0"
@@ -9346,6 +9284,21 @@ dependencies = [
"sp-std",
]
+[[package]]
+name = "pallet-collective-content"
+version = "0.1.0"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "parity-scale-codec",
+ "scale-info",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
[[package]]
name = "pallet-contracts"
version = "4.0.0-dev"
@@ -9403,7 +9356,7 @@ version = "4.0.0-dev"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -10474,7 +10427,7 @@ dependencies = [
"proc-macro2",
"quote",
"sp-runtime",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -10540,6 +10493,7 @@ dependencies = [
name = "pallet-sudo"
version = "4.0.0-dev"
dependencies = [
+ "docify",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -10570,6 +10524,7 @@ dependencies = [
name = "pallet-timestamp"
version = "4.0.0-dev"
dependencies = [
+ "docify",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -10862,7 +10817,7 @@ dependencies = [
name = "parachain-template-node"
version = "0.1.0"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"color-print",
"cumulus-client-cli",
"cumulus-client-collator",
@@ -10934,7 +10889,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"log",
"pallet-aura",
"pallet-authorship",
@@ -10978,6 +10933,7 @@ dependencies = [
"cumulus-primitives-utility",
"frame-support",
"frame-system",
+ "kusama-runtime-constants",
"log",
"num-traits",
"pallet-asset-tx-payment",
@@ -10986,8 +10942,12 @@ dependencies = [
"pallet-balances",
"pallet-collator-selection",
"parity-scale-codec",
+ "polkadot-core-primitives",
"polkadot-primitives",
+ "polkadot-runtime-constants",
+ "rococo-runtime-constants",
"scale-info",
+ "smallvec",
"sp-consensus-aura",
"sp-core",
"sp-io",
@@ -10997,6 +10957,7 @@ dependencies = [
"staging-xcm-builder",
"staging-xcm-executor",
"substrate-wasm-builder",
+ "westend-runtime-constants",
]
[[package]]
@@ -11012,7 +10973,7 @@ dependencies = [
"cumulus-test-relay-sproof-builder",
"frame-support",
"frame-system",
- "hex-literal 0.4.1",
+ "hex-literal",
"pallet-assets",
"pallet-balances",
"pallet-collator-selection",
@@ -11257,7 +11218,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"log",
"pallet-asset-tx-payment",
"pallet-assets",
@@ -11333,7 +11294,7 @@ dependencies = [
"pest_meta",
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -11374,7 +11335,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -11457,7 +11418,7 @@ dependencies = [
[[package]]
name = "polkadot"
-version = "1.0.0"
+version = "1.1.0"
dependencies = [
"assert_cmd",
"color-eyre",
@@ -11564,6 +11525,7 @@ name = "polkadot-availability-recovery"
version = "1.0.0"
dependencies = [
"assert_matches",
+ "async-trait",
"env_logger 0.9.3",
"fatality",
"futures",
@@ -11590,9 +11552,9 @@ dependencies = [
[[package]]
name = "polkadot-cli"
-version = "1.0.0"
+version = "1.1.0"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"frame-benchmarking-cli",
"futures",
"log",
@@ -12055,7 +12017,7 @@ dependencies = [
"assert_matches",
"futures",
"futures-timer",
- "hex-literal 0.3.4",
+ "hex-literal",
"libc",
"parity-scale-codec",
"pin-project",
@@ -12072,7 +12034,6 @@ dependencies = [
"slotmap",
"sp-core",
"sp-maybe-compressed-blob",
- "sp-tracing",
"sp-wasm-interface",
"substrate-build-script-utils",
"tempfile",
@@ -12297,9 +12258,10 @@ dependencies = [
"parking_lot 0.12.1",
"polkadot-node-subsystem",
"polkadot-node-subsystem-util",
- "polkadot-overseer",
"polkadot-primitives",
+ "sc-client-api",
"sc-keystore",
+ "sc-utils",
"sp-application-crypto",
"sp-core",
"sp-keyring",
@@ -12319,6 +12281,7 @@ dependencies = [
"polkadot-node-primitives",
"polkadot-primitives",
"polkadot-statement-table",
+ "sc-client-api",
"sc-network",
"sc-transaction-pool-api",
"smallvec",
@@ -12356,11 +12319,13 @@ dependencies = [
"polkadot-node-primitives",
"polkadot-node-subsystem",
"polkadot-node-subsystem-test-helpers",
+ "polkadot-node-subsystem-types",
"polkadot-overseer",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"prioritized-metered-channel",
"rand 0.8.5",
+ "sc-client-api",
"schnellru",
"sp-application-crypto",
"sp-core",
@@ -12384,6 +12349,7 @@ dependencies = [
"polkadot-node-metrics",
"polkadot-node-network-protocol",
"polkadot-node-primitives",
+ "polkadot-node-subsystem-test-helpers",
"polkadot-node-subsystem-types",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
@@ -12398,7 +12364,7 @@ dependencies = [
[[package]]
name = "polkadot-parachain-bin"
-version = "1.0.0"
+version = "1.1.0"
dependencies = [
"assert_cmd",
"asset-hub-kusama-runtime",
@@ -12408,7 +12374,7 @@ dependencies = [
"bridge-hub-kusama-runtime",
"bridge-hub-polkadot-runtime",
"bridge-hub-rococo-runtime",
- "clap 4.4.2",
+ "clap 4.4.4",
"collectives-polkadot-runtime",
"color-print",
"contracts-rococo-runtime",
@@ -12426,7 +12392,7 @@ dependencies = [
"frame-benchmarking-cli",
"futures",
"glutton-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"jsonrpsee",
"log",
"nix 0.26.2",
@@ -12517,7 +12483,7 @@ name = "polkadot-primitives"
version = "1.0.0"
dependencies = [
"bitvec",
- "hex-literal 0.4.1",
+ "hex-literal",
"parity-scale-codec",
"polkadot-core-primitives",
"polkadot-parachain-primitives",
@@ -12594,7 +12560,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"log",
"pallet-authority-discovery",
"pallet-authorship",
@@ -12694,7 +12660,7 @@ dependencies = [
"frame-support",
"frame-support-test",
"frame-system",
- "hex-literal 0.4.1",
+ "hex-literal",
"impl-trait-for-tuples",
"libsecp256k1",
"log",
@@ -12773,7 +12739,8 @@ dependencies = [
"frame-support-test",
"frame-system",
"futures",
- "hex-literal 0.4.1",
+ "hex-literal",
+ "impl-trait-for-tuples",
"log",
"pallet-authority-discovery",
"pallet-authorship",
@@ -12785,6 +12752,7 @@ dependencies = [
"pallet-timestamp",
"pallet-vesting",
"parity-scale-codec",
+ "polkadot-core-primitives",
"polkadot-parachain-primitives",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
@@ -12827,9 +12795,8 @@ dependencies = [
"frame-system",
"frame-system-rpc-runtime-api",
"futures",
- "hex-literal 0.4.1",
+ "hex-literal",
"is_executable",
- "kusama-runtime-constants",
"kvdb",
"kvdb-rocksdb",
"log",
@@ -12875,9 +12842,6 @@ dependencies = [
"polkadot-parachain-primitives",
"polkadot-primitives",
"polkadot-rpc",
- "polkadot-runtime",
- "polkadot-runtime-common",
- "polkadot-runtime-constants",
"polkadot-runtime-parachains",
"polkadot-statement-distribution",
"polkadot-test-client",
@@ -12933,7 +12897,6 @@ dependencies = [
"sp-transaction-pool",
"sp-version",
"sp-weights",
- "staging-kusama-runtime",
"substrate-prometheus-endpoint",
"tempfile",
"thiserror",
@@ -13021,7 +12984,7 @@ version = "1.0.0"
dependencies = [
"assert_matches",
"async-trait",
- "clap 4.4.2",
+ "clap 4.4.4",
"color-eyre",
"futures",
"futures-timer",
@@ -13056,7 +13019,7 @@ dependencies = [
"frame-support",
"frame-system",
"frame-system-rpc-runtime-api",
- "hex-literal 0.4.1",
+ "hex-literal",
"log",
"pallet-authority-discovery",
"pallet-authorship",
@@ -13167,7 +13130,7 @@ dependencies = [
name = "polkadot-voter-bags"
version = "1.0.0"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"generate-bags",
"polkadot-runtime",
"sp-io",
@@ -13347,7 +13310,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62"
dependencies = [
"proc-macro2",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -13367,9 +13330,9 @@ dependencies = [
[[package]]
name = "prioritized-metered-channel"
-version = "0.2.0"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "382698e48a268c832d0b181ed438374a6bb708a82a8ca273bb0f61c74cf209c4"
+checksum = "e99f0c89bd88f393aab44a4ab949351f7bc7e7e1179d11ecbfe50cbe4c47e342"
dependencies = [
"coarsetime",
"crossbeam-queue",
@@ -13429,14 +13392,14 @@ checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
name = "proc-macro2"
-version = "1.0.66"
+version = "1.0.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9"
+checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328"
dependencies = [
"unicode-ident",
]
@@ -13475,7 +13438,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -13790,7 +13753,7 @@ checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd"
dependencies = [
"pem",
"ring 0.16.20",
- "time 0.3.27",
+ "time",
"x509-parser 0.13.2",
"yasna",
]
@@ -13803,7 +13766,7 @@ checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b"
dependencies = [
"pem",
"ring 0.16.20",
- "time 0.3.27",
+ "time",
"yasna",
]
@@ -13866,7 +13829,7 @@ checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -13929,7 +13892,7 @@ checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2"
name = "remote-ext-tests-bags-list"
version = "1.0.0"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"frame-system",
"kusama-runtime-constants",
"log",
@@ -14017,13 +13980,14 @@ dependencies = [
[[package]]
name = "ring"
version = "0.1.0"
-source = "git+https://github.com/w3f/ring-proof?rev=0e948f3#0e948f3c28cbacecdd3020403c4841c0eb339213"
+source = "git+https://github.com/w3f/ring-proof?rev=8657210#86572101f4210647984ab4efedba6b3fcc890895"
dependencies = [
"ark-ec",
"ark-ff",
"ark-poly",
"ark-serialize",
"ark-std",
+ "blake2",
"common",
"fflonk",
"merlin 3.0.0",
@@ -14130,7 +14094,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"log",
"pallet-authority-discovery",
"pallet-authorship",
@@ -14628,7 +14592,7 @@ dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -14637,7 +14601,7 @@ version = "0.10.0-dev"
dependencies = [
"array-bytes",
"chrono",
- "clap 4.4.2",
+ "clap 4.4.4",
"fdlimit",
"futures",
"futures-timer",
@@ -14695,6 +14659,7 @@ dependencies = [
"sp-statement-store",
"sp-storage",
"sp-test-primitives",
+ "sp-trie",
"substrate-prometheus-endpoint",
"substrate-test-runtime",
"thiserror",
@@ -14809,17 +14774,14 @@ dependencies = [
"num-traits",
"parity-scale-codec",
"parking_lot 0.12.1",
- "rand_chacha 0.2.2",
"sc-block-builder",
"sc-client-api",
"sc-consensus",
"sc-consensus-epochs",
"sc-consensus-slots",
- "sc-network",
"sc-network-test",
"sc-telemetry",
"sc-transaction-pool-api",
- "scale-info",
"sp-api",
"sp-application-crypto",
"sp-block-builder",
@@ -15133,7 +15095,7 @@ dependencies = [
"substrate-test-runtime",
"tempfile",
"tracing",
- "tracing-subscriber 0.2.25",
+ "tracing-subscriber",
"wat",
]
@@ -15741,7 +15703,7 @@ dependencies = [
name = "sc-storage-monitor"
version = "0.1.0"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"fs4",
"log",
"sc-client-db",
@@ -15831,7 +15793,7 @@ dependencies = [
"thiserror",
"tracing",
"tracing-log",
- "tracing-subscriber 0.2.25",
+ "tracing-subscriber",
]
[[package]]
@@ -15841,7 +15803,7 @@ dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -16114,20 +16076,25 @@ dependencies = [
name = "seedling-runtime"
version = "0.1.0"
dependencies = [
+ "cumulus-pallet-aura-ext",
"cumulus-pallet-parachain-system",
"cumulus-pallet-solo-to-para",
"cumulus-primitives-core",
+ "cumulus-primitives-timestamp",
"frame-executive",
"frame-support",
"frame-system",
+ "pallet-aura",
"pallet-balances",
"pallet-sudo",
+ "pallet-timestamp",
"parachain-info",
"parachains-common",
"parity-scale-codec",
"scale-info",
"sp-api",
"sp-block-builder",
+ "sp-consensus-aura",
"sp-core",
"sp-inherents",
"sp-offchain",
@@ -16195,7 +16162,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -16209,9 +16176,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.105"
+version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360"
+checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65"
dependencies = [
"itoa",
"ryu",
@@ -16261,7 +16228,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -16358,6 +16325,7 @@ dependencies = [
name = "shell-runtime"
version = "0.1.0"
dependencies = [
+ "cumulus-pallet-aura-ext",
"cumulus-pallet-parachain-system",
"cumulus-pallet-xcm",
"cumulus-primitives-core",
@@ -16365,12 +16333,15 @@ dependencies = [
"frame-support",
"frame-system",
"frame-try-runtime",
+ "pallet-aura",
+ "pallet-timestamp",
"parachain-info",
"parachains-common",
"parity-scale-codec",
"scale-info",
"sp-api",
"sp-block-builder",
+ "sp-consensus-aura",
"sp-core",
"sp-inherents",
"sp-offchain",
@@ -16410,18 +16381,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "signal-hook-tokio"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "213241f76fb1e37e27de3b6aa1b068a2c333233b59cca6634f634b80a27ecf1e"
-dependencies = [
- "futures-core",
- "libc",
- "signal-hook",
- "tokio",
-]
-
[[package]]
name = "signature"
version = "1.6.4"
@@ -16701,7 +16660,7 @@ dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -17039,7 +16998,6 @@ name = "sp-core"
version = "21.0.0"
dependencies = [
"array-bytes",
- "arrayvec 0.7.4",
"bandersnatch_vrfs",
"bitflags 1.3.2",
"blake2",
@@ -17102,7 +17060,7 @@ version = "9.0.0"
dependencies = [
"quote",
"sp-core-hashing",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -17146,7 +17104,7 @@ version = "8.0.0"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -17188,7 +17146,7 @@ name = "sp-io"
version = "23.0.0"
dependencies = [
"bytes",
- "ed25519-dalek 2.0.0",
+ "ed25519-dalek",
"libsecp256k1",
"log",
"parity-scale-codec",
@@ -17284,7 +17242,7 @@ dependencies = [
name = "sp-npos-elections-fuzzer"
version = "2.0.0-alpha.5"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"honggfuzz",
"rand 0.8.5",
"sp-npos-elections",
@@ -17377,7 +17335,7 @@ dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -17475,7 +17433,7 @@ version = "4.0.0-dev"
dependencies = [
"aes-gcm 0.10.2",
"curve25519-dalek 4.0.0",
- "ed25519-dalek 2.0.0",
+ "ed25519-dalek",
"hkdf",
"parity-scale-codec",
"rand 0.8.5",
@@ -17541,7 +17499,7 @@ dependencies = [
"sp-std",
"tracing",
"tracing-core",
- "tracing-subscriber 0.2.25",
+ "tracing-subscriber",
]
[[package]]
@@ -17617,7 +17575,7 @@ dependencies = [
"proc-macro2",
"quote",
"sp-version",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -17725,7 +17683,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"kusama-runtime-constants",
"log",
"pallet-authority-discovery",
@@ -17823,47 +17781,6 @@ dependencies = [
"tokio",
]
-[[package]]
-name = "staging-staking-miner"
-version = "1.0.0"
-dependencies = [
- "assert_cmd",
- "clap 4.4.2",
- "exitcode",
- "frame-election-provider-support",
- "frame-remote-externalities",
- "frame-support",
- "frame-system",
- "futures-util",
- "jsonrpsee",
- "log",
- "pallet-balances",
- "pallet-election-provider-multi-phase",
- "pallet-staking",
- "pallet-transaction-payment",
- "parity-scale-codec",
- "paste",
- "polkadot-core-primitives",
- "polkadot-runtime",
- "polkadot-runtime-common",
- "sc-transaction-pool-api",
- "serde",
- "serde_json",
- "signal-hook",
- "signal-hook-tokio",
- "sp-core",
- "sp-npos-elections",
- "sp-runtime",
- "sp-state-machine",
- "sp-version",
- "staging-kusama-runtime",
- "sub-tokens",
- "thiserror",
- "tokio",
- "tracing-subscriber 0.3.17",
- "westend-runtime",
-]
-
[[package]]
name = "staging-xcm"
version = "1.0.0"
@@ -17872,7 +17789,7 @@ dependencies = [
"derivative",
"environmental",
"hex",
- "hex-literal 0.4.1",
+ "hex-literal",
"impl-trait-for-tuples",
"log",
"parity-scale-codec",
@@ -18038,19 +17955,11 @@ dependencies = [
"webrtc-util",
]
-[[package]]
-name = "sub-tokens"
-version = "0.1.0"
-source = "git+https://github.com/paritytech/substrate-debug-kit?branch=master#e12503ab781e913735dc389865a3b8b4a6c6399d"
-dependencies = [
- "separator",
-]
-
[[package]]
name = "subkey"
version = "3.0.0"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"sc-cli",
]
@@ -18092,7 +18001,7 @@ dependencies = [
name = "substrate-frame-cli"
version = "4.0.0-dev"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"frame-support",
"frame-system",
"sc-cli",
@@ -18441,9 +18350,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.31"
+version = "2.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398"
+checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8"
dependencies = [
"proc-macro2",
"quote",
@@ -18551,7 +18460,7 @@ dependencies = [
name = "test-parachain-adder-collator"
version = "1.0.0"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"futures",
"futures-timer",
"log",
@@ -18570,7 +18479,6 @@ dependencies = [
"sp-keyring",
"substrate-test-utils",
"test-parachain-adder",
- "test-parachain-adder-collator",
"tokio",
]
@@ -18600,7 +18508,7 @@ dependencies = [
name = "test-parachain-undying-collator"
version = "1.0.0"
dependencies = [
- "clap 4.4.2",
+ "clap 4.4.4",
"futures",
"futures-timer",
"log",
@@ -18619,7 +18527,6 @@ dependencies = [
"sp-keyring",
"substrate-test-utils",
"test-parachain-undying",
- "test-parachain-undying-collator",
"tokio",
]
@@ -18655,9 +18562,9 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d"
[[package]]
name = "thiserror"
-version = "1.0.47"
+version = "1.0.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f"
+checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7"
dependencies = [
"thiserror-impl",
]
@@ -18684,13 +18591,13 @@ dependencies = [
[[package]]
name = "thiserror-impl"
-version = "1.0.47"
+version = "1.0.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b"
+checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -18762,17 +18669,6 @@ dependencies = [
"tikv-jemalloc-sys",
]
-[[package]]
-name = "time"
-version = "0.1.45"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a"
-dependencies = [
- "libc",
- "wasi 0.10.0+wasi-snapshot-preview1",
- "winapi",
-]
-
[[package]]
name = "time"
version = "0.3.27"
@@ -18881,7 +18777,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -19062,7 +18958,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -19105,7 +19001,7 @@ dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -19138,7 +19034,7 @@ dependencies = [
"ansi_term",
"chrono",
"lazy_static",
- "matchers 0.0.1",
+ "matchers",
"parking_lot 0.11.2",
"regex",
"serde",
@@ -19152,29 +19048,11 @@ dependencies = [
"tracing-serde",
]
-[[package]]
-name = "tracing-subscriber"
-version = "0.3.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77"
-dependencies = [
- "matchers 0.1.0",
- "nu-ansi-term",
- "once_cell",
- "regex",
- "sharded-slab",
- "smallvec",
- "thread_local",
- "tracing",
- "tracing-core",
- "tracing-log",
-]
-
[[package]]
name = "trie-bench"
-version = "0.37.0"
+version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4f54b4f9d51d368e62cf7e0730c7c1e18fc658cc84333656bab5b328f44aa964"
+checksum = "a4680cb226e31d2a096592d0edecdda91cc371743002f80c0f8cf80219819b3b"
dependencies = [
"criterion 0.4.0",
"hash-db",
@@ -19188,9 +19066,9 @@ dependencies = [
[[package]]
name = "trie-db"
-version = "0.27.1"
+version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85"
+checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642"
dependencies = [
"hash-db",
"hashbrown 0.13.2",
@@ -19276,7 +19154,7 @@ version = "0.10.0-dev"
dependencies = [
"assert_cmd",
"async-trait",
- "clap 4.4.2",
+ "clap 4.4.4",
"frame-remote-externalities",
"frame-try-runtime",
"hex",
@@ -19643,12 +19521,6 @@ version = "0.9.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
-[[package]]
-name = "wasi"
-version = "0.10.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
-
[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
@@ -19678,7 +19550,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
"wasm-bindgen-shared",
]
@@ -19712,7 +19584,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -20151,7 +20023,7 @@ dependencies = [
"sha2 0.10.7",
"stun",
"thiserror",
- "time 0.3.27",
+ "time",
"tokio",
"turn",
"url",
@@ -20348,7 +20220,7 @@ dependencies = [
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"frame-try-runtime",
- "hex-literal 0.4.1",
+ "hex-literal",
"log",
"pallet-authority-discovery",
"pallet-authorship",
@@ -20759,7 +20631,7 @@ dependencies = [
"ring 0.16.20",
"rusticata-macros",
"thiserror",
- "time 0.3.27",
+ "time",
]
[[package]]
@@ -20777,7 +20649,7 @@ dependencies = [
"oid-registry 0.6.1",
"rusticata-macros",
"thiserror",
- "time 0.3.27",
+ "time",
]
[[package]]
@@ -20848,7 +20720,7 @@ dependencies = [
"Inflector",
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
@@ -20947,7 +20819,7 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd"
dependencies = [
- "time 0.3.27",
+ "time",
]
[[package]]
@@ -20967,7 +20839,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.31",
+ "syn 2.0.37",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index 4db27b98e90788775663aed31cbc10c851316318..d1078e3c86a82a3129e2d8cb2bf965fdbf0f36d5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -8,31 +8,31 @@ license = "GPL-3.0-only"
resolver = "2"
members = [
- "cumulus/bridges/bin/runtime-common",
- "cumulus/bridges/modules/grandpa",
- "cumulus/bridges/modules/messages",
- "cumulus/bridges/modules/parachains",
- "cumulus/bridges/modules/relayers",
- "cumulus/bridges/modules/xcm-bridge-hub-router",
- "cumulus/bridges/primitives/chain-asset-hub-kusama",
- "cumulus/bridges/primitives/chain-asset-hub-polkadot",
- "cumulus/bridges/primitives/chain-bridge-hub-cumulus",
- "cumulus/bridges/primitives/chain-bridge-hub-kusama",
- "cumulus/bridges/primitives/chain-bridge-hub-polkadot",
- "cumulus/bridges/primitives/chain-bridge-hub-rococo",
- "cumulus/bridges/primitives/chain-bridge-hub-wococo",
- "cumulus/bridges/primitives/chain-kusama",
- "cumulus/bridges/primitives/chain-polkadot",
- "cumulus/bridges/primitives/chain-rococo",
- "cumulus/bridges/primitives/chain-wococo",
- "cumulus/bridges/primitives/header-chain",
- "cumulus/bridges/primitives/messages",
- "cumulus/bridges/primitives/parachains",
- "cumulus/bridges/primitives/polkadot-core",
- "cumulus/bridges/primitives/relayers",
- "cumulus/bridges/primitives/runtime",
- "cumulus/bridges/primitives/test-utils",
- "cumulus/bridges/primitives/xcm-bridge-hub-router",
+ "bridges/bin/runtime-common",
+ "bridges/modules/grandpa",
+ "bridges/modules/messages",
+ "bridges/modules/parachains",
+ "bridges/modules/relayers",
+ "bridges/modules/xcm-bridge-hub-router",
+ "bridges/primitives/chain-asset-hub-kusama",
+ "bridges/primitives/chain-asset-hub-polkadot",
+ "bridges/primitives/chain-bridge-hub-cumulus",
+ "bridges/primitives/chain-bridge-hub-kusama",
+ "bridges/primitives/chain-bridge-hub-polkadot",
+ "bridges/primitives/chain-bridge-hub-rococo",
+ "bridges/primitives/chain-bridge-hub-wococo",
+ "bridges/primitives/chain-kusama",
+ "bridges/primitives/chain-polkadot",
+ "bridges/primitives/chain-rococo",
+ "bridges/primitives/chain-wococo",
+ "bridges/primitives/header-chain",
+ "bridges/primitives/messages",
+ "bridges/primitives/parachains",
+ "bridges/primitives/polkadot-core",
+ "bridges/primitives/relayers",
+ "bridges/primitives/runtime",
+ "bridges/primitives/test-utils",
+ "bridges/primitives/xcm-bridge-hub-router",
"cumulus/client/cli",
"cumulus/client/collator",
"cumulus/client/consensus/aura",
@@ -92,7 +92,6 @@ members = [
"cumulus/primitives/utility",
"cumulus/test/client",
"cumulus/test/relay-sproof-builder",
- "cumulus/test/relay-validation-worker-provider",
"cumulus/test/runtime",
"cumulus/test/service",
"cumulus/xcm/xcm-emulator",
@@ -172,7 +171,6 @@ members = [
"polkadot/statement-table",
"polkadot/utils/generate-bags",
"polkadot/utils/remote-ext-tests/bags-list",
- "polkadot/utils/staking-miner",
"polkadot/xcm",
"polkadot/xcm/pallet-xcm",
"polkadot/xcm/pallet-xcm-benchmarks",
@@ -452,6 +450,7 @@ members = [
"substrate/utils/prometheus",
"substrate/utils/wasm-builder",
]
+default-members = [ "polkadot" ]
[profile.release]
# Polkadot runtime requires unwinding.
diff --git a/README.md b/README.md
index a0ef181827983bf89b32f8f955e470f222eb2864..56b3481bafc038f7d3dd0606558e9e37243dcd53 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-> NOTE: We have recently made significant changes to our repository structure. In order to
-streamline our development process and foster better contributions, we have merged three separate
-repositories Cumulus, Substrate and Polkadot into this repository. Read more about the changes [
+> NOTE: We have recently made significant changes to our repository structure. In order to streamline our development
+process and foster better contributions, we have merged three separate repositories Cumulus, Substrate and Polkadot into
+this repository. Read more about the changes [
here](https://polkadot-public.notion.site/Polkadot-SDK-FAQ-fbc4cecc2c46443fb37b9eeec2f0d85f).
# Polkadot SDK
@@ -9,27 +9,29 @@ here](https://polkadot-public.notion.site/Polkadot-SDK-FAQ-fbc4cecc2c46443fb37b9
[![StackExchange](https://img.shields.io/badge/StackExchange-Community%20&%20Support-222222?logo=stackexchange)](https://substrate.stackexchange.com/)
-The Polkadot SDK repository provides all the resources needed to start building on the Polkadot
-network, a multi-chain blockchain platform that enables different blockchains to interoperate and
-share information in a secure and scalable way. The Polkadot SDK comprises three main pieces of
-software:
+The Polkadot SDK repository provides all the resources needed to start building on the Polkadot network, a multi-chain
+blockchain platform that enables different blockchains to interoperate and share information in a secure and scalable
+way. The Polkadot SDK comprises three main pieces of software:
## [Polkadot](./polkadot/)
-[![PolkadotForum](https://img.shields.io/badge/Polkadot_Forum-e6007a?logo=polkadot)](https://forum.polkadot.network/) [![Polkadot-license](https://img.shields.io/badge/License-GPL3-blue)](./polkadot/LICENSE)
+[![PolkadotForum](https://img.shields.io/badge/Polkadot_Forum-e6007a?logo=polkadot)](https://forum.polkadot.network/)
+[![Polkadot-license](https://img.shields.io/badge/License-GPL3-blue)](./polkadot/LICENSE)
-Implementation of a node for the https://polkadot.network in Rust, using the Substrate framework.
-This directory currently contains runtimes for the Polkadot, Kusama, Westend, and Rococo networks.
-In the future, these will be relocated to the [`runtimes`](https://github.com/polkadot-fellows/runtimes/) repository.
+Implementation of a node for the https://polkadot.network in Rust, using the Substrate framework. This directory
+currently contains runtimes for the Polkadot, Kusama, Westend, and Rococo networks. In the future, these will be
+relocated to the [`runtimes`](https://github.com/polkadot-fellows/runtimes/) repository.
## [Substrate](./substrate/)
- [![SubstrateRustDocs](https://img.shields.io/badge/Rust_Docs-Substrate-24CC85?logo=rust)](https://paritytech.github.io/substrate/master/substrate/index.html) [![Substrate-license](https://img.shields.io/badge/License-GPL3%2FApache2.0-blue)](./substrate/README.md#LICENSE)
+ [![SubstrateRustDocs](https://img.shields.io/badge/Rust_Docs-Substrate-24CC85?logo=rust)](https://paritytech.github.io/substrate/master/substrate/index.html)
+ [![Substrate-license](https://img.shields.io/badge/License-GPL3%2FApache2.0-blue)](./substrate/README.md#LICENSE)
-Substrate is the primary blockchain SDK used by developers to create the parachains that make up
-the Polkadot network. Additionally, it allows for the development of self-sovereign blockchains
-that operate completely independently of Polkadot.
+Substrate is the primary blockchain SDK used by developers to create the parachains that make up the Polkadot network.
+Additionally, it allows for the development of self-sovereign blockchains that operate completely independently of
+Polkadot.
## [Cumulus](./cumulus/)
-[![CumulusRustDocs](https://img.shields.io/badge/Rust_Docs-Cumulus-222222?logo=rust)](https://paritytech.github.io/cumulus/cumulus_client_collator/index.html) [![Cumulus-license](https://img.shields.io/badge/License-GPL3-blue)](./cumulus/LICENSE)
+[![CumulusRustDocs](https://img.shields.io/badge/Rust_Docs-Cumulus-222222?logo=rust)](https://paritytech.github.io/cumulus/cumulus_client_collator/index.html)
+[![Cumulus-license](https://img.shields.io/badge/License-GPL3-blue)](./cumulus/LICENSE)
Cumulus is a set of tools for writing Substrate-based Polkadot parachains.
@@ -37,10 +39,10 @@ Cumulus is a set of tools for writing Substrate-based Polkadot parachains.
Below are the primary upstream dependencies utilized in this project:
-- [parity-scale-codec](https://crates.io/crates/parity-scale-codec)
-- [parity-db](https://crates.io/crates/parity-db)
-- [parity-common](https://github.com/paritytech/parity-common)
-- [trie](https://github.com/paritytech/trie)
+- [`parity-scale-codec`](https://crates.io/crates/parity-scale-codec)
+- [`parity-db`](https://crates.io/crates/parity-db)
+- [`parity-common`](https://github.com/paritytech/parity-common)
+- [`trie`](https://github.com/paritytech/trie)
## Security
@@ -48,9 +50,11 @@ The security policy and procedures can be found in [docs/SECURITY.md](./docs/SEC
## Contributing & Code of Conduct
-Ensure you follow our [contribution guidelines](./docs/CONTRIBUTING.md). In every interaction and contribution, this project adheres to the [Contributor Covenant Code of Conduct](./docs/CODE_OF_CONDUCT.md).
+Ensure you follow our [contribution guidelines](./docs/CONTRIBUTING.md). In every interaction and contribution, this
+project adheres to the [Contributor Covenant Code of Conduct](./docs/CODE_OF_CONDUCT.md).
## Additional Resources
-- For monitoring upcoming changes and current proposals related to the technical implementation of the Polkadot network, visit the [`Requests for Comment (RFC)`](https://github.com/polkadot-fellows/RFCs) repository. While it's maintained by the Polkadot Fellowship, the RFC process welcomes contributions from everyone.
-
+- For monitoring upcoming changes and current proposals related to the technical implementation of the Polkadot network,
+ visit the [`Requests for Comment (RFC)`](https://github.com/polkadot-fellows/RFCs) repository. While it's maintained
+ by the Polkadot Fellowship, the RFC process welcomes contributions from everyone.
diff --git a/cumulus/bridges/.gitignore b/bridges/.gitignore
similarity index 100%
rename from cumulus/bridges/.gitignore
rename to bridges/.gitignore
diff --git a/cumulus/bridges/CODE_OF_CONDUCT.md b/bridges/CODE_OF_CONDUCT.md
similarity index 96%
rename from cumulus/bridges/CODE_OF_CONDUCT.md
rename to bridges/CODE_OF_CONDUCT.md
index 70541fb72fa25af86a4268b947cdeb880d1d739c..23411da2e048c758d56d511c792e020a37d0ee0d 100644
--- a/cumulus/bridges/CODE_OF_CONDUCT.md
+++ b/bridges/CODE_OF_CONDUCT.md
@@ -34,9 +34,9 @@ of preference. We see that blockchains are naturally community platforms with u
ultimate decision makers. We assert that good software will maximise user agency by facilitate
user-expression on the network. As such:
-- This project will strive to give users as much choice as is both reasonable and possible over what
+* This project will strive to give users as much choice as is both reasonable and possible over what
protocol they adhere to; but
-- use of the project's technical forums, commenting systems, pull requests and issue trackers as a
+* use of the project's technical forums, commenting systems, pull requests and issue trackers as a
means to express individual protocol preferences is forbidden.
## Our Responsibilities
diff --git a/cumulus/bridges/LICENSE b/bridges/LICENSE
similarity index 100%
rename from cumulus/bridges/LICENSE
rename to bridges/LICENSE
diff --git a/cumulus/bridges/README.md b/bridges/README.md
similarity index 70%
rename from cumulus/bridges/README.md
rename to bridges/README.md
index 2f8c5ca9abb293699fc9510ed60ef4be117dd783..da46fe67d924acb2afffcf971bacb60b560f0cd5 100644
--- a/cumulus/bridges/README.md
+++ b/bridges/README.md
@@ -2,11 +2,10 @@
This is a collection of components for building bridges.
-These components include Substrate pallets for syncing headers, passing arbitrary messages, as well
-as libraries for building relayers to provide cross-chain communication capabilities.
+These components include Substrate pallets for syncing headers, passing arbitrary messages, as well as libraries for
+building relayers to provide cross-chain communication capabilities.
-Three bridge nodes are also available. The nodes can be used to run test networks which bridge other
-Substrate chains.
+Three bridge nodes are also available. The nodes can be used to run test networks which bridge other Substrate chains.
🚧 The bridges are currently under construction - a hardhat is recommended beyond this point 🚧
@@ -21,8 +20,8 @@ Substrate chains.
## Installation
-To get up and running you need both stable and nightly Rust. Rust nightly is used to build the Web
-Assembly (WASM) runtime for the node. You can configure the WASM support as so:
+To get up and running you need both stable and nightly Rust. Rust nightly is used to build the Web Assembly (WASM)
+runtime for the node. You can configure the WASM support as so:
```bash
rustup install nightly
@@ -38,8 +37,8 @@ cargo build --all
cargo test --all
```
-Also you can build the repo with
-[Parity CI Docker image](https://github.com/paritytech/scripts/tree/master/dockerfiles/bridges-ci):
+Also you can build the repo with [Parity CI Docker
+image](https://github.com/paritytech/scripts/tree/master/dockerfiles/bridges-ci):
```bash
docker pull paritytech/bridges-ci:production
@@ -57,16 +56,14 @@ docker run --rm -it -w /shellhere/parity-bridges-common \
If you want to reproduce other steps of CI process you can use the following
[guide](https://github.com/paritytech/scripts#reproduce-ci-locally).
-If you need more information about setting up your development environment [Substrate's
-Installation page](https://docs.substrate.io/main-docs/install/) is a good
-resource.
+If you need more information about setting up your development environment [Substrate's Installation
+page](https://docs.substrate.io/main-docs/install/) is a good resource.
## High-Level Architecture
-This repo has support for bridging foreign chains together using a combination of Substrate pallets
-and external processes called relayers. A bridge chain is one that is able to follow the consensus
-of a foreign chain independently. For example, consider the case below where we want to bridge two
-Substrate based chains.
+This repo has support for bridging foreign chains together using a combination of Substrate pallets and external
+processes called relayers. A bridge chain is one that is able to follow the consensus of a foreign chain independently.
+For example, consider the case below where we want to bridge two Substrate based chains.
```
+---------------+ +---------------+
@@ -82,19 +79,19 @@ Substrate based chains.
+---------------+
```
-The Millau chain must be able to accept Rialto headers and verify their integrity. It does this by
-using a runtime module designed to track GRANDPA finality. Since two blockchains can't interact
-directly they need an external service, called a relayer, to communicate. The relayer will subscribe
-to new Rialto headers via RPC and submit them to the Millau chain for verification.
+The Millau chain must be able to accept Rialto headers and verify their integrity. It does this by using a runtime
+module designed to track GRANDPA finality. Since two blockchains can't interact directly they need an external service,
+called a relayer, to communicate. The relayer will subscribe to new Rialto headers via RPC and submit them to the Millau
+chain for verification.
-Take a look at [Bridge High Level Documentation](./docs/high-level-overview.md) for more in-depth
-description of the bridge interaction.
+Take a look at [Bridge High Level Documentation](./docs/high-level-overview.md) for more in-depth description of the
+bridge interaction.
## Project Layout
-Here's an overview of how the project is laid out. The main bits are the `bin`, which is the actual
-"blockchain", the `modules` which are used to build the blockchain's logic (a.k.a the runtime) and
-the `relays` which are used to pass messages between chains.
+Here's an overview of how the project is laid out. The main bits are the `bin`, which is the actual "blockchain", the
+`modules` which are used to build the blockchain's logic (a.k.a the runtime) and the `relays` which are used to pass
+messages between chains.
```
├── bin // Node and Runtime for the various Substrate chains
@@ -117,16 +114,16 @@ the `relays` which are used to pass messages between chains.
## Running the Bridge
-To run the Bridge you need to be able to connect the bridge relay node to the RPC interface of nodes
-on each side of the bridge (source and target chain).
+To run the Bridge you need to be able to connect the bridge relay node to the RPC interface of nodes on each side of the
+bridge (source and target chain).
There are 2 ways to run the bridge, described below:
-- building & running from source: with this option, you'll be able to run the bridge between two standalone
-chains that are running GRANDPA finality gadget to achieve finality;
+- building & running from source: with this option, you'll be able to run the bridge between two standalone chains that
+are running GRANDPA finality gadget to achieve finality;
-- running a Docker Compose setup: this is a recommended option, where you'll see bridges with parachains,
-complex relays and more.
+- running a Docker Compose setup: this is a recommended option, where you'll see bridges with parachains, complex relays
+and more.
### Using the Source
@@ -141,16 +138,15 @@ cargo build -p substrate-relay
### Running a Dev network
-We will launch a dev network to demonstrate how to relay a message between two Substrate based
-chains (named Rialto and Millau).
+We will launch a dev network to demonstrate how to relay a message between two Substrate based chains (named Rialto and
+Millau).
-To do this we will need two nodes, two relayers which will relay headers, and two relayers which
-will relay messages.
+To do this we will need two nodes, two relayers which will relay headers, and two relayers which will relay messages.
#### Running from local scripts
-To run a simple dev network you can use the scripts located in the
-[`deployments/local-scripts` folder](./deployments/local-scripts).
+To run a simple dev network you can use the scripts located in the [`deployments/local-scripts`
+folder](./deployments/local-scripts).
First, we must run the two Substrate nodes.
@@ -167,8 +163,8 @@ After the nodes are up we can run the header relayers.
./deployments/local-scripts/relay-rialto-to-millau.sh
```
-At this point you should see the relayer submitting headers from the Millau Substrate chain to the
-Rialto Substrate chain.
+At this point you should see the relayer submitting headers from the Millau Substrate chain to the Rialto Substrate
+chain.
```
# Header Relayer Logs
@@ -192,20 +188,23 @@ You will also see the message lane relayers listening for new messages.
[Millau_to_Rialto_MessageLane_00000000] [date] DEBUG bridge Asking Millau::ReceivingConfirmationsDelivery about best message nonces
[...] [date] INFO bridge Synced Some(2) of Some(3) nonces in Millau::MessagesDelivery -> Rialto::MessagesDelivery race
[...] [date] DEBUG bridge Asking Millau::MessagesDelivery about message nonces
-[...] [date] DEBUG bridge Received best nonces from Millau::ReceivingConfirmationsDelivery: TargetClientNonces { latest_nonce: 0, nonces_data: () }
+[...] [date] DEBUG bridge Received best nonces from Millau::ReceivingConfirmationsDelivery: TargetClientNonces {
+ latest_nonce: 0, nonces_data: () }
[...] [date] DEBUG bridge Asking Millau::ReceivingConfirmationsDelivery about finalized message nonces
-[...] [date] DEBUG bridge Received finalized nonces from Millau::ReceivingConfirmationsDelivery: TargetClientNonces { latest_nonce: 0, nonces_data: () }
+[...] [date] DEBUG bridge Received finalized nonces from Millau::ReceivingConfirmationsDelivery: TargetClientNonces {
+ latest_nonce: 0, nonces_data: () }
[...] [date] DEBUG bridge Received nonces from Millau::MessagesDelivery: SourceClientNonces { new_nonces: {}, confirmed_nonce: Some(0) }
[...] [date] DEBUG bridge Asking Millau node about its state
-[...] [date] DEBUG bridge Received state from Millau node: ClientState { best_self: HeaderId(1593, 0xacac***), best_finalized_self: HeaderId(1590, 0x0be81d...), best_finalized_peer_at_best_self: HeaderId(0, 0xdcdd89...) }
+[...] [date] DEBUG bridge Received state from Millau node: ClientState { best_self: HeaderId(1593, 0xacac***), best_finalized_self:
+ HeaderId(1590, 0x0be81d...), best_finalized_peer_at_best_self: HeaderId(0, 0xdcdd89...) }
```
To send a message see the ["How to send a message" section](#how-to-send-a-message).
### How to send a message
-In this section we'll show you how to quickly send a bridge message. The message is just an encoded XCM
-`Trap(43)` message.
+In this section we'll show you how to quickly send a bridge message. The message is just an encoded XCM `Trap(43)`
+message.
```bash
# In `parity-bridges-common` folder
@@ -222,20 +221,20 @@ TRACE bridge Sent transaction to Millau node: 0x5e68...
And at the Rialto node logs you'll something like this:
```
-... runtime::bridge-messages: Received messages: total=1, valid=1. Weight used: Weight(ref_time: 1215065371, proof_size: 48559)/Weight(ref_time: 1215065371, proof_size: 54703).
-```
+... runtime::bridge-messages: Received messages: total=1, valid=1. Weight used: Weight(ref_time: 1215065371, proof_size:
+ 48559)/Weight(ref_time: 1215065371, proof_size: 54703).
+```
-It means that the message has been delivered and dispatched. Message may be dispatched with an
-error, though - the goal of our test bridge is to ensure that messages are successfully delivered
-and all involved components are working.
+It means that the message has been delivered and dispatched. Message may be dispatched with an error, though - the goal
+of our test bridge is to ensure that messages are successfully delivered and all involved components are working.
## Full Network Docker Compose Setup
-For a more sophisticated deployment which includes bidirectional header sync, message passing,
-monitoring dashboards, etc. see the [Deployments README](./deployments/README.md).
+For a more sophisticated deployment which includes bidirectional header sync, message passing, monitoring dashboards,
+etc. see the [Deployments README](./deployments/README.md).
-You should note that you can find images for all the bridge components published on
-[Docker Hub](https://hub.docker.com/u/paritytech).
+You should note that you can find images for all the bridge components published on [Docker
+Hub](https://hub.docker.com/u/paritytech).
To run a Rialto node for example, you can use the following command:
@@ -247,13 +246,12 @@ docker run -p 30333:30333 -p 9933:9933 -p 9944:9944 \
## Community
-Main hangout for the community is [Element](https://element.io/) (formerly Riot). Element is a chat
-server like, for example, Discord. Most discussions around Polkadot and Substrate happen
-in various Element "rooms" (channels). So, joining Element might be a good idea, anyway.
+Main hangout for the community is [Element](https://element.io/) (formerly Riot). Element is a chat server like, for
+example, Discord. Most discussions around Polkadot and Substrate happen in various Element "rooms" (channels). So,
+joining Element might be a good idea, anyway.
-If you are interested in information exchange and development of Polkadot related bridges please
-feel free to join the [Polkadot Bridges](https://app.element.io/#/room/#bridges:web3.foundation)
-Element channel.
+If you are interested in information exchange and development of Polkadot related bridges please feel free to join the
+[Polkadot Bridges](https://app.element.io/#/room/#bridges:web3.foundation) Element channel.
-The [Substrate Technical](https://app.element.io/#/room/#substrate-technical:matrix.org) Element
-channel is most suited for discussions regarding Substrate itself.
+The [Substrate Technical](https://app.element.io/#/room/#substrate-technical:matrix.org) Element channel is most suited
+for discussions regarding Substrate itself.
diff --git a/bridges/SECURITY.md b/bridges/SECURITY.md
new file mode 100644
index 0000000000000000000000000000000000000000..9f215c88765474e6b211882296c8cf190f216780
--- /dev/null
+++ b/bridges/SECURITY.md
@@ -0,0 +1,18 @@
+# Security Policy
+
+Thanks for helping make the Parity ecosystem more secure. Security is one of our first priorities.
+
+## Reporting a vulnerability
+
+If you find something that can be treated as a security vulnerability, please do not use the issue tracker or discuss it
+in the public forum as it can cause more damage, rather than giving real help to the ecosystem.
+
+Security vulnerabilities should be reported by the [contact form](https://security-submission.parity.io/).
+
+If you think that your report might be eligible for the Bug Bounty Program, please mark this during the submission.
+Please check up-to-date [Parity Bug Bounty Program rules](https://www.parity.io/bug-bounty) to find out the information
+about our Bug Bounty Program.
+
+**Warning**: This is an unified SECURITY.md file for Paritytech GitHub Organization. The presence of this file does not
+mean that this repository is covered by the Bug Bounty program. Please always check the Bug Bounty Program scope for
+information.
diff --git a/cumulus/bridges/bin/runtime-common/Cargo.toml b/bridges/bin/runtime-common/Cargo.toml
similarity index 72%
rename from cumulus/bridges/bin/runtime-common/Cargo.toml
rename to bridges/bin/runtime-common/Cargo.toml
index b139f835c1a013b049f5c621f571d4377f234475..5c3fefc69ce710b1af10721ad41d1e5144b00f5a 100644
--- a/cumulus/bridges/bin/runtime-common/Cargo.toml
+++ b/bridges/bin/runtime-common/Cargo.toml
@@ -29,24 +29,24 @@ pallet-bridge-relayers = { path = "../../modules/relayers", default-features = f
# Substrate dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-frame-system = { path = "../../../../substrate/frame/system", default-features = false }
-pallet-transaction-payment = { path = "../../../../substrate/frame/transaction-payment", default-features = false }
-pallet-utility = { path = "../../../../substrate/frame/utility", default-features = false }
-sp-api = { path = "../../../../substrate/primitives/api", default-features = false }
-sp-core = { path = "../../../../substrate/primitives/core", default-features = false }
-sp-io = { path = "../../../../substrate/primitives/io", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
-sp-trie = { path = "../../../../substrate/primitives/trie", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+frame-system = { path = "../../../substrate/frame/system", default-features = false }
+pallet-transaction-payment = { path = "../../../substrate/frame/transaction-payment", default-features = false }
+pallet-utility = { path = "../../../substrate/frame/utility", default-features = false }
+sp-api = { path = "../../../substrate/primitives/api", default-features = false }
+sp-core = { path = "../../../substrate/primitives/core", default-features = false }
+sp-io = { path = "../../../substrate/primitives/io", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
+sp-trie = { path = "../../../substrate/primitives/trie", default-features = false }
# Polkadot dependencies
-xcm = { package = "staging-xcm", path = "../../../../polkadot/xcm", default-features = false }
-xcm-builder = { package = "staging-xcm-builder", path = "../../../../polkadot/xcm/xcm-builder", default-features = false }
+xcm = { package = "staging-xcm", path = "../../../polkadot/xcm", default-features = false }
+xcm-builder = { package = "staging-xcm-builder", path = "../../../polkadot/xcm/xcm-builder", default-features = false }
[dev-dependencies]
bp-test-utils = { path = "../../primitives/test-utils" }
-pallet-balances = { path = "../../../../substrate/frame/balances" }
+pallet-balances = { path = "../../../substrate/frame/balances" }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/bin/runtime-common/src/integrity.rs b/bridges/bin/runtime-common/src/integrity.rs
similarity index 96%
rename from cumulus/bridges/bin/runtime-common/src/integrity.rs
rename to bridges/bin/runtime-common/src/integrity.rs
index 290c22f835d2a488e4f312f0a4811f730925fc15..d3827a14dd6cc24e088a8d05d26aba9d769eb213 100644
--- a/cumulus/bridges/bin/runtime-common/src/integrity.rs
+++ b/bridges/bin/runtime-common/src/integrity.rs
@@ -27,7 +27,6 @@ use codec::Encode;
use frame_support::{storage::generator::StorageValue, traits::Get, weights::Weight};
use frame_system::limits;
use pallet_bridge_messages::WeightInfoExt as _;
-use sp_runtime::traits::SignedExtension;
/// Macro that ensures that the runtime configuration and chain primitives crate are sharing
/// the same types (nonce, block number, hash, hasher, account id and header).
@@ -347,15 +346,3 @@ pub fn check_message_lane_weights<
);
}
}
-
-/// Check that the `AdditionalSigned` type of a wrapped runtime is the same as the one of the
-/// corresponding actual runtime.
-///
-/// This method doesn't perform any `assert`. If the condition is not true it will generate a
-/// compile-time error.
-pub fn check_additional_signed()
-where
- SignedExt: SignedExtension,
- IndirectSignedExt: SignedExtension,
-{
-}
diff --git a/cumulus/bridges/bin/runtime-common/src/lib.rs b/bridges/bin/runtime-common/src/lib.rs
similarity index 100%
rename from cumulus/bridges/bin/runtime-common/src/lib.rs
rename to bridges/bin/runtime-common/src/lib.rs
diff --git a/cumulus/bridges/bin/runtime-common/src/messages.rs b/bridges/bin/runtime-common/src/messages.rs
similarity index 100%
rename from cumulus/bridges/bin/runtime-common/src/messages.rs
rename to bridges/bin/runtime-common/src/messages.rs
diff --git a/cumulus/bridges/bin/runtime-common/src/messages_api.rs b/bridges/bin/runtime-common/src/messages_api.rs
similarity index 100%
rename from cumulus/bridges/bin/runtime-common/src/messages_api.rs
rename to bridges/bin/runtime-common/src/messages_api.rs
diff --git a/cumulus/bridges/bin/runtime-common/src/messages_benchmarking.rs b/bridges/bin/runtime-common/src/messages_benchmarking.rs
similarity index 100%
rename from cumulus/bridges/bin/runtime-common/src/messages_benchmarking.rs
rename to bridges/bin/runtime-common/src/messages_benchmarking.rs
diff --git a/cumulus/bridges/bin/runtime-common/src/messages_call_ext.rs b/bridges/bin/runtime-common/src/messages_call_ext.rs
similarity index 100%
rename from cumulus/bridges/bin/runtime-common/src/messages_call_ext.rs
rename to bridges/bin/runtime-common/src/messages_call_ext.rs
diff --git a/cumulus/bridges/bin/runtime-common/src/messages_generation.rs b/bridges/bin/runtime-common/src/messages_generation.rs
similarity index 100%
rename from cumulus/bridges/bin/runtime-common/src/messages_generation.rs
rename to bridges/bin/runtime-common/src/messages_generation.rs
diff --git a/cumulus/bridges/bin/runtime-common/src/messages_xcm_extension.rs b/bridges/bin/runtime-common/src/messages_xcm_extension.rs
similarity index 100%
rename from cumulus/bridges/bin/runtime-common/src/messages_xcm_extension.rs
rename to bridges/bin/runtime-common/src/messages_xcm_extension.rs
diff --git a/cumulus/bridges/bin/runtime-common/src/mock.rs b/bridges/bin/runtime-common/src/mock.rs
similarity index 100%
rename from cumulus/bridges/bin/runtime-common/src/mock.rs
rename to bridges/bin/runtime-common/src/mock.rs
diff --git a/cumulus/bridges/bin/runtime-common/src/parachains_benchmarking.rs b/bridges/bin/runtime-common/src/parachains_benchmarking.rs
similarity index 100%
rename from cumulus/bridges/bin/runtime-common/src/parachains_benchmarking.rs
rename to bridges/bin/runtime-common/src/parachains_benchmarking.rs
diff --git a/cumulus/bridges/bin/runtime-common/src/priority_calculator.rs b/bridges/bin/runtime-common/src/priority_calculator.rs
similarity index 100%
rename from cumulus/bridges/bin/runtime-common/src/priority_calculator.rs
rename to bridges/bin/runtime-common/src/priority_calculator.rs
diff --git a/cumulus/bridges/bin/runtime-common/src/refund_relayer_extension.rs b/bridges/bin/runtime-common/src/refund_relayer_extension.rs
similarity index 100%
rename from cumulus/bridges/bin/runtime-common/src/refund_relayer_extension.rs
rename to bridges/bin/runtime-common/src/refund_relayer_extension.rs
diff --git a/cumulus/bridges/docs/complex-relay.html b/bridges/docs/complex-relay.html
similarity index 100%
rename from cumulus/bridges/docs/complex-relay.html
rename to bridges/docs/complex-relay.html
diff --git a/cumulus/bridges/docs/grandpa-finality-relay.html b/bridges/docs/grandpa-finality-relay.html
similarity index 100%
rename from cumulus/bridges/docs/grandpa-finality-relay.html
rename to bridges/docs/grandpa-finality-relay.html
diff --git a/bridges/docs/high-level-overview.md b/bridges/docs/high-level-overview.md
new file mode 100644
index 0000000000000000000000000000000000000000..42efc8100bd080763c22ea3e4e813f3c3c87db37
--- /dev/null
+++ b/bridges/docs/high-level-overview.md
@@ -0,0 +1,184 @@
+# High-Level Bridge Documentation
+
+This document gives a brief, abstract description of main components that may be found in this repository. If you want
+to see how we're using them to build Rococo <> Wococo (Kusama <> Polkadot) bridge, please refer to the [Polkadot <>
+Kusama Bridge](./polkadot-kusama-bridge-overview.md).
+
+## Purpose
+
+This repo contains all components required to build a trustless connection between standalone Substrate chains, that are
+using GRANDPA finality, their parachains or any combination of those. On top of this connection, we offer a messaging
+pallet that provides means to organize messages exchange.
+
+On top of that layered infrastructure, anyone may build their own bridge applications - e.g. [XCM
+messaging](./polkadot-kusama-bridge-overview.md), [encoded calls
+messaging](https://github.com/paritytech/parity-bridges-common/releases/tag/encoded-calls-messaging) and so on.
+
+## Terminology
+
+Even though we support (and require) two-way bridging, the documentation will generally talk about a one-sided
+interaction. That's to say, we will only talk about syncing finality proofs and messages from a _source_ chain to a
+_target_ chain. This is because the two-sided interaction is really just the one-sided interaction with the source and
+target chains switched.
+
+The bridge has both on-chain (pallets) and offchain (relayers) components.
+
+## On-chain components
+
+On-chain bridge components are pallets that are deployed at the chain runtime. Finality pallets require deployment at
+the target chain, while messages pallet needs to be deployed at both, source and target chains.
+
+### Bridge GRANDPA Finality Pallet
+
+A GRANDPA light client of the source chain built into the target chain's runtime. It provides a "source of truth" about
+the source chain headers which have been finalized. This is useful for higher level applications.
+
+The pallet tracks current GRANDPA authorities set and only accepts finality proofs (GRANDPA justifications), generated
+by the current authorities set. The GRANDPA protocol itself requires current authorities set to generate explicit
+justification for the header that enacts next authorities set. Such headers and their finality proofs are called
+mandatory in the pallet and relayer pays no fee for such headers submission.
+
+The pallet does not require all headers to be imported or provided. The relayer itself chooses which headers he wants to
+submit (with the exception of mandatory headers).
+
+More: [pallet level documentation and code](../modules/grandpa/).
+
+### Bridge Parachains Finality Pallet
+
+Parachains are not supposed to have their own finality, so we can't use bridge GRANDPA pallet to verify their finality
+proofs. Instead, they rely on their relay chain finality. The parachain header is considered final, when it is accepted
+by the [`paras`
+pallet](https://github.com/paritytech/polkadot/tree/1a034bd6de0e76721d19aed02a538bcef0787260/runtime/parachains/src/paras)
+at its relay chain. Obviously, the relay chain block, where it is accepted, must also be finalized by the relay chain
+GRANDPA gadget.
+
+That said, the bridge parachains pallet accepts storage proof of one or several parachain heads, inserted to the
+[`Heads`](https://github.com/paritytech/polkadot/blob/1a034bd6de0e76721d19aed02a538bcef0787260/runtime/parachains/src/paras/mod.rs#L642)
+map of the [`paras`
+pallet](https://github.com/paritytech/polkadot/tree/1a034bd6de0e76721d19aed02a538bcef0787260/runtime/parachains/src/paras).
+To verify this storage proof, the pallet uses relay chain header, imported earlier by the bridge GRANDPA pallet.
+
+The pallet may track multiple parachains at once and those parachains may use different primitives. So the parachain
+header decoding never happens at the pallet level. For maintaining the headers order, the pallet uses relay chain header
+number.
+
+More: [pallet level documentation and code](../modules/parachains/).
+
+### Bridge Messages Pallet
+
+The pallet is responsible for queuing messages at the source chain and receiving the messages proofs at the target
+chain. The messages are sent to the particular _lane_, where they are guaranteed to be received in the same order they
+are sent. The pallet supports many lanes.
+
+The lane has two ends. Outbound lane end is storing number of messages that have been sent and the number of messages
+that have been received. Inbound lane end stores the number of messages that have been received and also a map that maps
+messages to relayers that have delivered those messages to the target chain.
+
+The pallet has three main entrypoints:
+- the `send_message` may be used by the other runtime pallets to send the messages;
+- the `receive_messages_proof` is responsible for parsing the messages proof and handing messages over to the dispatch
+code;
+- the `receive_messages_delivery_proof` is responsible for parsing the messages delivery proof and rewarding relayers
+that have delivered the message.
+
+Many things are abstracted by the pallet:
+- the message itself may mean anything, the pallet doesn't care about its content;
+- the message dispatch happens during delivery, but it is decoupled from the pallet code;
+- the messages proof and messages delivery proof are verified outside of the pallet;
+- the relayers incentivization scheme is defined outside of the pallet.
+
+Outside of the messaging pallet, we have a set of adapters, where messages and delivery proofs are regular storage
+proofs. The proofs are generated at the bridged chain and require bridged chain finality. So messages pallet, in this
+case, depends on one of the finality pallets. The messages are XCM messages and we are using XCM executor to dispatch
+them on receival. You may find more info in [Polkadot <> Kusama Bridge](./polkadot-kusama-bridge-overview.md) document.
+
+More: [pallet level documentation and code](../modules/messages/).
+
+### Bridge Relayers Pallet
+
+The pallet is quite simple. It just registers relayer rewards and has an entrypoint to collect them. When the rewards
+are registered and the reward amount is configured outside of the pallet.
+
+More: [pallet level documentation and code](../modules/relayers/).
+
+## Offchain Components
+
+Offchain bridge components are separate processes, called relayers. Relayers are connected both to the source chain and
+target chain nodes. Relayers are reading state of the source chain, compare it to the state of the target chain and, if
+state at target chain needs to be updated, submits target chain transaction.
+
+### GRANDPA Finality Relay
+
+The task of relay is to submit source chain GRANDPA justifications and their corresponding headers to the Bridge GRANDPA
+Finality Pallet, deployed at the target chain. For that, the relay subscribes to the source chain GRANDPA justifications
+stream and submits every new justification it sees to the target chain GRANDPA light client. In addition, relay is
+searching for mandatory headers and submits their justifications - without that the pallet will be unable to move
+forward.
+
+More: [GRANDPA Finality Relay Sequence Diagram](./grandpa-finality-relay.html), [pallet level documentation and
+code](../relays/finality/).
+
+### Parachains Finality Relay
+
+The relay connects to the source _relay_ chain and the target chain nodes. It doesn't need to connect to the tracked
+parachain nodes. The relay looks at the
+[`Heads`](https://github.com/paritytech/polkadot/blob/1a034bd6de0e76721d19aed02a538bcef0787260/runtime/parachains/src/paras/mod.rs#L642)
+map of the [`paras`
+pallet](https://github.com/paritytech/polkadot/tree/1a034bd6de0e76721d19aed02a538bcef0787260/runtime/parachains/src/paras)
+in source chain, and compares the value with the best parachain head, stored in the bridge parachains pallet at the
+target chain. If new parachain head appears at the relay chain block `B`, the relay process **waits** until header `B`
+or one of its ancestors appears at the target chain. Once it is available, the storage proof of the map entry is
+generated and is submitted to the target chain.
+
+As its on-chain component (which requires bridge GRANDPA pallet to be deployed nearby), the parachains finality relay
+requires GRANDPA finality relay to be running in parallel. Without it, the header `B` or any of its children's finality
+at source won't be relayed at target, and target chain won't be able to verify generated storage proof.
+
+More: [Parachains Finality Relay Sequence Diagram](./parachains-finality-relay.html), [code](../relays/parachains/).
+
+### Messages Relay
+
+Messages relay is actually two relays that are running in a single process: messages delivery relay and delivery
+confirmation relay. Even though they are more complex and have many caveats, the overall algorithm is the same as in
+other relays.
+
+Message delivery relay connects to the source chain and looks at the outbound lane end, waiting until new messages are
+queued there. Once they appear at the source block `B`, the relay start waiting for the block `B` or its descendant
+appear at the target chain. Then the messages storage proof is generated and submitted to the bridge messages pallet at
+the target chain. In addition, the transaction may include the storage proof of the outbound lane state - that proves
+that relayer rewards have been paid and this data (map of relay accounts to the delivered messages) may be pruned from
+the inbound lane state at the target chain.
+
+Delivery confirmation relay connects to the target chain and starts watching the inbound lane end. When new messages are
+delivered to the target chain, the corresponding _source chain account_ is inserted to the map in the inbound lane data.
+Relay detects that, say, at the target chain block `B` and waits until that block or its descendant appears at the
+source chain. Once that happens, the relay crafts a storage proof of that data and sends it to the messages pallet,
+deployed at the source chain.
+
+As you can see, the messages relay also requires finality relay to be operating in parallel. Since messages relay
+submits transactions to both source and target chains, it requires both _source-to-target_ and _target-to-source_
+finality relays. They can be GRANDPA finality relays or GRANDPA+parachains finality relays, depending on the type of
+connected chain.
+
+More: [Messages Relay Sequence Diagram](./messages-relay.html), [pallet level documentation and
+code](../relays/messages/).
+
+### Complex Relay
+
+Every relay transaction has its cost. The only transaction, that is "free" to relayer is when the mandatory GRANDPA
+header is submitted. The relay that feeds the bridge with every relay chain and/or parachain head it sees, will have to
+pay a (quite large) cost. And if no messages are sent through the bridge, that is just waste of money.
+
+We have a special relay mode, called _complex relay_, where relay mostly sleeps and only submits transactions that are
+required for the messages/confirmations delivery. This mode starts two message relays (in both directions). All required
+finality relays are also started in a special _on-demand_ mode. In this mode they do not submit any headers without
+special request. As always, the only exception is when GRANDPA finality relay sees the mandatory header - it is
+submitted without such request.
+
+The message relays are watching their lanes and when, at some block `B`, they see new messages/confirmations to be
+delivered, they are asking on-demand relays to relay this block `B`. On-demand relays does that and then message relay
+may perform its job. If on-demand relay is a parachain finality relay, it also runs its own on-demand GRANDPA relay,
+which is used to relay required relay chain headers.
+
+More: [Complex Relay Sequence Diagram](./complex-relay.html),
+[code](../relays/bin-substrate/src/cli/relay_headers_and_messages/).
diff --git a/cumulus/bridges/docs/messages-relay.html b/bridges/docs/messages-relay.html
similarity index 100%
rename from cumulus/bridges/docs/messages-relay.html
rename to bridges/docs/messages-relay.html
diff --git a/cumulus/bridges/docs/parachains-finality-relay.html b/bridges/docs/parachains-finality-relay.html
similarity index 100%
rename from cumulus/bridges/docs/parachains-finality-relay.html
rename to bridges/docs/parachains-finality-relay.html
diff --git a/cumulus/bridges/docs/polkadot-kusama-bridge-overview.md b/bridges/docs/polkadot-kusama-bridge-overview.md
similarity index 56%
rename from cumulus/bridges/docs/polkadot-kusama-bridge-overview.md
rename to bridges/docs/polkadot-kusama-bridge-overview.md
index b469720f65b2bb5b8b941ec34e89df505d13ac67..08036f0b0722b869786ae3d0abfc6ae7ea7c2c18 100644
--- a/cumulus/bridges/docs/polkadot-kusama-bridge-overview.md
+++ b/bridges/docs/polkadot-kusama-bridge-overview.md
@@ -1,35 +1,35 @@
# Polkadot <> Kusama Bridge Overview
-This document describes how we use all components, described in the [High-Level Bridge Documentation](./high-level-overview.md),
-to build the XCM bridge between Kusama and Polkadot. In this case, our components merely work as a XCM transport
-(like XCMP/UMP/HRMP), between chains that are not a part of the same consensus system.
+This document describes how we use all components, described in the [High-Level Bridge
+Documentation](./high-level-overview.md), to build the XCM bridge between Kusama and Polkadot. In this case, our
+components merely work as a XCM transport (like XCMP/UMP/HRMP), between chains that are not a part of the same consensus
+system.
The overall architecture may be seen in [this diagram](./polkadot-kusama-bridge.html).
## Bridge Hubs
-All operations at relay chain are expensive. Ideally all non-mandatory transactions must happen on parachains.
-That's why we are planning to have two parachains - Polkadot Bridge Hub under Polkadot consensus and Kusama
-Bridge Hub under Kusama consensus.
+All operations at relay chain are expensive. Ideally all non-mandatory transactions must happen on parachains. That's
+why we are planning to have two parachains - Polkadot Bridge Hub under Polkadot consensus and Kusama Bridge Hub under
+Kusama consensus.
-The Bridge Hub will have all required bridge pallets in its runtime. We hope that later, other teams will be able to
-use our bridge hubs too and have their pallets there.
+The Bridge Hub will have all required bridge pallets in its runtime. We hope that later, other teams will be able to use
+our bridge hubs too and have their pallets there.
-The Bridge Hub will use the base token of the ecosystem - KSM at Kusama Bridge Hub and DOT at Polkadot Bridge Hub.
-The runtime will have minimal set of non-bridge pallets, so there's not much you can do directly on bridge hubs.
+The Bridge Hub will use the base token of the ecosystem - KSM at Kusama Bridge Hub and DOT at Polkadot Bridge Hub. The
+runtime will have minimal set of non-bridge pallets, so there's not much you can do directly on bridge hubs.
## Connecting Parachains
-You won't be able to directly use bridge hub transactions to send XCM messages over the bridge. Instead, you'll need
-to use other parachains transactions, which will use HRMP to deliver messages to the Bridge Hub. The Bridge Hub will
-just queue these messages in its outbound lane, which is dedicated to deliver messages between two parachains.
+You won't be able to directly use bridge hub transactions to send XCM messages over the bridge. Instead, you'll need to
+use other parachains transactions, which will use HRMP to deliver messages to the Bridge Hub. The Bridge Hub will just
+queue these messages in its outbound lane, which is dedicated to deliver messages between two parachains.
-Our first planned bridge will connect the Polkadot and Kusama Asset Hubs. A bridge between those two
-parachains would allow Asset Hub Polkadot accounts to hold wrapped KSM tokens and Asset Hub Kusama
-accounts to hold wrapped DOT tokens.
+Our first planned bridge will connect the Polkadot and Kusama Asset Hubs. A bridge between those two parachains would
+allow Asset Hub Polkadot accounts to hold wrapped KSM tokens and Asset Hub Kusama accounts to hold wrapped DOT tokens.
-For that bridge (pair of parachains under different consensus systems) we'll be using the lane 00000000. Later,
-when other parachains will join the bridge, they will be using other lanes for their messages.
+For that bridge (pair of parachains under different consensus systems) we'll be using the lane 00000000. Later, when
+other parachains will join the bridge, they will be using other lanes for their messages.
## Running Relayers
@@ -38,9 +38,9 @@ justifications to the bridge hubs at the other side. It'll also relay finalized
Hub heads. This will only happen when messages will be queued at hubs. So most of time relayer will be idle.
There's no any active relayer sets, or something like that. Anyone may start its own relayer and relay queued messages.
-We are not against that and, as always, appreciate any community efforts. Of course, running relayer has the cost.
-Apart from paying for the CPU and network, the relayer pays for transactions at both sides of the bridge. We have
-a mechanism for rewarding relayers.
+We are not against that and, as always, appreciate any community efforts. Of course, running relayer has the cost. Apart
+from paying for the CPU and network, the relayer pays for transactions at both sides of the bridge. We have a mechanism
+for rewarding relayers.
### Compensating the Cost of Message Delivery Transactions
@@ -56,51 +56,49 @@ is the relayer, which is following our rules:
- we compensate the cost of message delivery transactions that have actually delivered the messages. So if your
transaction has claimed to deliver messages `[42, 43, 44]`, but, because of some reasons, has actually delivered
- messages `[42, 43]`, the transaction will be free for relayer. If it has not delivered any messages, then
- the relayer pays the full cost of the transaction;
+ messages `[42, 43]`, the transaction will be free for relayer. If it has not delivered any messages, then the relayer
+ pays the full cost of the transaction;
- we compensate the cost of message delivery and all required finality calls, if they are part of the same
[`frame_utility::batch_all`](https://github.com/paritytech/substrate/blob/891d6a5c870ab88521183facafc811a203bb6541/frame/utility/src/lib.rs#L326)
- transaction. Of course, the calls inside the batch must be linked - e.g. the submitted parachain head must be used
- to prove messages. Relay header must be used to prove parachain head finality. If one of calls fails, or if they
- are not linked together, the relayer pays the full transaction cost.
+ transaction. Of course, the calls inside the batch must be linked - e.g. the submitted parachain head must be used to
+ prove messages. Relay header must be used to prove parachain head finality. If one of calls fails, or if they are not
+ linked together, the relayer pays the full transaction cost.
Please keep in mind that the fee of "zero-cost" transactions is still withdrawn from the relayer account. But the
-compensation is registered in the `pallet_bridge_relayers::RelayerRewards` map at the target bridge hub. The relayer
-may later claim all its rewards later, using the `pallet_bridge_relayers::claim_rewards` call.
+compensation is registered in the `pallet_bridge_relayers::RelayerRewards` map at the target bridge hub. The relayer may
+later claim all its rewards later, using the `pallet_bridge_relayers::claim_rewards` call.
*A side note*: why we don't simply set the cost of useful transactions to zero? That's because the bridge has its cost.
If we won't take any fees, it would mean that the sender is not obliged to pay for its messages. And Bridge Hub
-collators (and, maybe, "treasury") are not receiving any payment for including transactions. More about this later,
-in the [Who is Rewarding Relayers](#who-is-rewarding-relayers) section.
+collators (and, maybe, "treasury") are not receiving any payment for including transactions. More about this later, in
+the [Who is Rewarding Relayers](#who-is-rewarding-relayers) section.
### Message Delivery Confirmation Rewards
In addition to the "zero-cost" message delivery transactions, the relayer is also rewarded for:
-- delivering every message. The reward is registered during delivery confirmation transaction at the Source Bridge
- Hub.;
+- delivering every message. The reward is registered during delivery confirmation transaction at the Source Bridge Hub.;
-- submitting delivery confirmation transaction. The relayer may submit delivery confirmation that e.g. confirms
- delivery of four messages, of which the only one (or zero) messages is actually delivered by this relayer. It
- receives some fee for confirming messages, delivered by other relayers.
+- submitting delivery confirmation transaction. The relayer may submit delivery confirmation that e.g. confirms delivery
+ of four messages, of which the only one (or zero) messages is actually delivered by this relayer. It receives some fee
+ for confirming messages, delivered by other relayers.
Both rewards may be claimed using the `pallet_bridge_relayers::claim_rewards` call at the Source Bridge Hub.
### Who is Rewarding Relayers
Obviously, there should be someone who is paying relayer rewards. We want bridge transactions to have a cost, so we
-can't use fees for rewards. Instead, the parachains using the bridge, use sovereign accounts on both sides
-of the bridge to cover relayer rewards.
+can't use fees for rewards. Instead, the parachains using the bridge, use sovereign accounts on both sides of the bridge
+to cover relayer rewards.
-Bridged Parachains will have sovereign accounts at bridge hubs. For example, the Kusama Asset Hub will
-have an account at the Polkadot Bridge Hub. The Polkadot Asset Hub will have an account at the Kusama
-Bridge Hub. The sovereign accounts are used as a source of funds when the relayer is calling the
-`pallet_bridge_relayers::claim_rewards`.
+Bridged Parachains will have sovereign accounts at bridge hubs. For example, the Kusama Asset Hub will have an account
+at the Polkadot Bridge Hub. The Polkadot Asset Hub will have an account at the Kusama Bridge Hub. The sovereign accounts
+are used as a source of funds when the relayer is calling the `pallet_bridge_relayers::claim_rewards`.
-Since messages lane is only used by the pair of parachains, there's no collision between different bridges. E.g.
-Kusama Asset Hub will only reward relayers that are delivering messages from Kusama Asset Hub. The Kusama Asset Hub sovereign account
-is not used to cover rewards of bridging with some other Polkadot Parachain.
+Since messages lane is only used by the pair of parachains, there's no collision between different bridges. E.g. Kusama
+Asset Hub will only reward relayers that are delivering messages from Kusama Asset Hub. The Kusama Asset Hub sovereign
+account is not used to cover rewards of bridging with some other Polkadot Parachain.
### Multiple Relayers and Rewards
@@ -108,25 +106,24 @@ Our goal is to incentivize running honest relayers. But we have no relayers sets
message delivery transaction, hoping that the cost of this transaction will be compensated. So what if some message is
currently queued and two relayers are submitting two identical message delivery transactions at once? Without any
special means, the cost of first included transaction will be compensated and the cost of the other one won't. A honest,
-but unlucky relayer will lose some money. In addition, we'll waste some portion of block size and weight, which
-may be used by other useful transactions.
+but unlucky relayer will lose some money. In addition, we'll waste some portion of block size and weight, which may be
+used by other useful transactions.
-To solve the problem, we have two signed extensions ([generate_bridge_reject_obsolete_headers_and_messages! {}](../bin/runtime-common/src/lib.rs)
-and [RefundRelayerForMessagesFromParachain](../bin/runtime-common/src/refund_relayer_extension.rs)), that are
-preventing bridge transactions with obsolete data from including into the block. We are rejecting following
-transactions:
+To solve the problem, we have two signed extensions ([generate_bridge_reject_obsolete_headers_and_messages!
+{}](../bin/runtime-common/src/lib.rs) and
+[RefundRelayerForMessagesFromParachain](../bin/runtime-common/src/refund_relayer_extension.rs)), that are preventing
+bridge transactions with obsolete data from including into the block. We are rejecting following transactions:
- transactions, that are submitting the GRANDPA justification for the best finalized header, or one of its ancestors;
- transactions, that are submitting the proof of the current best parachain head, or one of its ancestors;
-- transactions, that are delivering already delivered messages. If at least one of messages is not yet delivered,
- the transaction is not rejected;
+- transactions, that are delivering already delivered messages. If at least one of messages is not yet delivered, the
+ transaction is not rejected;
-- transactions, that are confirming delivery of already confirmed messages. If at least one of confirmations is new,
- the transaction is not rejected;
+- transactions, that are confirming delivery of already confirmed messages. If at least one of confirmations is new, the
+ transaction is not rejected;
- [`frame_utility::batch_all`](https://github.com/paritytech/substrate/blob/891d6a5c870ab88521183facafc811a203bb6541/frame/utility/src/lib.rs#L326)
- transactions, that have both finality and message delivery calls. All restrictions from the
- [Compensating the Cost of Message Delivery Transactions](#compensating-the-cost-of-message-delivery-transactions)
- are applied.
+ transactions, that have both finality and message delivery calls. All restrictions from the [Compensating the Cost of
+ Message Delivery Transactions](#compensating-the-cost-of-message-delivery-transactions) are applied.
diff --git a/cumulus/bridges/docs/polkadot-kusama-bridge.html b/bridges/docs/polkadot-kusama-bridge.html
similarity index 100%
rename from cumulus/bridges/docs/polkadot-kusama-bridge.html
rename to bridges/docs/polkadot-kusama-bridge.html
diff --git a/cumulus/bridges/modules/grandpa/Cargo.toml b/bridges/modules/grandpa/Cargo.toml
similarity index 65%
rename from cumulus/bridges/modules/grandpa/Cargo.toml
rename to bridges/modules/grandpa/Cargo.toml
index 87eda6b29a703599dcc8afd6a2b88191e458a3c9..05d6a8e5c26b0d82f5dc80ce5be21d9a53b46d33 100644
--- a/cumulus/bridges/modules/grandpa/Cargo.toml
+++ b/bridges/modules/grandpa/Cargo.toml
@@ -20,20 +20,20 @@ bp-header-chain = { path = "../../primitives/header-chain", default-features = f
# Substrate Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-frame-system = { path = "../../../../substrate/frame/system", default-features = false }
-sp-consensus-grandpa = { path = "../../../../substrate/primitives/consensus/grandpa", default-features = false, features = ["serde"] }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false, features = ["serde"] }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
-sp-trie = { path = "../../../../substrate/primitives/trie", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+frame-system = { path = "../../../substrate/frame/system", default-features = false }
+sp-consensus-grandpa = { path = "../../../substrate/primitives/consensus/grandpa", default-features = false, features = ["serde"] }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false, features = ["serde"] }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
+sp-trie = { path = "../../../substrate/primitives/trie", default-features = false }
# Optional Benchmarking Dependencies
bp-test-utils = { path = "../../primitives/test-utils", default-features = false, optional = true }
-frame-benchmarking = { path = "../../../../substrate/frame/benchmarking", default-features = false, optional = true }
+frame-benchmarking = { path = "../../../substrate/frame/benchmarking", default-features = false, optional = true }
[dev-dependencies]
-sp-core = { path = "../../../../substrate/primitives/core" }
-sp-io = { path = "../../../../substrate/primitives/io" }
+sp-core = { path = "../../../substrate/primitives/core" }
+sp-io = { path = "../../../substrate/primitives/io" }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/modules/grandpa/README.md b/bridges/modules/grandpa/README.md
similarity index 100%
rename from cumulus/bridges/modules/grandpa/README.md
rename to bridges/modules/grandpa/README.md
diff --git a/cumulus/bridges/modules/grandpa/src/benchmarking.rs b/bridges/modules/grandpa/src/benchmarking.rs
similarity index 100%
rename from cumulus/bridges/modules/grandpa/src/benchmarking.rs
rename to bridges/modules/grandpa/src/benchmarking.rs
diff --git a/cumulus/bridges/modules/grandpa/src/call_ext.rs b/bridges/modules/grandpa/src/call_ext.rs
similarity index 100%
rename from cumulus/bridges/modules/grandpa/src/call_ext.rs
rename to bridges/modules/grandpa/src/call_ext.rs
diff --git a/cumulus/bridges/modules/grandpa/src/lib.rs b/bridges/modules/grandpa/src/lib.rs
similarity index 100%
rename from cumulus/bridges/modules/grandpa/src/lib.rs
rename to bridges/modules/grandpa/src/lib.rs
diff --git a/cumulus/bridges/modules/grandpa/src/mock.rs b/bridges/modules/grandpa/src/mock.rs
similarity index 100%
rename from cumulus/bridges/modules/grandpa/src/mock.rs
rename to bridges/modules/grandpa/src/mock.rs
diff --git a/cumulus/bridges/modules/grandpa/src/storage_types.rs b/bridges/modules/grandpa/src/storage_types.rs
similarity index 100%
rename from cumulus/bridges/modules/grandpa/src/storage_types.rs
rename to bridges/modules/grandpa/src/storage_types.rs
diff --git a/cumulus/bridges/modules/grandpa/src/weights.rs b/bridges/modules/grandpa/src/weights.rs
similarity index 100%
rename from cumulus/bridges/modules/grandpa/src/weights.rs
rename to bridges/modules/grandpa/src/weights.rs
diff --git a/cumulus/bridges/modules/messages/Cargo.toml b/bridges/modules/messages/Cargo.toml
similarity index 67%
rename from cumulus/bridges/modules/messages/Cargo.toml
rename to bridges/modules/messages/Cargo.toml
index 5eecdb147fada8100866280af3c81b7ede77605f..7b7ea06198102ece6d93313413451a7c0294ef8b 100644
--- a/cumulus/bridges/modules/messages/Cargo.toml
+++ b/bridges/modules/messages/Cargo.toml
@@ -19,17 +19,17 @@ bp-runtime = { path = "../../primitives/runtime", default-features = false }
# Substrate Dependencies
-frame-benchmarking = { path = "../../../../substrate/frame/benchmarking", default-features = false, optional = true }
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-frame-system = { path = "../../../../substrate/frame/system", default-features = false }
-sp-core = { path = "../../../../substrate/primitives/core", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-benchmarking = { path = "../../../substrate/frame/benchmarking", default-features = false, optional = true }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+frame-system = { path = "../../../substrate/frame/system", default-features = false }
+sp-core = { path = "../../../substrate/primitives/core", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[dev-dependencies]
bp-test-utils = { path = "../../primitives/test-utils" }
-pallet-balances = { path = "../../../../substrate/frame/balances" }
-sp-io = { path = "../../../../substrate/primitives/io" }
+pallet-balances = { path = "../../../substrate/frame/balances" }
+sp-io = { path = "../../../substrate/primitives/io" }
[features]
default = [ "std" ]
diff --git a/bridges/modules/messages/README.md b/bridges/modules/messages/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..457d5f5facfa70fdb11d05c5d544e75eb44f975f
--- /dev/null
+++ b/bridges/modules/messages/README.md
@@ -0,0 +1,215 @@
+# Bridge Messages Pallet
+
+The messages pallet is used to deliver messages from source chain to target chain. Message is (almost) opaque to the
+module and the final goal is to hand message to the message dispatch mechanism.
+
+## Contents
+
+- [Overview](#overview)
+- [Message Workflow](#message-workflow)
+- [Integrating Message Lane Module into Runtime](#integrating-messages-module-into-runtime)
+- [Non-Essential Functionality](#non-essential-functionality)
+- [Weights of Module Extrinsics](#weights-of-module-extrinsics)
+
+## Overview
+
+Message lane is an unidirectional channel, where messages are sent from source chain to the target chain. At the same
+time, a single instance of messages module supports both outbound lanes and inbound lanes. So the chain where the module
+is deployed (this chain), may act as a source chain for outbound messages (heading to a bridged chain) and as a target
+chain for inbound messages (coming from a bridged chain).
+
+Messages module supports multiple message lanes. Every message lane is identified with a 4-byte identifier. Messages
+sent through the lane are assigned unique (for this lane) increasing integer value that is known as nonce ("number that
+can only be used once"). Messages that are sent over the same lane are guaranteed to be delivered to the target chain in
+the same order they're sent from the source chain. In other words, message with nonce `N` will be delivered right before
+delivering a message with nonce `N+1`.
+
+Single message lane may be seen as a transport channel for single application (onchain, offchain or mixed). At the same
+time the module itself never dictates any lane or message rules. In the end, it is the runtime developer who defines
+what message lane and message mean for this runtime.
+
+In our [Kusama<>Polkadot bridge](../../docs/polkadot-kusama-bridge-overview.md) we are using lane as a channel of
+communication between two parachains of different relay chains. For example, lane `[0, 0, 0, 0]` is used for Polkadot <>
+Kusama Asset Hub communications. Other lanes may be used to bridge other parachains.
+
+## Message Workflow
+
+The pallet is not intended to be used by end users and provides no public calls to send the message. Instead, it
+provides runtime-internal method that allows other pallets (or other runtime code) to queue outbound messages.
+
+The message "appears" when some runtime code calls the `send_message()` method of the pallet. The submitter specifies
+the lane that they're willing to use and the message itself. If some fee must be paid for sending the message, it must
+be paid outside of the pallet. If a message passes all checks (that include, for example, message size check, disabled
+lane check, ...), the nonce is assigned and the message is stored in the module storage. The message is in an
+"undelivered" state now.
+
+We assume that there are external, offchain actors, called relayers, that are submitting module related transactions to
+both target and source chains. The pallet itself has no assumptions about relayers incentivization scheme, but it has
+some callbacks for paying rewards. See [Integrating Messages Module into
+runtime](#Integrating-Messages-Module-into-runtime) for details.
+
+Eventually, some relayer would notice this message in the "undelivered" state and it would decide to deliver this
+message. Relayer then crafts `receive_messages_proof()` transaction (aka delivery transaction) for the messages module
+instance, deployed at the target chain. Relayer provides its account id at the source chain, the proof of message (or
+several messages), the number of messages in the transaction and their cumulative dispatch weight. Once a transaction is
+mined, the message is considered "delivered".
+
+Once a message is delivered, the relayer may want to confirm delivery back to the source chain. There are two reasons
+why it would want to do that. The first is that we intentionally limit number of "delivered", but not yet "confirmed"
+messages at inbound lanes (see [What about other Constants in the Messages Module Configuration
+Trait](#What-about-other-Constants-in-the-Messages-Module-Configuration-Trait) for explanation). So at some point, the
+target chain may stop accepting new messages until relayers confirm some of these. The second is that if the relayer
+wants to be rewarded for delivery, it must prove the fact that it has actually delivered the message. And this proof may
+only be generated after the delivery transaction is mined. So relayer crafts the `receive_messages_delivery_proof()`
+transaction (aka confirmation transaction) for the messages module instance, deployed at the source chain. Once this
+transaction is mined, the message is considered "confirmed".
+
+The "confirmed" state is the final state of the message. But there's one last thing related to the message - the fact
+that it is now "confirmed" and reward has been paid to the relayer (or at least callback for this has been called), must
+be confirmed to the target chain. Otherwise, we may reach the limit of "unconfirmed" messages at the target chain and it
+will stop accepting new messages. So relayer sometimes includes a nonce of the latest "confirmed" message in the next
+`receive_messages_proof()` transaction, proving that some messages have been confirmed.
+
+## Integrating Messages Module into Runtime
+
+As it has been said above, the messages module supports both outbound and inbound message lanes. So if we will integrate
+a module in some runtime, it may act as the source chain runtime for outbound messages and as the target chain runtime
+for inbound messages. In this section, we'll sometimes refer to the chain we're currently integrating with, as "this
+chain" and the other chain as "bridged chain".
+
+Messages module doesn't simply accept transactions that are claiming that the bridged chain has some updated data for
+us. Instead of this, the module assumes that the bridged chain is able to prove that updated data in some way. The proof
+is abstracted from the module and may be of any kind. In our Substrate-to-Substrate bridge we're using runtime storage
+proofs. Other bridges may use transaction proofs, Substrate header digests or anything else that may be proved.
+
+**IMPORTANT NOTE**: everything below in this chapter describes details of the messages module configuration. But if
+you're interested in well-probed and relatively easy integration of two Substrate-based chains, you may want to look at
+the [bridge-runtime-common](../../bin/runtime-common/) crate. This crate is providing a lot of helpers for integration,
+which may be directly used from within your runtime. Then if you'll decide to change something in this scheme, get back
+here for detailed information.
+
+### General Information
+
+The messages module supports instances. Every module instance is supposed to bridge this chain and some bridged chain.
+To bridge with another chain, using another instance is suggested (this isn't forced anywhere in the code, though). Keep
+in mind, that the pallet may be used to build virtual channels between multiple chains, as we do in our [Polkadot <>
+Kusama bridge](../../docs/polkadot-kusama-bridge-overview.md). There, the pallet actually bridges only two parachains -
+Kusama Bridge Hub and Polkadot Bridge Hub. However, other Kusama and Polkadot parachains are able to send (XCM) messages
+to their Bridge Hubs. The messages will be delivered to the other side of the bridge and routed to the proper
+destination parachain within the bridged chain consensus.
+
+Message submitters may track message progress by inspecting module events. When Message is accepted, the
+`MessageAccepted` event is emitted. The event contains both message lane identifier and nonce that has been assigned to
+the message. When a message is delivered to the target chain, the `MessagesDelivered` event is emitted from the
+`receive_messages_delivery_proof()` transaction. The `MessagesDelivered` contains the message lane identifier and
+inclusive range of delivered message nonces.
+
+The pallet provides no means to get the result of message dispatch at the target chain. If that is required, it must be
+done outside of the pallet. For example, XCM messages, when dispatched, have special instructions to send some data back
+to the sender. Other dispatchers may use similar mechanism for that.
+### How to plug-in Messages Module to Send Messages to the Bridged Chain?
+
+The `pallet_bridge_messages::Config` trait has 3 main associated types that are used to work with outbound messages. The
+`pallet_bridge_messages::Config::TargetHeaderChain` defines how we see the bridged chain as the target for our outbound
+messages. It must be able to check that the bridged chain may accept our message - like that the message has size below
+maximal possible transaction size of the chain and so on. And when the relayer sends us a confirmation transaction, this
+implementation must be able to parse and verify the proof of messages delivery. Normally, you would reuse the same
+(configurable) type on all chains that are sending messages to the same bridged chain.
+
+The `pallet_bridge_messages::Config::LaneMessageVerifier` defines a single callback to verify outbound messages. The
+simplest callback may just accept all messages. But in this case you'll need to answer many questions first. Who will
+pay for the delivery and confirmation transaction? Are we sure that someone will ever deliver this message to the
+bridged chain? Are we sure that we don't bloat our runtime storage by accepting this message? What if the message is
+improperly encoded or has some fields set to invalid values? Answering all those (and similar) questions would lead to
+correct implementation.
+
+There's another thing to consider when implementing type for use in
+`pallet_bridge_messages::Config::LaneMessageVerifier`. It is whether we treat all message lanes identically, or they'll
+have different sets of verification rules? For example, you may reserve lane#1 for messages coming from some
+'wrapped-token' pallet - then you may verify in your implementation that the origin is associated with this pallet.
+Lane#2 may be reserved for 'system' messages and you may charge zero fee for such messages. You may have some rate
+limiting for messages sent over the lane#3. Or you may just verify the same rules set for all outbound messages - it is
+all up to the `pallet_bridge_messages::Config::LaneMessageVerifier` implementation.
+
+The last type is the `pallet_bridge_messages::Config::DeliveryConfirmationPayments`. When confirmation transaction is
+received, we call the `pay_reward()` method, passing the range of delivered messages. You may use the
+[`pallet-bridge-relayers`](../relayers/) pallet and its
+[`DeliveryConfirmationPaymentsAdapter`](../relayers/src/payment_adapter.rs) adapter as a possible implementation. It
+allows you to pay fixed reward for relaying the message and some of its portion for confirming delivery.
+
+### I have a Messages Module in my Runtime, but I Want to Reject all Outbound Messages. What shall I do?
+
+You should be looking at the `bp_messages::source_chain::ForbidOutboundMessages` structure
+[`bp_messages::source_chain`](../../primitives/messages/src/source_chain.rs). It implements all required traits and will
+simply reject all transactions, related to outbound messages.
+
+### How to plug-in Messages Module to Receive Messages from the Bridged Chain?
+
+The `pallet_bridge_messages::Config` trait has 2 main associated types that are used to work with inbound messages. The
+`pallet_bridge_messages::Config::SourceHeaderChain` defines how we see the bridged chain as the source of our inbound
+messages. When relayer sends us a delivery transaction, this implementation must be able to parse and verify the proof
+of messages wrapped in this transaction. Normally, you would reuse the same (configurable) type on all chains that are
+sending messages to the same bridged chain.
+
+The `pallet_bridge_messages::Config::MessageDispatch` defines a way on how to dispatch delivered messages. Apart from
+actually dispatching the message, the implementation must return the correct dispatch weight of the message before
+dispatch is called.
+
+### I have a Messages Module in my Runtime, but I Want to Reject all Inbound Messages. What shall I do?
+
+You should be looking at the `bp_messages::target_chain::ForbidInboundMessages` structure from the
+[`bp_messages::target_chain`](../../primitives/messages/src/target_chain.rs) module. It implements all required traits
+and will simply reject all transactions, related to inbound messages.
+
+### What about other Constants in the Messages Module Configuration Trait?
+
+Two settings that are used to check messages in the `send_message()` function. The
+`pallet_bridge_messages::Config::ActiveOutboundLanes` is an array of all message lanes, that may be used to send
+messages. All messages sent using other lanes are rejected. All messages that have size above
+`pallet_bridge_messages::Config::MaximalOutboundPayloadSize` will also be rejected.
+
+To be able to reward the relayer for delivering messages, we store a map of message nonces range => identifier of the
+relayer that has delivered this range at the target chain runtime storage. If a relayer delivers multiple consequent
+ranges, they're merged into single entry. So there may be more than one entry for the same relayer. Eventually, this
+whole map must be delivered back to the source chain to confirm delivery and pay rewards. So to make sure we are able to
+craft this confirmation transaction, we need to: (1) keep the size of this map below a certain limit and (2) make sure
+that the weight of processing this map is below a certain limit. Both size and processing weight mostly depend on the
+number of entries. The number of entries is limited with the
+`pallet_bridge_messages::ConfigMaxUnrewardedRelayerEntriesAtInboundLane` parameter. Processing weight also depends on
+the total number of messages that are being confirmed, because every confirmed message needs to be read. So there's
+another `pallet_bridge_messages::Config::MaxUnconfirmedMessagesAtInboundLane` parameter for that.
+
+When choosing values for these parameters, you must also keep in mind that if proof in your scheme is based on finality
+of headers (and it is the most obvious option for Substrate-based chains with finality notion), then choosing too small
+values for these parameters may cause significant delays in message delivery. That's because there are too many actors
+involved in this scheme: 1) authorities that are finalizing headers of the target chain need to finalize header with
+non-empty map; 2) the headers relayer then needs to submit this header and its finality proof to the source chain; 3)
+the messages relayer must then send confirmation transaction (storage proof of this map) to the source chain; 4) when
+the confirmation transaction will be mined at some header, source chain authorities must finalize this header; 5) the
+headers relay then needs to submit this header and its finality proof to the target chain; 6) only now the messages
+relayer may submit new messages from the source to target chain and prune the entry from the map.
+
+Delivery transaction requires the relayer to provide both number of entries and total number of messages in the map.
+This means that the module never charges an extra cost for delivering a map - the relayer would need to pay exactly for
+the number of entries+messages it has delivered. So the best guess for values of these parameters would be the pair that
+would occupy `N` percent of the maximal transaction size and weight of the source chain. The `N` should be large enough
+to process large maps, at the same time keeping reserve for future source chain upgrades.
+
+## Non-Essential Functionality
+
+There may be a special account in every runtime where the messages module is deployed. This account, named 'module
+owner', is like a module-level sudo account - he's able to halt and resume all module operations without requiring
+runtime upgrade. Calls that are related to this account are:
+- `fn set_owner()`: current module owner may call it to transfer "ownership" to another account;
+- `fn halt_operations()`: the module owner (or sudo account) may call this function to stop all module operations. After
+ this call, all message-related transactions will be rejected until further `resume_operations` call'. This call may be
+ used when something extraordinary happens with the bridge;
+- `fn resume_operations()`: module owner may call this function to resume bridge operations. The module will resume its
+ regular operations after this call.
+
+If pallet owner is not defined, the governance may be used to make those calls.
+
+## Messages Relay
+
+We have an offchain actor, who is watching for new messages and submits them to the bridged chain. It is the messages
+relay - you may look at the [crate level documentation and the code](../../relays/messages/).
diff --git a/cumulus/bridges/modules/messages/src/benchmarking.rs b/bridges/modules/messages/src/benchmarking.rs
similarity index 100%
rename from cumulus/bridges/modules/messages/src/benchmarking.rs
rename to bridges/modules/messages/src/benchmarking.rs
diff --git a/cumulus/bridges/modules/messages/src/inbound_lane.rs b/bridges/modules/messages/src/inbound_lane.rs
similarity index 100%
rename from cumulus/bridges/modules/messages/src/inbound_lane.rs
rename to bridges/modules/messages/src/inbound_lane.rs
diff --git a/cumulus/bridges/modules/messages/src/lib.rs b/bridges/modules/messages/src/lib.rs
similarity index 100%
rename from cumulus/bridges/modules/messages/src/lib.rs
rename to bridges/modules/messages/src/lib.rs
diff --git a/cumulus/bridges/modules/messages/src/mock.rs b/bridges/modules/messages/src/mock.rs
similarity index 100%
rename from cumulus/bridges/modules/messages/src/mock.rs
rename to bridges/modules/messages/src/mock.rs
diff --git a/cumulus/bridges/modules/messages/src/outbound_lane.rs b/bridges/modules/messages/src/outbound_lane.rs
similarity index 100%
rename from cumulus/bridges/modules/messages/src/outbound_lane.rs
rename to bridges/modules/messages/src/outbound_lane.rs
diff --git a/cumulus/bridges/modules/messages/src/weights.rs b/bridges/modules/messages/src/weights.rs
similarity index 100%
rename from cumulus/bridges/modules/messages/src/weights.rs
rename to bridges/modules/messages/src/weights.rs
diff --git a/cumulus/bridges/modules/messages/src/weights_ext.rs b/bridges/modules/messages/src/weights_ext.rs
similarity index 100%
rename from cumulus/bridges/modules/messages/src/weights_ext.rs
rename to bridges/modules/messages/src/weights_ext.rs
diff --git a/cumulus/bridges/modules/parachains/Cargo.toml b/bridges/modules/parachains/Cargo.toml
similarity index 71%
rename from cumulus/bridges/modules/parachains/Cargo.toml
rename to bridges/modules/parachains/Cargo.toml
index 50a838edf56db3a7b94014b692eb8575b4f9e499..4eb09ed78d17f3b4da620ac6b28645bdaab88c12 100644
--- a/cumulus/bridges/modules/parachains/Cargo.toml
+++ b/bridges/modules/parachains/Cargo.toml
@@ -20,18 +20,18 @@ pallet-bridge-grandpa = { path = "../grandpa", default-features = false }
# Substrate Dependencies
-frame-benchmarking = { path = "../../../../substrate/frame/benchmarking", default-features = false, optional = true }
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-frame-system = { path = "../../../../substrate/frame/system", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
-sp-trie = { path = "../../../../substrate/primitives/trie", default-features = false }
+frame-benchmarking = { path = "../../../substrate/frame/benchmarking", default-features = false, optional = true }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+frame-system = { path = "../../../substrate/frame/system", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
+sp-trie = { path = "../../../substrate/primitives/trie", default-features = false }
[dev-dependencies]
bp-header-chain = { path = "../../primitives/header-chain" }
bp-test-utils = { path = "../../primitives/test-utils" }
-sp-core = { path = "../../../../substrate/primitives/core" }
-sp-io = { path = "../../../../substrate/primitives/io" }
+sp-core = { path = "../../../substrate/primitives/core" }
+sp-io = { path = "../../../substrate/primitives/io" }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/modules/parachains/README.md b/bridges/modules/parachains/README.md
similarity index 99%
rename from cumulus/bridges/modules/parachains/README.md
rename to bridges/modules/parachains/README.md
index 5982c65ad3166107128b9256f89f337f8de7c69e..d3f52c791ab5899c438bf902acd85d3e8a96153a 100644
--- a/cumulus/bridges/modules/parachains/README.md
+++ b/bridges/modules/parachains/README.md
@@ -19,7 +19,7 @@ validators. Validators validate the block and register the new parachain head in
[`Heads` map](https://github.com/paritytech/polkadot/blob/88013730166ba90745ae7c9eb3e0c1be1513c7cc/runtime/parachains/src/paras/mod.rs#L645)
of the [`paras`](https://github.com/paritytech/polkadot/tree/master/runtime/parachains/src/paras) pallet,
deployed at the relay chain. Keep in mind that this pallet, deployed at a relay chain, is **NOT** a bridge pallet,
-even though the names are similar.
+even though the names are similar.
And what the bridge parachains pallet does, is simply verifying storage proofs of parachain heads within that
`Heads` map. It does that using relay chain header, that has been previously imported by the
diff --git a/cumulus/bridges/modules/parachains/src/benchmarking.rs b/bridges/modules/parachains/src/benchmarking.rs
similarity index 100%
rename from cumulus/bridges/modules/parachains/src/benchmarking.rs
rename to bridges/modules/parachains/src/benchmarking.rs
diff --git a/cumulus/bridges/modules/parachains/src/call_ext.rs b/bridges/modules/parachains/src/call_ext.rs
similarity index 100%
rename from cumulus/bridges/modules/parachains/src/call_ext.rs
rename to bridges/modules/parachains/src/call_ext.rs
diff --git a/cumulus/bridges/modules/parachains/src/lib.rs b/bridges/modules/parachains/src/lib.rs
similarity index 100%
rename from cumulus/bridges/modules/parachains/src/lib.rs
rename to bridges/modules/parachains/src/lib.rs
diff --git a/cumulus/bridges/modules/parachains/src/mock.rs b/bridges/modules/parachains/src/mock.rs
similarity index 100%
rename from cumulus/bridges/modules/parachains/src/mock.rs
rename to bridges/modules/parachains/src/mock.rs
diff --git a/cumulus/bridges/modules/parachains/src/weights.rs b/bridges/modules/parachains/src/weights.rs
similarity index 100%
rename from cumulus/bridges/modules/parachains/src/weights.rs
rename to bridges/modules/parachains/src/weights.rs
diff --git a/cumulus/bridges/modules/parachains/src/weights_ext.rs b/bridges/modules/parachains/src/weights_ext.rs
similarity index 100%
rename from cumulus/bridges/modules/parachains/src/weights_ext.rs
rename to bridges/modules/parachains/src/weights_ext.rs
diff --git a/cumulus/bridges/modules/relayers/Cargo.toml b/bridges/modules/relayers/Cargo.toml
similarity index 66%
rename from cumulus/bridges/modules/relayers/Cargo.toml
rename to bridges/modules/relayers/Cargo.toml
index 3a7a57e18018967c35c2d3b72d317787333cedad..46fc3bb43b1de23b5784179ccd2dbc31ae6c7230 100644
--- a/cumulus/bridges/modules/relayers/Cargo.toml
+++ b/bridges/modules/relayers/Cargo.toml
@@ -20,19 +20,19 @@ pallet-bridge-messages = { path = "../messages", default-features = false }
# Substrate Dependencies
-frame-benchmarking = { path = "../../../../substrate/frame/benchmarking", default-features = false, optional = true }
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-frame-system = { path = "../../../../substrate/frame/system", default-features = false }
-sp-arithmetic = { path = "../../../../substrate/primitives/arithmetic", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-benchmarking = { path = "../../../substrate/frame/benchmarking", default-features = false, optional = true }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+frame-system = { path = "../../../substrate/frame/system", default-features = false }
+sp-arithmetic = { path = "../../../substrate/primitives/arithmetic", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[dev-dependencies]
bp-runtime = { path = "../../primitives/runtime" }
-pallet-balances = { path = "../../../../substrate/frame/balances" }
-sp-core = { path = "../../../../substrate/primitives/core" }
-sp-io = { path = "../../../../substrate/primitives/io" }
-sp-runtime = { path = "../../../../substrate/primitives/runtime" }
+pallet-balances = { path = "../../../substrate/frame/balances" }
+sp-core = { path = "../../../substrate/primitives/core" }
+sp-io = { path = "../../../substrate/primitives/io" }
+sp-runtime = { path = "../../../substrate/primitives/runtime" }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/modules/relayers/README.md b/bridges/modules/relayers/README.md
similarity index 100%
rename from cumulus/bridges/modules/relayers/README.md
rename to bridges/modules/relayers/README.md
diff --git a/cumulus/bridges/modules/relayers/src/benchmarking.rs b/bridges/modules/relayers/src/benchmarking.rs
similarity index 100%
rename from cumulus/bridges/modules/relayers/src/benchmarking.rs
rename to bridges/modules/relayers/src/benchmarking.rs
diff --git a/cumulus/bridges/modules/relayers/src/lib.rs b/bridges/modules/relayers/src/lib.rs
similarity index 100%
rename from cumulus/bridges/modules/relayers/src/lib.rs
rename to bridges/modules/relayers/src/lib.rs
diff --git a/cumulus/bridges/modules/relayers/src/mock.rs b/bridges/modules/relayers/src/mock.rs
similarity index 100%
rename from cumulus/bridges/modules/relayers/src/mock.rs
rename to bridges/modules/relayers/src/mock.rs
diff --git a/cumulus/bridges/modules/relayers/src/payment_adapter.rs b/bridges/modules/relayers/src/payment_adapter.rs
similarity index 100%
rename from cumulus/bridges/modules/relayers/src/payment_adapter.rs
rename to bridges/modules/relayers/src/payment_adapter.rs
diff --git a/cumulus/bridges/modules/relayers/src/stake_adapter.rs b/bridges/modules/relayers/src/stake_adapter.rs
similarity index 100%
rename from cumulus/bridges/modules/relayers/src/stake_adapter.rs
rename to bridges/modules/relayers/src/stake_adapter.rs
diff --git a/cumulus/bridges/modules/relayers/src/weights.rs b/bridges/modules/relayers/src/weights.rs
similarity index 100%
rename from cumulus/bridges/modules/relayers/src/weights.rs
rename to bridges/modules/relayers/src/weights.rs
diff --git a/cumulus/bridges/modules/relayers/src/weights_ext.rs b/bridges/modules/relayers/src/weights_ext.rs
similarity index 100%
rename from cumulus/bridges/modules/relayers/src/weights_ext.rs
rename to bridges/modules/relayers/src/weights_ext.rs
diff --git a/cumulus/bridges/modules/xcm-bridge-hub-router/Cargo.toml b/bridges/modules/xcm-bridge-hub-router/Cargo.toml
similarity index 59%
rename from cumulus/bridges/modules/xcm-bridge-hub-router/Cargo.toml
rename to bridges/modules/xcm-bridge-hub-router/Cargo.toml
index 6ad3c57ca73a788cc09d8fb9e9b1d3510027e4c2..c61cab291e142e5e1aa4680b162d288ee62284a5 100644
--- a/cumulus/bridges/modules/xcm-bridge-hub-router/Cargo.toml
+++ b/bridges/modules/xcm-bridge-hub-router/Cargo.toml
@@ -8,7 +8,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
-log = { version = "0.4.19", default-features = false }
+log = { version = "0.4.20", default-features = false }
scale-info = { version = "2.8.0", default-features = false, features = ["bit-vec", "derive", "serde"] }
# Bridge dependencies
@@ -17,21 +17,21 @@ bp-xcm-bridge-hub-router = { path = "../../primitives/xcm-bridge-hub-router", de
# Substrate Dependencies
-frame-benchmarking = { path = "../../../../substrate/frame/benchmarking", default-features = false, optional = true }
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-frame-system = { path = "../../../../substrate/frame/system", default-features = false }
-sp-core = { path = "../../../../substrate/primitives/core", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-benchmarking = { path = "../../../substrate/frame/benchmarking", default-features = false, optional = true }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+frame-system = { path = "../../../substrate/frame/system", default-features = false }
+sp-core = { path = "../../../substrate/primitives/core", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
# Polkadot Dependencies
-xcm = { package = "staging-xcm", path = "../../../../polkadot/xcm", default-features = false }
-xcm-builder = { package = "staging-xcm-builder", path = "../../../../polkadot/xcm/xcm-builder", default-features = false }
+xcm = { package = "staging-xcm", path = "../../../polkadot/xcm", default-features = false }
+xcm-builder = { package = "staging-xcm-builder", path = "../../../polkadot/xcm/xcm-builder", default-features = false }
[dev-dependencies]
-sp-io = { path = "../../../../substrate/primitives/io" }
-sp-std = { path = "../../../../substrate/primitives/std" }
+sp-io = { path = "../../../substrate/primitives/io" }
+sp-std = { path = "../../../substrate/primitives/std" }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/modules/xcm-bridge-hub-router/src/benchmarking.rs b/bridges/modules/xcm-bridge-hub-router/src/benchmarking.rs
similarity index 100%
rename from cumulus/bridges/modules/xcm-bridge-hub-router/src/benchmarking.rs
rename to bridges/modules/xcm-bridge-hub-router/src/benchmarking.rs
diff --git a/cumulus/bridges/modules/xcm-bridge-hub-router/src/lib.rs b/bridges/modules/xcm-bridge-hub-router/src/lib.rs
similarity index 100%
rename from cumulus/bridges/modules/xcm-bridge-hub-router/src/lib.rs
rename to bridges/modules/xcm-bridge-hub-router/src/lib.rs
diff --git a/cumulus/bridges/modules/xcm-bridge-hub-router/src/mock.rs b/bridges/modules/xcm-bridge-hub-router/src/mock.rs
similarity index 99%
rename from cumulus/bridges/modules/xcm-bridge-hub-router/src/mock.rs
rename to bridges/modules/xcm-bridge-hub-router/src/mock.rs
index cd50b98a168853eec6a37c9a4806271574454cca..58df21a6d9016a70a8414b884ccedf33d7ae1524 100644
--- a/cumulus/bridges/modules/xcm-bridge-hub-router/src/mock.rs
+++ b/bridges/modules/xcm-bridge-hub-router/src/mock.rs
@@ -144,5 +144,5 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
/// Run pallet test.
pub fn run_test(test: impl FnOnce() -> T) -> T {
- new_test_ext().execute_with(|| test())
+ new_test_ext().execute_with(test)
}
diff --git a/cumulus/bridges/modules/xcm-bridge-hub-router/src/weights.rs b/bridges/modules/xcm-bridge-hub-router/src/weights.rs
similarity index 100%
rename from cumulus/bridges/modules/xcm-bridge-hub-router/src/weights.rs
rename to bridges/modules/xcm-bridge-hub-router/src/weights.rs
diff --git a/cumulus/bridges/primitives/chain-asset-hub-kusama/Cargo.toml b/bridges/primitives/chain-asset-hub-kusama/Cargo.toml
similarity index 88%
rename from cumulus/bridges/primitives/chain-asset-hub-kusama/Cargo.toml
rename to bridges/primitives/chain-asset-hub-kusama/Cargo.toml
index 557f56bfb62e2b26c80a48e99f8a4c7e0898d76f..adb9a57bc134729ab753e3006093207e0de32e61 100644
--- a/cumulus/bridges/primitives/chain-asset-hub-kusama/Cargo.toml
+++ b/bridges/primitives/chain-asset-hub-kusama/Cargo.toml
@@ -11,7 +11,7 @@ codec = { package = "parity-scale-codec", version = "3.1.5", default-features =
scale-info = { version = "2.9.0", default-features = false, features = ["derive"] }
# Substrate Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
# Bridge Dependencies
bp-xcm-bridge-hub-router = { path = "../xcm-bridge-hub-router", default-features = false }
diff --git a/cumulus/bridges/primitives/chain-asset-hub-kusama/src/lib.rs b/bridges/primitives/chain-asset-hub-kusama/src/lib.rs
similarity index 100%
rename from cumulus/bridges/primitives/chain-asset-hub-kusama/src/lib.rs
rename to bridges/primitives/chain-asset-hub-kusama/src/lib.rs
diff --git a/cumulus/bridges/primitives/chain-asset-hub-polkadot/Cargo.toml b/bridges/primitives/chain-asset-hub-polkadot/Cargo.toml
similarity index 79%
rename from cumulus/bridges/primitives/chain-asset-hub-polkadot/Cargo.toml
rename to bridges/primitives/chain-asset-hub-polkadot/Cargo.toml
index 6fe9ffab44b800bd2308635a6ef91572fd2ded3d..857ead15b0ddf79b82fd7b8c01da767419e22e2b 100644
--- a/cumulus/bridges/primitives/chain-asset-hub-polkadot/Cargo.toml
+++ b/bridges/primitives/chain-asset-hub-polkadot/Cargo.toml
@@ -11,8 +11,8 @@ codec = { package = "parity-scale-codec", version = "3.1.5", default-features =
scale-info = { version = "2.9.0", default-features = false, features = ["derive"] }
# Substrate Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
# Bridge Dependencies
bp-xcm-bridge-hub-router = { path = "../xcm-bridge-hub-router", default-features = false }
diff --git a/cumulus/bridges/primitives/chain-asset-hub-polkadot/src/lib.rs b/bridges/primitives/chain-asset-hub-polkadot/src/lib.rs
similarity index 100%
rename from cumulus/bridges/primitives/chain-asset-hub-polkadot/src/lib.rs
rename to bridges/primitives/chain-asset-hub-polkadot/src/lib.rs
diff --git a/cumulus/bridges/primitives/chain-bridge-hub-cumulus/Cargo.toml b/bridges/primitives/chain-bridge-hub-cumulus/Cargo.toml
similarity index 62%
rename from cumulus/bridges/primitives/chain-bridge-hub-cumulus/Cargo.toml
rename to bridges/primitives/chain-bridge-hub-cumulus/Cargo.toml
index 865cead3c878023cce8fefe3b4c64ca0c4b4c13c..24cf7236d45333254dd62073dfebcd85ec526362 100644
--- a/cumulus/bridges/primitives/chain-bridge-hub-cumulus/Cargo.toml
+++ b/bridges/primitives/chain-bridge-hub-cumulus/Cargo.toml
@@ -15,13 +15,13 @@ bp-runtime = { path = "../runtime", default-features = false }
# Substrate Based Dependencies
-frame-system = { path = "../../../../substrate/frame/system", default-features = false }
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-sp-api = { path = "../../../../substrate/primitives/api", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-system = { path = "../../../substrate/frame/system", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+sp-api = { path = "../../../substrate/primitives/api", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
# Polkadot Dependencies
-polkadot-primitives = { path = "../../../../polkadot/primitives", default-features = false }
+polkadot-primitives = { path = "../../../polkadot/primitives", default-features = false }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs b/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs
similarity index 72%
rename from cumulus/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs
rename to bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs
index feef61c7f20a1655f86ffbcc52809bfd9fef41e5..c1dbc6db36f644c3d123a8c3c5930fce31973146 100644
--- a/cumulus/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs
+++ b/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs
@@ -23,10 +23,9 @@ pub use bp_polkadot_core::{
};
use bp_messages::*;
+use bp_polkadot_core::SuffixedCommonSignedExtension;
use bp_runtime::extensions::{
- BridgeRejectObsoleteHeadersAndMessages, ChargeTransactionPayment, CheckEra, CheckGenesis,
- CheckNonZeroSender, CheckNonce, CheckSpecVersion, CheckTxVersion, CheckWeight,
- GenericSignedExtension, RefundBridgedParachainMessagesSchema,
+ BridgeRejectObsoleteHeadersAndMessages, RefundBridgedParachainMessagesSchema,
};
use frame_support::{
dispatch::DispatchClass,
@@ -133,88 +132,8 @@ pub const MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX: MessageNonce = 1024;
/// analysis (like the one above).
pub const MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX: MessageNonce = 4096;
-/// Extra signed extension data that is used by all bridge hubs.
-pub type SignedExtra = (
- CheckNonZeroSender,
- CheckSpecVersion,
- CheckTxVersion,
- CheckGenesis,
- CheckEra,
- CheckNonce,
- CheckWeight,
- ChargeTransactionPayment,
+/// Signed extension that is used by all bridge hubs.
+pub type SignedExtension = SuffixedCommonSignedExtension<(
BridgeRejectObsoleteHeadersAndMessages,
RefundBridgedParachainMessagesSchema,
-);
-
-/// Signed extension that is used by all bridge hubs.
-pub type SignedExtension = GenericSignedExtension;
-
-/// Helper trait to define some extra methods on bridge hubs signed extension (and
-/// overcome Rust limitations).
-pub trait BridgeHubSignedExtension {
- /// Create signed extension from its components.
- fn from_params(
- spec_version: u32,
- transaction_version: u32,
- era: bp_runtime::TransactionEra,
- genesis_hash: Hash,
- nonce: Nonce,
- tip: Balance,
- ) -> Self;
-
- /// Return transaction nonce.
- fn nonce(&self) -> Nonce;
-
- /// Return transaction tip.
- fn tip(&self) -> Balance;
-}
-
-impl BridgeHubSignedExtension for SignedExtension {
- /// Create signed extension from its components.
- fn from_params(
- spec_version: u32,
- transaction_version: u32,
- era: bp_runtime::TransactionEra,
- genesis_hash: Hash,
- nonce: Nonce,
- tip: Balance,
- ) -> Self {
- GenericSignedExtension::new(
- (
- (), // non-zero sender
- (), // spec version
- (), // tx version
- (), // genesis
- era.frame_era(), // era
- nonce.into(), // nonce (compact encoding)
- (), // Check weight
- tip.into(), // transaction payment / tip (compact encoding)
- (), // bridge reject obsolete headers and msgs
- (), // bridge reward to relayer for message passing
- ),
- Some((
- (),
- spec_version,
- transaction_version,
- genesis_hash,
- era.signed_payload(genesis_hash),
- (),
- (),
- (),
- (),
- (),
- )),
- )
- }
-
- /// Return transaction nonce.
- fn nonce(&self) -> Nonce {
- self.payload.5 .0
- }
-
- /// Return transaction tip.
- fn tip(&self) -> Balance {
- self.payload.7 .0
- }
-}
+)>;
diff --git a/cumulus/bridges/primitives/chain-bridge-hub-kusama/Cargo.toml b/bridges/primitives/chain-bridge-hub-kusama/Cargo.toml
similarity index 66%
rename from cumulus/bridges/primitives/chain-bridge-hub-kusama/Cargo.toml
rename to bridges/primitives/chain-bridge-hub-kusama/Cargo.toml
index 92b0c9bf447562b4523077a996c6ea702ccf5af7..387f5e8ade6e7dc501159266a94168dd7055a8c1 100644
--- a/cumulus/bridges/primitives/chain-bridge-hub-kusama/Cargo.toml
+++ b/bridges/primitives/chain-bridge-hub-kusama/Cargo.toml
@@ -15,10 +15,10 @@ bp-messages = { path = "../messages", default-features = false }
# Substrate Based Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-sp-api = { path = "../../../../substrate/primitives/api", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+sp-api = { path = "../../../substrate/primitives/api", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs b/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs
similarity index 100%
rename from cumulus/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs
rename to bridges/primitives/chain-bridge-hub-kusama/src/lib.rs
diff --git a/cumulus/bridges/primitives/chain-bridge-hub-polkadot/Cargo.toml b/bridges/primitives/chain-bridge-hub-polkadot/Cargo.toml
similarity index 66%
rename from cumulus/bridges/primitives/chain-bridge-hub-polkadot/Cargo.toml
rename to bridges/primitives/chain-bridge-hub-polkadot/Cargo.toml
index 7468d5be60d3f53e80ee8c3b36bddaeea235a7d4..40b386e22d224da198043f44210a8c1de65af3ac 100644
--- a/cumulus/bridges/primitives/chain-bridge-hub-polkadot/Cargo.toml
+++ b/bridges/primitives/chain-bridge-hub-polkadot/Cargo.toml
@@ -16,10 +16,10 @@ bp-messages = { path = "../messages", default-features = false }
# Substrate Based Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-sp-api = { path = "../../../../substrate/primitives/api", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+sp-api = { path = "../../../substrate/primitives/api", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs b/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs
similarity index 100%
rename from cumulus/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs
rename to bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs
diff --git a/cumulus/bridges/primitives/chain-bridge-hub-rococo/Cargo.toml b/bridges/primitives/chain-bridge-hub-rococo/Cargo.toml
similarity index 66%
rename from cumulus/bridges/primitives/chain-bridge-hub-rococo/Cargo.toml
rename to bridges/primitives/chain-bridge-hub-rococo/Cargo.toml
index 8dde903701c7c6dd900d9b6a93038b1262bfd1de..05b8163e9fcaacc8f32c0b45bfafffc882e0f1be 100644
--- a/cumulus/bridges/primitives/chain-bridge-hub-rococo/Cargo.toml
+++ b/bridges/primitives/chain-bridge-hub-rococo/Cargo.toml
@@ -15,10 +15,10 @@ bp-messages = { path = "../messages", default-features = false }
# Substrate Based Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-sp-api = { path = "../../../../substrate/primitives/api", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+sp-api = { path = "../../../substrate/primitives/api", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs b/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs
similarity index 100%
rename from cumulus/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs
rename to bridges/primitives/chain-bridge-hub-rococo/src/lib.rs
diff --git a/cumulus/bridges/primitives/chain-bridge-hub-wococo/Cargo.toml b/bridges/primitives/chain-bridge-hub-wococo/Cargo.toml
similarity index 66%
rename from cumulus/bridges/primitives/chain-bridge-hub-wococo/Cargo.toml
rename to bridges/primitives/chain-bridge-hub-wococo/Cargo.toml
index c93cdad5110b484488c0d661c894e612557b559b..17c134f4412f7d74a45e089c920bd260bcd95008 100644
--- a/cumulus/bridges/primitives/chain-bridge-hub-wococo/Cargo.toml
+++ b/bridges/primitives/chain-bridge-hub-wococo/Cargo.toml
@@ -16,10 +16,10 @@ bp-messages = { path = "../messages", default-features = false }
# Substrate Based Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-sp-api = { path = "../../../../substrate/primitives/api", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+sp-api = { path = "../../../substrate/primitives/api", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs b/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs
similarity index 100%
rename from cumulus/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs
rename to bridges/primitives/chain-bridge-hub-wococo/src/lib.rs
diff --git a/cumulus/bridges/primitives/chain-kusama/Cargo.toml b/bridges/primitives/chain-kusama/Cargo.toml
similarity index 71%
rename from cumulus/bridges/primitives/chain-kusama/Cargo.toml
rename to bridges/primitives/chain-kusama/Cargo.toml
index e404bdb3d94f17bfff662e7c33c43dc9d71c44f3..2d63c3f374fb50c94e2572c09511bf20d63b61e4 100644
--- a/cumulus/bridges/primitives/chain-kusama/Cargo.toml
+++ b/bridges/primitives/chain-kusama/Cargo.toml
@@ -16,9 +16,9 @@ bp-runtime = { path = "../runtime", default-features = false }
# Substrate Based Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-sp-api = { path = "../../../../substrate/primitives/api", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+sp-api = { path = "../../../substrate/primitives/api", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/primitives/chain-kusama/src/lib.rs b/bridges/primitives/chain-kusama/src/lib.rs
similarity index 96%
rename from cumulus/bridges/primitives/chain-kusama/src/lib.rs
rename to bridges/primitives/chain-kusama/src/lib.rs
index e234a87b6cf680e1b0b2aba39d04704b85b8c896..8c3fbd9c203e5e81ebfc248259cd823255d826f2 100644
--- a/cumulus/bridges/primitives/chain-kusama/src/lib.rs
+++ b/bridges/primitives/chain-kusama/src/lib.rs
@@ -57,6 +57,9 @@ impl ChainWithGrandpa for Kusama {
const AVERAGE_HEADER_SIZE_IN_JUSTIFICATION: u32 = AVERAGE_HEADER_SIZE_IN_JUSTIFICATION;
}
+// The SignedExtension used by Kusama.
+pub use bp_polkadot_core::CommonSignedExtension as SignedExtension;
+
/// Name of the parachains pallet in the Kusama runtime.
pub const PARAS_PALLET_NAME: &str = "Paras";
diff --git a/cumulus/bridges/primitives/chain-polkadot/Cargo.toml b/bridges/primitives/chain-polkadot/Cargo.toml
similarity index 71%
rename from cumulus/bridges/primitives/chain-polkadot/Cargo.toml
rename to bridges/primitives/chain-polkadot/Cargo.toml
index 4d9bf8c182f9e38db8868126f76531f12146e3f9..539b10ef9c68f490756d4f7e0453b25c9b7fc5c7 100644
--- a/cumulus/bridges/primitives/chain-polkadot/Cargo.toml
+++ b/bridges/primitives/chain-polkadot/Cargo.toml
@@ -16,9 +16,9 @@ bp-runtime = { path = "../runtime", default-features = false }
# Substrate Based Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-sp-api = { path = "../../../../substrate/primitives/api", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+sp-api = { path = "../../../substrate/primitives/api", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/primitives/chain-polkadot/src/lib.rs b/bridges/primitives/chain-polkadot/src/lib.rs
similarity index 92%
rename from cumulus/bridges/primitives/chain-polkadot/src/lib.rs
rename to bridges/primitives/chain-polkadot/src/lib.rs
index 9585fd4d71634ea9af59d6a64206e7dcfc3c80ca..d1d6f74543121afb47c5fdc423fd29aae5e2615e 100644
--- a/cumulus/bridges/primitives/chain-polkadot/src/lib.rs
+++ b/bridges/primitives/chain-polkadot/src/lib.rs
@@ -21,7 +21,7 @@
pub use bp_polkadot_core::*;
use bp_header_chain::ChainWithGrandpa;
-use bp_runtime::{decl_bridge_finality_runtime_apis, Chain};
+use bp_runtime::{decl_bridge_finality_runtime_apis, extensions::PrevalidateAttests, Chain};
use frame_support::weights::Weight;
use sp_std::prelude::Vec;
@@ -57,6 +57,9 @@ impl ChainWithGrandpa for Polkadot {
const AVERAGE_HEADER_SIZE_IN_JUSTIFICATION: u32 = AVERAGE_HEADER_SIZE_IN_JUSTIFICATION;
}
+/// The SignedExtension used by Polkadot.
+pub type SignedExtension = SuffixedCommonSignedExtension;
+
/// Name of the parachains pallet in the Polkadot runtime.
pub const PARAS_PALLET_NAME: &str = "Paras";
diff --git a/cumulus/bridges/primitives/chain-rococo/Cargo.toml b/bridges/primitives/chain-rococo/Cargo.toml
similarity index 71%
rename from cumulus/bridges/primitives/chain-rococo/Cargo.toml
rename to bridges/primitives/chain-rococo/Cargo.toml
index 72c6d4c03b66641b97244a0d9ff67ee666d44348..3c4d3917bc219bfd7dd65ec9e8a0c283fe834e49 100644
--- a/cumulus/bridges/primitives/chain-rococo/Cargo.toml
+++ b/bridges/primitives/chain-rococo/Cargo.toml
@@ -16,9 +16,9 @@ bp-runtime = { path = "../runtime", default-features = false }
# Substrate Based Dependencies
-sp-api = { path = "../../../../substrate/primitives/api", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
+sp-api = { path = "../../../substrate/primitives/api", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/primitives/chain-rococo/src/lib.rs b/bridges/primitives/chain-rococo/src/lib.rs
similarity index 96%
rename from cumulus/bridges/primitives/chain-rococo/src/lib.rs
rename to bridges/primitives/chain-rococo/src/lib.rs
index cf7cd16990f8642fbe039310d54de36b5859330e..1589d14ea5143da0bc0244b23f502a2b99cf9233 100644
--- a/cumulus/bridges/primitives/chain-rococo/src/lib.rs
+++ b/bridges/primitives/chain-rococo/src/lib.rs
@@ -61,6 +61,9 @@ parameter_types! {
pub const SS58Prefix: u8 = 42;
}
+// The SignedExtension used by Rococo.
+pub use bp_polkadot_core::CommonSignedExtension as SignedExtension;
+
/// Name of the parachains pallet in the Rococo runtime.
pub const PARAS_PALLET_NAME: &str = "Paras";
diff --git a/cumulus/bridges/primitives/chain-wococo/Cargo.toml b/bridges/primitives/chain-wococo/Cargo.toml
similarity index 73%
rename from cumulus/bridges/primitives/chain-wococo/Cargo.toml
rename to bridges/primitives/chain-wococo/Cargo.toml
index f7feb7f96eb17b7f1f16c5abc77904a3cbc26c58..05901821b366b71d40d9c28392150172be44a0b7 100644
--- a/cumulus/bridges/primitives/chain-wococo/Cargo.toml
+++ b/bridges/primitives/chain-wococo/Cargo.toml
@@ -17,9 +17,9 @@ bp-rococo = { path = "../chain-rococo", default-features = false }
# Substrate Based Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-sp-api = { path = "../../../../substrate/primitives/api", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+sp-api = { path = "../../../substrate/primitives/api", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/primitives/chain-wococo/src/lib.rs b/bridges/primitives/chain-wococo/src/lib.rs
similarity index 96%
rename from cumulus/bridges/primitives/chain-wococo/src/lib.rs
rename to bridges/primitives/chain-wococo/src/lib.rs
index c64451993ee7a8bba32b7f7cd7e00cbeab5dd048..5b5bde82690442c3a2c26b424163eeb58b5892e9 100644
--- a/cumulus/bridges/primitives/chain-wococo/src/lib.rs
+++ b/bridges/primitives/chain-wococo/src/lib.rs
@@ -60,6 +60,9 @@ impl ChainWithGrandpa for Wococo {
const AVERAGE_HEADER_SIZE_IN_JUSTIFICATION: u32 = AVERAGE_HEADER_SIZE_IN_JUSTIFICATION;
}
+// The SignedExtension used by Wococo.
+pub use bp_rococo::CommonSignedExtension as SignedExtension;
+
/// Name of the With-Wococo GRANDPA pallet instance that is deployed at bridged chains.
pub const WITH_WOCOCO_GRANDPA_PALLET_NAME: &str = "BridgeWococoGrandpa";
diff --git a/cumulus/bridges/primitives/header-chain/Cargo.toml b/bridges/primitives/header-chain/Cargo.toml
similarity index 66%
rename from cumulus/bridges/primitives/header-chain/Cargo.toml
rename to bridges/primitives/header-chain/Cargo.toml
index a7b53b0336dcc59c88bfd828e3af75b540cfe551..e3e83235960a8d1565d5be040ce222b632e95876 100644
--- a/cumulus/bridges/primitives/header-chain/Cargo.toml
+++ b/bridges/primitives/header-chain/Cargo.toml
@@ -18,11 +18,11 @@ bp-runtime = { path = "../runtime", default-features = false }
# Substrate Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-sp-core = { path = "../../../../substrate/primitives/core", default-features = false, features = ["serde"] }
-sp-consensus-grandpa = { path = "../../../../substrate/primitives/consensus/grandpa", default-features = false, features = ["serde"] }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false, features = ["serde"] }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+sp-core = { path = "../../../substrate/primitives/core", default-features = false, features = ["serde"] }
+sp-consensus-grandpa = { path = "../../../substrate/primitives/consensus/grandpa", default-features = false, features = ["serde"] }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false, features = ["serde"] }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[dev-dependencies]
bp-test-utils = { path = "../test-utils" }
diff --git a/cumulus/bridges/primitives/header-chain/src/justification/mod.rs b/bridges/primitives/header-chain/src/justification/mod.rs
similarity index 97%
rename from cumulus/bridges/primitives/header-chain/src/justification/mod.rs
rename to bridges/primitives/header-chain/src/justification/mod.rs
index 24c453a0790c90c04b4573a85a66a276a8e6fa89..72a5f68918d9703babe1e9c263f9148c57df4340 100644
--- a/cumulus/bridges/primitives/header-chain/src/justification/mod.rs
+++ b/bridges/primitives/header-chain/src/justification/mod.rs
@@ -97,7 +97,11 @@ impl GrandpaJustification {
}
}
-impl crate::FinalityProof for GrandpaJustification {
+impl crate::FinalityProof for GrandpaJustification {
+ fn target_header_hash(&self) -> H::Hash {
+ self.commit.target_hash
+ }
+
fn target_header_number(&self) -> H::Number {
self.commit.target_number
}
diff --git a/cumulus/bridges/primitives/header-chain/src/justification/verification/equivocation.rs b/bridges/primitives/header-chain/src/justification/verification/equivocation.rs
similarity index 100%
rename from cumulus/bridges/primitives/header-chain/src/justification/verification/equivocation.rs
rename to bridges/primitives/header-chain/src/justification/verification/equivocation.rs
diff --git a/cumulus/bridges/primitives/header-chain/src/justification/verification/mod.rs b/bridges/primitives/header-chain/src/justification/verification/mod.rs
similarity index 100%
rename from cumulus/bridges/primitives/header-chain/src/justification/verification/mod.rs
rename to bridges/primitives/header-chain/src/justification/verification/mod.rs
diff --git a/cumulus/bridges/primitives/header-chain/src/justification/verification/optimizer.rs b/bridges/primitives/header-chain/src/justification/verification/optimizer.rs
similarity index 100%
rename from cumulus/bridges/primitives/header-chain/src/justification/verification/optimizer.rs
rename to bridges/primitives/header-chain/src/justification/verification/optimizer.rs
diff --git a/cumulus/bridges/primitives/header-chain/src/justification/verification/strict.rs b/bridges/primitives/header-chain/src/justification/verification/strict.rs
similarity index 100%
rename from cumulus/bridges/primitives/header-chain/src/justification/verification/strict.rs
rename to bridges/primitives/header-chain/src/justification/verification/strict.rs
diff --git a/cumulus/bridges/primitives/header-chain/src/lib.rs b/bridges/primitives/header-chain/src/lib.rs
similarity index 98%
rename from cumulus/bridges/primitives/header-chain/src/lib.rs
rename to bridges/primitives/header-chain/src/lib.rs
index 7008dfa6063aedaa2d4869eef87f3a076a7b2380..d2c7ec0759e884713cb37a871bbcc65cabd256af 100644
--- a/cumulus/bridges/primitives/header-chain/src/lib.rs
+++ b/bridges/primitives/header-chain/src/lib.rs
@@ -127,7 +127,10 @@ pub struct InitializationData {
}
/// Abstract finality proof that is justifying block finality.
-pub trait FinalityProof: Clone + Send + Sync + Debug {
+pub trait FinalityProof: Clone + Send + Sync + Debug {
+ /// Return hash of header that this proof is generated for.
+ fn target_header_hash(&self) -> Hash;
+
/// Return number of header that this proof is generated for.
fn target_header_number(&self) -> Number;
}
@@ -209,7 +212,7 @@ impl TryFrom> for HeaderGrandpa
/// Helper trait for finding equivocations in finality proofs.
pub trait FindEquivocations {
/// The type returned when encountering an error while looking for equivocations.
- type Error;
+ type Error: Debug;
/// Find equivocations.
fn find_equivocations(
diff --git a/cumulus/bridges/primitives/header-chain/src/storage_keys.rs b/bridges/primitives/header-chain/src/storage_keys.rs
similarity index 100%
rename from cumulus/bridges/primitives/header-chain/src/storage_keys.rs
rename to bridges/primitives/header-chain/src/storage_keys.rs
diff --git a/cumulus/bridges/primitives/header-chain/tests/implementation_match.rs b/bridges/primitives/header-chain/tests/implementation_match.rs
similarity index 100%
rename from cumulus/bridges/primitives/header-chain/tests/implementation_match.rs
rename to bridges/primitives/header-chain/tests/implementation_match.rs
diff --git a/cumulus/bridges/primitives/header-chain/tests/justification/equivocation.rs b/bridges/primitives/header-chain/tests/justification/equivocation.rs
similarity index 100%
rename from cumulus/bridges/primitives/header-chain/tests/justification/equivocation.rs
rename to bridges/primitives/header-chain/tests/justification/equivocation.rs
diff --git a/cumulus/bridges/primitives/header-chain/tests/justification/optimizer.rs b/bridges/primitives/header-chain/tests/justification/optimizer.rs
similarity index 100%
rename from cumulus/bridges/primitives/header-chain/tests/justification/optimizer.rs
rename to bridges/primitives/header-chain/tests/justification/optimizer.rs
diff --git a/cumulus/bridges/primitives/header-chain/tests/justification/strict.rs b/bridges/primitives/header-chain/tests/justification/strict.rs
similarity index 100%
rename from cumulus/bridges/primitives/header-chain/tests/justification/strict.rs
rename to bridges/primitives/header-chain/tests/justification/strict.rs
diff --git a/cumulus/bridges/primitives/header-chain/tests/tests.rs b/bridges/primitives/header-chain/tests/tests.rs
similarity index 100%
rename from cumulus/bridges/primitives/header-chain/tests/tests.rs
rename to bridges/primitives/header-chain/tests/tests.rs
diff --git a/cumulus/bridges/primitives/messages/Cargo.toml b/bridges/primitives/messages/Cargo.toml
similarity index 78%
rename from cumulus/bridges/primitives/messages/Cargo.toml
rename to bridges/primitives/messages/Cargo.toml
index b1fa6d575aeb60a98c879ac0d4320b2d213408da..b30d6d2559f7916e79f2a3aa2c83ff66298bb24c 100644
--- a/cumulus/bridges/primitives/messages/Cargo.toml
+++ b/bridges/primitives/messages/Cargo.toml
@@ -18,9 +18,9 @@ bp-header-chain = { path = "../header-chain", default-features = false }
# Substrate Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-sp-core = { path = "../../../../substrate/primitives/core", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+sp-core = { path = "../../../substrate/primitives/core", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[dev-dependencies]
hex = "0.4"
diff --git a/cumulus/bridges/primitives/messages/src/lib.rs b/bridges/primitives/messages/src/lib.rs
similarity index 100%
rename from cumulus/bridges/primitives/messages/src/lib.rs
rename to bridges/primitives/messages/src/lib.rs
diff --git a/cumulus/bridges/primitives/messages/src/source_chain.rs b/bridges/primitives/messages/src/source_chain.rs
similarity index 100%
rename from cumulus/bridges/primitives/messages/src/source_chain.rs
rename to bridges/primitives/messages/src/source_chain.rs
diff --git a/cumulus/bridges/primitives/messages/src/storage_keys.rs b/bridges/primitives/messages/src/storage_keys.rs
similarity index 100%
rename from cumulus/bridges/primitives/messages/src/storage_keys.rs
rename to bridges/primitives/messages/src/storage_keys.rs
diff --git a/cumulus/bridges/primitives/messages/src/target_chain.rs b/bridges/primitives/messages/src/target_chain.rs
similarity index 100%
rename from cumulus/bridges/primitives/messages/src/target_chain.rs
rename to bridges/primitives/messages/src/target_chain.rs
diff --git a/cumulus/bridges/primitives/parachains/Cargo.toml b/bridges/primitives/parachains/Cargo.toml
similarity index 72%
rename from cumulus/bridges/primitives/parachains/Cargo.toml
rename to bridges/primitives/parachains/Cargo.toml
index 978296954bb7f2bcc716018eaa232f03562e6e89..ca69523dde37a68ea75dfbc23b5258d04c5510b9 100644
--- a/cumulus/bridges/primitives/parachains/Cargo.toml
+++ b/bridges/primitives/parachains/Cargo.toml
@@ -19,10 +19,10 @@ bp-runtime = { path = "../runtime", default-features = false }
# Substrate dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-sp-core = { path = "../../../../substrate/primitives/core", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+sp-core = { path = "../../../substrate/primitives/core", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/primitives/parachains/src/lib.rs b/bridges/primitives/parachains/src/lib.rs
similarity index 100%
rename from cumulus/bridges/primitives/parachains/src/lib.rs
rename to bridges/primitives/parachains/src/lib.rs
diff --git a/cumulus/bridges/primitives/polkadot-core/Cargo.toml b/bridges/primitives/polkadot-core/Cargo.toml
similarity index 69%
rename from cumulus/bridges/primitives/polkadot-core/Cargo.toml
rename to bridges/primitives/polkadot-core/Cargo.toml
index 2563adaf219c9909c5e45f97fa3003057cc6cabc..aa7eb8024fbf2c7613264af8daa5fefe0b24f7cc 100644
--- a/cumulus/bridges/primitives/polkadot-core/Cargo.toml
+++ b/bridges/primitives/polkadot-core/Cargo.toml
@@ -19,11 +19,11 @@ bp-runtime = { path = "../runtime", default-features = false }
# Substrate Based Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-frame-system = { path = "../../../../substrate/frame/system", default-features = false }
-sp-core = { path = "../../../../substrate/primitives/core", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+frame-system = { path = "../../../substrate/frame/system", default-features = false }
+sp-core = { path = "../../../substrate/primitives/core", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[dev-dependencies]
hex = "0.4"
diff --git a/cumulus/bridges/primitives/polkadot-core/src/lib.rs b/bridges/primitives/polkadot-core/src/lib.rs
similarity index 81%
rename from cumulus/bridges/primitives/polkadot-core/src/lib.rs
rename to bridges/primitives/polkadot-core/src/lib.rs
index b35d97ec79ae2275a5ab885a2f7eb4948e45969d..af39b5ab9babae2b2e6858bff83eaf8c29ef74bb 100644
--- a/cumulus/bridges/primitives/polkadot-core/src/lib.rs
+++ b/bridges/primitives/polkadot-core/src/lib.rs
@@ -17,7 +17,15 @@
#![cfg_attr(not(feature = "std"), no_std)]
use bp_messages::MessageNonce;
-use bp_runtime::{Chain, EncodedOrDecodedCall, StorageMapKeyProvider};
+use bp_runtime::{
+ self,
+ extensions::{
+ ChargeTransactionPayment, CheckEra, CheckGenesis, CheckNonZeroSender, CheckNonce,
+ CheckSpecVersion, CheckTxVersion, CheckWeight, GenericSignedExtension,
+ SignedExtensionSchema,
+ },
+ Chain, EncodedOrDecodedCall, StorageMapKeyProvider, TransactionEra,
+};
use frame_support::{
dispatch::DispatchClass,
parameter_types,
@@ -272,6 +280,99 @@ impl AccountInfoStorageMapKeyProvider {
}
}
+/// Extra signed extension data that is used by most chains.
+pub type CommonSignedExtra = (
+ CheckNonZeroSender,
+ CheckSpecVersion,
+ CheckTxVersion,
+ CheckGenesis,
+ CheckEra,
+ CheckNonce,
+ CheckWeight,
+ ChargeTransactionPayment,
+);
+
+/// Extra signed extension data that starts with `CommonSignedExtra`.
+pub type SuffixedCommonSignedExtension =
+ GenericSignedExtension<(CommonSignedExtra, Suffix)>;
+
+/// Helper trait to define some extra methods on `SuffixedCommonSignedExtension`.
+pub trait SuffixedCommonSignedExtensionExt {
+ /// Create signed extension from its components.
+ fn from_params(
+ spec_version: u32,
+ transaction_version: u32,
+ era: TransactionEra,
+ genesis_hash: Hash,
+ nonce: Nonce,
+ tip: Balance,
+ extra: (Suffix::Payload, Suffix::AdditionalSigned),
+ ) -> Self;
+
+ /// Return transaction nonce.
+ fn nonce(&self) -> Nonce;
+
+ /// Return transaction tip.
+ fn tip(&self) -> Balance;
+}
+
+impl SuffixedCommonSignedExtensionExt for SuffixedCommonSignedExtension
+where
+ Suffix: SignedExtensionSchema,
+{
+ fn from_params(
+ spec_version: u32,
+ transaction_version: u32,
+ era: TransactionEra,
+ genesis_hash: Hash,
+ nonce: Nonce,
+ tip: Balance,
+ extra: (Suffix::Payload, Suffix::AdditionalSigned),
+ ) -> Self {
+ GenericSignedExtension::new(
+ (
+ (
+ (), // non-zero sender
+ (), // spec version
+ (), // tx version
+ (), // genesis
+ era.frame_era(), // era
+ nonce.into(), // nonce (compact encoding)
+ (), // Check weight
+ tip.into(), // transaction payment / tip (compact encoding)
+ ),
+ extra.0,
+ ),
+ Some((
+ (
+ (),
+ spec_version,
+ transaction_version,
+ genesis_hash,
+ era.signed_payload(genesis_hash),
+ (),
+ (),
+ (),
+ ),
+ extra.1,
+ )),
+ )
+ }
+
+ fn nonce(&self) -> Nonce {
+ let common_payload = self.payload.0;
+ common_payload.5 .0
+ }
+
+ fn tip(&self) -> Balance {
+ let common_payload = self.payload.0;
+ common_payload.7 .0
+ }
+}
+
+/// Signed extension that is used by most chains.
+pub type CommonSignedExtension = SuffixedCommonSignedExtension<()>;
+
#[cfg(test)]
mod tests {
use super::*;
diff --git a/cumulus/bridges/primitives/polkadot-core/src/parachains.rs b/bridges/primitives/polkadot-core/src/parachains.rs
similarity index 100%
rename from cumulus/bridges/primitives/polkadot-core/src/parachains.rs
rename to bridges/primitives/polkadot-core/src/parachains.rs
diff --git a/cumulus/bridges/primitives/relayers/Cargo.toml b/bridges/primitives/relayers/Cargo.toml
similarity index 74%
rename from cumulus/bridges/primitives/relayers/Cargo.toml
rename to bridges/primitives/relayers/Cargo.toml
index bc674d4cb773682acdae3e7f90e546dd239cd6fb..99cd79c68417205f11d329bcce8637022aaa6e51 100644
--- a/cumulus/bridges/primitives/relayers/Cargo.toml
+++ b/bridges/primitives/relayers/Cargo.toml
@@ -17,9 +17,9 @@ bp-runtime = { path = "../runtime", default-features = false }
# Substrate Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
[dev-dependencies]
hex = "0.4"
diff --git a/cumulus/bridges/primitives/relayers/src/lib.rs b/bridges/primitives/relayers/src/lib.rs
similarity index 100%
rename from cumulus/bridges/primitives/relayers/src/lib.rs
rename to bridges/primitives/relayers/src/lib.rs
diff --git a/cumulus/bridges/primitives/relayers/src/registration.rs b/bridges/primitives/relayers/src/registration.rs
similarity index 100%
rename from cumulus/bridges/primitives/relayers/src/registration.rs
rename to bridges/primitives/relayers/src/registration.rs
diff --git a/cumulus/bridges/primitives/runtime/Cargo.toml b/bridges/primitives/runtime/Cargo.toml
similarity index 57%
rename from cumulus/bridges/primitives/runtime/Cargo.toml
rename to bridges/primitives/runtime/Cargo.toml
index f6134d6e3328004ff1e7cc50128abfe75dd5d014..4454066b59faed0d57b1ab8d06f619949007b5d4 100644
--- a/cumulus/bridges/primitives/runtime/Cargo.toml
+++ b/bridges/primitives/runtime/Cargo.toml
@@ -17,15 +17,15 @@ serde = { version = "1.0", default-features = false, features = ["alloc", "deriv
# Substrate Dependencies
-frame-support = { path = "../../../../substrate/frame/support", default-features = false }
-frame-system = { path = "../../../../substrate/frame/system", default-features = false }
-sp-core = { path = "../../../../substrate/primitives/core", default-features = false }
-sp-io = { path = "../../../../substrate/primitives/io", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false, features = ["serde"] }
-sp-state-machine = { path = "../../../../substrate/primitives/state-machine", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
-sp-trie = { path = "../../../../substrate/primitives/trie", default-features = false }
-trie-db = { version = "0.27.1", default-features = false }
+frame-support = { path = "../../../substrate/frame/support", default-features = false }
+frame-system = { path = "../../../substrate/frame/system", default-features = false }
+sp-core = { path = "../../../substrate/primitives/core", default-features = false }
+sp-io = { path = "../../../substrate/primitives/io", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false, features = ["serde"] }
+sp-state-machine = { path = "../../../substrate/primitives/state-machine", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
+sp-trie = { path = "../../../substrate/primitives/trie", default-features = false }
+trie-db = { version = "0.28.0", default-features = false }
[dev-dependencies]
hex-literal = "0.4"
diff --git a/cumulus/bridges/primitives/runtime/src/chain.rs b/bridges/primitives/runtime/src/chain.rs
similarity index 100%
rename from cumulus/bridges/primitives/runtime/src/chain.rs
rename to bridges/primitives/runtime/src/chain.rs
diff --git a/cumulus/bridges/primitives/runtime/src/extensions.rs b/bridges/primitives/runtime/src/extensions.rs
similarity index 94%
rename from cumulus/bridges/primitives/runtime/src/extensions.rs
rename to bridges/primitives/runtime/src/extensions.rs
index 253350d17e74faa13c97ab2a0ee1876fce69693f..44eeaad93c91603b34713ca477b5623f4e07aad0 100644
--- a/cumulus/bridges/primitives/runtime/src/extensions.rs
+++ b/bridges/primitives/runtime/src/extensions.rs
@@ -35,7 +35,12 @@ pub trait SignedExtensionSchema: Encode + Decode + Debug + Eq + Clone + StaticTy
type AdditionalSigned: Encode + Debug + Eq + Clone + StaticTypeInfo;
}
-// An implementation of `SignedExtensionSchema` using generic params.
+impl SignedExtensionSchema for () {
+ type Payload = ();
+ type AdditionalSigned = ();
+}
+
+/// An implementation of `SignedExtensionSchema` using generic params.
#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq, TypeInfo)]
pub struct GenericSignedExtensionSchema
(PhantomData<(P, S)>);
@@ -72,6 +77,9 @@ pub type CheckWeight = GenericSignedExtensionSchema<(), ()>;
/// The `SignedExtensionSchema` for `pallet_transaction_payment::ChargeTransactionPayment`.
pub type ChargeTransactionPayment = GenericSignedExtensionSchema, ()>;
+/// The `SignedExtensionSchema` for `polkadot-runtime-common::PrevalidateAttests`.
+pub type PrevalidateAttests = GenericSignedExtensionSchema<(), ()>;
+
/// The `SignedExtensionSchema` for `BridgeRejectObsoleteHeadersAndMessages`.
pub type BridgeRejectObsoleteHeadersAndMessages = GenericSignedExtensionSchema<(), ()>;
@@ -99,7 +107,7 @@ pub struct GenericSignedExtension {
// It may be set to `None` if extensions are decoded. We are never reconstructing transactions
// (and it makes no sense to do that) => decoded version of `SignedExtensions` is only used to
// read fields of the `payload`. And when resigning transaction, we're reconstructing
- // `SignedExtensions` from the scratch.
+ // `SignedExtensions` from scratch.
additional_signed: Option,
}
diff --git a/cumulus/bridges/primitives/runtime/src/lib.rs b/bridges/primitives/runtime/src/lib.rs
similarity index 100%
rename from cumulus/bridges/primitives/runtime/src/lib.rs
rename to bridges/primitives/runtime/src/lib.rs
diff --git a/cumulus/bridges/primitives/runtime/src/messages.rs b/bridges/primitives/runtime/src/messages.rs
similarity index 100%
rename from cumulus/bridges/primitives/runtime/src/messages.rs
rename to bridges/primitives/runtime/src/messages.rs
diff --git a/cumulus/bridges/primitives/runtime/src/storage_proof.rs b/bridges/primitives/runtime/src/storage_proof.rs
similarity index 100%
rename from cumulus/bridges/primitives/runtime/src/storage_proof.rs
rename to bridges/primitives/runtime/src/storage_proof.rs
diff --git a/cumulus/bridges/primitives/runtime/src/storage_types.rs b/bridges/primitives/runtime/src/storage_types.rs
similarity index 100%
rename from cumulus/bridges/primitives/runtime/src/storage_types.rs
rename to bridges/primitives/runtime/src/storage_types.rs
diff --git a/cumulus/bridges/primitives/test-utils/Cargo.toml b/bridges/primitives/test-utils/Cargo.toml
similarity index 57%
rename from cumulus/bridges/primitives/test-utils/Cargo.toml
rename to bridges/primitives/test-utils/Cargo.toml
index fc6e5859141ebe6dfa17bc854e1740eb9a90907c..7081ce90f97b90c3eb437d297fae5cc9f65cfe61 100644
--- a/cumulus/bridges/primitives/test-utils/Cargo.toml
+++ b/bridges/primitives/test-utils/Cargo.toml
@@ -4,7 +4,6 @@ version = "0.1.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
-publish = false
[dependencies]
bp-header-chain = { path = "../header-chain", default-features = false }
@@ -12,14 +11,14 @@ bp-parachains = { path = "../parachains", default-features = false }
bp-polkadot-core = { path = "../polkadot-core", default-features = false }
bp-runtime = { path = "../runtime", default-features = false }
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
-ed25519-dalek = { version = "1.0", default-features = false, features = ["u64_backend"] }
+ed25519-dalek = { version = "2.0", default-features = false }
finality-grandpa = { version = "0.16.2", default-features = false }
-sp-application-crypto = { path = "../../../../substrate/primitives/application-crypto", default-features = false }
-sp-consensus-grandpa = { path = "../../../../substrate/primitives/consensus/grandpa", default-features = false }
-sp-core = { path = "../../../../substrate/primitives/core", default-features = false }
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
-sp-std = { path = "../../../../substrate/primitives/std", default-features = false }
-sp-trie = { path = "../../../../substrate/primitives/trie", default-features = false }
+sp-application-crypto = { path = "../../../substrate/primitives/application-crypto", default-features = false }
+sp-consensus-grandpa = { path = "../../../substrate/primitives/consensus/grandpa", default-features = false }
+sp-core = { path = "../../../substrate/primitives/core", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
+sp-std = { path = "../../../substrate/primitives/std", default-features = false }
+sp-trie = { path = "../../../substrate/primitives/trie", default-features = false }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/primitives/test-utils/src/keyring.rs b/bridges/primitives/test-utils/src/keyring.rs
similarity index 81%
rename from cumulus/bridges/primitives/test-utils/src/keyring.rs
rename to bridges/primitives/test-utils/src/keyring.rs
index b99132de3ec36bf0f58a454635876708258d1c0f..eabf9c784eb8182f2824cd4c62defe4b92657450 100644
--- a/cumulus/bridges/primitives/test-utils/src/keyring.rs
+++ b/bridges/primitives/test-utils/src/keyring.rs
@@ -18,7 +18,7 @@
use bp_header_chain::{justification::JustificationVerificationContext, AuthoritySet};
use codec::Encode;
-use ed25519_dalek::{Keypair, PublicKey, SecretKey, Signature};
+use ed25519_dalek::{Signature, SigningKey, VerifyingKey};
use finality_grandpa::voter_set::VoterSet;
use sp_consensus_grandpa::{AuthorityId, AuthorityList, AuthorityWeight, SetId};
use sp_runtime::RuntimeDebug;
@@ -37,29 +37,15 @@ pub const FERDIE: Account = Account(5);
pub struct Account(pub u16);
impl Account {
- pub fn public(&self) -> PublicKey {
- (&self.secret()).into()
+ pub fn public(&self) -> VerifyingKey {
+ self.pair().verifying_key()
}
- pub fn secret(&self) -> SecretKey {
+ pub fn pair(&self) -> SigningKey {
let data = self.0.encode();
let mut bytes = [0_u8; 32];
bytes[0..data.len()].copy_from_slice(&data);
- SecretKey::from_bytes(&bytes)
- .expect("A static array of the correct length is a known good.")
- }
-
- pub fn pair(&self) -> Keypair {
- let mut pair: [u8; 64] = [0; 64];
-
- let secret = self.secret();
- pair[..32].copy_from_slice(&secret.to_bytes());
-
- let public = self.public();
- pair[32..].copy_from_slice(&public.to_bytes());
-
- Keypair::from_bytes(&pair)
- .expect("We expect the SecretKey to be good, so this must also be good.")
+ SigningKey::from_bytes(&bytes)
}
pub fn sign(&self, msg: &[u8]) -> Signature {
diff --git a/cumulus/bridges/primitives/test-utils/src/lib.rs b/bridges/primitives/test-utils/src/lib.rs
similarity index 100%
rename from cumulus/bridges/primitives/test-utils/src/lib.rs
rename to bridges/primitives/test-utils/src/lib.rs
diff --git a/cumulus/bridges/primitives/xcm-bridge-hub-router/Cargo.toml b/bridges/primitives/xcm-bridge-hub-router/Cargo.toml
similarity index 76%
rename from cumulus/bridges/primitives/xcm-bridge-hub-router/Cargo.toml
rename to bridges/primitives/xcm-bridge-hub-router/Cargo.toml
index df2b00563deb1df184cf5969f81ea82d5816ae6a..725a7d94564e226110453b35cdf4f0161c12c113 100644
--- a/cumulus/bridges/primitives/xcm-bridge-hub-router/Cargo.toml
+++ b/bridges/primitives/xcm-bridge-hub-router/Cargo.toml
@@ -11,8 +11,8 @@ codec = { package = "parity-scale-codec", version = "3.1.5", default-features =
scale-info = { version = "2.9.0", default-features = false, features = ["bit-vec", "derive"] }
# Substrate Dependencies
-sp-runtime = { path = "../../../../substrate/primitives/runtime", default-features = false }
-sp-core = { path = "../../../../substrate/primitives/core", default-features = false }
+sp-runtime = { path = "../../../substrate/primitives/runtime", default-features = false }
+sp-core = { path = "../../../substrate/primitives/core", default-features = false }
[features]
default = [ "std" ]
diff --git a/cumulus/bridges/primitives/xcm-bridge-hub-router/src/lib.rs b/bridges/primitives/xcm-bridge-hub-router/src/lib.rs
similarity index 100%
rename from cumulus/bridges/primitives/xcm-bridge-hub-router/src/lib.rs
rename to bridges/primitives/xcm-bridge-hub-router/src/lib.rs
diff --git a/cumulus/bridges/scripts/verify-pallets-build.sh b/bridges/scripts/verify-pallets-build.sh
similarity index 93%
rename from cumulus/bridges/scripts/verify-pallets-build.sh
rename to bridges/scripts/verify-pallets-build.sh
index 1ea3dbe8626030eaeb644ce80a0d58fd2760f038..b8ac09e26b8bcd78e4a0c3022c098f2ebc93afd3 100755
--- a/cumulus/bridges/scripts/verify-pallets-build.sh
+++ b/bridges/scripts/verify-pallets-build.sh
@@ -89,17 +89,26 @@ rm -rf $BRIDGES_FOLDER/scripts/update-weights-setup.sh
rm -rf $BRIDGES_FOLDER/scripts/update_substrate.sh
rm -rf $BRIDGES_FOLDER/tools
rm -f $BRIDGES_FOLDER/.dockerignore
+rm -f $BRIDGES_FOLDER/local.Dockerfile.dockerignore
rm -f $BRIDGES_FOLDER/deny.toml
rm -f $BRIDGES_FOLDER/.gitlab-ci.yml
rm -f $BRIDGES_FOLDER/.editorconfig
rm -f $BRIDGES_FOLDER/Cargo.toml
rm -f $BRIDGES_FOLDER/ci.Dockerfile
+rm -f $BRIDGES_FOLDER/local.Dockerfile
rm -f $BRIDGES_FOLDER/CODEOWNERS
rm -f $BRIDGES_FOLDER/Dockerfile
+rm -f $BRIDGES_FOLDER/rustfmt.toml
# let's fix Cargo.toml a bit (it'll be helpful if we are in the bridges repo)
if [[ ! -f "Cargo.toml" ]]; then
cat > Cargo.toml <<-CARGO_TOML
+ [workspace.package]
+ authors = ["Parity Technologies "]
+ edition = "2021"
+ repository = "https://github.com/paritytech/parity-bridges-common.git"
+ license = "GPL-3.0-only"
+
[workspace]
resolver = "2"
diff --git a/cumulus/.github/ISSUE_TEMPLATE/release-client.md b/cumulus/.github/ISSUE_TEMPLATE/release-client.md
deleted file mode 100644
index bb7f206157674634e395631eb2434659c5ad026e..0000000000000000000000000000000000000000
--- a/cumulus/.github/ISSUE_TEMPLATE/release-client.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-name: Release Checklist for Client
-about: Release Checklist for Client
-title: Release Checklist for Client {{ env.VERSION }}
----
-
-# Release Checklist - Client
-
-### Client Release
-
-- [ ] build a new `polkadot-parachain` binary and publish it to S3
-- [ ] new `polkadot-parachain` version has [run on the network](../../docs/release.md#burnin)
- without issue for at least 12h
-- [ ] a draft release has been created in the [Github Releases page](https://github.com/paritytech/cumulus/releases) with the relevant release-notes
-- [ ] the [build artifacts](../../docs/release.md#build-artifacts) have been added to the
- draft-release.
-
----
-
-Read more about the [release documentation](../../docs/release.md).
diff --git a/cumulus/.github/ISSUE_TEMPLATE/release-runtime.md b/cumulus/.github/ISSUE_TEMPLATE/release-runtime.md
deleted file mode 100644
index 0f3543759afd924ca6c74011ed6e64dc1e5005f4..0000000000000000000000000000000000000000
--- a/cumulus/.github/ISSUE_TEMPLATE/release-runtime.md
+++ /dev/null
@@ -1,54 +0,0 @@
----
-name: Release Checklist for Runtime
-about: Release Checklist for Runtime
-title: Release Checklist for Runtime {{ env.VERSION }}
----
-
-# Release Checklist - Runtimes
-
-**All** following checks must be completed before publishing a new release.
-The release process is owned and led by @paritytech/release-engineering team.
-The checks marked with :crab: are meant to be checked by [a runtime engineer](https://github.com/paritytech/cumulus/issues/1761).
-
-## Runtimes Release
-
-### Codebase
-These checks should be performed on the codebase.
-
-- [ ] the [`spec_version`](https://github.com/paritytech/cumulus/blob/master/docs/release.md#spec-version) has been incremented since the
- last release for any native runtimes from any existing use on public (non-private/test) networks
-- [ ] :crab: previously [completed migrations](https://github.com/paritytech/cumulus/blob/master/docs/release.md#old-migrations-removed) are removed for any public (non-private/test) networks
-- [ ] pallet and [extrinsic ordering](https://github.com/paritytech/cumulus/blob/master/docs/release.md#extrinsic-ordering--storage) as well as `SignedExtension`s have stayed
- the same. Bump `transaction_version` otherwise
-- [ ] the [benchmarks](https://github.com/paritytech/ci_cd/wiki/Benchmarks:-cumulus) ran
-- [ ] the weights have been updated for any modified runtime logic
-- [ ] :crab: the new weights are sane, there are no significant (>50%) drops or rises with no reason
-- [ ] :crab: XCM config is compatible with the configurations and versions of relevant interlocutors, like the Relay Chain.
-
-### On the release branch
-
-The following checks can be performed after we have forked off to the release-candidate branch or started an additional release candidate branch (rc-2, rc-3, etc)
-
-- [ ] Verify [new migrations](https://github.com/paritytech/cumulus/blob/master/docs/release.md#new-migrations) complete successfully, and the
- runtime state is correctly updated for any public (non-private/test)
- networks
-- [ ] Run [integration tests](https://github.com/paritytech/cumulus/blob/master/docs/release.md#integration-tests), and make sure they pass.
-- [ ] Push runtime upgrade to Asset Hub Westend and verify network stability
-- [ ] Push runtime upgrade to Collectives and verify network stability
-- [ ] Push runtime upgrade to Bridge-Hub-Kusama and verify network stability
-
-
-### Github
-
-- [ ] Check that a draft release has been created at the [Github Releases page](https://github.com/paritytech/cumulus/releases) with relevant [release
- notes](https://github.com/paritytech/cumulus/blob/master/docs/release.md#release-notes)
-- [ ] Check that [build artifacts](https://github.com/paritytech/cumulus/blob/master/docs/release.md#build-artifacts) have been added to the
- draft-release.
-
-# Post release
-
-- [ ] :crab: all commits (runtime version bumps, fixes) on this release branch have been merged back to master.
-
----
-
-Read more about the [release documentation](https://github.com/paritytech/cumulus/blob/master/docs/release.md).
diff --git a/cumulus/.github/workflows/release-50_publish-docker.yml b/cumulus/.github/workflows/release-50_publish-docker.yml
deleted file mode 100644
index 6ad943c3903ca597b38dedf64061e62a6c39cf6e..0000000000000000000000000000000000000000
--- a/cumulus/.github/workflows/release-50_publish-docker.yml
+++ /dev/null
@@ -1,206 +0,0 @@
-name: Release - Publish Docker Image
-
-# This workflow listens to pubished releases or can be triggered manually.
-# It includes releases and rc candidates.
-# It fetches the binaries, checks sha256 and GPG
-# signatures, then builds an injected docker
-# image and publishes it.
-
-on:
- release:
- types:
- - published
- workflow_dispatch:
- inputs:
- release_id:
- description: |
- Release ID.
- You can find it using the command:
- curl -s \
- -H "Authorization: Bearer ${GITHUB_TOKEN}" https://api.github.com/repos/$OWNER/$REPO/releases | \
- jq '.[] | { name: .name, id: .id }'
- required: true
- type: string
- image_type:
- description: Type of the image to be published
- required: true
- default: rc
- type: choice
- options:
- - rc
- - release
- registry:
- description: Container registry
- required: true
- type: string
- default: docker.io
- owner:
- description: Owner of the container image repo
- required: true
- type: string
- default: parity
-
-env:
- RELEASE_ID: ${{ inputs.release_id }}
- ENGINE: docker
- REGISTRY: ${{ inputs.registry }}
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- DOCKER_OWNER: ${{ inputs.owner || github.repository_owner }}
- REPO: ${{ github.repository }}
- BINARY: polkadot-parachain
- EVENT_ACTION: ${{ github.event.action }}
- EVENT_NAME: ${{ github.event_name }}
- IMAGE_TYPE: ${{ inputs.image_type }}
-
-jobs:
- fetch-artifacts:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout sources
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
-
- - name: Prepare temp folder
- run: |
- TMP=$(mktemp -d)
- echo "TMP=$TMP" >> "$GITHUB_ENV"
- pwd
- ls -al "$TMP"
-
- - name: Fetch lib.sh from polkadot repo
- working-directory: ${{ env.TMP }}
- run: |
- curl -O -L \
- -H "Accept: application/vnd.github.v3.raw" \
- https://raw.githubusercontent.com/paritytech/polkadot/master/scripts/ci/common/lib.sh
-
- chmod a+x lib.sh
- ls -al
-
- - name: Fetch release artifacts based on final release tag
- #this step runs only if the workflow is triggered automatically when new release is published
- if: ${{ env.EVENT_NAME == 'release' && env.EVENT_ACTION != '' && env.EVENT_ACTION == 'published' }}
- run: |
- mkdir -p release-artifacts && cd release-artifacts
-
- for f in $BINARY $BINARY.asc $BINARY.sha256; do
- URL="https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ github.event.release.tag_name }}/$f"
- echo " - Fetching $f from $URL"
- wget "$URL" -O "$f"
- done
- chmod a+x $BINARY
- cp -f ${TMP}/lib.sh .
- ls -al
-
- - name: Fetch rc artifacts or release artifacts based on release id
- #this step runs only if the workflow is triggered manually
- if: ${{ env.EVENT_NAME == 'workflow_dispatch' }}
- run: |
- . ${TMP}/lib.sh
-
- fetch_release_artifacts
-
- chmod a+x release-artifacts/$BINARY
- ls -al
-
- cp -f ${TMP}/lib.sh release-artifacts/
-
- - name: Cache the artifacts
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
- with:
- key: artifacts-${{ github.sha }}
- path: |
- ./release-artifacts/**/*
-
- build-container:
- runs-on: ubuntu-latest
- needs: fetch-artifacts
-
- steps:
- - name: Checkout sources
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
-
- - name: Get artifacts from cache
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
- with:
- key: artifacts-${{ github.sha }}
- fail-on-cache-miss: true
- path: |
- ./release-artifacts/**/*
-
- - name: Check sha256 ${{ env.BINARY }}
- working-directory: ./release-artifacts
- run: |
- . ./lib.sh
-
- echo "Checking binary $BINARY"
- check_sha256 $BINARY && echo "OK" || echo "ERR"
-
- - name: Check GPG ${{ env.BINARY }}
- working-directory: ./release-artifacts
- run: |
- . ./lib.sh
- import_gpg_keys
- check_gpg $BINARY
-
- - name: Build Injected Container image for ${{ env.BINARY }}
- env:
- IMAGE_NAME: ${{ env.BINARY }}
- OWNER: ${{ env.DOCKER_OWNER }}
- run: |
- ls -al
- echo "Building container for $BINARY"
- ./docker/scripts/build-injected-image.sh
-
- - name: Fetch rc commit and tag
- if: ${{ env.IMAGE_TYPE == 'rc' }}
- id: fetch_rc_refs
- run: |
- release=release-${{ inputs.release_id }} && \
- echo "release=${release}" >> $GITHUB_OUTPUT
-
- commit=$(git rev-parse --short HEAD) && \
- echo "commit=${commit}" >> $GITHUB_OUTPUT
-
- tag=$(git name-rev --tags --name-only $(git rev-parse HEAD)) && \
- [ "${tag}" != "undefined" ] && echo "tag=${tag}" >> $GITHUB_OUTPUT || \
- echo "No tag, doing without"
-
- - name: Fetch release tags
- if: ${{ env.IMAGE_TYPE == 'release' || env.EVENT_NAME == 'release' && env.EVENT_ACTION != '' && env.EVENT_ACTION == 'published' }}
- id: fetch_release_refs
- run: |
- VERSION=$(docker run --pull never --rm $DOCKER_OWNER/$BINARY --version | awk '{ print $2 }' )
- release=$( echo $VERSION | cut -f1 -d- )
- echo "tag=latest" >> $GITHUB_OUTPUT
- echo "release=${release}" >> $GITHUB_OUTPUT
-
-
- - name: Login to Dockerhub
- uses: docker/login-action@v2
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
-
- - name: Tag and Push Container image for ${{ env.BINARY }}
- id: docker_push
- env:
- TAGS: ${{ join(steps.fetch_rc_refs.outputs.*, ',') || join(steps.fetch_release_refs.outputs.*, ',') }}
- run: |
- TAGS=${TAGS[@]:-latest}
- IFS=',' read -r -a TAG_ARRAY <<< "$TAGS"
-
- echo "The image ${BINARY} will be tagged with ${TAG_ARRAY[*]}"
- for TAG in "${TAG_ARRAY[@]}"; do
- $ENGINE tag ${DOCKER_OWNER}/${BINARY} ${DOCKER_OWNER}/${BINARY}:${TAG}
- $ENGINE push ${DOCKER_OWNER}/${BINARY}:${TAG}
- done
-
- $ENGINE images | grep ${BINARY}
-
- - name: Check version for the published image for ${{ env.BINARY }}
- env:
- RELEASE_TAG: ${{ steps.fetch_rc_refs.outputs.release || steps.fetch_release_refs.outputs.release }}
- run: |
- echo "Checking tag ${RELEASE_TAG} for image ${REGISTRY}/${DOCKER_OWNER}/${BINARY}"
- $ENGINE run -i ${REGISTRY}/${DOCKER_OWNER}/${BINARY}:${RELEASE_TAG} --version
diff --git a/cumulus/CODEOWNERS b/cumulus/CODEOWNERS
deleted file mode 100644
index 3e5e8bd062dda4d1fd5675b49daaf7186b3a034e..0000000000000000000000000000000000000000
--- a/cumulus/CODEOWNERS
+++ /dev/null
@@ -1,23 +0,0 @@
-# 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
-/scripts/ci/ @paritytech/ci @paritytech/release-engineering
-
diff --git a/cumulus/README.md b/cumulus/README.md
index 419e293a0abd3a032de6e591d60b7006c64aa628..19f9f3f113dd06655c418a4caf6b30a9cad6ee9f 100644
--- a/cumulus/README.md
+++ b/cumulus/README.md
@@ -2,59 +2,53 @@
[![Doc](https://img.shields.io/badge/cumulus%20docs-master-brightgreen)](https://paritytech.github.io/cumulus/)
-This repository contains both the Cumulus SDK and also specific chains implemented on top of this
-SDK.
+This repository contains both the Cumulus SDK and also specific chains implemented on top of this SDK.
-If you only want to run a **Polkadot Parachain Node**, check out our [container
-section](./docs/container.md).
+If you only want to run a **Polkadot Parachain Node**, check out our [container section](./docs/container.md).
## Cumulus SDK
-A set of tools for writing [Substrate](https://substrate.io/)-based
-[Polkadot](https://wiki.polkadot.network/en/)
-[parachains](https://wiki.polkadot.network/docs/en/learn-parachains). Refer to the included
-[overview](docs/overview.md) for architectural details, and the [Connect to a relay chain how-to
-guide](https://docs.substrate.io/reference/how-to-guides/parachains/connect-to-a-relay-chain/) for a
-guided walk-through of using these tools.
+A set of tools for writing [Substrate](https://substrate.io/)-based [Polkadot](https://wiki.polkadot.network/en/)
+[parachains](https://wiki.polkadot.network/docs/en/learn-parachains). Refer to the included [overview](docs/overview.md)
+for architectural details, and the [Connect to a relay chain how-to
+guide](https://docs.substrate.io/reference/how-to-guides/parachains/connect-to-a-relay-chain/) for a guided walk-through
+of using these tools.
-It's easy to write blockchains using Substrate, and the overhead of writing parachains'
-distribution, p2p, database, and synchronization layers should be just as low. This project aims to
-make it easy to write parachains for Polkadot by leveraging the power of Substrate.
+It's easy to write blockchains using Substrate, and the overhead of writing parachains' distribution, p2p, database, and
+synchronization layers should be just as low. This project aims to make it easy to write parachains for Polkadot by
+leveraging the power of Substrate.
-Cumulus clouds are shaped sort of like dots; together they form a system that is intricate,
-beautiful and functional.
+Cumulus clouds are shaped sort of like dots; together they form a system that is intricate, beautiful and functional.
### Consensus
[`parachain-consensus`](https://github.com/paritytech/polkadot-sdk/blob/master/cumulus/client/consensus/common/src/parachain_consensus.rs)
-is a [consensus engine](https://docs.substrate.io/v3/advanced/consensus) for Substrate that follows
-a Polkadot [relay chain](https://wiki.polkadot.network/docs/en/learn-architecture#relay-chain). This
-will run a Polkadot node internally, and dictate to the client and synchronization algorithms which
-chain to follow,
-[finalize](https://wiki.polkadot.network/docs/en/learn-consensus#probabilistic-vs-provable-finality),
-and treat as best.
+is a [consensus engine](https://docs.substrate.io/v3/advanced/consensus) for Substrate that follows a Polkadot [relay
+chain](https://wiki.polkadot.network/docs/en/learn-architecture#relay-chain). This will run a Polkadot node internally,
+and dictate to the client and synchronization algorithms which chain to follow,
+[finalize](https://wiki.polkadot.network/docs/en/learn-consensus#probabilistic-vs-provable-finality), and treat as best.
### Collator
-A Polkadot [collator](https://wiki.polkadot.network/docs/en/learn-collator) for the parachain is
-implemented by the `polkadot-parachain` binary (previously called `polkadot-collator`).
+A Polkadot [collator](https://wiki.polkadot.network/docs/en/learn-collator) for the parachain is implemented by the
+`polkadot-parachain` binary (previously called `polkadot-collator`).
-You may run `polkadot-parachain` locally after building it or using one of the container option
-described [here](./docs/container.md).
+You may run `polkadot-parachain` locally after building it or using one of the container option described
+[here](./docs/container.md).
-### Relay Chain Interaction
-To operate a parachain node, a connection to the corresponding relay
-chain is necessary. This can be achieved in one of three ways:
-1. Run a full relay chain node within the parachain node (default)
-2. Connect to an external relay chain node via WebSocket RPC
+### Relay Chain Interaction
+To operate a parachain node, a connection to the corresponding relay chain is necessary. This can be achieved in one of
+three ways:
+1. Run a full relay chain node within the parachain node (default)
+2. Connect to an external relay chain node via WebSocket RPC
3. Run a light client for the relay chain
#### In-process Relay Chain Node
-If an external relay chain node is not specified (default behavior), then a full relay chain node is
-spawned within the same process.
+If an external relay chain node is not specified (default behavior), then a full relay chain node is spawned within the
+same process.
-This node has all of the typical components of a regular Polkadot node and will have to fully sync
-with the relay chain to work.
+This node has all of the typical components of a regular Polkadot node and will have to fully sync with the relay chain
+to work.
##### Example command
```bash
@@ -66,19 +60,16 @@ polkadot-parachain \
```
#### External Relay Chain Node
-An external relay chain node is connected via WebsSocket RPC by using the
-`--relay-chain-rpc-urls` command line argument. This option accepts one or more
-space-separated WebSocket URLs to a full relay chain node. By default, only the
-first URL will be used, with the rest as a backup in case the connection to the
-first node is lost.
+An external relay chain node is connected via WebsSocket RPC by using the `--relay-chain-rpc-urls` command line
+argument. This option accepts one or more space-separated WebSocket URLs to a full relay chain node. By default, only
+the first URL will be used, with the rest as a backup in case the connection to the first node is lost.
-Parachain nodes using this feature won't have to fully sync with the relay chain
-to work, so in general they will use fewer system resources.
+Parachain nodes using this feature won't have to fully sync with the relay chain to work, so in general they will use
+fewer system resources.
-**Note:** At this time, any parachain nodes using this feature will still spawn a
-significantly cut-down relay chain node in-process. Even though they lack the
-majority of normal Polkadot subsystems, they will still need to connect directly
-to the relay chain network.
+**Note:** At this time, any parachain nodes using this feature will still spawn a significantly cut-down relay chain
+node in-process. Even though they lack the majority of normal Polkadot subsystems, they will still need to connect
+directly to the relay chain network.
##### Example command
@@ -94,17 +85,15 @@ polkadot-parachain \
```
#### Relay Chain Light Client
-An internal relay chain light client provides a fast and lightweight approach
-for connecting to the relay chain network. It provides relay chain notifications
-and facilitates runtime calls.
+An internal relay chain light client provides a fast and lightweight approach for connecting to the relay chain network.
+It provides relay chain notifications and facilitates runtime calls.
-To specify which chain the light client should connect to, users need to supply
-a relay chain chain-spec as part of the relay chain arguments.
+To specify which chain the light client should connect to, users need to supply a relay chain chain-spec as part of the
+relay chain arguments.
-**Note:** At this time, any parachain nodes using this feature will still spawn
-a significantly cut-down relay chain node in-process. Even though they lack the
-majority of normal Polkadot subsystems, they will still need to connect directly
-to the relay chain network.
+**Note:** At this time, any parachain nodes using this feature will still spawn a significantly cut-down relay chain
+node in-process. Even though they lack the majority of normal Polkadot subsystems, they will still need to connect
+directly to the relay chain network.
##### Example command
@@ -118,23 +107,22 @@ polkadot-parachain \
```
## Installation and Setup
-Before building Cumulus SDK based nodes / runtimes prepare your environment by
-following Substrate [installation instructions](https://docs.substrate.io/main-docs/install/).
+Before building Cumulus SDK based nodes / runtimes prepare your environment by following Substrate [installation
+instructions](https://docs.substrate.io/main-docs/install/).
-To launch a local network, you can use [zombienet](https://github.com/paritytech/zombienet)
-for quick setup and experimentation or follow the [manual setup](#manual-setup).
+To launch a local network, you can use [zombienet](https://github.com/paritytech/zombienet) for quick setup and
+experimentation or follow the [manual setup](#manual-setup).
### Zombienet
-We use Zombienet to spin up networks for integration tests and local networks.
-Follow [these installation steps](https://github.com/paritytech/zombienet#requirements-by-provider)
-to set it up on your machine. A simple network specification with two relay chain
-nodes and one collator is located at [zombienet/examples/small_network.toml](zombienet/examples/small_network.toml).
+We use Zombienet to spin up networks for integration tests and local networks. Follow [these installation
+steps](https://github.com/paritytech/zombienet#requirements-by-provider) to set it up on your machine. A simple network
+specification with two relay chain nodes and one collator is located at
+[zombienet/examples/small_network.toml](zombienet/examples/small_network.toml).
#### Which provider should I use?
Zombienet offers multiple providers to run networks. Choose the one that best fits your needs:
- **Podman:** Choose this if you want to spin up a network quick and easy.
-- **Native:** Choose this if you want to develop and deploy your changes. Requires compilation
-of the binaries.
+- **Native:** Choose this if you want to develop and deploy your changes. Requires compilation of the binaries.
- **Kubernetes:** Choose this for advanced use-cases or running on cloud-infrastructure.
#### How to run
@@ -183,13 +171,16 @@ cargo build --release --bin polkadot-parachain
./target/release/polkadot-parachain export-genesis-wasm > genesis-wasm
# Collator1
-./target/release/polkadot-parachain --collator --alice --force-authoring --tmp --port 40335 --rpc-port 9946 -- --chain ../polkadot/rococo-local-cfde.json --port 30335
+./target/release/polkadot-parachain --collator --alice --force-authoring \
+ --tmp --port 40335 --rpc-port 9946 -- --chain ../polkadot/rococo-local-cfde.json --port 30335
# Collator2
-./target/release/polkadot-parachain --collator --bob --force-authoring --tmp --port 40336 --rpc-port 9947 -- --chain ../polkadot/rococo-local-cfde.json --port 30336
+./target/release/polkadot-parachain --collator --bob --force-authoring \
+ --tmp --port 40336 --rpc-port 9947 -- --chain ../polkadot/rococo-local-cfde.json --port 30336
# Parachain Full Node 1
-./target/release/polkadot-parachain --tmp --port 40337 --rpc-port 9948 -- --chain ../polkadot/rococo-local-cfde.json --port 30337
+./target/release/polkadot-parachain --tmp --port 40337 --rpc-port 9948 -- \
+ --chain ../polkadot/rococo-local-cfde.json --port 30337
```
#### Register the parachain
@@ -199,8 +190,8 @@ cargo build --release --bin polkadot-parachain
## Asset Hub 🪙
-This repository also contains the Asset Hub runtimes. Asset Hub is a system parachain
-providing an asset store for the Polkadot ecosystem.
+This repository also contains the Asset Hub runtimes. Asset Hub is a system parachain providing an asset store for the
+Polkadot ecosystem.
### Build & Launch a Node
@@ -228,20 +219,18 @@ See [the `contracts-rococo` readme](parachains/runtimes/contracts/contracts-roco
See [the `bridge-hubs` readme](parachains/runtimes/bridge-hubs/README.md) for details.
## Rococo 👑
-[Rococo](https://polkadot.js.org/apps/?rpc=wss://rococo-rpc.polkadot.io) is becoming a
-[Community Parachain Testbed](https://polkadot.network/blog/rococo-revamp-becoming-a-community-parachain-testbed/)
-for parachain teams in the Polkadot ecosystem. It supports multiple parachains with the
-differentiation of long-term connections and recurring short-term connections, to see
-which parachains are currently connected and how long they will be connected for
-[see here](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-rpc.polkadot.io#/parachains).
+[Rococo](https://polkadot.js.org/apps/?rpc=wss://rococo-rpc.polkadot.io) is becoming a [Community Parachain
+Testbed](https://polkadot.network/blog/rococo-revamp-becoming-a-community-parachain-testbed/) for parachain teams in the
+Polkadot ecosystem. It supports multiple parachains with the differentiation of long-term connections and recurring
+short-term connections, to see which parachains are currently connected and how long they will be connected for [see
+here](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-rpc.polkadot.io#/parachains).
-Rococo is an elaborate style of design and the name describes the painstaking effort that
-has gone into this project.
+Rococo is an elaborate style of design and the name describes the painstaking effort that has gone into this project.
### Build & Launch Rococo Collators
-Collators are similar to validators in the relay chain. These nodes build the blocks that
-will eventually be included by the relay chain for a parachain.
+Collators are similar to validators in the relay chain. These nodes build the blocks that will eventually be included by
+the relay chain for a parachain.
To run a Rococo collator you will need to compile the following binary:
@@ -250,8 +239,7 @@ To run a Rococo collator you will need to compile the following binary:
cargo build --release --locked --bin polkadot-parachain
```
-Once the executable is built, launch collators for each parachain (repeat once each for chain
-`tick`, `trick`, `track`):
+Once the executable is built, launch collators for each parachain (repeat once each for chain `tick`, `trick`, `track`):
```bash
./target/release/polkadot-parachain --chain $CHAIN --validator
@@ -261,10 +249,10 @@ You can also build [using a container](./docs/container.md).
### Parachains
-* [Asset Hub](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-statemint-rpc.polkadot.io#/explorer)
-* [Contracts on Rococo](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-contracts-rpc.polkadot.io#/explorer)
-* [RILT](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo.kilt.io#/explorer)
+- [Asset Hub](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-statemint-rpc.polkadot.io#/explorer)
+- [Contracts on Rococo](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo-contracts-rpc.polkadot.io#/explorer)
+- [RILT](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo.kilt.io#/explorer)
-The network uses horizontal message passing (HRMP) to enable communication between
-parachains and the relay chain and, in turn, between parachains. This means that every
-message is sent to the relay chain, and from the relay chain to its destination parachain.
+The network uses horizontal message passing (HRMP) to enable communication between parachains and the relay chain and,
+in turn, between parachains. This means that every message is sent to the relay chain, and from the relay chain to its
+destination parachain.
diff --git a/cumulus/bridges/SECURITY.md b/cumulus/bridges/SECURITY.md
deleted file mode 100644
index 65f2f3bff05dd94786f7f3c8d084af2ca9fe236f..0000000000000000000000000000000000000000
--- a/cumulus/bridges/SECURITY.md
+++ /dev/null
@@ -1,14 +0,0 @@
-# Security Policy
-
-Thanks for helping make the Parity ecosystem more secure. Security is one of our first priorities.
-
-## Reporting a vulnerability
-
-If you find something that can be treated as a security vulnerability, please do not use the issue tracker or discuss it in the public forum as it can cause more damage, rather than giving real help to the ecosystem.
-
-Security vulnerabilities should be reported by the [contact form](https://security-submission.parity.io/).
-
-If you think that your report might be eligible for the Bug Bounty Program, please mark this during the submission. Please check up-to-date [Parity Bug Bounty Program rules](https://www.parity.io/bug-bounty) to find out the information about our Bug Bounty Program.
-
-**Warning**: This is an unified SECURITY.md file for Paritytech GitHub Organization. The presence of this file does not mean that this repository is covered by the Bug Bounty program. Please always check the Bug Bounty Program scope for information.
-
diff --git a/cumulus/bridges/docs/high-level-overview.md b/cumulus/bridges/docs/high-level-overview.md
deleted file mode 100644
index 449224124afd77a4e53d55e7cf6b3b9a65961802..0000000000000000000000000000000000000000
--- a/cumulus/bridges/docs/high-level-overview.md
+++ /dev/null
@@ -1,181 +0,0 @@
-# High-Level Bridge Documentation
-
-This document gives a brief, abstract description of main components that may be found in this repository.
-If you want to see how we're using them to build Rococo <> Wococo (Kusama <> Polkadot) bridge, please
-refer to the [Polkadot <> Kusama Bridge](./polkadot-kusama-bridge-overview.md).
-
-## Purpose
-
-This repo contains all components required to build a trustless connection between standalone Substrate chains,
-that are using GRANDPA finality, their parachains or any combination of those. On top of this connection, we
-offer a messaging pallet that provides means to organize messages exchange.
-
-On top of that layered infrastructure, anyone may build their own bridge applications - e.g. [XCM messaging](./polkadot-kusama-bridge-overview.md),
-[encoded calls messaging](https://github.com/paritytech/parity-bridges-common/releases/tag/encoded-calls-messaging) and so on.
-
-## Terminology
-
-Even though we support (and require) two-way bridging, the documentation will generally talk about
-a one-sided interaction. That's to say, we will only talk about syncing finality proofs and messages
-from a _source_ chain to a _target_ chain. This is because the two-sided interaction is really just the
-one-sided interaction with the source and target chains switched.
-
-The bridge has both on-chain (pallets) and offchain (relayers) components.
-
-## On-chain components
-
-On-chain bridge components are pallets that are deployed at the chain runtime. Finality pallets require
-deployment at the target chain, while messages pallet needs to be deployed at both, source
-and target chains.
-
-### Bridge GRANDPA Finality Pallet
-
-A GRANDPA light client of the source chain built into the target chain's runtime. It provides a "source of truth"
-about the source chain headers which have been finalized. This is useful for higher level applications.
-
-The pallet tracks current GRANDPA authorities set and only accepts finality proofs (GRANDPA justifications),
-generated by the current authorities set. The GRANDPA protocol itself requires current authorities set to
-generate explicit justification for the header that enacts next authorities set. Such headers and their finality
-proofs are called mandatory in the pallet and relayer pays no fee for such headers submission.
-
-The pallet does not require all headers to be imported or provided. The relayer itself chooses which headers
-he wants to submit (with the exception of mandatory headers).
-
-More: [pallet level documentation and code](../modules/grandpa/).
-
-### Bridge Parachains Finality Pallet
-
-Parachains are not supposed to have their own finality, so we can't use bridge GRANDPA pallet to verify their
-finality proofs. Instead, they rely on their relay chain finality. The parachain header is considered final,
-when it is accepted by the [`paras` pallet](https://github.com/paritytech/polkadot/tree/1a034bd6de0e76721d19aed02a538bcef0787260/runtime/parachains/src/paras)
-at its relay chain. Obviously, the relay chain block, where it is accepted, must also be finalized by the relay
-chain GRANDPA gadget.
-
-That said, the bridge parachains pallet accepts storage proof of one or several parachain heads, inserted to the
-[`Heads`](https://github.com/paritytech/polkadot/blob/1a034bd6de0e76721d19aed02a538bcef0787260/runtime/parachains/src/paras/mod.rs#L642)
-map of the [`paras` pallet](https://github.com/paritytech/polkadot/tree/1a034bd6de0e76721d19aed02a538bcef0787260/runtime/parachains/src/paras).
-To verify this storage proof, the pallet uses relay chain header, imported earlier by the bridge GRANDPA pallet.
-
-The pallet may track multiple parachains at once and those parachains may use different primitives. So the
-parachain header decoding never happens at the pallet level. For maintaining the headers order, the pallet
-uses relay chain header number.
-
-More: [pallet level documentation and code](../modules/parachains/).
-
-### Bridge Messages Pallet
-
-The pallet is responsible for queuing messages at the source chain and receiving the messages proofs at the
-target chain. The messages are sent to the particular _lane_, where they are guaranteed to be received in the
-same order they are sent. The pallet supports many lanes.
-
-The lane has two ends. Outbound lane end is storing number of messages that have been sent and the number of
-messages that have been received. Inbound lane end stores the number of messages that have been received and
-also a map that maps messages to relayers that have delivered those messages to the target chain.
-
-The pallet has three main entrypoints:
-- the `send_message` may be used by the other runtime pallets to send the messages;
-- the `receive_messages_proof` is responsible for parsing the messages proof and handing messages over to the
-dispatch code;
-- the `receive_messages_delivery_proof` is responsible for parsing the messages delivery proof and rewarding
-relayers that have delivered the message.
-
-Many things are abstracted by the pallet:
-- the message itself may mean anything, the pallet doesn't care about its content;
-- the message dispatch happens during delivery, but it is decoupled from the pallet code;
-- the messages proof and messages delivery proof are verified outside of the pallet;
-- the relayers incentivization scheme is defined outside of the pallet.
-
-Outside of the messaging pallet, we have a set of adapters, where messages and delivery proofs are regular
-storage proofs. The proofs are generated at the bridged chain and require bridged chain finality. So messages
-pallet, in this case, depends on one of the finality pallets. The messages are XCM messages and we are using
-XCM executor to dispatch them on receival. You may find more info in [Polkadot <> Kusama Bridge](./polkadot-kusama-bridge-overview.md)
-document.
-
-More: [pallet level documentation and code](../modules/messages/).
-
-### Bridge Relayers Pallet
-
-The pallet is quite simple. It just registers relayer rewards and has an entrypoint to collect them. When
-the rewards are registered and the reward amount is configured outside of the pallet.
-
-More: [pallet level documentation and code](../modules/relayers/).
-
-## Offchain Components
-
-Offchain bridge components are separate processes, called relayers. Relayers are connected both to the
-source chain and target chain nodes. Relayers are reading state of the source chain, compare it to the
-state of the target chain and, if state at target chain needs to be updated, submits target chain
-transaction.
-
-### GRANDPA Finality Relay
-
-The task of relay is to submit source chain GRANDPA justifications and their corresponding headers to
-the Bridge GRANDPA Finality Pallet, deployed at the target chain. For that, the relay subscribes to
-the source chain GRANDPA justifications stream and submits every new justification it sees to the
-target chain GRANDPA light client. In addition, relay is searching for mandatory headers and
-submits their justifications - without that the pallet will be unable to move forward.
-
-More: [GRANDPA Finality Relay Sequence Diagram](./grandpa-finality-relay.html), [pallet level documentation and code](../relays/finality/).
-
-### Parachains Finality Relay
-
-The relay connects to the source _relay_ chain and the target chain nodes. It doesn't need to connect to the
-tracked parachain nodes. The relay looks at the [`Heads`](https://github.com/paritytech/polkadot/blob/1a034bd6de0e76721d19aed02a538bcef0787260/runtime/parachains/src/paras/mod.rs#L642)
-map of the [`paras` pallet](https://github.com/paritytech/polkadot/tree/1a034bd6de0e76721d19aed02a538bcef0787260/runtime/parachains/src/paras)
-in source chain, and compares the value with the best parachain head, stored in the bridge parachains pallet at
-the target chain. If new parachain head appears at the relay chain block `B`, the relay process **waits**
-until header `B` or one of its ancestors appears at the target chain. Once it is available, the storage
-proof of the map entry is generated and is submitted to the target chain.
-
-As its on-chain component (which requires bridge GRANDPA pallet to be deployed nearby), the parachains
-finality relay requires GRANDPA finality relay to be running in parallel. Without it, the header `B` or
-any of its children's finality at source won't be relayed at target, and target chain
-won't be able to verify generated storage proof.
-
-More: [Parachains Finality Relay Sequence Diagram](./parachains-finality-relay.html), [code](../relays/parachains/).
-
-### Messages Relay
-
-Messages relay is actually two relays that are running in a single process: messages delivery relay and
-delivery confirmation relay. Even though they are more complex and have many caveats, the overall algorithm
-is the same as in other relays.
-
-Message delivery relay connects to the source chain and looks at the outbound lane end, waiting until new
-messages are queued there. Once they appear at the source block `B`, the relay start waiting for the block
-`B` or its descendant appear at the target chain. Then the messages storage proof is generated and submitted
-to the bridge messages pallet at the target chain. In addition, the transaction may include the storage proof
-of the outbound lane state - that proves that relayer rewards have been paid and this data (map of relay
-accounts to the delivered messages) may be pruned from the inbound lane state at the target chain.
-
-Delivery confirmation relay connects to the target chain and starts watching the inbound lane end. When new
-messages are delivered to the target chain, the corresponding _source chain account_ is inserted to the
-map in the inbound lane data. Relay detects that, say, at the target chain block `B` and waits until that
-block or its descendant appears at the source chain. Once that happens, the relay crafts a storage proof of
-that data and sends it to the messages pallet, deployed at the source chain.
-
-As you can see, the messages relay also requires finality relay to be operating in parallel. Since messages
-relay submits transactions to both source and target chains, it requires both _source-to-target_ and
-_target-to-source_ finality relays. They can be GRANDPA finality relays or GRANDPA+parachains finality relays,
-depending on the type of connected chain.
-
-More: [Messages Relay Sequence Diagram](./messages-relay.html), [pallet level documentation and code](../relays/messages/).
-
-### Complex Relay
-
-Every relay transaction has its cost. The only transaction, that is "free" to relayer is when the mandatory
-GRANDPA header is submitted. The relay that feeds the bridge with every relay chain and/or parachain head it
-sees, will have to pay a (quite large) cost. And if no messages are sent through the bridge, that is just
-waste of money.
-
-We have a special relay mode, called _complex relay_, where relay mostly sleeps and only submits transactions
-that are required for the messages/confirmations delivery. This mode starts two message relays (in both
-directions). All required finality relays are also started in a special _on-demand_ mode. In this mode they
-do not submit any headers without special request. As always, the only exception is when GRANDPA finality
-relay sees the mandatory header - it is submitted without such request.
-
-The message relays are watching their lanes and when, at some block `B`, they see new messages/confirmations
-to be delivered, they are asking on-demand relays to relay this block `B`. On-demand relays does that and
-then message relay may perform its job. If on-demand relay is a parachain finality relay, it also runs its
-own on-demand GRANDPA relay, which is used to relay required relay chain headers.
-
-More: [Complex Relay Sequence Diagram](./complex-relay.html), [code](../relays/bin-substrate/src/cli/relay_headers_and_messages/).
diff --git a/cumulus/bridges/modules/messages/README.md b/cumulus/bridges/modules/messages/README.md
deleted file mode 100644
index b5250d0dca0b23be3943fecb3926be4ea7097be0..0000000000000000000000000000000000000000
--- a/cumulus/bridges/modules/messages/README.md
+++ /dev/null
@@ -1,242 +0,0 @@
-# Bridge Messages Pallet
-
-The messages pallet is used to deliver messages from source chain to target chain. Message is
-(almost) opaque to the module and the final goal is to hand message to the message dispatch
-mechanism.
-
-## Contents
-
-- [Overview](#overview)
-- [Message Workflow](#message-workflow)
-- [Integrating Message Lane Module into Runtime](#integrating-messages-module-into-runtime)
-- [Non-Essential Functionality](#non-essential-functionality)
-- [Weights of Module Extrinsics](#weights-of-module-extrinsics)
-
-## Overview
-
-Message lane is an unidirectional channel, where messages are sent from source chain to the target
-chain. At the same time, a single instance of messages module supports both outbound lanes and
-inbound lanes. So the chain where the module is deployed (this chain), may act as a source chain for
-outbound messages (heading to a bridged chain) and as a target chain for inbound messages (coming
-from a bridged chain).
-
-Messages module supports multiple message lanes. Every message lane is identified with a 4-byte
-identifier. Messages sent through the lane are assigned unique (for this lane) increasing integer
-value that is known as nonce ("number that can only be used once"). Messages that are sent over the
-same lane are guaranteed to be delivered to the target chain in the same order they're sent from
-the source chain. In other words, message with nonce `N` will be delivered right before delivering a
-message with nonce `N+1`.
-
-Single message lane may be seen as a transport channel for single application (onchain, offchain or
-mixed). At the same time the module itself never dictates any lane or message rules. In the end, it
-is the runtime developer who defines what message lane and message mean for this runtime.
-
-In our [Kusama<>Polkadot bridge](../../docs/polkadot-kusama-bridge-overview.md) we are using lane
-as a channel of communication between two parachains of different relay chains. For example, lane
-`[0, 0, 0, 0]` is used for Polkadot <> Kusama Asset Hub communications. Other lanes may be used to
-bridge other parachains.
-
-## Message Workflow
-
-The pallet is not intended to be used by end users and provides no public calls to send the message.
-Instead, it provides runtime-internal method that allows other pallets (or other runtime code) to queue
-outbound messages.
-
-The message "appears" when some runtime code calls the `send_message()` method of the pallet.
-The submitter specifies the lane that they're willing to use and the message itself. If some fee must
-be paid for sending the message, it must be paid outside of the pallet. If a message passes all checks
-(that include, for example, message size check, disabled lane check, ...), the nonce is assigned and
-the message is stored in the module storage. The message is in an "undelivered" state now.
-
-We assume that there are external, offchain actors, called relayers, that are submitting module
-related transactions to both target and source chains. The pallet itself has no assumptions about
-relayers incentivization scheme, but it has some callbacks for paying rewards. See
-[Integrating Messages Module into runtime](#Integrating-Messages-Module-into-runtime)
-for details.
-
-Eventually, some relayer would notice this message in the "undelivered" state and it would decide to
-deliver this message. Relayer then crafts `receive_messages_proof()` transaction (aka delivery
-transaction) for the messages module instance, deployed at the target chain. Relayer provides
-its account id at the source chain, the proof of message (or several messages), the number of
-messages in the transaction and their cumulative dispatch weight. Once a transaction is mined, the
-message is considered "delivered".
-
-Once a message is delivered, the relayer may want to confirm delivery back to the source chain.
-There are two reasons why it would want to do that. The first is that we intentionally limit number
-of "delivered", but not yet "confirmed" messages at inbound lanes
-(see [What about other Constants in the Messages Module Configuration Trait](#What-about-other-Constants-in-the-Messages-Module-Configuration-Trait) for explanation).
-So at some point, the target chain may stop accepting new messages until relayers confirm some of
-these. The second is that if the relayer wants to be rewarded for delivery, it must prove the fact
-that it has actually delivered the message. And this proof may only be generated after the delivery
-transaction is mined. So relayer crafts the `receive_messages_delivery_proof()` transaction (aka
-confirmation transaction) for the messages module instance, deployed at the source chain. Once
-this transaction is mined, the message is considered "confirmed".
-
-The "confirmed" state is the final state of the message. But there's one last thing related to the
-message - the fact that it is now "confirmed" and reward has been paid to the relayer (or at least
-callback for this has been called), must be confirmed to the target chain. Otherwise, we may reach
-the limit of "unconfirmed" messages at the target chain and it will stop accepting new messages. So
-relayer sometimes includes a nonce of the latest "confirmed" message in the next
-`receive_messages_proof()` transaction, proving that some messages have been confirmed.
-
-## Integrating Messages Module into Runtime
-
-As it has been said above, the messages module supports both outbound and inbound message lanes.
-So if we will integrate a module in some runtime, it may act as the source chain runtime for
-outbound messages and as the target chain runtime for inbound messages. In this section, we'll
-sometimes refer to the chain we're currently integrating with, as "this chain" and the other
-chain as "bridged chain".
-
-Messages module doesn't simply accept transactions that are claiming that the bridged chain has
-some updated data for us. Instead of this, the module assumes that the bridged chain is able to
-prove that updated data in some way. The proof is abstracted from the module and may be of any kind.
-In our Substrate-to-Substrate bridge we're using runtime storage proofs. Other bridges may use
-transaction proofs, Substrate header digests or anything else that may be proved.
-
-**IMPORTANT NOTE**: everything below in this chapter describes details of the messages module
-configuration. But if you're interested in well-probed and relatively easy integration of two
-Substrate-based chains, you may want to look at the
-[bridge-runtime-common](../../bin/runtime-common/) crate. This crate is providing a lot of
-helpers for integration, which may be directly used from within your runtime. Then if you'll decide
-to change something in this scheme, get back here for detailed information.
-
-### General Information
-
-The messages module supports instances. Every module instance is supposed to bridge this chain
-and some bridged chain. To bridge with another chain, using another instance is suggested (this
-isn't forced anywhere in the code, though). Keep in mind, that the pallet may be used to build
-virtual channels between multiple chains, as we do in our [Polkadot <> Kusama bridge](../../docs/polkadot-kusama-bridge-overview.md).
-There, the pallet actually bridges only two parachains - Kusama Bridge Hub and Polkadot
-Bridge Hub. However, other Kusama and Polkadot parachains are able to send (XCM) messages to their
-Bridge Hubs. The messages will be delivered to the other side of the bridge and routed to the proper
-destination parachain within the bridged chain consensus.
-
-Message submitters may track message progress by inspecting module events. When Message is accepted,
-the `MessageAccepted` event is emitted. The event contains both message lane identifier and nonce that
-has been assigned to the message. When a message is delivered to the target chain, the `MessagesDelivered`
-event is emitted from the `receive_messages_delivery_proof()` transaction. The `MessagesDelivered` contains
-the message lane identifier and inclusive range of delivered message nonces.
-
-The pallet provides no means to get the result of message dispatch at the target chain. If that is
-required, it must be done outside of the pallet. For example, XCM messages, when dispatched, have
-special instructions to send some data back to the sender. Other dispatchers may use similar
-mechanism for that.
-### How to plug-in Messages Module to Send Messages to the Bridged Chain?
-
-The `pallet_bridge_messages::Config` trait has 3 main associated types that are used to work with
-outbound messages. The `pallet_bridge_messages::Config::TargetHeaderChain` defines how we see the
-bridged chain as the target for our outbound messages. It must be able to check that the bridged
-chain may accept our message - like that the message has size below maximal possible transaction
-size of the chain and so on. And when the relayer sends us a confirmation transaction, this
-implementation must be able to parse and verify the proof of messages delivery. Normally, you would
-reuse the same (configurable) type on all chains that are sending messages to the same bridged
-chain.
-
-The `pallet_bridge_messages::Config::LaneMessageVerifier` defines a single callback to verify outbound
-messages. The simplest callback may just accept all messages. But in this case you'll need to answer
-many questions first. Who will pay for the delivery and confirmation transaction? Are we sure that
-someone will ever deliver this message to the bridged chain? Are we sure that we don't bloat our
-runtime storage by accepting this message? What if the message is improperly encoded or has some
-fields set to invalid values? Answering all those (and similar) questions would lead to correct
-implementation.
-
-There's another thing to consider when implementing type for use in
-`pallet_bridge_messages::Config::LaneMessageVerifier`. It is whether we treat all message lanes
-identically, or they'll have different sets of verification rules? For example, you may reserve
-lane#1 for messages coming from some 'wrapped-token' pallet - then you may verify in your
-implementation that the origin is associated with this pallet. Lane#2 may be reserved for 'system'
-messages and you may charge zero fee for such messages. You may have some rate limiting for messages
-sent over the lane#3. Or you may just verify the same rules set for all outbound messages - it is
-all up to the `pallet_bridge_messages::Config::LaneMessageVerifier` implementation.
-
-The last type is the `pallet_bridge_messages::Config::DeliveryConfirmationPayments`. When confirmation
-transaction is received, we call the `pay_reward()` method, passing the range of delivered messages.
-You may use the [`pallet-bridge-relayers`](../relayers/) pallet and its
-[`DeliveryConfirmationPaymentsAdapter`](../relayers/src/payment_adapter.rs) adapter as a possible
-implementation. It allows you to pay fixed reward for relaying the message and some of its portion
-for confirming delivery.
-
-### I have a Messages Module in my Runtime, but I Want to Reject all Outbound Messages. What shall I do?
-
-You should be looking at the `bp_messages::source_chain::ForbidOutboundMessages` structure
-[`bp_messages::source_chain`](../../primitives/messages/src/source_chain.rs). It implements
-all required traits and will simply reject all transactions, related to outbound messages.
-
-### How to plug-in Messages Module to Receive Messages from the Bridged Chain?
-
-The `pallet_bridge_messages::Config` trait has 2 main associated types that are used to work with
-inbound messages. The `pallet_bridge_messages::Config::SourceHeaderChain` defines how we see the
-bridged chain as the source of our inbound messages. When relayer sends us a delivery transaction,
-this implementation must be able to parse and verify the proof of messages wrapped in this
-transaction. Normally, you would reuse the same (configurable) type on all chains that are sending
-messages to the same bridged chain.
-
-The `pallet_bridge_messages::Config::MessageDispatch` defines a way on how to dispatch delivered
-messages. Apart from actually dispatching the message, the implementation must return the correct
-dispatch weight of the message before dispatch is called.
-
-### I have a Messages Module in my Runtime, but I Want to Reject all Inbound Messages. What shall I do?
-
-You should be looking at the `bp_messages::target_chain::ForbidInboundMessages` structure from
-the [`bp_messages::target_chain`](../../primitives/messages/src/target_chain.rs) module. It
-implements all required traits and will simply reject all transactions, related to inbound messages.
-
-### What about other Constants in the Messages Module Configuration Trait?
-
-Two settings that are used to check messages in the `send_message()` function. The
-`pallet_bridge_messages::Config::ActiveOutboundLanes` is an array of all message lanes, that
-may be used to send messages. All messages sent using other lanes are rejected. All messages that have
-size above `pallet_bridge_messages::Config::MaximalOutboundPayloadSize` will also be rejected.
-
-To be able to reward the relayer for delivering messages, we store a map of message nonces range =>
-identifier of the relayer that has delivered this range at the target chain runtime storage. If a
-relayer delivers multiple consequent ranges, they're merged into single entry. So there may be more
-than one entry for the same relayer. Eventually, this whole map must be delivered back to the source
-chain to confirm delivery and pay rewards. So to make sure we are able to craft this confirmation
-transaction, we need to: (1) keep the size of this map below a certain limit and (2) make sure that
-the weight of processing this map is below a certain limit. Both size and processing weight mostly
-depend on the number of entries. The number of entries is limited with the
-`pallet_bridge_messages::ConfigMaxUnrewardedRelayerEntriesAtInboundLane` parameter. Processing weight
-also depends on the total number of messages that are being confirmed, because every confirmed
-message needs to be read. So there's another
-`pallet_bridge_messages::Config::MaxUnconfirmedMessagesAtInboundLane` parameter for that.
-
-When choosing values for these parameters, you must also keep in mind that if proof in your scheme
-is based on finality of headers (and it is the most obvious option for Substrate-based chains with
-finality notion), then choosing too small values for these parameters may cause significant delays
-in message delivery. That's because there are too many actors involved in this scheme: 1) authorities
-that are finalizing headers of the target chain need to finalize header with non-empty map; 2) the
-headers relayer then needs to submit this header and its finality proof to the source chain; 3) the
-messages relayer must then send confirmation transaction (storage proof of this map) to the source
-chain; 4) when the confirmation transaction will be mined at some header, source chain authorities
-must finalize this header; 5) the headers relay then needs to submit this header and its finality
-proof to the target chain; 6) only now the messages relayer may submit new messages from the source
-to target chain and prune the entry from the map.
-
-Delivery transaction requires the relayer to provide both number of entries and total number of
-messages in the map. This means that the module never charges an extra cost for delivering a map -
-the relayer would need to pay exactly for the number of entries+messages it has delivered. So the
-best guess for values of these parameters would be the pair that would occupy `N` percent of the
-maximal transaction size and weight of the source chain. The `N` should be large enough to process
-large maps, at the same time keeping reserve for future source chain upgrades.
-
-## Non-Essential Functionality
-
-There may be a special account in every runtime where the messages module is deployed. This
-account, named 'module owner', is like a module-level sudo account - he's able to halt and
-resume all module operations without requiring runtime upgrade. Calls that are related to this
-account are:
-- `fn set_owner()`: current module owner may call it to transfer "ownership" to another account;
-- `fn halt_operations()`: the module owner (or sudo account) may call this function to stop all
- module operations. After this call, all message-related transactions will be rejected until
- further `resume_operations` call'. This call may be used when something extraordinary happens with
- the bridge;
-- `fn resume_operations()`: module owner may call this function to resume bridge operations. The
- module will resume its regular operations after this call.
-
-If pallet owner is not defined, the governance may be used to make those calls.
-
-## Messages Relay
-
-We have an offchain actor, who is watching for new messages and submits them to the bridged chain.
-It is the messages relay - you may look at the [crate level documentation and the code](../../relays/messages/).
diff --git a/cumulus/bridges/rustfmt.toml b/cumulus/bridges/rustfmt.toml
deleted file mode 100644
index 082150daf04ee39ada660c315fd0f5bbcf99dea0..0000000000000000000000000000000000000000
--- a/cumulus/bridges/rustfmt.toml
+++ /dev/null
@@ -1,24 +0,0 @@
-# Basic
-hard_tabs = true
-max_width = 100
-use_small_heuristics = "Max"
-# Imports
-imports_granularity = "Crate"
-reorder_imports = true
-# Consistency
-newline_style = "Unix"
-# Format comments
-comment_width = 100
-wrap_comments = true
-# Misc
-chain_width = 80
-spaces_around_ranges = false
-binop_separator = "Back"
-reorder_impl_items = false
-match_arm_leading_pipes = "Preserve"
-match_arm_blocks = false
-match_block_trailing_comma = true
-trailing_comma = "Vertical"
-trailing_semicolon = false
-use_field_init_shorthand = true
-
diff --git a/cumulus/client/cli/Cargo.toml b/cumulus/client/cli/Cargo.toml
index 6c44d5f5fd3b6631a7cfa0449d9d04adaa300a1f..c45b669fc6d1e58cad16dde5e45111fe5a9a74d4 100644
--- a/cumulus/client/cli/Cargo.toml
+++ b/cumulus/client/cli/Cargo.toml
@@ -5,7 +5,7 @@ authors.workspace = true
edition.workspace = true
[dependencies]
-clap = { version = "4.4.2", features = ["derive"] }
+clap = { version = "4.4.4", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0" }
url = "2.4.0"
diff --git a/cumulus/client/consensus/aura/src/collators/lookahead.rs b/cumulus/client/consensus/aura/src/collators/lookahead.rs
index 58d8e9d1a062f7538b498f34c1f510593d2f5412..57cd646fbcdef58fca265454eeeb677c35beee7b 100644
--- a/cumulus/client/consensus/aura/src/collators/lookahead.rs
+++ b/cumulus/client/consensus/aura/src/collators/lookahead.rs
@@ -34,7 +34,8 @@
use codec::{Codec, Encode};
use cumulus_client_collator::service::ServiceInterface as CollatorServiceInterface;
use cumulus_client_consensus_common::{
- self as consensus_common, ParachainBlockImportMarker, ParentSearchParams,
+ self as consensus_common, load_abridged_host_configuration, ParachainBlockImportMarker,
+ ParentSearchParams,
};
use cumulus_client_consensus_proposer::ProposerInterface;
use cumulus_primitives_aura::AuraUnincludedSegmentApi;
@@ -44,11 +45,13 @@ use cumulus_primitives_core::{
use cumulus_relay_chain_interface::RelayChainInterface;
use polkadot_node_primitives::SubmitCollationParams;
-use polkadot_node_subsystem::messages::CollationGenerationMessage;
+use polkadot_node_subsystem::messages::{
+ CollationGenerationMessage, RuntimeApiMessage, RuntimeApiRequest,
+};
use polkadot_overseer::Handle as OverseerHandle;
use polkadot_primitives::{CollatorPair, Id as ParaId, OccupiedCoreAssumption};
-use futures::prelude::*;
+use futures::{channel::oneshot, prelude::*};
use sc_client_api::{backend::AuxStore, BlockBackend, BlockOf};
use sc_consensus::BlockImport;
use sc_consensus_aura::standalone as aura_internal;
@@ -180,6 +183,17 @@ where
while let Some(relay_parent_header) = import_notifications.next().await {
let relay_parent = relay_parent_header.hash();
+ if !is_para_scheduled(relay_parent, params.para_id, &mut params.overseer_handle).await {
+ tracing::trace!(
+ target: crate::LOG_TARGET,
+ ?relay_parent,
+ ?params.para_id,
+ "Para is not scheduled on any core, skipping import notification",
+ );
+
+ continue
+ }
+
let max_pov_size = match params
.relay_client
.persisted_validation_data(
@@ -416,16 +430,68 @@ where
Some(SlotClaim::unchecked::
(author_pub, slot, timestamp))
}
+/// Reads allowed ancestry length parameter from the relay chain storage at the given relay parent.
+///
+/// Falls back to 0 in case of an error.
async fn max_ancestry_lookback(
- _relay_parent: PHash,
- _relay_client: &impl RelayChainInterface,
+ relay_parent: PHash,
+ relay_client: &impl RelayChainInterface,
) -> usize {
- // TODO [https://github.com/paritytech/cumulus/issues/2706]
- // We need to read the relay-chain state to know what the maximum
- // age truly is, but that depends on those pallets existing.
- //
- // For now, just provide the conservative value of '2'.
- // Overestimating can cause problems, as we'd be building on forks of the
- // chain that can never get included. Underestimating is less of an issue.
- 2
+ match load_abridged_host_configuration(relay_parent, relay_client).await {
+ Ok(Some(config)) => config.async_backing_params.allowed_ancestry_len as usize,
+ Ok(None) => {
+ tracing::error!(
+ target: crate::LOG_TARGET,
+ "Active config is missing in relay chain storage",
+ );
+ 0
+ },
+ Err(err) => {
+ tracing::error!(
+ target: crate::LOG_TARGET,
+ ?err,
+ ?relay_parent,
+ "Failed to read active config from relay chain client",
+ );
+ 0
+ },
+ }
+}
+
+// Checks if there exists a scheduled core for the para at the provided relay parent.
+//
+// Falls back to `false` in case of an error.
+async fn is_para_scheduled(
+ relay_parent: PHash,
+ para_id: ParaId,
+ overseer_handle: &mut OverseerHandle,
+) -> bool {
+ let (tx, rx) = oneshot::channel();
+ let request = RuntimeApiRequest::AvailabilityCores(tx);
+ overseer_handle
+ .send_msg(RuntimeApiMessage::Request(relay_parent, request), "LookaheadCollator")
+ .await;
+
+ let cores = match rx.await {
+ Ok(Ok(cores)) => cores,
+ Ok(Err(error)) => {
+ tracing::error!(
+ target: crate::LOG_TARGET,
+ ?error,
+ ?relay_parent,
+ "Failed to query availability cores runtime API",
+ );
+ return false
+ },
+ Err(oneshot::Canceled) => {
+ tracing::error!(
+ target: crate::LOG_TARGET,
+ ?relay_parent,
+ "Sender for availability cores runtime request dropped",
+ );
+ return false
+ },
+ };
+
+ cores.iter().any(|core| core.para_id() == Some(para_id))
}
diff --git a/cumulus/client/consensus/common/src/lib.rs b/cumulus/client/consensus/common/src/lib.rs
index edd97cf02a2557b372f3a88234267a0a4e639929..08bceabb2bd4a49ac8917e82caf1b97cd9eac183 100644
--- a/cumulus/client/consensus/common/src/lib.rs
+++ b/cumulus/client/consensus/common/src/lib.rs
@@ -20,8 +20,8 @@ use polkadot_primitives::{
};
use cumulus_primitives_core::{
- relay_chain::{BlockId as RBlockId, OccupiedCoreAssumption},
- ParaId,
+ relay_chain::{self, BlockId as RBlockId, OccupiedCoreAssumption},
+ AbridgedHostConfiguration, ParaId,
};
use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface};
@@ -211,6 +211,7 @@ pub trait ParachainBlockImportMarker {}
impl ParachainBlockImportMarker for ParachainBlockImport {}
/// Parameters when searching for suitable parents to build on top of.
+#[derive(Debug)]
pub struct ParentSearchParams {
/// The relay-parent that is intended to be used.
pub relay_parent: PHash,
@@ -228,6 +229,7 @@ pub struct ParentSearchParams {
}
/// A potential parent block returned from [`find_potential_parents`]
+#[derive(Debug, PartialEq)]
pub struct PotentialParent {
/// The hash of the block.
pub hash: B::Hash,
@@ -412,3 +414,18 @@ pub fn relay_slot_and_timestamp(
})
.ok()
}
+
+/// Reads abridged host configuration from the relay chain storage at the given relay parent.
+pub async fn load_abridged_host_configuration(
+ relay_parent: PHash,
+ relay_client: &impl RelayChainInterface,
+) -> Result