diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index fdaa0c8628f766e241ba9043698b611a0bd78811..4fc5b97caae0735058337c8b23e4ca7471761d24 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -13,7 +13,7 @@
# - Multiple owners are supported.
# - Either handle (e.g, @github_user or @github/team) or email can be used. Keep in mind,
# that handles might work better because they are more recognizable on GitHub,
-# eyou can use them for mentioning unlike an email.
+# you can use them for mentioning unlike an email.
# - The latest matching rule, if multiple, takes precedence.
# CI
diff --git a/.github/scripts/common/lib.sh b/.github/scripts/common/lib.sh
index 29dc269ffd23b1f51e1eb2b87a61544de0cbb57f..932a6d546c3706f50c74873c32cb8e61e3d33461 100755
--- a/.github/scripts/common/lib.sh
+++ b/.github/scripts/common/lib.sh
@@ -237,7 +237,7 @@ fetch_release_artifacts() {
popd > /dev/null
}
-# Fetch the release artifacts like binary and sigantures from S3. Assumes the ENV are set:
+# Fetch the release artifacts like binary and signatures from S3. Assumes the ENV are set:
# - RELEASE_ID
# - GITHUB_TOKEN
# - REPO in the form paritytech/polkadot
diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml
index 903d7a3fcb3d94bb6913d94627418d9212397bf3..58065f369c9cf160b0b94c233df9df1016426d07 100644
--- a/.github/workflows/check-links.yml
+++ b/.github/workflows/check-links.yml
@@ -3,8 +3,8 @@ name: Check links
on:
pull_request:
paths:
- - "*.rs"
- - "*.prdoc"
+ - "**.rs"
+ - "**.prdoc"
- ".github/workflows/check-links.yml"
- ".config/lychee.toml"
types: [opened, synchronize, reopened, ready_for_review]
diff --git a/.github/workflows/subsystem-benchmarks.yml b/.github/workflows/subsystem-benchmarks.yml
new file mode 100644
index 0000000000000000000000000000000000000000..f0d56bf6e9d3937d2f7c16873ea34bf1377e2aa2
--- /dev/null
+++ b/.github/workflows/subsystem-benchmarks.yml
@@ -0,0 +1,54 @@
+# The actions takes json file as input and runs github-action-benchmark for it.
+
+on:
+ workflow_dispatch:
+ inputs:
+ benchmark-data-dir-path:
+ description: "Path to the benchmark data directory"
+ required: true
+ type: string
+ output-file-path:
+ description: "Path to the benchmark data file"
+ required: true
+ type: string
+
+jobs:
+ subsystem-benchmarks:
+ runs-on: ubuntu-latest
+ environment: subsystem-benchmarks
+ steps:
+ - name: Validate inputs
+ run: |
+ echo "${{ github.event.inputs.benchmark-data-dir-path }}" | grep -P '^[a-z\-]'
+ echo "${{ github.event.inputs.output-file-path }}" | grep -P '^[a-z\-]+\.json'
+
+ - name: Checkout Sources
+ uses: actions/checkout@v4.1.2
+ with:
+ fetch-depth: 0
+ ref: "gh-pages"
+
+ - name: Copy bench results
+ id: step_one
+ run: |
+ cp bench/gitlab/${{ github.event.inputs.output-file-path }} ${{ github.event.inputs.output-file-path }}
+
+ - name: Switch branch
+ id: step_two
+ run: |
+ git checkout master --
+
+ - uses: actions/create-github-app-token@v1
+ id: app-token
+ with:
+ app-id: ${{ secrets.POLKADOTSDK_GHPAGES_APP_ID }}
+ private-key: ${{ secrets.POLKADOTSDK_GHPAGES_APP_KEY }}
+
+ - name: Store benchmark result
+ uses: benchmark-action/github-action-benchmark@v1
+ with:
+ tool: "customSmallerIsBetter"
+ output-file-path: ${{ github.event.inputs.output-file-path }}
+ benchmark-data-dir-path: "bench/${{ github.event.inputs.benchmark-data-dir-path }}"
+ github-token: ${{ steps.app-token.outputs.token }}
+ auto-push: true
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7f8796ca51248acb8be92fcb9f76e280b18e605e..93a6ccb9f8fbabc48a31d403ae4ed17bc2c2966a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -147,6 +147,13 @@ default:
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- if: $CI_COMMIT_REF_NAME =~ /^gh-readonly-queue.*$/ # merge queues
+.publish-gh-pages-refs:
+ rules:
+ - if: $CI_PIPELINE_SOURCE == "pipeline"
+ when: never
+ - if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_REF_NAME == "master"
+ - if: $CI_COMMIT_REF_NAME == "master"
+
# handle the specific case where benches could store incorrect bench data because of the downstream staging runs
# exclude cargo-check-benches from such runs
.test-refs-check-benches:
diff --git a/.gitlab/pipeline/build.yml b/.gitlab/pipeline/build.yml
index f8de6135572565d9d16465e68aa3f0bace915cc5..44d66eb2f5eb73dcdab8dad2b4b35165cf9dc4c7 100644
--- a/.gitlab/pipeline/build.yml
+++ b/.gitlab/pipeline/build.yml
@@ -350,7 +350,7 @@ build-runtimes-polkavm:
- .run-immediately
# - .collect-artifact
variables:
- # this variable gets overriden by "rusty-cachier environment inject", use the value as default
+ # this variable gets overridden by "rusty-cachier environment inject", use the value as default
CARGO_TARGET_DIR: "$CI_PROJECT_DIR/target"
before_script:
- mkdir -p ./artifacts/subkey
diff --git a/.gitlab/pipeline/publish.yml b/.gitlab/pipeline/publish.yml
index b73acb560f67f93e540826b95fcf075374189846..a37ba012a8a7678b2b7a453fb8d3dfb6d2582501 100644
--- a/.gitlab/pipeline/publish.yml
+++ b/.gitlab/pipeline/publish.yml
@@ -3,16 +3,13 @@
publish-rustdoc:
stage: publish
- extends: .kubernetes-env
+ extends:
+ - .kubernetes-env
+ - .publish-gh-pages-refs
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
@@ -60,9 +57,76 @@ publish-rustdoc:
- git commit -m "___Updated docs for ${CI_COMMIT_REF_NAME}___" ||
echo "___Nothing to commit___"
- git push origin gh-pages --force
+ # artificial sleep to publish gh-pages
+ - sleep 300
+ after_script:
+ - rm -rf .git/ ./*
+
+publish-subsystem-benchmarks:
+ stage: publish
+ variables:
+ CI_IMAGE: "paritytech/tools:latest"
+ extends:
+ - .kubernetes-env
+ - .publish-gh-pages-refs
+ needs:
+ - job: subsystem-regression-tests
+ artifacts: true
+ - job: publish-rustdoc
+ artifacts: false
+ script:
+ # 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
+ - rm -rf .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
+ # Push result to github
+ - git checkout gh-pages --force
+ - mkdir -p bench/gitlab/ || echo "Directory exists"
+ - rm -rf bench/gitlab/*.json || echo "No json files"
+ - cp -r charts/*.json bench/gitlab/
+ - git add bench/gitlab/
+ - git commit -m "Add json files with benchmark results for ${CI_COMMIT_REF_NAME}"
+ - git push origin gh-pages
+ # artificial sleep to publish gh-pages
+ - sleep 300
+ allow_failure: true
after_script:
- rm -rf .git/ ./*
+trigger_workflow:
+ stage: deploy
+ extends:
+ - .kubernetes-env
+ - .publish-gh-pages-refs
+ needs:
+ - job: publish-subsystem-benchmarks
+ artifacts: false
+ - job: subsystem-regression-tests
+ artifacts: true
+ script:
+ - echo "Triggering workflow"
+ - |
+ for benchmark in $(ls charts/*.json); do
+ export bencmark_name=$(basename $benchmark)
+ echo "Benchmark: $bencmark_name"
+ export benchmark_dir=$(echo $bencmark_name | sed 's/\.json//')
+ curl -q -X POST \
+ -H "Accept: application/vnd.github.v3+json" \
+ -H "Authorization: token $GITHUB_TOKEN" \
+ https://api.github.com/repos/paritytech/${CI_PROJECT_NAME}/actions/workflows/subsystem-benchmarks.yml/dispatches \
+ -d '{"ref":"refs/heads/master","inputs":{"benchmark-data-dir-path":"'$benchmark_dir'","output-file-path":"'$bencmark_name'"}}'
+ sleep 300
+ done
+ allow_failure: true
+
# note: images are used not only in zombienet but also in rococo, wococo and versi
.build-push-image:
image: $BUILDAH_IMAGE
diff --git a/.gitlab/pipeline/test.yml b/.gitlab/pipeline/test.yml
index d244316000aaf152810c396e37e470694be506cc..48c84b472b4354fe7eeb12bbf2880c276e90a477 100644
--- a/.gitlab/pipeline/test.yml
+++ b/.gitlab/pipeline/test.yml
@@ -25,7 +25,6 @@ test-linux-stable:
# "upgrade_version_checks_should_work" is currently failing
- |
time cargo nextest run \
- --filter-expr 'not deps(/polkadot-subsystem-bench/)' \
--workspace \
--locked \
--release \
@@ -70,7 +69,7 @@ test-linux-stable-runtime-benchmarks:
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- - time cargo nextest run --filter-expr 'not deps(/polkadot-subsystem-bench/)' --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet
+ - time cargo nextest run --workspace --features runtime-benchmarks benchmark --locked --cargo-profile testnet
# can be used to run all tests
# test-linux-stable-all:
@@ -497,12 +496,19 @@ test-syscalls:
subsystem-regression-tests:
stage: test
+ artifacts:
+ name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
+ when: always
+ expire_in: 1 days
+ paths:
+ - charts/
extends:
- .docker-env
- .common-refs
- .run-immediately
script:
- cargo bench --profile=testnet -p polkadot-availability-recovery --bench availability-recovery-regression-bench --features subsystem-benchmarks
+ - cargo bench --profile=testnet -p polkadot-availability-distribution --bench availability-distribution-regression-bench --features subsystem-benchmarks
tags:
- benchmark
allow_failure: true
diff --git a/.gitlab/pipeline/zombienet.yml b/.gitlab/pipeline/zombienet.yml
index 8d308714fab3cb44827bb202fce0939f52f730ad..52948e1eb719d9f8669523d9762f5662fd1b6e96 100644
--- a/.gitlab/pipeline/zombienet.yml
+++ b/.gitlab/pipeline/zombienet.yml
@@ -1,7 +1,8 @@
.zombienet-refs:
extends: .build-refs
variables:
- ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.95"
+ ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.99"
+ PUSHGATEWAY_URL: "http://zombienet-prometheus-pushgateway.managed-monitoring:9091/metrics/job/zombie-metrics"
include:
# substrate tests
diff --git a/.gitlab/rust-features.sh b/.gitlab/rust-features.sh
index c0ac192a6ec69ba16abb3bad2ec49de7e9cebb61..c3ec61ab8714768c9a49f2eb2e1e544706a1d875 100755
--- a/.gitlab/rust-features.sh
+++ b/.gitlab/rust-features.sh
@@ -15,7 +15,7 @@
#
# The steps of this script:
# 1. Check that all required dependencies are installed.
-# 2. Check that all rules are fullfilled for the whole workspace. If not:
+# 2. Check that all rules are fulfilled for the whole workspace. If not:
# 4. Check all crates to find the offending ones.
# 5. Print all offending crates and exit with code 1.
#
diff --git a/Cargo.lock b/Cargo.lock
index 074b657e767b1cc121a471f5aee662fc2290ebda..42524fc7765babca8787722d48c70b0a1d06e376 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -275,9 +275,9 @@ dependencies = [
[[package]]
name = "anstyle"
-version = "1.0.2"
+version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea"
+checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc"
[[package]]
name = "anstyle-parse"
@@ -867,6 +867,7 @@ dependencies = [
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
+ "cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"frame-benchmarking",
"frame-executive",
@@ -990,6 +991,7 @@ dependencies = [
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
+ "cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"frame-benchmarking",
"frame-executive",
@@ -1239,9 +1241,9 @@ checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae"
[[package]]
name = "async-trait"
-version = "0.1.74"
+version = "0.1.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9"
+checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681"
dependencies = [
"proc-macro2",
"quote",
@@ -1393,7 +1395,7 @@ name = "binary-merkle-tree"
version = "13.0.0"
dependencies = [
"array-bytes 6.1.0",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"hash-db",
"log",
"sp-core",
@@ -2010,6 +2012,7 @@ dependencies = [
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
+ "cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"frame-benchmarking",
"frame-executive",
@@ -2148,6 +2151,7 @@ dependencies = [
"pallet-message-queue",
"pallet-xcm",
"parachains-common",
+ "parity-scale-codec",
"rococo-westend-system-emulated-network",
"sp-runtime",
"staging-xcm",
@@ -2180,6 +2184,7 @@ dependencies = [
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
+ "cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"frame-benchmarking",
"frame-executive",
@@ -2623,9 +2628,9 @@ dependencies = [
[[package]]
name = "clap-num"
-version = "1.1.1"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0e063d263364859dc54fb064cedb7c122740cd4733644b14b176c097f51e8ab7"
+checksum = "488557e97528174edaa2ee268b23a809e0c598213a4bbcb4f34575a46fda147e"
dependencies = [
"num-traits",
]
@@ -2738,6 +2743,7 @@ dependencies = [
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
+ "cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"frame-benchmarking",
"frame-executive",
@@ -2843,10 +2849,11 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
[[package]]
name = "colored"
-version = "2.1.0"
+version = "2.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8"
+checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6"
dependencies = [
+ "is-terminal",
"lazy_static",
"windows-sys 0.48.0",
]
@@ -2992,6 +2999,7 @@ dependencies = [
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
+ "cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"frame-benchmarking",
"frame-executive",
@@ -3086,6 +3094,7 @@ dependencies = [
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
+ "cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"frame-benchmarking",
"frame-executive",
@@ -3150,6 +3159,7 @@ dependencies = [
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
+ "cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"frame-benchmarking",
"frame-executive",
@@ -3802,6 +3812,7 @@ dependencies = [
"sp-blockchain",
"sp-consensus",
"sp-core",
+ "sp-io",
"sp-runtime",
"sp-transaction-pool",
]
@@ -4047,7 +4058,7 @@ dependencies = [
"cumulus-primitives-core",
"cumulus-primitives-proof-size-hostfunction",
"cumulus-test-runtime",
- "docify 0.2.7",
+ "docify",
"frame-support",
"frame-system",
"log",
@@ -4320,7 +4331,6 @@ dependencies = [
"frame-system-rpc-runtime-api",
"futures",
"jsonrpsee",
- "pallet-im-online",
"pallet-timestamp",
"pallet-transaction-payment",
"parachains-common",
@@ -4570,6 +4580,17 @@ dependencies = [
"syn 1.0.109",
]
+[[package]]
+name = "derive-syn-parse"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.53",
+]
+
[[package]]
name = "derive_more"
version = "0.99.17"
@@ -4717,47 +4738,21 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
[[package]]
name = "docify"
-version = "0.1.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af1b04e6ef3d21119d3eb7b032bca17f99fe041e9c072f30f32cc0e1a2b1f3c4"
-dependencies = [
- "docify_macros 0.1.16",
-]
-
-[[package]]
-name = "docify"
-version = "0.2.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7cc4fd38aaa9fb98ac70794c82a00360d1e165a87fbf96a8a91f9dfc602aaee2"
-dependencies = [
- "docify_macros 0.2.7",
-]
-
-[[package]]
-name = "docify_macros"
-version = "0.1.16"
+version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b5610df7f2acf89a1bb5d1a66ae56b1c7fcdcfe3948856fb3ace3f644d70eb7"
+checksum = "43a2f138ad521dc4a2ced1a4576148a6a610b4c5923933b062a263130a6802ce"
dependencies = [
- "common-path",
- "derive-syn-parse",
- "lazy_static",
- "proc-macro2",
- "quote",
- "regex",
- "syn 2.0.53",
- "termcolor",
- "walkdir",
+ "docify_macros",
]
[[package]]
name = "docify_macros"
-version = "0.2.7"
+version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63fa215f3a0d40fb2a221b3aa90d8e1fbb8379785a990cb60d62ac71ebdc6460"
+checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad"
dependencies = [
"common-path",
- "derive-syn-parse",
+ "derive-syn-parse 0.2.0",
"once_cell",
"proc-macro2",
"quote",
@@ -5005,10 +5000,10 @@ dependencies = [
]
[[package]]
-name = "env_logger"
-version = "0.8.4"
+name = "env_filter"
+version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3"
+checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea"
dependencies = [
"log",
"regex",
@@ -5016,15 +5011,12 @@ dependencies = [
[[package]]
name = "env_logger"
-version = "0.9.3"
+version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7"
+checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3"
dependencies = [
- "atty",
- "humantime",
"log",
"regex",
- "termcolor",
]
[[package]]
@@ -5040,6 +5032,19 @@ dependencies = [
"termcolor",
]
+[[package]]
+name = "env_logger"
+version = "0.11.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9"
+dependencies = [
+ "anstream",
+ "anstyle",
+ "env_filter",
+ "humantime",
+ "log",
+]
+
[[package]]
name = "environmental"
version = "1.1.4"
@@ -5453,7 +5458,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa"
name = "frame"
version = "0.0.1-dev"
dependencies = [
- "docify 0.2.7",
+ "docify",
"frame-executive",
"frame-support",
"frame-system",
@@ -5682,7 +5687,7 @@ dependencies = [
"array-bytes 6.1.0",
"assert_matches",
"bitflags 1.3.2",
- "docify 0.2.7",
+ "docify",
"environmental",
"frame-metadata",
"frame-support-procedural",
@@ -5725,7 +5730,7 @@ version = "23.0.0"
dependencies = [
"Inflector",
"cfg-expr",
- "derive-syn-parse",
+ "derive-syn-parse 0.2.0",
"expander 2.0.0",
"frame-support-procedural-tools",
"itertools 0.10.5",
@@ -5826,7 +5831,7 @@ version = "28.0.0"
dependencies = [
"cfg-if",
"criterion 0.4.0",
- "docify 0.2.7",
+ "docify",
"frame-support",
"log",
"parity-scale-codec",
@@ -6772,7 +6777,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f"
dependencies = [
- "socket2 0.5.3",
+ "socket2 0.5.6",
"widestring",
"windows-sys 0.48.0",
"winreg",
@@ -6854,9 +6859,9 @@ checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd"
[[package]]
name = "jsonrpsee"
-version = "0.22.0"
+version = "0.22.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4a95f7cc23d5fab0cdeeaf6bad8c8f5e7a3aa7f0d211957ea78232b327ab27b0"
+checksum = "87f3ae45a64cfc0882934f963be9431b2a165d667f53140358181f262aca0702"
dependencies = [
"jsonrpsee-core",
"jsonrpsee-http-client",
@@ -6870,9 +6875,9 @@ dependencies = [
[[package]]
name = "jsonrpsee-client-transport"
-version = "0.22.0"
+version = "0.22.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6b1736cfa3845fd9f8f43751f2b8e0e83f7b6081e754502f7d63b6587692cc83"
+checksum = "455fc882e56f58228df2aee36b88a1340eafd707c76af2fa68cf94b37d461131"
dependencies = [
"futures-util",
"http",
@@ -6891,9 +6896,9 @@ dependencies = [
[[package]]
name = "jsonrpsee-core"
-version = "0.22.0"
+version = "0.22.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "82030d038658974732103e623ba2e0abec03bbbe175b39c0a2fafbada60c5868"
+checksum = "b75568f4f9696e3a47426e1985b548e1a9fcb13372a5e320372acaf04aca30d1"
dependencies = [
"anyhow",
"async-lock 3.3.0",
@@ -6917,9 +6922,9 @@ dependencies = [
[[package]]
name = "jsonrpsee-http-client"
-version = "0.22.0"
+version = "0.22.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36a06ef0de060005fddf772d54597bb6a8b0413da47dcffd304b0306147b9678"
+checksum = "9e7a95e346f55df84fb167b7e06470e196e7d5b9488a21d69c5d9732043ba7ba"
dependencies = [
"async-trait",
"hyper",
@@ -6937,22 +6942,22 @@ dependencies = [
[[package]]
name = "jsonrpsee-proc-macros"
-version = "0.22.0"
+version = "0.22.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69fc56131589f82e57805f7338b87023db4aafef813555708b159787e34ad6bc"
+checksum = "30ca066e73dd70294aebc5c2675d8ffae43be944af027c857ce0d4c51785f014"
dependencies = [
"heck 0.4.1",
"proc-macro-crate 3.0.0",
"proc-macro2",
"quote",
- "syn 1.0.109",
+ "syn 2.0.53",
]
[[package]]
name = "jsonrpsee-server"
-version = "0.22.0"
+version = "0.22.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d85be77fe5b2a94589e3164fb780017f7aff7d646b49278c0d0346af16975c8e"
+checksum = "0e29c1bd1f9bba83c864977c73404e505f74f730fa0db89dd490ec174e36d7f0"
dependencies = [
"futures-util",
"http",
@@ -6974,9 +6979,9 @@ dependencies = [
[[package]]
name = "jsonrpsee-types"
-version = "0.22.0"
+version = "0.22.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a48fdc1202eafc51c63e00406575e59493284ace8b8b61aa16f3a6db5d64f1a"
+checksum = "3467fd35feeee179f71ab294516bdf3a81139e7aeebdd860e46897c12e1a3368"
dependencies = [
"anyhow",
"beef",
@@ -6987,9 +6992,9 @@ dependencies = [
[[package]]
name = "jsonrpsee-ws-client"
-version = "0.22.0"
+version = "0.22.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c5ce25d70a8e4d3cc574bbc3cad0137c326ad64b194793d5e7bbdd3fa4504181"
+checksum = "68ca71e74983f624c0cb67828e480a981586074da8ad3a2f214c6a3f884edab9"
dependencies = [
"http",
"jsonrpsee-client-transport",
@@ -7943,7 +7948,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d"
dependencies = [
"const-random",
- "derive-syn-parse",
+ "derive-syn-parse 0.1.5",
"macro_magic_core_macros",
"proc-macro2",
"quote",
@@ -9215,7 +9220,7 @@ name = "pallet-bags-list"
version = "27.0.0"
dependencies = [
"aquamarine 0.5.0",
- "docify 0.2.7",
+ "docify",
"frame-benchmarking",
"frame-election-provider-support",
"frame-support",
@@ -9263,7 +9268,7 @@ dependencies = [
name = "pallet-balances"
version = "28.0.0"
dependencies = [
- "docify 0.2.7",
+ "docify",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -9534,7 +9539,7 @@ dependencies = [
"array-bytes 6.1.0",
"assert_matches",
"bitflags 1.3.2",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"environmental",
"frame-benchmarking",
"frame-support",
@@ -9552,6 +9557,7 @@ dependencies = [
"pallet-timestamp",
"pallet-utility",
"parity-scale-codec",
+ "paste",
"pretty_assertions",
"rand",
"rand_pcg",
@@ -9780,7 +9786,7 @@ dependencies = [
"sp-runtime",
"sp-std 14.0.0",
"sp-tracing 16.0.0",
- "strum 0.24.1",
+ "strum 0.26.2",
]
[[package]]
@@ -9881,7 +9887,7 @@ dependencies = [
name = "pallet-example-single-block-migrations"
version = "0.0.1"
dependencies = [
- "docify 0.2.7",
+ "docify",
"frame-executive",
"frame-support",
"frame-system",
@@ -9947,7 +9953,7 @@ dependencies = [
name = "pallet-fast-unstake"
version = "27.0.0"
dependencies = [
- "docify 0.2.7",
+ "docify",
"frame-benchmarking",
"frame-election-provider-support",
"frame-support",
@@ -10148,7 +10154,7 @@ dependencies = [
name = "pallet-migrations"
version = "1.0.0"
dependencies = [
- "docify 0.1.16",
+ "docify",
"frame-benchmarking",
"frame-executive",
"frame-support",
@@ -10201,7 +10207,7 @@ name = "pallet-mmr"
version = "27.0.0"
dependencies = [
"array-bytes 6.1.0",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -10452,7 +10458,7 @@ dependencies = [
name = "pallet-paged-list"
version = "0.6.0"
dependencies = [
- "docify 0.2.7",
+ "docify",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -10494,7 +10500,7 @@ dependencies = [
name = "pallet-parameters"
version = "0.0.1"
dependencies = [
- "docify 0.2.7",
+ "docify",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -10655,7 +10661,7 @@ dependencies = [
name = "pallet-safe-mode"
version = "9.0.0"
dependencies = [
- "docify 0.2.7",
+ "docify",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -10712,7 +10718,7 @@ dependencies = [
name = "pallet-scheduler"
version = "29.0.0"
dependencies = [
- "docify 0.2.7",
+ "docify",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -10925,7 +10931,7 @@ dependencies = [
name = "pallet-sudo"
version = "28.0.0"
dependencies = [
- "docify 0.2.7",
+ "docify",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -10955,7 +10961,7 @@ dependencies = [
name = "pallet-timestamp"
version = "27.0.0"
dependencies = [
- "docify 0.2.7",
+ "docify",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -11059,7 +11065,7 @@ dependencies = [
name = "pallet-treasury"
version = "27.0.0"
dependencies = [
- "docify 0.2.7",
+ "docify",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -11079,7 +11085,7 @@ dependencies = [
name = "pallet-tx-pause"
version = "9.0.0"
dependencies = [
- "docify 0.2.7",
+ "docify",
"frame-benchmarking",
"frame-support",
"frame-system",
@@ -11188,6 +11194,7 @@ dependencies = [
"staging-xcm",
"staging-xcm-builder",
"staging-xcm-executor",
+ "xcm-fee-payment-runtime-api",
]
[[package]]
@@ -11765,6 +11772,7 @@ dependencies = [
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
+ "cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"enumflags2",
"frame-benchmarking",
@@ -11864,6 +11872,7 @@ dependencies = [
"cumulus-pallet-xcmp-queue",
"cumulus-primitives-aura",
"cumulus-primitives-core",
+ "cumulus-primitives-storage-weight-reclaim",
"cumulus-primitives-utility",
"enumflags2",
"frame-benchmarking",
@@ -12092,7 +12101,7 @@ version = "7.0.0"
dependencies = [
"assert_matches",
"bitvec",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"futures",
"futures-timer",
"itertools 0.10.5",
@@ -12122,7 +12131,7 @@ dependencies = [
"always-assert",
"assert_matches",
"bitvec",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"futures",
"futures-timer",
"log",
@@ -12178,7 +12187,7 @@ version = "7.0.0"
dependencies = [
"assert_matches",
"async-trait",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"fatality",
"futures",
"futures-timer",
@@ -12240,7 +12249,7 @@ version = "7.0.0"
dependencies = [
"assert_matches",
"bitvec",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"fatality",
"futures",
"futures-timer",
@@ -12412,7 +12421,7 @@ dependencies = [
"async-trait",
"bitvec",
"derive_more",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"futures",
"futures-timer",
"itertools 0.10.5",
@@ -12454,7 +12463,7 @@ version = "7.0.0"
dependencies = [
"assert_matches",
"bitvec",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"futures",
"futures-timer",
"kvdb",
@@ -12896,7 +12905,7 @@ dependencies = [
"rand_chacha 0.3.1",
"sc-authority-discovery",
"sc-network",
- "strum 0.24.1",
+ "strum 0.26.2",
"thiserror",
"tracing-gum",
]
@@ -12988,7 +12997,7 @@ dependencies = [
"assert_matches",
"async-trait",
"derive_more",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"fatality",
"futures",
"futures-channel",
@@ -13367,7 +13376,7 @@ version = "0.0.1"
dependencies = [
"cumulus-pallet-aura-ext",
"cumulus-pallet-parachain-system",
- "docify 0.2.7",
+ "docify",
"frame",
"frame-executive",
"frame-support",
@@ -13386,11 +13395,14 @@ dependencies = [
"pallet-example-single-block-migrations",
"pallet-examples",
"pallet-multisig",
+ "pallet-nfts",
+ "pallet-preimage",
"pallet-proxy",
"pallet-referenda",
"pallet-scheduler",
"pallet-timestamp",
"pallet-transaction-payment",
+ "pallet-uniques",
"pallet-utility",
"parity-scale-codec",
"sc-cli",
@@ -13429,7 +13441,7 @@ dependencies = [
"assert_matches",
"async-trait",
"bitvec",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"frame-benchmarking",
"frame-benchmarking-cli",
"frame-support",
@@ -13443,7 +13455,6 @@ dependencies = [
"log",
"mmr-gadget",
"pallet-babe",
- "pallet-im-online",
"pallet-staking",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
@@ -13540,12 +13551,14 @@ dependencies = [
"sp-transaction-pool",
"sp-version",
"sp-weights",
+ "staging-xcm",
"substrate-prometheus-endpoint",
"tempfile",
"thiserror",
"tracing-gum",
"westend-runtime",
"westend-runtime-constants",
+ "xcm-fee-payment-runtime-api",
]
[[package]]
@@ -13604,7 +13617,7 @@ dependencies = [
"clap-num",
"color-eyre",
"colored",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"futures",
"futures-timer",
"hex",
@@ -13644,6 +13657,7 @@ dependencies = [
"sc-service",
"schnorrkel 0.11.4",
"serde",
+ "serde_json",
"serde_yaml",
"sha1",
"sp-application-crypto",
@@ -15044,7 +15058,6 @@ dependencies = [
"pallet-elections-phragmen",
"pallet-grandpa",
"pallet-identity",
- "pallet-im-online",
"pallet-indices",
"pallet-membership",
"pallet-message-queue",
@@ -15115,6 +15128,7 @@ dependencies = [
"substrate-wasm-builder",
"tiny-keccak",
"tokio",
+ "xcm-fee-payment-runtime-api",
]
[[package]]
@@ -15624,7 +15638,7 @@ name = "sc-chain-spec"
version = "27.0.0"
dependencies = [
"array-bytes 6.1.0",
- "docify 0.2.7",
+ "docify",
"log",
"memmap2 0.9.3",
"parity-scale-codec",
@@ -16137,7 +16151,7 @@ dependencies = [
"array-bytes 6.1.0",
"assert_matches",
"criterion 0.4.0",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"num_cpus",
"parity-scale-codec",
"parking_lot 0.12.1",
@@ -16573,7 +16587,7 @@ name = "sc-rpc"
version = "29.0.0"
dependencies = [
"assert_matches",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"futures",
"jsonrpsee",
"log",
@@ -16815,7 +16829,7 @@ dependencies = [
name = "sc-statement-store"
version = "10.0.0"
dependencies = [
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"log",
"parity-db",
"parking_lot 0.12.1",
@@ -17007,9 +17021,9 @@ dependencies = [
[[package]]
name = "scale-info"
-version = "2.11.0"
+version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ef2175c2907e7c8bc0a9c3f86aeb5ec1f3b275300ad58a44d0c3ae379a5e52e"
+checksum = "788745a868b0e751750388f4e6546eb921ef714a4317fa6954f7cde114eb2eb7"
dependencies = [
"bitvec",
"cfg-if",
@@ -17021,9 +17035,9 @@ dependencies = [
[[package]]
name = "scale-info-derive"
-version = "2.11.0"
+version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "634d9b8eb8fd61c5cdd3390d9b2132300a7e7618955b98b8416f118c1b4e144f"
+checksum = "7dc2f4e8bc344b9fc3d5f74f72c2e55bfc38d28dc2ebc69c194a3df424e4d9ac"
dependencies = [
"proc-macro-crate 1.3.1",
"proc-macro2",
@@ -17898,7 +17912,7 @@ name = "snowbridge-outbound-queue-merkle-tree"
version = "0.3.0"
dependencies = [
"array-bytes 4.2.0",
- "env_logger 0.9.3",
+ "env_logger 0.11.3",
"hex",
"hex-literal",
"parity-scale-codec",
@@ -18208,12 +18222,12 @@ dependencies = [
[[package]]
name = "socket2"
-version = "0.5.3"
+version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877"
+checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871"
dependencies = [
"libc",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -18401,7 +18415,7 @@ name = "sp-arithmetic"
version = "23.0.0"
dependencies = [
"criterion 0.4.0",
- "docify 0.2.7",
+ "docify",
"integer-sqrt",
"num-traits",
"parity-scale-codec",
@@ -18544,7 +18558,7 @@ dependencies = [
"sp-keystore",
"sp-mmr-primitives",
"sp-runtime",
- "strum 0.24.1",
+ "strum 0.26.2",
"w3f-bls",
]
@@ -18835,7 +18849,7 @@ version = "31.0.0"
dependencies = [
"sp-core",
"sp-runtime",
- "strum 0.24.1",
+ "strum 0.26.2",
]
[[package]]
@@ -18951,7 +18965,7 @@ dependencies = [
name = "sp-runtime"
version = "31.0.1"
dependencies = [
- "docify 0.2.7",
+ "docify",
"either",
"hash256-std-hasher",
"impl-trait-for-tuples",
@@ -19721,6 +19735,15 @@ version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125"
+[[package]]
+name = "strum"
+version = "0.26.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29"
+dependencies = [
+ "strum_macros 0.26.2",
+]
+
[[package]]
name = "strum_macros"
version = "0.24.3"
@@ -19747,6 +19770,19 @@ dependencies = [
"syn 2.0.53",
]
+[[package]]
+name = "strum_macros"
+version = "0.26.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946"
+dependencies = [
+ "heck 0.4.1",
+ "proc-macro2",
+ "quote",
+ "rustversion",
+ "syn 2.0.53",
+]
+
[[package]]
name = "subkey"
version = "9.0.0"
@@ -20012,7 +20048,7 @@ dependencies = [
"parity-wasm",
"polkavm-linker",
"sp-maybe-compressed-blob",
- "strum 0.24.1",
+ "strum 0.26.2",
"tempfile",
"toml 0.8.8",
"walkdir",
@@ -20560,9 +20596,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
-version = "1.33.0"
+version = "1.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653"
+checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787"
dependencies = [
"backtrace",
"bytes",
@@ -20572,16 +20608,16 @@ dependencies = [
"parking_lot 0.12.1",
"pin-project-lite 0.2.12",
"signal-hook-registry",
- "socket2 0.5.3",
+ "socket2 0.5.6",
"tokio-macros",
"windows-sys 0.48.0",
]
[[package]]
name = "tokio-macros"
-version = "2.1.0"
+version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
+checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
dependencies = [
"proc-macro2",
"quote",
@@ -21894,7 +21930,6 @@ dependencies = [
"pallet-fast-unstake",
"pallet-grandpa",
"pallet-identity",
- "pallet-im-online",
"pallet-indices",
"pallet-membership",
"pallet-message-queue",
@@ -21969,6 +22004,7 @@ dependencies = [
"tiny-keccak",
"tokio",
"westend-runtime-constants",
+ "xcm-fee-payment-runtime-api",
]
[[package]]
@@ -22442,6 +22478,20 @@ dependencies = [
"staging-xcm-executor",
]
+[[package]]
+name = "xcm-fee-payment-runtime-api"
+version = "0.1.0"
+dependencies = [
+ "frame-support",
+ "parity-scale-codec",
+ "scale-info",
+ "sp-api",
+ "sp-runtime",
+ "sp-std 14.0.0",
+ "sp-weights",
+ "staging-xcm",
+]
+
[[package]]
name = "xcm-procedural"
version = "7.0.0"
diff --git a/Cargo.toml b/Cargo.toml
index 01d6ef8e87bdaf4dcf0e4f73dfde59df76f500c4..e6162830375fd9e0053b5623d01196ceb2f3fb55 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,24 +10,24 @@ resolver = "2"
members = [
"bridges/bin/runtime-common",
+ "bridges/chains/chain-asset-hub-rococo",
+ "bridges/chains/chain-asset-hub-westend",
+ "bridges/chains/chain-bridge-hub-cumulus",
+ "bridges/chains/chain-bridge-hub-kusama",
+ "bridges/chains/chain-bridge-hub-polkadot",
+ "bridges/chains/chain-bridge-hub-rococo",
+ "bridges/chains/chain-bridge-hub-westend",
+ "bridges/chains/chain-kusama",
+ "bridges/chains/chain-polkadot",
+ "bridges/chains/chain-polkadot-bulletin",
+ "bridges/chains/chain-rococo",
+ "bridges/chains/chain-westend",
"bridges/modules/grandpa",
"bridges/modules/messages",
"bridges/modules/parachains",
"bridges/modules/relayers",
"bridges/modules/xcm-bridge-hub",
"bridges/modules/xcm-bridge-hub-router",
- "bridges/primitives/chain-asset-hub-rococo",
- "bridges/primitives/chain-asset-hub-westend",
- "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-westend",
- "bridges/primitives/chain-kusama",
- "bridges/primitives/chain-polkadot",
- "bridges/primitives/chain-polkadot-bulletin",
- "bridges/primitives/chain-rococo",
- "bridges/primitives/chain-westend",
"bridges/primitives/header-chain",
"bridges/primitives/messages",
"bridges/primitives/parachains",
@@ -214,6 +214,7 @@ members = [
"polkadot/xcm/xcm-builder",
"polkadot/xcm/xcm-executor",
"polkadot/xcm/xcm-executor/integration-tests",
+ "polkadot/xcm/xcm-fee-payment-runtime-api",
"polkadot/xcm/xcm-simulator",
"polkadot/xcm/xcm-simulator/example",
"polkadot/xcm/xcm-simulator/fuzzer",
diff --git a/bridges/README.md b/bridges/README.md
index a2ce213d2541c346361eb28125a06e3079e1c269..8bfa39841f51e7824d0f1169540342c2bd88b664 100644
--- a/bridges/README.md
+++ b/bridges/README.md
@@ -38,10 +38,10 @@ cargo test --all
```
Also you can build the repo with [Parity CI Docker
-image](https://github.com/paritytech/scripts/tree/master/dockerfiles/bridges-ci):
+image](https://github.com/paritytech/scripts/tree/master/dockerfiles/ci-unified):
```bash
-docker pull paritytech/bridges-ci:production
+docker pull paritytech/ci-unified:latest
mkdir ~/cache
chown 1000:1000 ~/cache #processes in the container runs as "nonroot" user with UID 1000
docker run --rm -it -w /shellhere/parity-bridges-common \
@@ -49,7 +49,7 @@ docker run --rm -it -w /shellhere/parity-bridges-common \
-v "$(pwd)":/shellhere/parity-bridges-common \
-e CARGO_HOME=/cache/cargo/ \
-e SCCACHE_DIR=/cache/sccache/ \
- -e CARGO_TARGET_DIR=/cache/target/ paritytech/bridges-ci:production cargo build --all
+ -e CARGO_TARGET_DIR=/cache/target/ paritytech/ci-unified:latest cargo build --all
#artifacts can be found in ~/cache/target
```
diff --git a/bridges/bin/runtime-common/Cargo.toml b/bridges/bin/runtime-common/Cargo.toml
index fac88b20ca57901d4116e147bd9363a41ff35e36..67b91a16a302d6214830241082b21c407b04c6d1 100644
--- a/bridges/bin/runtime-common/Cargo.toml
+++ b/bridges/bin/runtime-common/Cargo.toml
@@ -11,10 +11,10 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
workspace = true
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
+codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] }
hash-db = { version = "0.16.0", default-features = false }
log = { workspace = true }
-scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
+scale-info = { version = "2.11.1", default-features = false, features = ["derive"] }
static_assertions = { version = "1.1", optional = true }
# Bridge dependencies
diff --git a/bridges/bin/runtime-common/src/messages_api.rs b/bridges/bin/runtime-common/src/messages_api.rs
index ccf1c754041ed84dc302f0660fdd5bde8dc8d533..7fbdeb366124778b36c77725be8ca8778020be1b 100644
--- a/bridges/bin/runtime-common/src/messages_api.rs
+++ b/bridges/bin/runtime-common/src/messages_api.rs
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity Bridges Common. If not, see .
-//! Helpers for implementing various message-related runtime API mthods.
+//! Helpers for implementing various message-related runtime API methods.
use bp_messages::{
InboundMessageDetails, LaneId, MessageNonce, MessagePayload, OutboundMessageDetails,
diff --git a/bridges/bin/runtime-common/src/messages_xcm_extension.rs b/bridges/bin/runtime-common/src/messages_xcm_extension.rs
index e3da6155f08a198d5469adbfc64e40213eddf8eb..46ed4da0d85481fcc7223740084945924f9c710f 100644
--- a/bridges/bin/runtime-common/src/messages_xcm_extension.rs
+++ b/bridges/bin/runtime-common/src/messages_xcm_extension.rs
@@ -248,7 +248,7 @@ impl LocalXcmQueueManager {
sender_and_lane: &SenderAndLane,
enqueued_messages: MessageNonce,
) {
- // skip if we dont want to handle congestion
+ // skip if we don't want to handle congestion
if !H::supports_congestion_detection() {
return
}
diff --git a/bridges/bin/runtime-common/src/mock.rs b/bridges/bin/runtime-common/src/mock.rs
index deee4524e8586d45c01f08126e84b9c619cfeba2..8c4cb2233e17c7ff0f6aa05f45483db07ef2b707 100644
--- a/bridges/bin/runtime-common/src/mock.rs
+++ b/bridges/bin/runtime-common/src/mock.rs
@@ -379,7 +379,7 @@ impl Chain for BridgedUnderlyingChain {
impl ChainWithGrandpa for BridgedUnderlyingChain {
const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str = "";
const MAX_AUTHORITIES_COUNT: u32 = 16;
- const REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY: u32 = 8;
+ const REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY: u32 = 8;
const MAX_MANDATORY_HEADER_SIZE: u32 = 256;
const AVERAGE_HEADER_SIZE: u32 = 64;
}
diff --git a/bridges/bin/runtime-common/src/priority_calculator.rs b/bridges/bin/runtime-common/src/priority_calculator.rs
index c2737128e3422dd72ca3b49d66151268d719e0bc..5035553f508dfea94a0cb5ddf9b916dd7d9b4ea5 100644
--- a/bridges/bin/runtime-common/src/priority_calculator.rs
+++ b/bridges/bin/runtime-common/src/priority_calculator.rs
@@ -163,7 +163,7 @@ mod integrity_tests {
{
// just an estimation of extra transaction bytes that are added to every transaction
// (including signature, signed extensions extra and etc + in our case it includes
- // all call arguments extept the proof itself)
+ // all call arguments except the proof itself)
let base_tx_size = 512;
// let's say we are relaying similar small messages and for every message we add more trie
// nodes to the proof (x0.5 because we expect some nodes to be reused)
diff --git a/bridges/bin/runtime-common/src/refund_relayer_extension.rs b/bridges/bin/runtime-common/src/refund_relayer_extension.rs
index 8e901d72821fe1dfb749f4227c2875f1d807fccc..455392a0a277f3520cd7f58150f12e7420d36014 100644
--- a/bridges/bin/runtime-common/src/refund_relayer_extension.rs
+++ b/bridges/bin/runtime-common/src/refund_relayer_extension.rs
@@ -1538,7 +1538,7 @@ mod tests {
}
#[test]
- fn validate_boosts_priority_of_message_delivery_transactons() {
+ fn validate_boosts_priority_of_message_delivery_transactions() {
run_test(|| {
initialize_environment(100, 100, 100);
@@ -1568,7 +1568,7 @@ mod tests {
}
#[test]
- fn validate_does_not_boost_priority_of_message_delivery_transactons_with_too_many_messages() {
+ fn validate_does_not_boost_priority_of_message_delivery_transactions_with_too_many_messages() {
run_test(|| {
initialize_environment(100, 100, 100);
diff --git a/bridges/primitives/chain-asset-hub-rococo/Cargo.toml b/bridges/chains/chain-asset-hub-rococo/Cargo.toml
similarity index 69%
rename from bridges/primitives/chain-asset-hub-rococo/Cargo.toml
rename to bridges/chains/chain-asset-hub-rococo/Cargo.toml
index 4dfa149e0ea9ab4e0ac1804844a0c128f15bd5bb..9a6419a5b4055be348f4f8813e3c1301f14f7142 100644
--- a/bridges/primitives/chain-asset-hub-rococo/Cargo.toml
+++ b/bridges/chains/chain-asset-hub-rococo/Cargo.toml
@@ -5,19 +5,20 @@ version = "0.4.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+repository.workspace = true
[lints]
workspace = true
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
-scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
+codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false }
+scale-info = { version = "2.11.1", default-features = false, features = ["derive"] }
# Substrate Dependencies
frame-support = { path = "../../../substrate/frame/support", default-features = false }
# Bridge Dependencies
-bp-xcm-bridge-hub-router = { path = "../xcm-bridge-hub-router", default-features = false }
+bp-xcm-bridge-hub-router = { path = "../../primitives/xcm-bridge-hub-router", default-features = false }
[features]
default = ["std"]
diff --git a/bridges/primitives/chain-asset-hub-rococo/src/lib.rs b/bridges/chains/chain-asset-hub-rococo/src/lib.rs
similarity index 100%
rename from bridges/primitives/chain-asset-hub-rococo/src/lib.rs
rename to bridges/chains/chain-asset-hub-rococo/src/lib.rs
diff --git a/bridges/primitives/chain-asset-hub-westend/Cargo.toml b/bridges/chains/chain-asset-hub-westend/Cargo.toml
similarity index 69%
rename from bridges/primitives/chain-asset-hub-westend/Cargo.toml
rename to bridges/chains/chain-asset-hub-westend/Cargo.toml
index c9bd437562b86a97cdf2807c18b4905e695d1a5e..1c08ee28e417cb50ce9ef9ded5f17163e1bb30d4 100644
--- a/bridges/primitives/chain-asset-hub-westend/Cargo.toml
+++ b/bridges/chains/chain-asset-hub-westend/Cargo.toml
@@ -5,19 +5,20 @@ version = "0.3.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+repository.workspace = true
[lints]
workspace = true
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
-scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
+codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false }
+scale-info = { version = "2.11.1", default-features = false, features = ["derive"] }
# Substrate Dependencies
frame-support = { path = "../../../substrate/frame/support", default-features = false }
# Bridge Dependencies
-bp-xcm-bridge-hub-router = { path = "../xcm-bridge-hub-router", default-features = false }
+bp-xcm-bridge-hub-router = { path = "../../primitives/xcm-bridge-hub-router", default-features = false }
[features]
default = ["std"]
diff --git a/bridges/primitives/chain-asset-hub-westend/src/lib.rs b/bridges/chains/chain-asset-hub-westend/src/lib.rs
similarity index 100%
rename from bridges/primitives/chain-asset-hub-westend/src/lib.rs
rename to bridges/chains/chain-asset-hub-westend/src/lib.rs
diff --git a/bridges/primitives/chain-bridge-hub-cumulus/Cargo.toml b/bridges/chains/chain-bridge-hub-cumulus/Cargo.toml
similarity index 78%
rename from bridges/primitives/chain-bridge-hub-cumulus/Cargo.toml
rename to bridges/chains/chain-bridge-hub-cumulus/Cargo.toml
index d35eefa1c45c3f7cf479dcea2ee4da87dbc31627..4b900002a4d81abb9d7364f555a150a2af6c839c 100644
--- a/bridges/primitives/chain-bridge-hub-cumulus/Cargo.toml
+++ b/bridges/chains/chain-bridge-hub-cumulus/Cargo.toml
@@ -5,6 +5,7 @@ version = "0.7.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+repository.workspace = true
[lints]
workspace = true
@@ -12,9 +13,9 @@ workspace = true
[dependencies]
# Bridge Dependencies
-bp-polkadot-core = { path = "../polkadot-core", default-features = false }
-bp-messages = { path = "../messages", default-features = false }
-bp-runtime = { path = "../runtime", default-features = false }
+bp-polkadot-core = { path = "../../primitives/polkadot-core", default-features = false }
+bp-messages = { path = "../../primitives/messages", default-features = false }
+bp-runtime = { path = "../../primitives/runtime", default-features = false }
# Substrate Based Dependencies
diff --git a/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs b/bridges/chains/chain-bridge-hub-cumulus/src/lib.rs
similarity index 100%
rename from bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs
rename to bridges/chains/chain-bridge-hub-cumulus/src/lib.rs
diff --git a/bridges/primitives/chain-bridge-hub-kusama/Cargo.toml b/bridges/chains/chain-bridge-hub-kusama/Cargo.toml
similarity index 83%
rename from bridges/primitives/chain-bridge-hub-kusama/Cargo.toml
rename to bridges/chains/chain-bridge-hub-kusama/Cargo.toml
index 8d71b3f5eb7646a81af55c0030814c604ead82ef..ff6dd8849abe3897f1c3eb3cb1de8b7d89af5ca7 100644
--- a/bridges/primitives/chain-bridge-hub-kusama/Cargo.toml
+++ b/bridges/chains/chain-bridge-hub-kusama/Cargo.toml
@@ -5,6 +5,7 @@ version = "0.6.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+repository.workspace = true
[lints]
workspace = true
@@ -13,8 +14,8 @@ workspace = true
# Bridge Dependencies
bp-bridge-hub-cumulus = { path = "../chain-bridge-hub-cumulus", default-features = false }
-bp-runtime = { path = "../runtime", default-features = false }
-bp-messages = { path = "../messages", default-features = false }
+bp-runtime = { path = "../../primitives/runtime", default-features = false }
+bp-messages = { path = "../../primitives/messages", default-features = false }
# Substrate Based Dependencies
diff --git a/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs b/bridges/chains/chain-bridge-hub-kusama/src/lib.rs
similarity index 100%
rename from bridges/primitives/chain-bridge-hub-kusama/src/lib.rs
rename to bridges/chains/chain-bridge-hub-kusama/src/lib.rs
diff --git a/bridges/primitives/chain-bridge-hub-polkadot/Cargo.toml b/bridges/chains/chain-bridge-hub-polkadot/Cargo.toml
similarity index 83%
rename from bridges/primitives/chain-bridge-hub-polkadot/Cargo.toml
rename to bridges/chains/chain-bridge-hub-polkadot/Cargo.toml
index 4e89e8a5c9a173bc9a084af9e7c609a6bae287a8..da8b8a82fa702eeab719335fa9968b78ee965163 100644
--- a/bridges/primitives/chain-bridge-hub-polkadot/Cargo.toml
+++ b/bridges/chains/chain-bridge-hub-polkadot/Cargo.toml
@@ -5,6 +5,7 @@ version = "0.6.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+repository.workspace = true
[lints]
workspace = true
@@ -14,8 +15,8 @@ workspace = true
# Bridge Dependencies
bp-bridge-hub-cumulus = { path = "../chain-bridge-hub-cumulus", default-features = false }
-bp-runtime = { path = "../runtime", default-features = false }
-bp-messages = { path = "../messages", default-features = false }
+bp-runtime = { path = "../../primitives/runtime", default-features = false }
+bp-messages = { path = "../../primitives/messages", default-features = false }
# Substrate Based Dependencies
diff --git a/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs b/bridges/chains/chain-bridge-hub-polkadot/src/lib.rs
similarity index 100%
rename from bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs
rename to bridges/chains/chain-bridge-hub-polkadot/src/lib.rs
diff --git a/bridges/primitives/chain-bridge-hub-rococo/Cargo.toml b/bridges/chains/chain-bridge-hub-rococo/Cargo.toml
similarity index 83%
rename from bridges/primitives/chain-bridge-hub-rococo/Cargo.toml
rename to bridges/chains/chain-bridge-hub-rococo/Cargo.toml
index 1643d934a982ec0795fc370b221dc35d36d3b492..f7672df012f2fc2a21cfc987468427a3222317ea 100644
--- a/bridges/primitives/chain-bridge-hub-rococo/Cargo.toml
+++ b/bridges/chains/chain-bridge-hub-rococo/Cargo.toml
@@ -5,6 +5,7 @@ version = "0.7.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+repository.workspace = true
[lints]
workspace = true
@@ -13,8 +14,8 @@ workspace = true
# Bridge Dependencies
bp-bridge-hub-cumulus = { path = "../chain-bridge-hub-cumulus", default-features = false }
-bp-runtime = { path = "../runtime", default-features = false }
-bp-messages = { path = "../messages", default-features = false }
+bp-runtime = { path = "../../primitives/runtime", default-features = false }
+bp-messages = { path = "../../primitives/messages", default-features = false }
# Substrate Based Dependencies
diff --git a/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs b/bridges/chains/chain-bridge-hub-rococo/src/lib.rs
similarity index 100%
rename from bridges/primitives/chain-bridge-hub-rococo/src/lib.rs
rename to bridges/chains/chain-bridge-hub-rococo/src/lib.rs
diff --git a/bridges/primitives/chain-bridge-hub-westend/Cargo.toml b/bridges/chains/chain-bridge-hub-westend/Cargo.toml
similarity index 83%
rename from bridges/primitives/chain-bridge-hub-westend/Cargo.toml
rename to bridges/chains/chain-bridge-hub-westend/Cargo.toml
index 32a7850c5392fd892ec40e9968fa365ec59cbba3..ec74c4b947d693dba92d4da5051526e49349e0a5 100644
--- a/bridges/primitives/chain-bridge-hub-westend/Cargo.toml
+++ b/bridges/chains/chain-bridge-hub-westend/Cargo.toml
@@ -5,6 +5,7 @@ version = "0.3.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+repository.workspace = true
[lints]
workspace = true
@@ -14,8 +15,8 @@ workspace = true
# Bridge Dependencies
bp-bridge-hub-cumulus = { path = "../chain-bridge-hub-cumulus", default-features = false }
-bp-runtime = { path = "../runtime", default-features = false }
-bp-messages = { path = "../messages", default-features = false }
+bp-runtime = { path = "../../primitives/runtime", default-features = false }
+bp-messages = { path = "../../primitives/messages", default-features = false }
# Substrate Based Dependencies
diff --git a/bridges/primitives/chain-bridge-hub-westend/src/lib.rs b/bridges/chains/chain-bridge-hub-westend/src/lib.rs
similarity index 100%
rename from bridges/primitives/chain-bridge-hub-westend/src/lib.rs
rename to bridges/chains/chain-bridge-hub-westend/src/lib.rs
diff --git a/bridges/primitives/chain-kusama/Cargo.toml b/bridges/chains/chain-kusama/Cargo.toml
similarity index 71%
rename from bridges/primitives/chain-kusama/Cargo.toml
rename to bridges/chains/chain-kusama/Cargo.toml
index 0660f34602389d1cf9e1ec88b57d1a9aeb9a3830..66061ff2793cbdd3419fa8894ab78e37486102ea 100644
--- a/bridges/primitives/chain-kusama/Cargo.toml
+++ b/bridges/chains/chain-kusama/Cargo.toml
@@ -5,6 +5,7 @@ version = "0.5.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+repository.workspace = true
[lints]
workspace = true
@@ -13,9 +14,9 @@ workspace = true
# Bridge Dependencies
-bp-header-chain = { path = "../header-chain", default-features = false }
-bp-polkadot-core = { path = "../polkadot-core", default-features = false }
-bp-runtime = { path = "../runtime", default-features = false }
+bp-header-chain = { path = "../../primitives/header-chain", default-features = false }
+bp-polkadot-core = { path = "../../primitives/polkadot-core", default-features = false }
+bp-runtime = { path = "../../primitives/runtime", default-features = false }
# Substrate Based Dependencies
diff --git a/bridges/primitives/chain-kusama/src/lib.rs b/bridges/chains/chain-kusama/src/lib.rs
similarity index 95%
rename from bridges/primitives/chain-kusama/src/lib.rs
rename to bridges/chains/chain-kusama/src/lib.rs
index e3b4d0520f61c858b54d78dfa4a45f57bac411fb..a81004afe8127b556211d0207d2bc1f9ecc02955 100644
--- a/bridges/primitives/chain-kusama/src/lib.rs
+++ b/bridges/chains/chain-kusama/src/lib.rs
@@ -53,8 +53,8 @@ impl Chain for Kusama {
impl ChainWithGrandpa for Kusama {
const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str = WITH_KUSAMA_GRANDPA_PALLET_NAME;
const MAX_AUTHORITIES_COUNT: u32 = MAX_AUTHORITIES_COUNT;
- const REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY: u32 =
- REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY;
+ const REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY: u32 =
+ REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY;
const MAX_MANDATORY_HEADER_SIZE: u32 = MAX_MANDATORY_HEADER_SIZE;
const AVERAGE_HEADER_SIZE: u32 = AVERAGE_HEADER_SIZE;
}
diff --git a/bridges/primitives/chain-polkadot-bulletin/Cargo.toml b/bridges/chains/chain-polkadot-bulletin/Cargo.toml
similarity index 68%
rename from bridges/primitives/chain-polkadot-bulletin/Cargo.toml
rename to bridges/chains/chain-polkadot-bulletin/Cargo.toml
index 15c824fcbdb31c2c84f63bd56d4d0b3f90efc5b1..2db16a00e92492e3a167458343a88a24c2186748 100644
--- a/bridges/primitives/chain-polkadot-bulletin/Cargo.toml
+++ b/bridges/chains/chain-polkadot-bulletin/Cargo.toml
@@ -5,20 +5,21 @@ version = "0.4.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+repository.workspace = true
[lints]
workspace = true
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
-scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
+codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] }
+scale-info = { version = "2.11.1", default-features = false, features = ["derive"] }
# Bridge Dependencies
-bp-header-chain = { path = "../header-chain", default-features = false }
-bp-messages = { path = "../messages", default-features = false }
-bp-polkadot-core = { path = "../polkadot-core", default-features = false }
-bp-runtime = { path = "../runtime", default-features = false }
+bp-header-chain = { path = "../../primitives/header-chain", default-features = false }
+bp-messages = { path = "../../primitives/messages", default-features = false }
+bp-polkadot-core = { path = "../../primitives/polkadot-core", default-features = false }
+bp-runtime = { path = "../../primitives/runtime", default-features = false }
# Substrate Based Dependencies
diff --git a/bridges/primitives/chain-polkadot-bulletin/src/lib.rs b/bridges/chains/chain-polkadot-bulletin/src/lib.rs
similarity index 96%
rename from bridges/primitives/chain-polkadot-bulletin/src/lib.rs
rename to bridges/chains/chain-polkadot-bulletin/src/lib.rs
index f2eebf9312470a42e1d3a1c7d67ab8b7a38af189..f3d300567f2b4f92cec272e0929a3c53d718c823 100644
--- a/bridges/primitives/chain-polkadot-bulletin/src/lib.rs
+++ b/bridges/chains/chain-polkadot-bulletin/src/lib.rs
@@ -43,7 +43,7 @@ use sp_runtime::{traits::DispatchInfoOf, transaction_validity::TransactionValidi
pub use bp_polkadot_core::{
AccountAddress, AccountId, Balance, Block, BlockNumber, Hash, Hasher, Header, Nonce, Signature,
SignedBlock, UncheckedExtrinsic, AVERAGE_HEADER_SIZE, EXTRA_STORAGE_PROOF_SIZE,
- MAX_MANDATORY_HEADER_SIZE, REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY,
+ MAX_MANDATORY_HEADER_SIZE, REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY,
};
/// Maximal number of GRANDPA authorities at Polkadot Bulletin chain.
@@ -62,7 +62,7 @@ const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(90);
// Re following constants - we are using the same values at Cumulus parachains. They are limited
// by the maximal transaction weight/size. Since block limits at Bulletin Chain are larger than
-// at the Cumulus Bridgeg Hubs, we could reuse the same values.
+// at the Cumulus Bridge Hubs, we could reuse the same values.
/// Maximal number of unrewarded relayer entries at inbound lane for Cumulus-based parachains.
pub const MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX: MessageNonce = 1024;
@@ -207,8 +207,8 @@ impl Chain for PolkadotBulletin {
impl ChainWithGrandpa for PolkadotBulletin {
const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str = WITH_POLKADOT_BULLETIN_GRANDPA_PALLET_NAME;
const MAX_AUTHORITIES_COUNT: u32 = MAX_AUTHORITIES_COUNT;
- const REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY: u32 =
- REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY;
+ const REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY: u32 =
+ REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY;
const MAX_MANDATORY_HEADER_SIZE: u32 = MAX_MANDATORY_HEADER_SIZE;
const AVERAGE_HEADER_SIZE: u32 = AVERAGE_HEADER_SIZE;
}
diff --git a/bridges/primitives/chain-polkadot/Cargo.toml b/bridges/chains/chain-polkadot/Cargo.toml
similarity index 71%
rename from bridges/primitives/chain-polkadot/Cargo.toml
rename to bridges/chains/chain-polkadot/Cargo.toml
index 6421b7f40106e404eeba04be72f5448fd5f65159..c700935f3083b5f287277c7d9975be53352b2506 100644
--- a/bridges/primitives/chain-polkadot/Cargo.toml
+++ b/bridges/chains/chain-polkadot/Cargo.toml
@@ -5,6 +5,7 @@ version = "0.5.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+repository.workspace = true
[lints]
workspace = true
@@ -13,9 +14,9 @@ workspace = true
# Bridge Dependencies
-bp-header-chain = { path = "../header-chain", default-features = false }
-bp-polkadot-core = { path = "../polkadot-core", default-features = false }
-bp-runtime = { path = "../runtime", default-features = false }
+bp-header-chain = { path = "../../primitives/header-chain", default-features = false }
+bp-polkadot-core = { path = "../../primitives/polkadot-core", default-features = false }
+bp-runtime = { path = "../../primitives/runtime", default-features = false }
# Substrate Based Dependencies
diff --git a/bridges/primitives/chain-polkadot/src/lib.rs b/bridges/chains/chain-polkadot/src/lib.rs
similarity index 95%
rename from bridges/primitives/chain-polkadot/src/lib.rs
rename to bridges/chains/chain-polkadot/src/lib.rs
index fc5e10308a8e33463a74c041f157daaef09cc9c8..00d35783a9b61844bab7701fdb60711125447ca3 100644
--- a/bridges/primitives/chain-polkadot/src/lib.rs
+++ b/bridges/chains/chain-polkadot/src/lib.rs
@@ -55,8 +55,8 @@ impl Chain for Polkadot {
impl ChainWithGrandpa for Polkadot {
const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str = WITH_POLKADOT_GRANDPA_PALLET_NAME;
const MAX_AUTHORITIES_COUNT: u32 = MAX_AUTHORITIES_COUNT;
- const REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY: u32 =
- REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY;
+ const REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY: u32 =
+ REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY;
const MAX_MANDATORY_HEADER_SIZE: u32 = MAX_MANDATORY_HEADER_SIZE;
const AVERAGE_HEADER_SIZE: u32 = AVERAGE_HEADER_SIZE;
}
diff --git a/bridges/primitives/chain-rococo/Cargo.toml b/bridges/chains/chain-rococo/Cargo.toml
similarity index 71%
rename from bridges/primitives/chain-rococo/Cargo.toml
rename to bridges/chains/chain-rococo/Cargo.toml
index de373f0ae64b8d9a8124dbcdfcca3c2bf05e2787..5a5613bb376a5a4f75c773b3350993262149f973 100644
--- a/bridges/primitives/chain-rococo/Cargo.toml
+++ b/bridges/chains/chain-rococo/Cargo.toml
@@ -5,6 +5,7 @@ version = "0.6.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+repository.workspace = true
[lints]
workspace = true
@@ -13,9 +14,9 @@ workspace = true
# Bridge Dependencies
-bp-header-chain = { path = "../header-chain", default-features = false }
-bp-polkadot-core = { path = "../polkadot-core", default-features = false }
-bp-runtime = { path = "../runtime", default-features = false }
+bp-header-chain = { path = "../../primitives/header-chain", default-features = false }
+bp-polkadot-core = { path = "../../primitives/polkadot-core", default-features = false }
+bp-runtime = { path = "../../primitives/runtime", default-features = false }
# Substrate Based Dependencies
diff --git a/bridges/primitives/chain-rococo/src/lib.rs b/bridges/chains/chain-rococo/src/lib.rs
similarity index 95%
rename from bridges/primitives/chain-rococo/src/lib.rs
rename to bridges/chains/chain-rococo/src/lib.rs
index f1b256f0f090f048cc8db3a16c112ed8b938f6ce..2385dd2cbb250181ce5f46aef9f1e76f8fd010d2 100644
--- a/bridges/primitives/chain-rococo/src/lib.rs
+++ b/bridges/chains/chain-rococo/src/lib.rs
@@ -53,8 +53,8 @@ impl Chain for Rococo {
impl ChainWithGrandpa for Rococo {
const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str = WITH_ROCOCO_GRANDPA_PALLET_NAME;
const MAX_AUTHORITIES_COUNT: u32 = MAX_AUTHORITIES_COUNT;
- const REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY: u32 =
- REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY;
+ const REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY: u32 =
+ REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY;
const MAX_MANDATORY_HEADER_SIZE: u32 = MAX_MANDATORY_HEADER_SIZE;
const AVERAGE_HEADER_SIZE: u32 = AVERAGE_HEADER_SIZE;
}
diff --git a/bridges/primitives/chain-westend/Cargo.toml b/bridges/chains/chain-westend/Cargo.toml
similarity index 71%
rename from bridges/primitives/chain-westend/Cargo.toml
rename to bridges/chains/chain-westend/Cargo.toml
index e55a8d649a88b88d84f4f3547c23709cef67d872..10b06d76507ef95bbff00f5560b705ecee1ec4ce 100644
--- a/bridges/primitives/chain-westend/Cargo.toml
+++ b/bridges/chains/chain-westend/Cargo.toml
@@ -5,6 +5,7 @@ version = "0.3.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+repository.workspace = true
[lints]
workspace = true
@@ -13,9 +14,9 @@ workspace = true
# Bridge Dependencies
-bp-header-chain = { path = "../header-chain", default-features = false }
-bp-polkadot-core = { path = "../polkadot-core", default-features = false }
-bp-runtime = { path = "../runtime", default-features = false }
+bp-header-chain = { path = "../../primitives/header-chain", default-features = false }
+bp-polkadot-core = { path = "../../primitives/polkadot-core", default-features = false }
+bp-runtime = { path = "../../primitives/runtime", default-features = false }
# Substrate Based Dependencies
diff --git a/bridges/primitives/chain-westend/src/lib.rs b/bridges/chains/chain-westend/src/lib.rs
similarity index 95%
rename from bridges/primitives/chain-westend/src/lib.rs
rename to bridges/chains/chain-westend/src/lib.rs
index f03fd2160a700eb3817a6feb629e9d366cc366aa..b344b7f4bf93392c08502446513a9ae39296b512 100644
--- a/bridges/primitives/chain-westend/src/lib.rs
+++ b/bridges/chains/chain-westend/src/lib.rs
@@ -53,8 +53,8 @@ impl Chain for Westend {
impl ChainWithGrandpa for Westend {
const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str = WITH_WESTEND_GRANDPA_PALLET_NAME;
const MAX_AUTHORITIES_COUNT: u32 = MAX_AUTHORITIES_COUNT;
- const REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY: u32 =
- REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY;
+ const REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY: u32 =
+ REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY;
const MAX_MANDATORY_HEADER_SIZE: u32 = MAX_MANDATORY_HEADER_SIZE;
const AVERAGE_HEADER_SIZE: u32 = AVERAGE_HEADER_SIZE;
}
diff --git a/bridges/docs/bridge-relayers-claim-rewards.png b/bridges/docs/bridge-relayers-claim-rewards.png
new file mode 100644
index 0000000000000000000000000000000000000000..d56b8dd871e8445e7cab49517123b0092ce09137
Binary files /dev/null and b/bridges/docs/bridge-relayers-claim-rewards.png differ
diff --git a/bridges/docs/bridge-relayers-deregister.png b/bridges/docs/bridge-relayers-deregister.png
new file mode 100644
index 0000000000000000000000000000000000000000..e7706cee78916d7e2bbcfd7ee4a1a046a0450f87
Binary files /dev/null and b/bridges/docs/bridge-relayers-deregister.png differ
diff --git a/bridges/docs/bridge-relayers-register.png b/bridges/docs/bridge-relayers-register.png
new file mode 100644
index 0000000000000000000000000000000000000000..e9e3e1b5ac87c5c9d31477c696912fcbc93b0c78
Binary files /dev/null and b/bridges/docs/bridge-relayers-register.png differ
diff --git a/bridges/docs/running-relayer.md b/bridges/docs/running-relayer.md
new file mode 100644
index 0000000000000000000000000000000000000000..710810a476e4df5e4b80fde31f9576be5ad26391
--- /dev/null
+++ b/bridges/docs/running-relayer.md
@@ -0,0 +1,343 @@
+# Running your own bridge relayer
+
+:warning: :construction: Please read the [Disclaimer](#disclaimer) section first :construction: :warning:
+
+## Disclaimer
+
+There are several things you should know before running your own relayer:
+
+- initial bridge version (we call it bridges v1) supports any number of relayers, but **there's no guaranteed
+compensation** for running a relayer and/or submitting valid bridge transactions. Most probably you'll end up
+spending more funds than getting from rewards - please accept this fact;
+
+- even if your relayer has managed to submit a valid bridge transaction that has been included into the bridge
+hub block, there's no guarantee that you will be able to claim your compensation for that transaction. That's
+because compensations are paid from the account, controlled by relay chain governance and it could have no funds
+to compensate your useful actions. We'll be working on a proper process to resupply it on-time, but we can't
+provide any guarantee until that process is well established.
+
+## A Brief Introduction into Relayers and our Compensations Scheme
+
+Omitting details, relayer is an offchain process that is connected to both bridged chains. It looks at the
+outbound bridge messages queue and submits message delivery transactions to the target chain. There's a lot
+of details behind that simple phrase - you could find more info in the
+[High-Level Bridge Overview](./high-level-overview.md) document.
+
+Reward that is paid to relayer has two parts. The first part static and is controlled by the governance.
+It is rather small initially - e.g. you need to deliver `10_000` Kusama -> Polkadot messages to gain single
+KSM token.
+
+The other reward part is dynamic. So to deliver an XCM message from one BridgeHub to another, we'll need to
+submit two transactions on different chains. Every transaction has its cost, which is:
+
+- dynamic, because e.g. message size can change and/or fee factor of the target chain may change;
+
+- quite large, because those transactions are quite heavy (mostly in terms of size, not weight).
+
+We are compensating the cost of **valid**, **minimal** and **useful** bridge-related transactions to
+relayer, that has submitted such transaction. Valid here means that the transaction doesn't fail. Minimal
+means that all data within transaction call is actually required for the transaction to succeed. Useful
+means that all supplied data in transaction is new and yet unknown to the target chain.
+
+We have implemented a relayer that is able to craft such transactions. The rest of document contains a detailed
+information on how to deploy this software on your own node.
+
+## Relayers Concurrency
+
+As it has been said above, we are not compensating cost of transactions that are not **useful**. For
+example, if message `100` has already been delivered from Kusama Bridge Hub to Polkadot Bridge Hub, then another
+transaction that delivers the same message `100` won't be **useful**. Hence, no compensation to relayer that
+has submitted that second transaction.
+
+But what if there are several relayers running? They are noticing the same queued message `100` and
+simultaneously submit identical message delivery transactions. You may expect that there'll be one lucky
+relayer, whose transaction would win the "race" and which will receive the compensation and reward. And
+there'll be several other relayers, losing some funds on their unuseful transactions.
+
+But actually, we have a solution that invalidates transactions of "unlucky" relayers before they are
+included into the block. So at least you may be sure that you won't waste your funds on duplicate transactions.
+
+
+Some details?
+
+All **unuseful** transactions are rejected by our
+[transaction extension](https://github.com/paritytech/polkadot-sdk/blob/master/bridges/bin/runtime-common/src/refund_relayer_extension.rs),
+which also handles transaction fee compensations. You may find more info on unuseful (aka obsolete) transactions
+by lurking in the code.
+
+We also have the WiP prototype of relayers coordination protocol, where relayers will get some guarantee
+that their transactions will be prioritized over other relayers transactions at their assigned slots.
+That is planned for the future version of bridge and the progress is
+[tracked here](https://github.com/paritytech/parity-bridges-common/issues/2486).
+
+
+
+## Prerequisites
+
+Let's focus on the bridge between Polkadot and Kusama Bridge Hubs. Let's also assume that we want to start
+a relayer that "serves" an initial lane [`0x00000001`](https://github.com/polkadot-fellows/runtimes/blob/9ce1bbbbcd7843b3c76ba4d43c036bc311959e9f/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_polkadot_config.rs#L54).
+
+
+Lane?
+
+Think of lane as a queue of messages that need to be delivered to the other/bridged chain. The lane is
+bidirectional, meaning that there are four "endpoints". Two "outbound" endpoints (one at every chain), contain
+messages that need to be delivered to the bridged chain. Two "inbound" are accepting messages from the bridged
+chain and also remember the relayer, who has delivered message(s) to reward it later.
+
+
+
+The same steps may be performed for other lanes and bridges as well - you'll just need to change several parameters.
+
+So to start your relayer instance, you'll need to prepare:
+
+- an address of ws/wss RPC endpoint of the Kusama relay chain;
+
+- an address of ws/wss RPC endpoint of the Polkadot relay chain;
+
+- an address of ws/wss RPC endpoint of the Kusama Bridge Hub chain;
+
+- an address of ws/wss RPC endpoint of the Polkadot Bridge Hub chain;
+
+- an account on Kusama Bridge Hub;
+
+- an account on Polkadot Bridge Hub.
+
+For RPC endpoints, you could start your own nodes, or use some public community nodes. Nodes are not meant to be
+archive or provide access to insecure RPC calls.
+
+To create an account on Bridge Hubs, you could use XCM teleport functionality. E.g. if you have an account on
+the relay chain, you could use the `teleportAssets` call of `xcmPallet` and send asset
+`V3 { id: Concrete(0, Here), Fungible: }` to beneficiary `V3(0, X1(AccountId32()))`
+on destination `V3(0, X1(Parachain(1002)))`. To estimate amounts you need, please refer to the [Costs](#costs)
+section of the document.
+
+## Registering your Relayer Account (Optional, But Please Read)
+
+Bridge transactions are quite heavy and expensive. We want to minimize block space that can be occupied by
+invalid bridge transactions and prioritize valid transactions over invalid. That is achieved by **optional**
+relayer registration. Transactions, signed by relayers with active registration, gain huge priority boost.
+In exchange, such relayers may be slashed if they submit **invalid** or **non-minimal** transaction.
+
+Transactions, signed by relayers **without** active registration, on the other hand, receive no priority
+boost. It means that if there is active registered relayer, most likely all transactions from unregistered
+will be counted as **unuseful**, not included into the block and unregistered relayer won't get any reward
+for his operations.
+
+Before registering, you should know several things about your funds:
+
+- to register, you need to hold significant amount of funds on your relayer account. As of now, it is
+ [100 KSM](https://github.com/polkadot-fellows/runtimes/blob/9ce1bbbbcd7843b3c76ba4d43c036bc311959e9f/system-parachains/bridge-hubs/bridge-hub-kusama/src/bridge_to_polkadot_config.rs#L71C14-L71C43)
+ for registration on Kusama Bridge Hub and
+ [500 DOT](https://github.com/polkadot-fellows/runtimes/blob/9ce1bbbbcd7843b3c76ba4d43c036bc311959e9f/system-parachains/bridge-hubs/bridge-hub-polkadot/src/bridge_to_kusama_config.rs#L71C14-L71C43)
+ for registration on Polkadot Bridge Hub;
+
+- when you are registered, those funds are reserved on relayer account and you can't transfer them.
+
+The registration itself, has three states: active, inactive or expired. Initially, it is active, meaning that all
+your transactions that are **validated** on top of block, where it is active get priority boost. Registration
+becomes expired when the block with the number you have specified during registration is "mined". It is the
+`validTill` parameter of the `register` call (see below). After that `validTill` block, you may unregister and get
+your reserved funds back. There's also an intermediate point between those blocks - it is the `validTill - LEASE`,
+where `LEASE` is the the chain constant, controlled by the governance. Initially it is set to `300` blocks.
+All your transactions, **validated** between the `validTill - LEASE` and `validTill` blocks do not get the
+priority boost. Also, it is forbidden to specify `validTill` such that the `validTill - currentBlock` is less
+than the `LEASE`.
+
+
+Example?
+
+| Bridge Hub Block | Registration State | Comment |
+| ----------------- | ------------------ | ------------------------------------------------------ |
+| 100 | Active | You have submitted a tx with the `register(1000)` call |
+| 101 | Active | Your message delivery transactions are boosted |
+| 102 | Active | Your message delivery transactions are boosted |
+| ... | Active | Your message delivery transactions are boosted |
+| 700 | Inactive | Your message delivery transactions are not boosted |
+| 701 | Inactive | Your message delivery transactions are not boosted |
+| ... | Inactive | Your message delivery transactions are not boosted |
+| 1000 | Expired | Your may submit a tx with the `deregister` call |
+
+
+
+So once you have enough funds on your account and have selected the `validTill` parameter value, you
+could use the Polkadot JS apps to submit an extrinsic. If you want priority boost for your transactions
+on the Kusama Bridge Hub, open the
+[Polkadot JS Apps](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-bridge-hub-rpc.polkadot.io#/extrinsics)
+and submit the `register` extrinsic from the `bridgeRelayers` pallet:
+
+![Register Extrinsic](./bridge-relayers-register.png)
+
+To deregister, submit the simple `deregister` extrinsic when registration is expired:
+
+![Deregister Extrinsic](./bridge-relayers-deregister.png)
+
+At any time, you can prolong your registration by calling the `register` with the larger `validTill`.
+
+## Costs
+
+Your relayer account (on both Bridge Hubs) must hold enough funds to be able to pay costs of bridge
+transactions. If your relayer behaves correctly, those costs will be compensated and you will be
+able to claim it later.
+
+**IMPORTANT**: you may add tip to your bridge transactions to boost their priority. But our
+compensation mechanism never refunds transaction tip, so all tip tokens will be lost.
+
+
+Types of bridge transactions
+
+There are two types of bridge transactions:
+
+- message delivery transaction brings queued message(s) from one Bridge Hub to another. We record
+ the fact that this specific (your) relayer has delivered those messages;
+
+- message confirmation transaction confirms that some message have been delivered and also brings
+ back information on how many messages (your) relayer has delivered. We use this information later
+ to register delivery rewards on the source chain.
+
+Several messages/confirmations may be included in a single bridge transaction. Apart from this
+data, bridge transaction may include finality and storage proofs, required to prove authenticity of
+this data.
+
+
+
+To deliver and get reward for a single message, the relayer needs to submit two transactions. One
+at the source Bridge Hub and one at the target Bridge Hub. Below are costs for Polkadot <> Kusama
+messages (as of today):
+
+- to deliver a single Polkadot -> Kusama message, you would need to pay around `0.06 KSM` at Kusama
+ Bridge Hub and around `1.62 DOT` at Polkadot Bridge Hub;
+
+- to deliver a single Kusama -> Polkadot message, you would need to pay around `1.70 DOT` at Polkadot
+ Bridge Hub and around `0.05 KSM` at Kusama Bridge Hub.
+
+Those values are not constants - they depend on call weights (that may change from release to release),
+on transaction sizes (that depends on message size and chain state) and congestion factor. In any
+case - it is your duty to make sure that the relayer has enough funds to pay transaction fees.
+
+## Claiming your Compensations and Rewards
+
+Hopefully you have successfully delivered some messages and now can claim your compensation and reward.
+This requires submitting several transactions. But first, let's check that you actually have something to
+claim. For that, let's check the state of the pallet that tracks all rewards.
+
+To check your rewards at the Kusama Bridge Hub, go to the
+[Polkadot JS Apps](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-bridge-hub-rpc.polkadot.io#/chainstate)
+targeting Kusama Bridge Hub, select the `bridgeRelayers` pallet, choose `relayerRewards` map and
+your relayer account. Then:
+
+- set the `laneId` to `0x00000001`
+
+- set the `bridgedChainId` to `bhpd`;
+
+- check the both variants of the `owner` field: `ThisChain` is used to pay for message delivery transactions
+ and `BridgedChain` is used to pay for message confirmation transactions.
+
+If check shows that you have some rewards, you can craft the claim transaction, with similar parameters.
+For that, go to `Extrinsics` tab of the
+[Polkadot JS Apps](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-bridge-hub-rpc.polkadot.io#/extrinsics)
+and submit the following transaction (make sure to change `owner` before):
+
+![Claim Rewards Extrinsic](./bridge-relayers-claim-rewards.png)
+
+To claim rewards on Polkadot Bridge Hub you can follow the same process. The only difference is that you
+need to set value of the `bridgedChainId` to `bhks`.
+
+## Starting your Relayer
+
+### Starting your Rococo <> Westend Relayer
+
+You may find the relayer image reference in the
+[Releases](https://github.com/paritytech/parity-bridges-common/releases)
+of this repository. Make sure to check supported (bundled) versions
+of release there. For Rococo <> Westend bridge, normally you may use the
+latest published release. The release notes always contain the docker
+image reference and source files, required to build relayer manually.
+
+Once you have the docker image, update variables and run the following script:
+```sh
+export DOCKER_IMAGE=
+
+export ROCOCO_HOST=
+export ROCOCO_PORT=
+# or set it to '--rococo-secure' if wss is used above
+export ROCOCO_IS_SECURE=
+export BRIDGE_HUB_ROCOCO_HOST=
+export BRIDGE_HUB_ROCOCO_PORT=
+# or set it to '--bridge-hub-rococo-secure' if wss is used above
+export BRIDGE_HUB_ROCOCO_IS_SECURE=
+export BRIDGE_HUB_ROCOCO_KEY_FILE=
+
+export WESTEND_HOST=
+export WESTEND_PORT=
+# or set it to '--westend-secure' if wss is used above
+export WESTEND_IS_SECURE=
+export BRIDGE_HUB_WESTEND_HOST=
+export BRIDGE_HUB_WESTEND_PORT=
+# or set it to '--bridge-hub-westend-secure ' if wss is used above
+export BRIDGE_HUB_WESTEND_IS_SECURE=
+export BRIDGE_HUB_WESTEND_KEY_FILE=
+
+# you can get extended relay logs (e.g. for debugging issues) by passing `-e RUST_LOG=bridge=trace`
+# argument to the `docker` binary
+docker run \
+ -v $BRIDGE_HUB_ROCOCO_KEY_FILE:/bhr.key \
+ -v $BRIDGE_HUB_WESTEND_KEY_FILE:/bhw.key \
+ $DOCKER_IMAGE \
+ relay-headers-and-messages bridge-hub-rococo-bridge-hub-westend \
+ --rococo-host $ROCOCO_HOST \
+ --rococo-port $ROCOCO_PORT \
+ $ROCOCO_IS_SECURE \
+ --rococo-version-mode Auto \
+ --bridge-hub-rococo-host $BRIDGE_HUB_ROCOCO_HOST \
+ --bridge-hub-rococo-port $BRIDGE_HUB_ROCOCO_PORT \
+ $BRIDGE_HUB_ROCOCO_IS_SECURE \
+ --bridge-hub-rococo-version-mode Auto \
+ --bridge-hub-rococo-signer-file /bhr.key \
+ --bridge-hub-rococo-transactions-mortality 16 \
+ --westend-host $WESTEND_HOST \
+ --westend-port $WESTEND_PORT \
+ $WESTEND_IS_SECURE \
+ --westend-version-mode Auto \
+ --bridge-hub-westend-host $BRIDGE_HUB_WESTEND_HOST \
+ --bridge-hub-westend-port $BRIDGE_HUB_WESTEND_PORT \
+ $BRIDGE_HUB_WESTEND_IS_SECURE \
+ --bridge-hub-westend-version-mode Auto \
+ --bridge-hub-westend-signer-file /bhw.key \
+ --bridge-hub-westend-transactions-mortality 16 \
+ --lane 00000002
+```
+
+### Starting your Polkadot <> Kusama Relayer
+
+*Work in progress, coming soon*
+
+### Watching your relayer state
+
+Our relayer provides some Prometheus metrics that you may convert into some fancy Grafana dashboards
+and alerts. By default, metrics are exposed at port `9616`. To expose endpoint to the localhost, change
+the docker command by adding following two lines:
+
+```sh
+docker run \
+ ..
+ -p 127.0.0.1:9616:9616 \ # tell Docker to bind container port 9616 to host port 9616
+ # and listen for connections on the host' localhost interface
+ ..
+ $DOCKER_IMAGE \
+ relay-headers-and-messages bridge-hub-rococo-bridge-hub-westend \
+ --prometheus-host 0.0.0.0 \ # tell `substrate-relay` binary to accept Prometheus endpoint
+ # connections from everywhere
+ ..
+```
+
+You can find more info on configuring Prometheus and Grafana in the
+[Monitor your node](https://wiki.polkadot.network/docs/maintain-guides-how-to-monitor-your-node)
+guide from Polkadot wiki.
+
+We have our own set of Grafana dashboards and alerts. You may use them for inspiration.
+Please find them in this folder:
+
+- for Rococo <> Westend bridge: [rococo-westend](https://github.com/paritytech/parity-bridges-common/tree/master/deployments/bridges/rococo-westend).
+
+- for Polkadot <> Kusama bridge: *work in progress, coming soon*
diff --git a/bridges/modules/grandpa/Cargo.toml b/bridges/modules/grandpa/Cargo.toml
index dccd7b3bdca3533cda4fec82ed0266d0b221b7a7..0db1827211a05f715cd1aed0db93da0f52c9d67c 100644
--- a/bridges/modules/grandpa/Cargo.toml
+++ b/bridges/modules/grandpa/Cargo.toml
@@ -5,6 +5,7 @@ description = "Module implementing GRANDPA on-chain light client used for bridgi
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+repository.workspace = true
[lints]
workspace = true
@@ -12,10 +13,10 @@ workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
+codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false }
finality-grandpa = { version = "0.16.2", default-features = false }
log = { workspace = true }
-scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
+scale-info = { version = "2.11.1", default-features = false, features = ["derive"] }
# Bridge Dependencies
diff --git a/bridges/modules/grandpa/README.md b/bridges/modules/grandpa/README.md
index 992bd2cc47228249310c56747416b07be6e1e287..4a3099b8afc654bfced296aaa0ead4a5d113eb7f 100644
--- a/bridges/modules/grandpa/README.md
+++ b/bridges/modules/grandpa/README.md
@@ -10,7 +10,7 @@ It is used by the parachains light client (bridge parachains pallet) and by mess
## A Brief Introduction into GRANDPA Finality
You can find detailed information on GRANDPA, by exploring its [repository](https://github.com/paritytech/finality-grandpa).
-Here is the minimal reqiuired GRANDPA information to understand how pallet works.
+Here is the minimal required GRANDPA information to understand how pallet works.
Any Substrate chain may use different block authorship algorithms (like BABE or Aura) to determine block producers and
generate blocks. This has nothing common with finality, though - the task of block authorship is to coordinate
diff --git a/bridges/modules/grandpa/src/call_ext.rs b/bridges/modules/grandpa/src/call_ext.rs
index e3c778b480baa51a8b9e5d04564ac54bc7a68a21..4a7ebb3cc8d42d7cb9d97d5c6990bb33658416bd 100644
--- a/bridges/modules/grandpa/src/call_ext.rs
+++ b/bridges/modules/grandpa/src/call_ext.rs
@@ -205,7 +205,7 @@ pub(crate) fn submit_finality_proof_info_from_args, I: 'static>(
// as an extra weight.
let votes_ancestries_len = justification.votes_ancestries.len().saturated_into();
let extra_weight =
- if votes_ancestries_len > T::BridgedChain::REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY {
+ if votes_ancestries_len > T::BridgedChain::REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY {
T::WeightInfo::submit_finality_proof(precommits_len, votes_ancestries_len)
} else {
Weight::zero()
@@ -396,11 +396,11 @@ mod tests {
let finality_target = test_header(1);
let mut justification_params = JustificationGeneratorParams {
header: finality_target.clone(),
- ancestors: TestBridgedChain::REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY,
+ ancestors: TestBridgedChain::REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY,
..Default::default()
};
- // when there are `REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY` headers => no refund
+ // when there are `REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY` headers => no refund
let justification = make_justification_for_header(justification_params.clone());
let call = RuntimeCall::Grandpa(crate::Call::submit_finality_proof_ex {
finality_target: Box::new(finality_target.clone()),
@@ -409,7 +409,7 @@ mod tests {
});
assert_eq!(call.submit_finality_proof_info().unwrap().extra_weight, Weight::zero());
- // when there are `REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY + 1` headers => full refund
+ // when there are `REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY + 1` headers => full refund
justification_params.ancestors += 1;
let justification = make_justification_for_header(justification_params);
let call_weight = ::WeightInfo::submit_finality_proof(
diff --git a/bridges/modules/grandpa/src/lib.rs b/bridges/modules/grandpa/src/lib.rs
index ce2c47da954fa46efc4c70e9608864735fa16277..9e095651ef81da1e5418d7532ae56ae0fb8ef564 100644
--- a/bridges/modules/grandpa/src/lib.rs
+++ b/bridges/modules/grandpa/src/lib.rs
@@ -935,7 +935,7 @@ mod tests {
}
#[test]
- fn succesfully_imports_header_with_valid_finality() {
+ fn successfully_imports_header_with_valid_finality() {
run_test(|| {
initialize_substrate_bridge();
@@ -1192,7 +1192,7 @@ mod tests {
header.digest = change_log(0);
let justification = make_justification_for_header(JustificationGeneratorParams {
header: header.clone(),
- ancestors: TestBridgedChain::REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY + 1,
+ ancestors: TestBridgedChain::REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY + 1,
..Default::default()
});
diff --git a/bridges/modules/grandpa/src/mock.rs b/bridges/modules/grandpa/src/mock.rs
index 4318d663a2e17fe80199830d443f5b6a85fae441..e689e520c92ffcb230a83f7a728722a688729417 100644
--- a/bridges/modules/grandpa/src/mock.rs
+++ b/bridges/modules/grandpa/src/mock.rs
@@ -87,7 +87,7 @@ impl Chain for TestBridgedChain {
impl ChainWithGrandpa for TestBridgedChain {
const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str = "";
const MAX_AUTHORITIES_COUNT: u32 = MAX_BRIDGED_AUTHORITIES;
- const REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY: u32 = 8;
+ const REASONABLE_HEADERS_IN_JUSTIFICATION_ANCESTRY: u32 = 8;
const MAX_MANDATORY_HEADER_SIZE: u32 = 256;
const AVERAGE_HEADER_SIZE: u32 = 64;
}
diff --git a/bridges/modules/messages/Cargo.toml b/bridges/modules/messages/Cargo.toml
index 173d6f1c16448517b7051cfba2f96625ff3d525a..df5b92db7402bd048b1afca9c13cfb1dddc74863 100644
--- a/bridges/modules/messages/Cargo.toml
+++ b/bridges/modules/messages/Cargo.toml
@@ -5,15 +5,16 @@ version = "0.7.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+repository.workspace = true
[lints]
workspace = true
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false }
+codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false }
log = { workspace = true }
num-traits = { version = "0.2", default-features = false }
-scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
+scale-info = { version = "2.11.1", default-features = false, features = ["derive"] }
# Bridge dependencies
diff --git a/bridges/modules/messages/src/inbound_lane.rs b/bridges/modules/messages/src/inbound_lane.rs
index 966ec939e70e22e830ee30157d2d7da74d59733c..da1698e6e0370f9f84ca8dd53bc1ebc99f696017 100644
--- a/bridges/modules/messages/src/inbound_lane.rs
+++ b/bridges/modules/messages/src/inbound_lane.rs
@@ -21,7 +21,7 @@ use crate::Config;
use bp_messages::{
target_chain::{DispatchMessage, DispatchMessageData, MessageDispatch},
DeliveredMessages, InboundLaneData, LaneId, MessageKey, MessageNonce, OutboundLaneData,
- ReceivalResult, UnrewardedRelayer,
+ ReceptionResult, UnrewardedRelayer,
};
use codec::{Decode, Encode, EncodeLike, MaxEncodedLen};
use frame_support::traits::Get;
@@ -170,21 +170,21 @@ impl InboundLane {
relayer_at_bridged_chain: &S::Relayer,
nonce: MessageNonce,
message_data: DispatchMessageData,
- ) -> ReceivalResult {
+ ) -> ReceptionResult {
let mut data = self.storage.get_or_init_data();
if Some(nonce) != data.last_delivered_nonce().checked_add(1) {
- return ReceivalResult::InvalidNonce
+ return ReceptionResult::InvalidNonce
}
// if there are more unrewarded relayer entries than we may accept, reject this message
if data.relayers.len() as MessageNonce >= self.storage.max_unrewarded_relayer_entries() {
- return ReceivalResult::TooManyUnrewardedRelayers
+ return ReceptionResult::TooManyUnrewardedRelayers
}
// if there are more unconfirmed messages than we may accept, reject this message
let unconfirmed_messages_count = nonce.saturating_sub(data.last_confirmed_nonce);
if unconfirmed_messages_count > self.storage.max_unconfirmed_messages() {
- return ReceivalResult::TooManyUnconfirmedMessages
+ return ReceptionResult::TooManyUnconfirmedMessages
}
// then, dispatch message
@@ -207,7 +207,7 @@ impl InboundLane {
};
self.storage.set_data(data);
- ReceivalResult::Dispatched(dispatch_result)
+ ReceptionResult::Dispatched(dispatch_result)
}
}
@@ -235,7 +235,7 @@ mod tests {
nonce,
inbound_message_data(REGULAR_PAYLOAD)
),
- ReceivalResult::Dispatched(dispatch_result(0))
+ ReceptionResult::Dispatched(dispatch_result(0))
);
}
@@ -362,7 +362,7 @@ mod tests {
10,
inbound_message_data(REGULAR_PAYLOAD)
),
- ReceivalResult::InvalidNonce
+ ReceptionResult::InvalidNonce
);
assert_eq!(lane.storage.get_or_init_data().last_delivered_nonce(), 0);
});
@@ -381,7 +381,7 @@ mod tests {
current_nonce,
inbound_message_data(REGULAR_PAYLOAD)
),
- ReceivalResult::Dispatched(dispatch_result(0))
+ ReceptionResult::Dispatched(dispatch_result(0))
);
}
// Fails to dispatch new message from different than latest relayer.
@@ -391,7 +391,7 @@ mod tests {
max_nonce + 1,
inbound_message_data(REGULAR_PAYLOAD)
),
- ReceivalResult::TooManyUnrewardedRelayers,
+ ReceptionResult::TooManyUnrewardedRelayers,
);
// Fails to dispatch new messages from latest relayer. Prevents griefing attacks.
assert_eq!(
@@ -400,7 +400,7 @@ mod tests {
max_nonce + 1,
inbound_message_data(REGULAR_PAYLOAD)
),
- ReceivalResult::TooManyUnrewardedRelayers,
+ ReceptionResult::TooManyUnrewardedRelayers,
);
});
}
@@ -417,7 +417,7 @@ mod tests {
current_nonce,
inbound_message_data(REGULAR_PAYLOAD)
),
- ReceivalResult::Dispatched(dispatch_result(0))
+ ReceptionResult::Dispatched(dispatch_result(0))
);
}
// Fails to dispatch new message from different than latest relayer.
@@ -427,7 +427,7 @@ mod tests {
max_nonce + 1,
inbound_message_data(REGULAR_PAYLOAD)
),
- ReceivalResult::TooManyUnconfirmedMessages,
+ ReceptionResult::TooManyUnconfirmedMessages,
);
// Fails to dispatch new messages from latest relayer.
assert_eq!(
@@ -436,7 +436,7 @@ mod tests {
max_nonce + 1,
inbound_message_data(REGULAR_PAYLOAD)
),
- ReceivalResult::TooManyUnconfirmedMessages,
+ ReceptionResult::TooManyUnconfirmedMessages,
);
});
}
@@ -451,7 +451,7 @@ mod tests {
1,
inbound_message_data(REGULAR_PAYLOAD)
),
- ReceivalResult::Dispatched(dispatch_result(0))
+ ReceptionResult::Dispatched(dispatch_result(0))
);
assert_eq!(
lane.receive_message::(
@@ -459,7 +459,7 @@ mod tests {
2,
inbound_message_data(REGULAR_PAYLOAD)
),
- ReceivalResult::Dispatched(dispatch_result(0))
+ ReceptionResult::Dispatched(dispatch_result(0))
);
assert_eq!(
lane.receive_message::(
@@ -467,7 +467,7 @@ mod tests {
3,
inbound_message_data(REGULAR_PAYLOAD)
),
- ReceivalResult::Dispatched(dispatch_result(0))
+ ReceptionResult::Dispatched(dispatch_result(0))
);
assert_eq!(
lane.storage.get_or_init_data().relayers,
@@ -490,7 +490,7 @@ mod tests {
1,
inbound_message_data(REGULAR_PAYLOAD)
),
- ReceivalResult::Dispatched(dispatch_result(0))
+ ReceptionResult::Dispatched(dispatch_result(0))
);
assert_eq!(
lane.receive_message::(
@@ -498,7 +498,7 @@ mod tests {
1,
inbound_message_data(REGULAR_PAYLOAD)
),
- ReceivalResult::InvalidNonce,
+ ReceptionResult::InvalidNonce,
);
});
}
@@ -524,7 +524,7 @@ mod tests {
1,
inbound_message_data(payload)
),
- ReceivalResult::Dispatched(dispatch_result(1))
+ ReceptionResult::Dispatched(dispatch_result(1))
);
});
}
diff --git a/bridges/modules/messages/src/lib.rs b/bridges/modules/messages/src/lib.rs
index a86cb326cf0404512b7fe6ad0aa2a696ff7d0a47..bc00db9eba5ba12dbdaa0de7008f293a727a7ef5 100644
--- a/bridges/modules/messages/src/lib.rs
+++ b/bridges/modules/messages/src/lib.rs
@@ -47,7 +47,7 @@ pub use weights_ext::{
use crate::{
inbound_lane::{InboundLane, InboundLaneStorage},
- outbound_lane::{OutboundLane, OutboundLaneStorage, ReceivalConfirmationError},
+ outbound_lane::{OutboundLane, OutboundLaneStorage, ReceptionConfirmationError},
};
use bp_messages::{
@@ -90,7 +90,7 @@ pub const LOG_TARGET: &str = "runtime::bridge-messages";
#[frame_support::pallet]
pub mod pallet {
use super::*;
- use bp_messages::{ReceivalResult, ReceivedMessages};
+ use bp_messages::{ReceivedMessages, ReceptionResult};
use bp_runtime::RangeInclusiveExt;
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
@@ -376,13 +376,13 @@ pub mod pallet {
// delivery transaction cost anyway. And base cost covers everything except
// dispatch, so we have a balance here.
let unspent_weight = match &receival_result {
- ReceivalResult::Dispatched(dispatch_result) => {
+ ReceptionResult::Dispatched(dispatch_result) => {
valid_messages += 1;
dispatch_result.unspent_weight
},
- ReceivalResult::InvalidNonce |
- ReceivalResult::TooManyUnrewardedRelayers |
- ReceivalResult::TooManyUnconfirmedMessages => message_dispatch_weight,
+ ReceptionResult::InvalidNonce |
+ ReceptionResult::TooManyUnrewardedRelayers |
+ ReceptionResult::TooManyUnconfirmedMessages => message_dispatch_weight,
};
lane_messages_received_status.push(message.key.nonce, receival_result);
@@ -455,7 +455,7 @@ pub mod pallet {
last_delivered_nonce,
&lane_data.relayers,
)
- .map_err(Error::::ReceivalConfirmation)?;
+ .map_err(Error::::ReceptionConfirmation)?;
if let Some(confirmed_messages) = confirmed_messages {
// emit 'delivered' event
@@ -563,7 +563,7 @@ pub mod pallet {
/// The message someone is trying to work with (i.e. increase fee) is not yet sent.
MessageIsNotYetSent,
/// Error confirming messages receival.
- ReceivalConfirmation(ReceivalConfirmationError),
+ ReceptionConfirmation(ReceptionConfirmationError),
/// Error generated by the `OwnedBridgeModule` trait.
BridgeModule(bp_runtime::OwnedBridgeModuleError),
}
@@ -923,7 +923,7 @@ mod tests {
PAYLOAD_REJECTED_BY_TARGET_CHAIN, REGULAR_PAYLOAD, TEST_LANE_ID, TEST_LANE_ID_2,
TEST_LANE_ID_3, TEST_RELAYER_A, TEST_RELAYER_B,
},
- outbound_lane::ReceivalConfirmationError,
+ outbound_lane::ReceptionConfirmationError,
};
use bp_messages::{
source_chain::MessagesBridge, BridgeMessagesCall, UnrewardedRelayer,
@@ -950,11 +950,11 @@ mod tests {
let outbound_lane = outbound_lane::(lane_id);
let message_nonce = outbound_lane.data().latest_generated_nonce + 1;
- let prev_enqueud_messages = outbound_lane.data().queued_messages().saturating_len();
+ let prev_enqueued_messages = outbound_lane.data().queued_messages().saturating_len();
let valid_message = Pallet::::validate_message(lane_id, ®ULAR_PAYLOAD)
.expect("validate_message has failed");
let artifacts = Pallet::::send_message(valid_message);
- assert_eq!(artifacts.enqueued_messages, prev_enqueud_messages + 1);
+ assert_eq!(artifacts.enqueued_messages, prev_enqueued_messages + 1);
// check event with assigned nonce
assert_eq!(
@@ -1541,7 +1541,7 @@ mod tests {
}
#[test]
- fn actual_dispatch_weight_does_not_overlow() {
+ fn actual_dispatch_weight_does_not_overflow() {
run_test(|| {
let message1 = message(1, message_payload(0, u64::MAX / 2));
let message2 = message(2, message_payload(0, u64::MAX / 2));
@@ -1775,7 +1775,7 @@ mod tests {
// returns `last_confirmed_nonce`;
// 3) it means that we're going to confirm delivery of messages 1..=1;
// 4) so the number of declared messages (see `UnrewardedRelayersState`) is `0` and
- // numer of actually confirmed messages is `1`.
+ // number of actually confirmed messages is `1`.
assert_noop!(
Pallet::::receive_messages_delivery_proof(
RuntimeOrigin::signed(1),
@@ -1785,8 +1785,8 @@ mod tests {
))),
UnrewardedRelayersState { last_delivered_nonce: 1, ..Default::default() },
),
- Error::::ReceivalConfirmation(
- ReceivalConfirmationError::TryingToConfirmMoreMessagesThanExpected
+ Error::::ReceptionConfirmation(
+ ReceptionConfirmationError::TryingToConfirmMoreMessagesThanExpected
),
);
});
diff --git a/bridges/modules/messages/src/outbound_lane.rs b/bridges/modules/messages/src/outbound_lane.rs
index 431c2cfb7eef3e8dd48e49c6ac37153ae64d57b6..acef5546d2a64fa8a3fb38c6b41ae30819cdeaa2 100644
--- a/bridges/modules/messages/src/outbound_lane.rs
+++ b/bridges/modules/messages/src/outbound_lane.rs
@@ -53,7 +53,7 @@ pub type StoredMessagePayload = BoundedVec>::MaximalOu
/// Result of messages receival confirmation.
#[derive(Encode, Decode, RuntimeDebug, PartialEq, Eq, PalletError, TypeInfo)]
-pub enum ReceivalConfirmationError {
+pub enum ReceptionConfirmationError {
/// Bridged chain is trying to confirm more messages than we have generated. May be a result
/// of invalid bridged chain storage.
FailedToConfirmFutureMessages,
@@ -103,7 +103,7 @@ impl OutboundLane {
max_allowed_messages: MessageNonce,
latest_delivered_nonce: MessageNonce,
relayers: &VecDeque>,
- ) -> Result