diff --git a/.github/allowed-actions.js b/.github/allowed-actions.js
new file mode 100644
index 0000000000000000000000000000000000000000..4fb894758060d4a3dbe57973fbb52bb8c326e786
--- /dev/null
+++ b/.github/allowed-actions.js
@@ -0,0 +1,7 @@
+// This is a whitelist of GitHub Actions that are approved for use in this project.
+// If a new or existing workflow file is updated to use an action or action version
+// not listed here, CI will fail.
+
+module.exports = [
+ 'gaurav-nelson/github-action-markdown-link-check@7481451f70251762f149d69596e3e276ebf2b236', // gaurav-nelson/github-action-markdown-link-check@v1.0.8
+]
diff --git a/.github/workflows/md-link-check.yml b/.github/workflows/md-link-check.yml
index 75948534b3c194430e87e4a2fc6eb8c600c4618e..868569911d47185c08aff6d419ad56240a0dbc59 100644
--- a/.github/workflows/md-link-check.yml
+++ b/.github/workflows/md-link-check.yml
@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- - uses: gaurav-nelson/github-action-markdown-link-check@v1
+ - uses: gaurav-nelson/github-action-markdown-link-check@7481451f70251762f149d69596e3e276ebf2b236
with:
use-quiet-mode: 'yes'
config-file: '.github/workflows/mlc_config.json'
diff --git a/.github/workflows/mlc_config.json b/.github/workflows/mlc_config.json
index f741e987b1b2a771d4b15a478a519ca8e868b60a..e7e620b39e0a9b2dd60eb57498ba99c1b6635443 100644
--- a/.github/workflows/mlc_config.json
+++ b/.github/workflows/mlc_config.json
@@ -1,7 +1,7 @@
{
"ignorePatterns": [
{
- "pattern": "^https://crates.io"
+ "pattern": "^https://crates.io",
}
]
}
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 215157061bb0b5889abef0b8a012c7d09f5168f3..62e438645e10382cfbbc83962291a3746f648bdc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -24,9 +24,6 @@ stages:
- check
- test
- build
- - post-build-test
- - chaos-env
- - chaos
- publish
- deploy
- flaming-fir
@@ -400,12 +397,11 @@ build-linux-substrate: &build-binary
<<: *collect-artifacts
<<: *docker-env
rules:
- # .build-refs with manual on PRs and chaos
+ # .build-refs with manual on PRs
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME == "tags"
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
- - if: $CI_COMMIT_MESSAGE =~ /\[chaos:(basic|medium|large)\]/ && $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # i.e add [chaos:basic] in commit message to trigger
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
when: manual
allow_failure: true
@@ -491,136 +487,40 @@ build-rust-doc:
- echo "" > ./crate-docs/index.html
- sccache -s
-#### stage: post-build-test
-
-trigger-contracts-ci:
- stage: post-build-test
- needs:
- - job: build-linux-substrate
- artifacts: false
- - job: test-linux-stable
- artifacts: false
- trigger:
- project: parity/srml-contracts-waterfall
- branch: master
- strategy: depend
- rules:
- - if: $CI_PIPELINE_SOURCE == "web"
- - if: $CI_PIPELINE_SOURCE == "schedule"
- - if: $CI_COMMIT_REF_NAME == "master"
-
-#### stage: chaos-env
-
-build-chaos-docker:
- stage: chaos-env
- rules:
- # .build-refs with chaos
- - if: $CI_PIPELINE_SOURCE == "web"
- - if: $CI_COMMIT_REF_NAME == "master"
- - if: $CI_COMMIT_REF_NAME == "tags"
- - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
- - if: $CI_COMMIT_MESSAGE =~ /\[chaos:(basic|medium|large)\]/ && $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # i.e add [chaos:basic] in commit message to trigger
- needs:
- - job: build-linux-substrate
- image: docker:stable
- tags:
- - kubernetes-parity-build
- variables:
- <<: *default-vars
- DOCKER_HOST: tcp://localhost:2375
- DOCKER_DRIVER: overlay2
- PRODUCT: substrate
- DOCKERFILE: $PRODUCT.Dockerfile
- CONTAINER_IMAGE: paritypr/$PRODUCT
- environment:
- name: parity-simnet
- services:
- - docker:dind
- before_script:
- - test "$DOCKER_CHAOS_USER" -a "$DOCKER_CHAOS_TOKEN"
- || ( echo "no docker credentials provided"; exit 1 )
- - docker login -u "$DOCKER_CHAOS_USER" -p "$DOCKER_CHAOS_TOKEN"
- - docker info
- script:
- - cd ./artifacts/$PRODUCT/
- - VERSION="ci-${CI_COMMIT_SHORT_SHA}"
- - echo "${PRODUCT} version = ${VERSION}"
- - test -z "${VERSION}" && exit 1
- - docker build
- --build-arg VCS_REF="${CI_COMMIT_SHA}"
- --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
- --tag $CONTAINER_IMAGE:$VERSION
- --file $DOCKERFILE .
- - docker push $CONTAINER_IMAGE:$VERSION
- after_script:
- - docker logout
-
-#### stage: chaos
-
-chaos-test-singlenodeheight:
- stage: chaos
- rules:
- # .build-refs with chaos
- - if: $CI_PIPELINE_SOURCE == "web"
- - if: $CI_COMMIT_REF_NAME == "master"
- - if: $CI_COMMIT_REF_NAME == "tags"
- - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
- - if: $CI_COMMIT_MESSAGE =~ /\[chaos:(basic|medium|large)\]/ && $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # i.e add [chaos:basic] in commit message to trigger
- image: paritypr/simnet:latest
- needs:
- - job: build-chaos-docker
- tags:
- - parity-simnet
- variables:
- <<: *default-vars
- PRODUCT: substrate
- DOCKERFILE: $PRODUCT.Dockerfile
- CONTAINER_IMAGE: paritypr/$PRODUCT
- KEEP_NAMESPACE: 0
- NAMESPACE: "substrate-ci-${CI_COMMIT_SHORT_SHA}-${CI_PIPELINE_ID}"
- VERSION: "ci-${CI_COMMIT_SHORT_SHA}"
- interruptible: true
- environment:
- name: parity-simnet
- script:
- - simnet spawn dev -i $CONTAINER_IMAGE:$VERSION
- - simnet singlenodeheight -h 30
- after_script:
- - simnet clean
-
#### stage: publish
.build-push-docker-image: &build-push-docker-image
<<: *build-refs
<<: *kubernetes-build
- image: docker:stable
- services:
- - docker:dind
+ image: quay.io/buildah/stable
variables: &docker-build-vars
<<: *default-vars
- DOCKER_HOST: tcp://localhost:2375
- DOCKER_DRIVER: overlay2
GIT_STRATEGY: none
DOCKERFILE: $PRODUCT.Dockerfile
- CONTAINER_IMAGE: parity/$PRODUCT
+ IMAGE_NAME: docker.io/parity/$PRODUCT
before_script:
- - test "$Docker_Hub_User_Parity" -a "$Docker_Hub_Pass_Parity"
- || ( echo "no docker credentials provided"; exit 1 )
- - docker login -u "$Docker_Hub_User_Parity" -p "$Docker_Hub_Pass_Parity"
- - docker info
+ - test "$Docker_Hub_User_Parity" -a "$Docker_Hub_Pass_Parity" ||
+ ( echo "no docker credentials provided"; exit 1 )
script:
- cd ./artifacts/$PRODUCT/
- VERSION="$(cat ./VERSION)"
- echo "${PRODUCT} version = ${VERSION}"
- test -z "${VERSION}" && exit 1
- - docker build
+ - buildah bud
+ --squash
+ --format=docker
--build-arg VCS_REF="${CI_COMMIT_SHA}"
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
- --tag $CONTAINER_IMAGE:$VERSION
- --tag $CONTAINER_IMAGE:latest
- --file $DOCKERFILE .
- - docker push $CONTAINER_IMAGE:$VERSION
- - docker push $CONTAINER_IMAGE:latest
+ --tag "$IMAGE_NAME:$VERSION"
+ --tag "$IMAGE_NAME:latest"
+ --file "$DOCKERFILE" .
+ - echo "$Docker_Hub_Pass_Parity" |
+ buildah login --username "$Docker_Hub_User_Parity" --password-stdin docker.io
+ - buildah info
+ - buildah push
+ --format=v2s2
+ "$IMAGE_NAME:$VERSION"
+ "$IMAGE_NAME:latest"
publish-docker-substrate:
stage: publish
@@ -634,7 +534,7 @@ publish-docker-substrate:
<<: *docker-build-vars
PRODUCT: substrate
after_script:
- - docker logout
+ - buildah logout "$IMAGE_NAME"
# only VERSION information is needed for the deployment
- find ./artifacts/ -depth -not -name VERSION -type f -delete
@@ -648,7 +548,7 @@ publish-docker-subkey:
<<: *docker-build-vars
PRODUCT: subkey
after_script:
- - docker logout
+ - buildah logout "$IMAGE_NAME"
publish-s3-release:
stage: publish
diff --git a/.maintain/frame-weight-template.hbs b/.maintain/frame-weight-template.hbs
index 6e555da968d35512e001b94da85dfa696aef5d2e..2253452e203daff7374cffae4ffabe9ae8407254 100644
--- a/.maintain/frame-weight-template.hbs
+++ b/.maintain/frame-weight-template.hbs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -54,6 +54,7 @@ impl WeightInfo for SubstrateWeight {
) -> Weight {
({{underscore benchmark.base_weight}} as Weight)
{{~#each benchmark.component_weight as |cw|}}
+ // Standard Error: {{underscore cw.error}}
.saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))
{{~/each}}
{{~#if (ne benchmark.base_reads "0")}}
@@ -82,6 +83,7 @@ impl WeightInfo for () {
) -> Weight {
({{underscore benchmark.base_weight}} as Weight)
{{~#each benchmark.component_weight as |cw|}}
+ // Standard Error: {{underscore cw.error}}
.saturating_add(({{underscore cw.slope}} as Weight).saturating_mul({{cw.name}} as Weight))
{{~/each}}
{{~#if (ne benchmark.base_reads "0")}}
diff --git a/.maintain/gitlab/check_polkadot_companion_build.sh b/.maintain/gitlab/check_polkadot_companion_build.sh
index 4b6e45c267efe1a933ccfa0476958cbabd177d14..f2b61c6192d620bf8f5bed5fcb510538174b8484 100755
--- a/.maintain/gitlab/check_polkadot_companion_build.sh
+++ b/.maintain/gitlab/check_polkadot_companion_build.sh
@@ -9,6 +9,7 @@
# polkadot companion: paritytech/polkadot#567
#
+set -e
github_api_substrate_pull_url="https://api.github.com/repos/paritytech/substrate/pulls"
# use github api v3 in order to access the data without authentication
@@ -44,6 +45,7 @@ cargo install -f --version 0.2.0 diener
# Merge master into our branch before building Polkadot to make sure we don't miss
# any commits that are required by Polkadot.
+git fetch --depth 100 origin
git merge origin/master
# Clone the current Polkadot master branch into ./polkadot.
diff --git a/.maintain/update-copyright.sh b/.maintain/update-copyright.sh
index d48fc3cc979d626898c09591f8a5df2944dba3cd..d67cab7c1e15222477fa11955fbe8951e7efbf78 100755
--- a/.maintain/update-copyright.sh
+++ b/.maintain/update-copyright.sh
@@ -1,15 +1,14 @@
#!/usr/bin/env bash
-SINGLE_DATES=$(grep -lr "// Copyright [0-9]* Parity Technologies (UK) Ltd.")
-RANGE_DATES=$(grep -lr "// Copyright [0-9]*-[0-9]* Parity Technologies (UK) Ltd.")
+SINGLE_DATES=$(grep -lr "// Copyright (C) [0-9]* Parity Technologies (UK) Ltd.")
YEAR=$(date +%Y)
for file in $SINGLE_DATES; do
- FILE_YEAR=$(cat $file | sed -n "s|// Copyright \([[:digit:]][[:digit:]][[:digit:]][[:digit:]]\) Parity Technologies (UK) Ltd.|\1|p")
+ FILE_YEAR=$(cat $file | sed -n "s|// Copyright (C) \([[:digit:]][[:digit:]][[:digit:]][[:digit:]]\) Parity Technologies (UK) Ltd.|\1|p")
if [ $YEAR -ne $FILE_YEAR ]; then
- sed -i -e "s|// Copyright \([[:digit:]][[:digit:]][[:digit:]][[:digit:]]\) Parity Technologies (UK) Ltd.|// Copyright \1-$YEAR Parity Technologies (UK) Ltd.|g" $file
+ sed -i -e "s|// Copyright (C) \([[:digit:]][[:digit:]][[:digit:]][[:digit:]]\) Parity Technologies (UK) Ltd.|// Copyright (C) \1-$YEAR Parity Technologies (UK) Ltd.|g" $file
fi
done
-grep -lr "// Copyright [0-9]*-[0-9]* Parity Technologies (UK) Ltd." |
- xargs sed -i -e "s|// Copyright \([[:digit:]][[:digit:]][[:digit:]][[:digit:]]\)-[[:digit:]][[:digit:]][[:digit:]][[:digit:]] Parity Technologies (UK) Ltd.|// Copyright \1-$YEAR Parity Technologies (UK) Ltd.|g"
+grep -lr "// Copyright (C) [0-9]*-[0-9]* Parity Technologies (UK) Ltd." |
+ xargs sed -i -e "s|// Copyright (C) \([[:digit:]][[:digit:]][[:digit:]][[:digit:]]\)-[[:digit:]][[:digit:]][[:digit:]][[:digit:]] Parity Technologies (UK) Ltd.|// Copyright (C) \1-$YEAR Parity Technologies (UK) Ltd.|g"
diff --git a/Cargo.lock b/Cargo.lock
index bcdb368bae512e1c862d3e2da55988538739dbba..58d82cbec448c6a22f4d12a7a7c04544b6874907 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -244,9 +244,9 @@ dependencies = [
[[package]]
name = "async-io"
-version = "1.2.0"
+version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "40a0b2bb8ae20fede194e779150fe283f65a4a08461b496de546ec366b174ad9"
+checksum = "9315f8f07556761c3e48fec2e6b276004acf426e6dc068b2c2251854d65ee0fd"
dependencies = [
"concurrent-queue",
"fastrand",
@@ -306,15 +306,15 @@ checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0"
[[package]]
name = "async-tls"
-version = "0.10.0"
+version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d85a97c4a0ecce878efd3f945f119c78a646d8975340bca0398f9bb05c30cc52"
+checksum = "2f23d769dbf1838d5df5156e7b1ad404f4c463d1ac2c6aeb6cd943630f8a8400"
dependencies = [
"futures-core",
"futures-io",
- "rustls",
+ "rustls 0.19.0",
"webpki",
- "webpki-roots 0.20.0",
+ "webpki-roots",
]
[[package]]
@@ -419,7 +419,7 @@ dependencies = [
"cfg-if 0.1.10",
"clang-sys",
"clap",
- "env_logger",
+ "env_logger 0.7.1",
"lazy_static",
"lazycell",
"log",
@@ -716,6 +716,24 @@ dependencies = [
"winapi 0.3.9",
]
+[[package]]
+name = "cipher"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801"
+dependencies = [
+ "generic-array 0.14.4",
+]
+
+[[package]]
+name = "ckb-merkle-mountain-range"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e486fe53bb9f2ca0f58cb60e8679a5354fd6687a839942ef0a75967250289ca6"
+dependencies = [
+ "cfg-if 0.1.10",
+]
+
[[package]]
name = "clang-sys"
version = "0.29.3"
@@ -1328,6 +1346,19 @@ dependencies = [
"syn",
]
+[[package]]
+name = "env_logger"
+version = "0.5.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38"
+dependencies = [
+ "atty",
+ "humantime",
+ "log",
+ "regex",
+ "termcolor",
+]
+
[[package]]
name = "env_logger"
version = "0.7.1"
@@ -1450,7 +1481,7 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fdbe0d94371f9ce939b555dd342d0686cc4c0cadbcd4b61d70af5ff97eb4126"
dependencies = [
- "env_logger",
+ "env_logger 0.7.1",
"log",
]
@@ -1546,6 +1577,7 @@ dependencies = [
name = "frame-benchmarking-cli"
version = "2.0.0"
dependencies = [
+ "Inflector",
"chrono",
"frame-benchmarking",
"handlebars",
@@ -2342,7 +2374,7 @@ dependencies = [
"futures-util",
"hyper 0.13.9",
"log",
- "rustls",
+ "rustls 0.18.1",
"rustls-native-certs",
"tokio 0.2.23",
"tokio-rustls",
@@ -2392,6 +2424,22 @@ dependencies = [
"libc",
]
+[[package]]
+name = "if-watch"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "16d7c5e361e6b05c882b4847dd98992534cebc6fcde7f4bc98225bcf10fd6d0d"
+dependencies = [
+ "async-io",
+ "futures 0.3.8",
+ "futures-lite",
+ "if-addrs",
+ "ipnet",
+ "libc",
+ "log",
+ "winapi 0.3.9",
+]
+
[[package]]
name = "impl-codec"
version = "0.4.2"
@@ -2758,9 +2806,9 @@ checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a"
[[package]]
name = "libc"
-version = "0.2.80"
+version = "0.2.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614"
+checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb"
[[package]]
name = "libloading"
@@ -2780,9 +2828,9 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a"
[[package]]
name = "libp2p"
-version = "0.31.2"
+version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "724846a3194368fefcac7ebdab12e01b8ac382e3efe399ddbd28851ab34f396f"
+checksum = "2e17c636b5fe5ff900ccc2840b643074bfac321551d821243a781d0d46f06588"
dependencies = [
"atomic",
"bytes 0.5.6",
@@ -2818,13 +2866,12 @@ dependencies = [
[[package]]
name = "libp2p-core"
-version = "0.25.2"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc9c96d3a606a696a3a6c0ad3c3352c57bda2082ec9090930f1bd9daf787039f"
+checksum = "e1cb706da14c064dce54d8864ade6836b3486b51689300da74eeb7053aa4551e"
dependencies = [
"asn1_der",
"bs58",
- "bytes 0.5.6",
"ed25519-dalek",
"either",
"fnv",
@@ -2863,9 +2910,9 @@ dependencies = [
[[package]]
name = "libp2p-deflate"
-version = "0.25.0"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a579d7dd506d0620ba88ccc1754436b7de35ed6c884234f9a226bbfce382640"
+checksum = "e3257a41f376aa23f237231971fee7e350e4d8353cfcf233aef34d6d6b638f0c"
dependencies = [
"flate2",
"futures 0.3.8",
@@ -2874,9 +2921,9 @@ dependencies = [
[[package]]
name = "libp2p-dns"
-version = "0.25.0"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15dea5933f570844d7b5222b12b58f7bd52e9ca38cd65a1bd4f35341f053f012"
+checksum = "2e09bab25af01326b4ed9486d31325911437448edda30bc57681502542d49f20"
dependencies = [
"futures 0.3.8",
"libp2p-core",
@@ -2885,9 +2932,9 @@ dependencies = [
[[package]]
name = "libp2p-floodsub"
-version = "0.25.0"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23070a0838bd9a8adb27e6eba477eeb650c498f9d139383dd0135d20a8170253"
+checksum = "6fd8cdd5ef1dd0b7346975477216d752de976b92e43051bc8bd808c372ea6cec"
dependencies = [
"cuckoofilter",
"fnv",
@@ -2903,9 +2950,9 @@ dependencies = [
[[package]]
name = "libp2p-gossipsub"
-version = "0.25.0"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "65e8f3aa0906fbad435dac23c177eef3cdfaaf62609791bd7f54f8553edcfdf9"
+checksum = "d489531aa9d4ba8726a08b3b74e21c2e10a518ad266ebca98d79040123ab0036"
dependencies = [
"base64 0.13.0",
"byteorder",
@@ -2929,9 +2976,9 @@ dependencies = [
[[package]]
name = "libp2p-identify"
-version = "0.25.0"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "802fb973a7e0dde3fb9a2113a62bad90338ebe01983b706e1d576d0c2af93cda"
+checksum = "c43bc51a9bc3780288c526615ba0f5f8216820ea6dcc02b89e8daee526c5fccb"
dependencies = [
"futures 0.3.8",
"libp2p-core",
@@ -2945,9 +2992,9 @@ dependencies = [
[[package]]
name = "libp2p-kad"
-version = "0.26.0"
+version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6506b7b7982f7626fc96a91bc61be4b1fe7ae9ac23824f0ecefcce21cb39238c"
+checksum = "a226956b49438a10f3206480b8faf5e61fc445c349ea9d9cc37766a83745fa9a"
dependencies = [
"arrayvec 0.5.2",
"bytes 0.5.6",
@@ -2971,31 +3018,30 @@ dependencies = [
[[package]]
name = "libp2p-mdns"
-version = "0.25.0"
+version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4458ec36b5ab2662fb4d5c8bb9b6e1591da0ab6efe8881c7a7670ef033bc8937"
+checksum = "8a9e12688e8f14008c950c1efde587cb44dbf316fa805f419cd4e524991236f5"
dependencies = [
- "async-std",
+ "async-io",
"data-encoding",
"dns-parser",
- "either",
"futures 0.3.8",
+ "if-watch",
"lazy_static",
"libp2p-core",
"libp2p-swarm",
"log",
- "net2",
"rand 0.7.3",
"smallvec 1.5.0",
+ "socket2",
"void",
- "wasm-timer",
]
[[package]]
name = "libp2p-mplex"
-version = "0.25.0"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae2132b14045009b0f8e577a06e1459592ef0a89dedc58f3d4baf4eac956837b"
+checksum = "ce3200fbe6608e623bd9efa459cc8bafa0e4efbb0a2dfcdd0e1387ff4181264b"
dependencies = [
"bytes 0.5.6",
"futures 0.3.8",
@@ -3011,9 +3057,9 @@ dependencies = [
[[package]]
name = "libp2p-noise"
-version = "0.27.0"
+version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9610a524bef4db383cd96b4ec3ec4722eafa72c7242fa89990b74166760583d"
+checksum = "0580e0d18019d254c9c349c03ff7b22e564b6f2ada70c045fc39738e144f2139"
dependencies = [
"bytes 0.5.6",
"curve25519-dalek 3.0.0",
@@ -3033,9 +3079,9 @@ dependencies = [
[[package]]
name = "libp2p-ping"
-version = "0.25.0"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "659adf89356e04f65398bb74ee791b269e63da9e41b37f8dc19eaacd12487bfe"
+checksum = "50b2ec86a18cbf09d7df440e7786a2409640c774e476e9a3b4d031382c3d7588"
dependencies = [
"futures 0.3.8",
"libp2p-core",
@@ -3048,9 +3094,9 @@ dependencies = [
[[package]]
name = "libp2p-plaintext"
-version = "0.25.0"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96dfe26270c91d4ff095030d1fcadd602f3fd84968ebd592829916d0715798a6"
+checksum = "6a7b1bdcbe46a3a2159c231601ed29645282653c0a96ce3a2ad8352c9fbe6800"
dependencies = [
"bytes 0.5.6",
"futures 0.3.8",
@@ -3065,13 +3111,13 @@ dependencies = [
[[package]]
name = "libp2p-pnet"
-version = "0.19.2"
+version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96b3c2d5d26a9500e959a0e19743897239a6c4be78dadf99b70414301a70c006"
+checksum = "6ce3374f3b28162db9d3442c9347c4f14cb01e8290052615c7d341d40eae0599"
dependencies = [
"futures 0.3.8",
"log",
- "pin-project 0.4.27",
+ "pin-project 1.0.2",
"rand 0.7.3",
"salsa20",
"sha3",
@@ -3079,9 +3125,9 @@ dependencies = [
[[package]]
name = "libp2p-request-response"
-version = "0.6.0"
+version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e952dcc9d2d7e7e45ae8bfcff255723091bd43e3e9a7741a0af8a17fe55b3ed"
+checksum = "620e2950decbf77554b5aed3824f7d0e2c04923f28c70f9bff1a402c47ef6b1e"
dependencies = [
"async-trait",
"bytes 0.5.6",
@@ -3099,9 +3145,9 @@ dependencies = [
[[package]]
name = "libp2p-swarm"
-version = "0.25.0"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "de333c483f27d02ecf7b6cef814a36f5e1876f15139eefb00225c405350e1c22"
+checksum = "fdf5894ee1ee63a38aa58d58a16e3dcf7ede6b59ea7b22302c00c1a41d7aec41"
dependencies = [
"either",
"futures 0.3.8",
@@ -3115,9 +3161,9 @@ dependencies = [
[[package]]
name = "libp2p-tcp"
-version = "0.25.1"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc28c9ad6dc43f4c3950411cf808639d90307a076330e7996e5e94e70279bde0"
+checksum = "1d2113a7dab2b502c55fe290910cd7399a2aa04fe70a2f5a415a87a1db600c0e"
dependencies = [
"async-std",
"futures 0.3.8",
@@ -3131,9 +3177,9 @@ dependencies = [
[[package]]
name = "libp2p-uds"
-version = "0.25.0"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d821208d4b9af4b293a56dde470edd9f9fac8bb94a51f4f5327cc29a471b3f3"
+checksum = "af05fe92c2a3aa320bc82a308ddb7b33bef3b060154c5a4b9fb0b01f15385fc0"
dependencies = [
"async-std",
"futures 0.3.8",
@@ -3143,9 +3189,9 @@ dependencies = [
[[package]]
name = "libp2p-wasm-ext"
-version = "0.25.0"
+version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e6ef400b231ba78e866b860445480ca21ee447e03034138c6d57cf2969d6bf4"
+checksum = "37cd44ea05a4523f40183f60ab6e6a80e400a5ddfc98b0df1c55edeb85576cd9"
dependencies = [
"futures 0.3.8",
"js-sys",
@@ -3157,9 +3203,9 @@ dependencies = [
[[package]]
name = "libp2p-websocket"
-version = "0.26.0"
+version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a5736e2fccdcea6e728bbaf903bddc113be223313ce2c756ad9fe43b5a2b0f06"
+checksum = "270c80528e21089ea25b41dd1ab8fd834bdf093ebee422fed3b68699a857a083"
dependencies = [
"async-tls",
"either",
@@ -3167,19 +3213,19 @@ dependencies = [
"libp2p-core",
"log",
"quicksink",
- "rustls",
+ "rustls 0.19.0",
"rw-stream-sink",
"soketto",
"url 2.2.0",
"webpki",
- "webpki-roots 0.21.0",
+ "webpki-roots",
]
[[package]]
name = "libp2p-yamux"
-version = "0.28.0"
+version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3be7ac000fa3e42ac09a6e658e48de34ac8ef9fff64a4e6e6b08dcc8f4b0e5f6"
+checksum = "36799de9092c35782f080032eddbc8de870f94a0def87cf9f8883efccd5cacf0"
dependencies = [
"futures 0.3.8",
"libp2p-core",
@@ -3895,10 +3941,12 @@ dependencies = [
"frame-system-rpc-runtime-api",
"hex-literal",
"node-primitives",
+ "pallet-assets",
"pallet-authority-discovery",
"pallet-authorship",
"pallet-babe",
"pallet-balances",
+ "pallet-bounties",
"pallet-collective",
"pallet-contracts",
"pallet-contracts-primitives",
@@ -3909,7 +3957,9 @@ dependencies = [
"pallet-identity",
"pallet-im-online",
"pallet-indices",
+ "pallet-lottery",
"pallet-membership",
+ "pallet-mmr",
"pallet-multisig",
"pallet-offences",
"pallet-offences-benchmarking",
@@ -3924,6 +3974,7 @@ dependencies = [
"pallet-staking-reward-curve",
"pallet-sudo",
"pallet-timestamp",
+ "pallet-tips",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"pallet-treasury",
@@ -3966,6 +4017,7 @@ dependencies = [
"sc-consensus-aura",
"sc-executor",
"sc-finality-grandpa",
+ "sc-keystore",
"sc-rpc",
"sc-rpc-api",
"sc-service",
@@ -4228,8 +4280,10 @@ dependencies = [
name = "pallet-assets"
version = "2.0.0"
dependencies = [
+ "frame-benchmarking",
"frame-support",
"frame-system",
+ "pallet-balances",
"parity-scale-codec",
"serde",
"sp-core",
@@ -4354,6 +4408,24 @@ dependencies = [
"sp-std",
]
+[[package]]
+name = "pallet-bounties"
+version = "2.0.0"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-treasury",
+ "parity-scale-codec",
+ "serde",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "sp-storage",
+]
+
[[package]]
name = "pallet-collective"
version = "2.0.0"
@@ -4634,6 +4706,21 @@ dependencies = [
"sp-std",
]
+[[package]]
+name = "pallet-lottery"
+version = "2.0.0"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "parity-scale-codec",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
[[package]]
name = "pallet-membership"
version = "2.0.0"
@@ -4648,6 +4735,24 @@ dependencies = [
"sp-std",
]
+[[package]]
+name = "pallet-mmr"
+version = "2.0.0"
+dependencies = [
+ "ckb-merkle-mountain-range",
+ "env_logger 0.5.13",
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "hex-literal",
+ "parity-scale-codec",
+ "serde",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
[[package]]
name = "pallet-multisig"
version = "2.0.0"
@@ -4977,6 +5082,24 @@ dependencies = [
"sp-timestamp",
]
+[[package]]
+name = "pallet-tips"
+version = "2.0.0"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "pallet-treasury",
+ "parity-scale-codec",
+ "serde",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+ "sp-storage",
+]
+
[[package]]
name = "pallet-transaction-payment"
version = "2.0.0"
@@ -5032,6 +5155,7 @@ dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
+ "impl-trait-for-tuples",
"pallet-balances",
"parity-scale-codec",
"serde",
@@ -5751,7 +5875,7 @@ version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a44883e74aa97ad63db83c4bf8ca490f02b2fc02f92575e720c8551e843c945f"
dependencies = [
- "env_logger",
+ "env_logger 0.7.1",
"log",
"rand 0.7.3",
"rand_core 0.5.1",
@@ -6214,6 +6338,19 @@ dependencies = [
"webpki",
]
+[[package]]
+name = "rustls"
+version = "0.19.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b"
+dependencies = [
+ "base64 0.13.0",
+ "log",
+ "ring",
+ "sct",
+ "webpki",
+]
+
[[package]]
name = "rustls-native-certs"
version = "0.4.0"
@@ -6221,7 +6358,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "629d439a7672da82dd955498445e496ee2096fe2117b9f796558a43fdb9e59b8"
dependencies = [
"openssl-probe",
- "rustls",
+ "rustls 0.18.1",
"schannel",
"security-framework",
]
@@ -6260,11 +6397,11 @@ dependencies = [
[[package]]
name = "salsa20"
-version = "0.6.0"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7f47b10fa80f6969bbbd9c8e7cc998f082979d402a9e10579e2303a87955395"
+checksum = "399f290ffc409596022fce5ea5d4138184be4784f2b28c62c59f0d8389059a15"
dependencies = [
- "stream-cipher",
+ "cipher",
]
[[package]]
@@ -6994,7 +7131,6 @@ dependencies = [
"linked-hash-map",
"linked_hash_set",
"log",
- "lru",
"nohash-hasher",
"parity-scale-codec",
"parking_lot 0.11.1",
@@ -7487,6 +7623,7 @@ dependencies = [
"merlin",
"rand 0.7.3",
"rand_core 0.5.1",
+ "serde",
"sha2 0.8.2",
"subtle 2.3.0",
"zeroize",
@@ -7852,11 +7989,11 @@ dependencies = [
[[package]]
name = "socket2"
-version = "0.3.16"
+version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fd8b795c389288baa5f355489c65e71fd48a02104600d15c4cfbc561e9e429d"
+checksum = "2c29947abdee2a218277abeca306f25789c938e500ea5a9d4b12a5a504466902"
dependencies = [
- "cfg-if 0.1.10",
+ "cfg-if 1.0.0",
"libc",
"redox_syscall",
"winapi 0.3.9",
@@ -8279,6 +8416,7 @@ dependencies = [
"rand 0.7.3",
"rand_chacha 0.2.2",
"schnorrkel",
+ "serde",
"sp-core",
"sp-externalities",
"sp-std",
@@ -8372,6 +8510,7 @@ dependencies = [
name = "sp-runtime-interface"
version = "2.0.0"
dependencies = [
+ "impl-trait-for-tuples",
"parity-scale-codec",
"primitive-types",
"rustversion",
@@ -9364,7 +9503,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e12831b255bcfa39dc0436b01e19fea231a37db570686c06ee72c423479f889a"
dependencies = [
"futures-core",
- "rustls",
+ "rustls 0.18.1",
"tokio 0.2.23",
"webpki",
]
@@ -9641,8 +9780,9 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"
[[package]]
name = "trybuild"
-version = "1.0.35"
-source = "git+https://github.com/bkchr/trybuild.git?branch=bkchr-use-workspace-cargo-lock#0eaad05ba8a32a743751ff52b57a7d9f57da4869"
+version = "1.0.38"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "17b06f8610494cbeb9a7665b398306f0109ab8708296d7f24b0bcd89178bb350"
dependencies = [
"dissimilar",
"glob",
@@ -9660,7 +9800,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59"
dependencies = [
"cfg-if 0.1.10",
- "rand 0.7.3",
+ "rand 0.6.5",
"static_assertions",
]
@@ -9875,11 +10015,11 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
[[package]]
name = "wasm-bindgen"
-version = "0.2.68"
+version = "0.2.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42"
+checksum = "3cd364751395ca0f68cafb17666eee36b63077fb5ecd972bbcd74c90c4bf736e"
dependencies = [
- "cfg-if 0.1.10",
+ "cfg-if 1.0.0",
"serde",
"serde_json",
"wasm-bindgen-macro",
@@ -9887,9 +10027,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.68"
+version = "0.2.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68"
+checksum = "1114f89ab1f4106e5b55e688b828c0ab0ea593a1ea7c094b141b14cbaaec2d62"
dependencies = [
"bumpalo",
"lazy_static",
@@ -9914,9 +10054,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.68"
+version = "0.2.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038"
+checksum = "7a6ac8995ead1f084a8dea1e65f194d0973800c7f571f6edd70adf06ecf77084"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -9924,9 +10064,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.68"
+version = "0.2.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe"
+checksum = "b5a48c72f299d80557c7c62e37e7225369ecc0c963964059509fbafe917c7549"
dependencies = [
"proc-macro2",
"quote",
@@ -9937,9 +10077,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.68"
+version = "0.2.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307"
+checksum = "7e7811dd7f9398f14cc76efd356f98f03aa30419dea46aa810d71e819fc97158"
[[package]]
name = "wasm-bindgen-test"
@@ -10220,15 +10360,6 @@ dependencies = [
"untrusted",
]
-[[package]]
-name = "webpki-roots"
-version = "0.20.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f20dea7535251981a9670857150d571846545088359b28e4951d350bdaf179f"
-dependencies = [
- "webpki",
-]
-
[[package]]
name = "webpki-roots"
version = "0.21.0"
@@ -10336,9 +10467,9 @@ dependencies = [
[[package]]
name = "zeroize"
-version = "1.1.1"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05f33972566adbd2d3588b0491eb94b98b43695c4ef897903470ede4f3f5a28a"
+checksum = "81a974bcdd357f0dca4d41677db03436324d45a4c9ed2d0b873a5a360ce41c36"
dependencies = [
"zeroize_derive",
]
diff --git a/Cargo.toml b/Cargo.toml
index 6a007a209f1fab2058880db643aba43305fb4d99..12e79490ef6b0e7a296586acb59d45dd428bc6c5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,19 +1,19 @@
[workspace]
members = [
"bin/node-template/node",
- "bin/node-template/runtime",
"bin/node-template/pallets/template",
+ "bin/node-template/runtime",
"bin/node/bench",
"bin/node/browser-testing",
"bin/node/cli",
"bin/node/executor",
"bin/node/primitives",
- "bin/node/rpc-client",
"bin/node/rpc",
+ "bin/node/rpc-client",
"bin/node/runtime",
"bin/node/testing",
- "bin/utils/subkey",
"bin/utils/chain-spec-builder",
+ "bin/utils/subkey",
"client/api",
"client/authority-discovery",
"client/basic-authorship",
@@ -26,53 +26,52 @@ members = [
"client/consensus/babe",
"client/consensus/babe/rpc",
"client/consensus/common",
+ "client/consensus/epochs",
"client/consensus/manual-seal",
"client/consensus/pow",
- "client/consensus/uncles",
"client/consensus/slots",
- "client/consensus/epochs",
+ "client/consensus/uncles",
"client/db",
"client/executor",
"client/executor/common",
+ "client/executor/runtime-test",
"client/executor/wasmi",
"client/executor/wasmtime",
- "client/executor/runtime-test",
"client/finality-grandpa",
"client/informant",
- "client/light",
- "client/tracing",
"client/keystore",
+ "client/light",
"client/network",
- "client/network/test",
"client/network-gossip",
+ "client/network/test",
"client/offchain",
"client/peerset",
"client/proposer-metrics",
- "client/rpc-servers",
"client/rpc",
"client/rpc-api",
+ "client/rpc-servers",
"client/service",
"client/service/test",
"client/state-db",
"client/sync-state-rpc",
"client/telemetry",
+ "client/tracing",
"client/transaction-pool",
"client/transaction-pool/graph",
- "utils/prometheus",
"frame/assets",
- "frame/aura",
"frame/atomic-swap",
+ "frame/aura",
"frame/authority-discovery",
"frame/authorship",
"frame/babe",
"frame/balances",
"frame/benchmarking",
+ "frame/bounties",
"frame/collective",
"frame/contracts",
"frame/contracts/rpc",
"frame/contracts/rpc/runtime-api",
"frame/democracy",
- "frame/elections-phragmen",
"frame/elections",
"frame/example",
"frame/example-offchain-worker",
@@ -82,7 +81,9 @@ members = [
"frame/identity",
"frame/im-online",
"frame/indices",
+ "frame/lottery",
"frame/membership",
+ "frame/merkle-mountain-range",
"frame/metadata",
"frame/multisig",
"frame/nicks",
@@ -97,8 +98,8 @@ members = [
"frame/session/benchmarking",
"frame/society",
"frame/staking",
- "frame/staking/reward-curve",
"frame/staking/fuzzer",
+ "frame/staking/reward-curve",
"frame/sudo",
"frame/support",
"frame/support/procedural",
@@ -113,62 +114,63 @@ members = [
"frame/transaction-payment/rpc",
"frame/transaction-payment/rpc/runtime-api",
"frame/treasury",
+ "frame/tips",
"frame/utility",
"frame/vesting",
"primitives/allocator",
+ "primitives/api",
+ "primitives/api/proc-macro",
+ "primitives/api/test",
"primitives/application-crypto",
"primitives/application-crypto/test",
+ "primitives/arithmetic",
+ "primitives/arithmetic/fuzzer",
"primitives/authority-discovery",
"primitives/authorship",
"primitives/block-builder",
"primitives/blockchain",
+ "primitives/chain-spec",
"primitives/consensus/aura",
"primitives/consensus/babe",
"primitives/consensus/common",
"primitives/consensus/pow",
"primitives/consensus/vrf",
"primitives/core",
- "primitives/chain-spec",
"primitives/database",
"primitives/debug-derive",
- "primitives/storage",
"primitives/externalities",
"primitives/finality-grandpa",
"primitives/inherents",
+ "primitives/io",
"primitives/keyring",
"primitives/keystore",
- "primitives/offchain",
- "primitives/panic-handler",
"primitives/npos-elections",
- "primitives/npos-elections/fuzzer",
"primitives/npos-elections/compact",
+ "primitives/npos-elections/fuzzer",
+ "primitives/offchain",
+ "primitives/panic-handler",
"primitives/rpc",
+ "primitives/runtime",
"primitives/runtime-interface",
"primitives/runtime-interface/proc-macro",
+ "primitives/runtime-interface/test",
"primitives/runtime-interface/test-wasm",
"primitives/runtime-interface/test-wasm-deprecated",
- "primitives/runtime-interface/test",
+ "primitives/sandbox",
"primitives/serializer",
"primitives/session",
- "primitives/api",
- "primitives/api/proc-macro",
- "primitives/api/test",
- "primitives/arithmetic",
- "primitives/arithmetic/fuzzer",
- "primitives/io",
- "primitives/runtime",
- "primitives/sandbox",
"primitives/staking",
- "primitives/std",
- "primitives/version",
"primitives/state-machine",
+ "primitives/std",
+ "primitives/storage",
"primitives/tasks",
- "primitives/timestamp",
"primitives/test-primitives",
- "primitives/transaction-pool",
+ "primitives/timestamp",
"primitives/tracing",
+ "primitives/transaction-pool",
"primitives/trie",
"primitives/utils",
+ "primitives/version",
"primitives/wasm-interface",
"test-utils/client",
"test-utils/derive",
@@ -183,6 +185,7 @@ members = [
"utils/frame/frame-utilities-cli",
"utils/frame/rpc/support",
"utils/frame/rpc/system",
+ "utils/prometheus",
"utils/wasm-builder",
]
diff --git a/HEADER b/HEADER-APACHE2
similarity index 92%
rename from HEADER
rename to HEADER-APACHE2
index c9b28a07b0f22975f2eb835c4d334bd17828e6fe..f364f4bdf845a20c9c4bc5cbcc1f35ccff5c9b3d 100644
--- a/HEADER
+++ b/HEADER-APACHE2
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/docs/license_header.txt b/HEADER-GPL3
similarity index 50%
rename from docs/license_header.txt
rename to HEADER-GPL3
index f9c1daa1ad1c14affab82e390c91bd5d8445ab71..0dd7e4f76028fb89205b8fac192936cab48a0b83 100644
--- a/docs/license_header.txt
+++ b/HEADER-GPL3
@@ -1,15 +1,17 @@
-// Copyright 2017-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
diff --git a/bin/node-template/node/Cargo.toml b/bin/node-template/node/Cargo.toml
index d2b5a35b352b25d3b89788cd31727cdae94b5cfc..38cdaa1eea48c7b7ef257474ef5d73842e20ac84 100644
--- a/bin/node-template/node/Cargo.toml
+++ b/bin/node-template/node/Cargo.toml
@@ -22,6 +22,7 @@ sc-cli = { version = "0.8.0", path = "../../../client/cli", features = ["wasmtim
sp-core = { version = "2.0.0", path = "../../../primitives/core" }
sc-executor = { version = "0.8.0", path = "../../../client/executor", features = ["wasmtime"] }
sc-service = { version = "0.8.0", path = "../../../client/service", features = ["wasmtime"] }
+sc-keystore = { version = "2.0.0", path = "../../../client/keystore" }
sp-inherents = { version = "2.0.0", path = "../../../primitives/inherents" }
sc-transaction-pool = { version = "2.0.0", path = "../../../client/transaction-pool" }
sp-transaction-pool = { version = "2.0.0", path = "../../../primitives/transaction-pool" }
diff --git a/bin/node-template/node/src/chain_spec.rs b/bin/node-template/node/src/chain_spec.rs
index 41f582fb64a46cf598c0f424b23793b95f0291db..c5451e81f20c10b064df046010f7989036002925 100644
--- a/bin/node-template/node/src/chain_spec.rs
+++ b/bin/node-template/node/src/chain_spec.rs
@@ -39,7 +39,7 @@ pub fn authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) {
}
pub fn development_config() -> Result {
- let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;
+ let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;
Ok(ChainSpec::from_genesis(
// Name
@@ -78,7 +78,7 @@ pub fn development_config() -> Result {
}
pub fn local_testnet_config() -> Result {
- let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;
+ let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?;
Ok(ChainSpec::from_genesis(
// Name
diff --git a/bin/node-template/node/src/command.rs b/bin/node-template/node/src/command.rs
index 5c41643a2932f67479ec5cf0529a48248f7f5b1f..1c22b388af78ea3375de531a057560b44e847b88 100644
--- a/bin/node-template/node/src/command.rs
+++ b/bin/node-template/node/src/command.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -66,7 +66,7 @@ pub fn run() -> sc_cli::Result<()> {
let cli = Cli::from_args();
match &cli.subcommand {
- Some(Subcommand::Key(cmd)) => cmd.run(),
+ Some(Subcommand::Key(cmd)) => cmd.run(&cli),
Some(Subcommand::BuildSpec(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| cmd.run(config.chain_spec, config.network))
diff --git a/bin/node-template/node/src/service.rs b/bin/node-template/node/src/service.rs
index 1fa1a372a05d36cad15973de5d62c4f8563c0d77..7e1939fb023a8082d0abb147902b27b484f1fe35 100644
--- a/bin/node-template/node/src/service.rs
+++ b/bin/node-template/node/src/service.rs
@@ -10,6 +10,7 @@ use sc_executor::native_executor_instance;
pub use sc_executor::NativeExecutor;
use sp_consensus_aura::sr25519::{AuthorityPair as AuraPair};
use sc_finality_grandpa::SharedVoterState;
+use sc_keystore::LocalKeystore;
// Our native executor instance.
native_executor_instance!(
@@ -37,6 +38,10 @@ pub fn new_partial(config: &Configuration) -> Result
)
>, ServiceError> {
+ if config.keystore_remote.is_some() {
+ return Err(ServiceError::Other(
+ format!("Remote Keystores are not supported.")))
+ }
let inherent_data_providers = sp_inherents::InherentDataProviders::new();
let (client, backend, keystore_container, task_manager) =
@@ -78,14 +83,30 @@ pub fn new_partial(config: &Configuration) -> Result Result, &'static str> {
+ // FIXME: here would the concrete keystore be built,
+ // must return a concrete type (NOT `LocalKeystore`) that
+ // implements `CryptoStore` and `SyncCryptoStore`
+ Err("Remote Keystore not supported.")
+}
+
/// Builds a new service for a full client.
pub fn new_full(mut config: Configuration) -> Result {
let sc_service::PartialComponents {
- client, backend, mut task_manager, import_queue, keystore_container,
+ client, backend, mut task_manager, import_queue, mut keystore_container,
select_chain, transaction_pool, inherent_data_providers,
other: (block_import, grandpa_link),
} = new_partial(&config)?;
+ if let Some(url) = &config.keystore_remote {
+ match remote_keystore(url) {
+ Ok(k) => keystore_container.set_remote_keystore(k),
+ Err(e) => {
+ return Err(ServiceError::Other(
+ format!("Error hooking up remote keystore for {}: {}", url, e)))
+ }
+ };
+ }
config.network.notifications_protocols.push(sc_finality_grandpa::GRANDPA_PROTOCOL_NAME.into());
let (network, network_status_sinks, system_rpc_tx, network_starter) =
diff --git a/bin/node-template/pallets/template/src/mock.rs b/bin/node-template/pallets/template/src/mock.rs
index 4c7c16e7f55787d1b6214a5b6112e308d9878b44..60d22aad7bc66eb9a78b6680c6e45e0ca2944a03 100644
--- a/bin/node-template/pallets/template/src/mock.rs
+++ b/bin/node-template/pallets/template/src/mock.rs
@@ -1,8 +1,8 @@
use crate::{Module, Config};
use sp_core::H256;
-use frame_support::{impl_outer_origin, parameter_types, weights::Weight};
+use frame_support::{impl_outer_origin, parameter_types};
use sp_runtime::{
- traits::{BlakeTwo256, IdentityLookup}, testing::Header, Perbill,
+ traits::{BlakeTwo256, IdentityLookup}, testing::Header,
};
use frame_system as system;
@@ -16,13 +16,14 @@ impl_outer_origin! {
pub struct Test;
parameter_types! {
pub const BlockHashCount: u64 = 250;
- pub const MaximumBlockWeight: Weight = 1024;
- pub const MaximumBlockLength: u32 = 2 * 1024;
- pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
+ pub const SS58Prefix: u8 = 42;
}
impl system::Config for Test {
type BaseCallFilter = ();
+ type BlockWeights = ();
+ type BlockLength = ();
+ type DbWeight = ();
type Origin = Origin;
type Call = ();
type Index = u64;
@@ -34,19 +35,13 @@ impl system::Config for Test {
type Header = Header;
type Event = ();
type BlockHashCount = BlockHashCount;
- type MaximumBlockWeight = MaximumBlockWeight;
- type DbWeight = ();
- type BlockExecutionWeight = ();
- type ExtrinsicBaseWeight = ();
- type MaximumExtrinsicWeight = MaximumBlockWeight;
- type MaximumBlockLength = MaximumBlockLength;
- type AvailableBlockRatio = AvailableBlockRatio;
type Version = ();
type PalletInfo = ();
type AccountData = ();
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = ();
+ type SS58Prefix = SS58Prefix;
}
impl Config for Test {
diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs
index a899afe9ad12fd2fcaf36461a99f1e526495e356..0812346779646e7a2d552c6c98db35e3159b5d78 100644
--- a/bin/node-template/runtime/src/lib.rs
+++ b/bin/node-template/runtime/src/lib.rs
@@ -13,7 +13,7 @@ use sp_runtime::{
transaction_validity::{TransactionValidity, TransactionSource},
};
use sp_runtime::traits::{
- BlakeTwo256, Block as BlockT, AccountIdLookup, Verify, IdentifyAccount, NumberFor, Saturating,
+ BlakeTwo256, Block as BlockT, AccountIdLookup, Verify, IdentifyAccount, NumberFor,
};
use sp_api::impl_runtime_apis;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
@@ -126,16 +126,17 @@ pub fn native_version() -> NativeVersion {
}
}
+const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
+
parameter_types! {
+ pub const Version: RuntimeVersion = VERSION;
pub const BlockHashCount: BlockNumber = 2400;
/// We allow for 2 seconds of compute with a 6 second average block time.
- pub const MaximumBlockWeight: Weight = 2 * WEIGHT_PER_SECOND;
- pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
- /// Assume 10% of weight for average on_initialize calls.
- pub MaximumExtrinsicWeight: Weight = AvailableBlockRatio::get()
- .saturating_sub(Perbill::from_percent(10)) * MaximumBlockWeight::get();
- pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
- pub const Version: RuntimeVersion = VERSION;
+ pub BlockWeights: frame_system::limits::BlockWeights = frame_system::limits::BlockWeights
+ ::with_sensible_defaults(2 * WEIGHT_PER_SECOND, NORMAL_DISPATCH_RATIO);
+ pub BlockLength: frame_system::limits::BlockLength = frame_system::limits::BlockLength
+ ::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
+ pub const SS58Prefix: u8 = 42;
}
// Configure FRAME pallets to include in runtime.
@@ -143,6 +144,10 @@ parameter_types! {
impl frame_system::Config for Runtime {
/// The basic call filter to use in dispatchable.
type BaseCallFilter = ();
+ /// Block & extrinsics weights: base values and limits.
+ type BlockWeights = BlockWeights;
+ /// The maximum length of a block (in bytes).
+ type BlockLength = BlockLength;
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
/// The aggregated dispatch type that is available for extrinsics.
@@ -165,24 +170,8 @@ impl frame_system::Config for Runtime {
type Origin = Origin;
/// Maximum number of block number to block hash mappings to keep (oldest pruned first).
type BlockHashCount = BlockHashCount;
- /// Maximum weight of each block.
- type MaximumBlockWeight = MaximumBlockWeight;
/// The weight of database operations that the runtime can invoke.
type DbWeight = RocksDbWeight;
- /// The weight of the overhead invoked on the block import process, independent of the
- /// extrinsics included in that block.
- type BlockExecutionWeight = BlockExecutionWeight;
- /// The base weight of any extrinsic processed by the runtime, independent of the
- /// logic of that extrinsic. (Signature verification, nonce increment, fee, etc...)
- type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
- /// The maximum weight that a single extrinsic of `Normal` dispatch class can have,
- /// idependent of the logic of that extrinsics. (Roughly max block weight - average on
- /// initialize cost).
- type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
- /// Maximum size of all encoded transactions (in bytes) that are allowed in one block.
- type MaximumBlockLength = MaximumBlockLength;
- /// Portion of the block weight that is available to all normal transactions.
- type AvailableBlockRatio = AvailableBlockRatio;
/// Version of the runtime.
type Version = Version;
/// Converts a module to the index of the module in `construct_runtime!`.
@@ -197,6 +186,8 @@ impl frame_system::Config for Runtime {
type AccountData = pallet_balances::AccountData;
/// Weight information for the extrinsics of this pallet.
type SystemWeightInfo = ();
+ /// This is used as an identifier of the chain. 42 is the generic substrate prefix.
+ type SS58Prefix = SS58Prefix;
}
impl pallet_aura::Config for Runtime {
diff --git a/bin/node/bench/src/common.rs b/bin/node/bench/src/common.rs
index 2637d6e9bd04d809af5b374790adcc6e5207993f..d04d79e9907af2b25d4300cd498a1f7962c12abe 100644
--- a/bin/node/bench/src/common.rs
+++ b/bin/node/bench/src/common.rs
@@ -1,7 +1,6 @@
-
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -45,4 +44,4 @@ impl SizeType {
SizeType::Custom(val) => Some(*val),
}
}
-}
\ No newline at end of file
+}
diff --git a/bin/node/bench/src/construct.rs b/bin/node/bench/src/construct.rs
index 5506dc426de0bc6e7f69cf9e2825f33bb99f24b1..a8a02f19c306eeee2c5d0ccab85b77bbb3fb3aa5 100644
--- a/bin/node/bench/src/construct.rs
+++ b/bin/node/bench/src/construct.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/bench/src/core.rs b/bin/node/bench/src/core.rs
index 6faa7b72721f495ac6a481f3f48dd0b86e9efd3a..26b7f92b1448376fe3d0a2c9553abd568189358f 100644
--- a/bin/node/bench/src/core.rs
+++ b/bin/node/bench/src/core.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/bench/src/generator.rs b/bin/node/bench/src/generator.rs
index 759a4299c72758f540e92349de6a25591c506d39..c540ae147c9f0f59c13787f3b9233ba4c0abc042 100644
--- a/bin/node/bench/src/generator.rs
+++ b/bin/node/bench/src/generator.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/bench/src/import.rs b/bin/node/bench/src/import.rs
index ae28a20089e103dd6c5c0c538e87be7069a8c2fe..b4fee58dac0252332b6b1d72aeb80d05695a092a 100644
--- a/bin/node/bench/src/import.rs
+++ b/bin/node/bench/src/import.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/bench/src/main.rs b/bin/node/bench/src/main.rs
index 46b659dd88387e94c2d493e3d5975df3e7c28fab..40e9e1577777e81c8cbbadfa2c0e619639022a30 100644
--- a/bin/node/bench/src/main.rs
+++ b/bin/node/bench/src/main.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/bench/src/simple_trie.rs b/bin/node/bench/src/simple_trie.rs
index 3cfd7ddb300a9101b22d55a2d460526a283fa0e2..a29b51a38af58bb80343edf72988f73a5fb64a47 100644
--- a/bin/node/bench/src/simple_trie.rs
+++ b/bin/node/bench/src/simple_trie.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/bench/src/state_sizes.rs b/bin/node/bench/src/state_sizes.rs
index d35989f61be3467960c0870fca1bd5969d571081..f9288c10548981d87f14eb8cabbd836ceb83e520 100644
--- a/bin/node/bench/src/state_sizes.rs
+++ b/bin/node/bench/src/state_sizes.rs
@@ -1,18 +1,20 @@
-// Copyright 2015-2020 Parity Technologies (UK) Ltd.
-// This file is part of Parity.
+// This file is part of Substrate.
-// Parity is free software: you can redistribute it and/or modify
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Parity is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Parity. If not, see .
+// along with this program. If not, see .
/// Kusama value size distribution
pub const KUSAMA_STATE_DISTRIBUTION: &'static[(u32, u32)] = &[
@@ -4753,4 +4755,4 @@ pub const KUSAMA_STATE_DISTRIBUTION: &'static[(u32, u32)] = &[
(1516670, 1),
(1605731, 1),
(1605821, 1),
-];
\ No newline at end of file
+];
diff --git a/bin/node/bench/src/tempdb.rs b/bin/node/bench/src/tempdb.rs
index abce7daa518bfa75361b84fb69229f3d780752dc..31ef71fba7b5e34215210b72a80458555a516bd0 100644
--- a/bin/node/bench/src/tempdb.rs
+++ b/bin/node/bench/src/tempdb.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/bench/src/trie.rs b/bin/node/bench/src/trie.rs
index eb6c574e27170b8ce8a38c575db55468bcafb5d3..a3e7620473d98ba46646c8e8bc1ac1333c0535b5 100644
--- a/bin/node/bench/src/trie.rs
+++ b/bin/node/bench/src/trie.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/bench/src/txpool.rs b/bin/node/bench/src/txpool.rs
index 7ea13fc15ec68fb3a02ea7889282d281409bd67e..ecac3827adf684dd80bd865e2fb1eef84a306321 100644
--- a/bin/node/bench/src/txpool.rs
+++ b/bin/node/bench/src/txpool.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/browser-testing/Cargo.toml b/bin/node/browser-testing/Cargo.toml
index f1cad30aede176c676cd0c2d86441e5ec255e0fe..e29f104f87e470e20078e57ae987e318d737d070 100644
--- a/bin/node/browser-testing/Cargo.toml
+++ b/bin/node/browser-testing/Cargo.toml
@@ -8,11 +8,11 @@ license = "Apache-2.0"
[dependencies]
futures-timer = "3.0.2"
-libp2p = { version = "0.31.1", default-features = false }
+libp2p = { version = "0.33.0", default-features = false }
jsonrpc-core = "15.0.0"
serde = "1.0.106"
serde_json = "1.0.48"
-wasm-bindgen = { version = "=0.2.68", features = ["serde-serialize"] }
+wasm-bindgen = { version = "=0.2.69", features = ["serde-serialize"] }
wasm-bindgen-futures = "0.4.18"
wasm-bindgen-test = "0.3.18"
futures = "0.3.4"
diff --git a/bin/node/browser-testing/src/lib.rs b/bin/node/browser-testing/src/lib.rs
index 777e5ea9f132e44d888ce8ea68b8d9e8fdf44655..ad18de87b3d3eb7f112fd026dfd2dec9656cc682 100644
--- a/bin/node/browser-testing/src/lib.rs
+++ b/bin/node/browser-testing/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,7 +26,7 @@
//! ```
//! For debug infomation, such as the informant, run without the `--headless`
//! flag and open a browser to the url that `wasm-pack test` outputs.
-//! For more infomation see https://rustwasm.github.io/docs/wasm-pack/.
+//! For more infomation see .
use wasm_bindgen_test::{wasm_bindgen_test, wasm_bindgen_test_configure};
use wasm_bindgen_futures::JsFuture;
diff --git a/bin/node/cli/bin/main.rs b/bin/node/cli/bin/main.rs
index 299b760c82e36b2b6540f6ae4efd8111cf430640..cf32a7cf2886092d1f14d388a01c23257e6498a7 100644
--- a/bin/node/cli/bin/main.rs
+++ b/bin/node/cli/bin/main.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/cli/build.rs b/bin/node/cli/build.rs
index a36f0d01a0a034a10686d3565e6abf538e6a5886..befcdaea6d9cff98ce2df3ad334d1430efe718e8 100644
--- a/bin/node/cli/build.rs
+++ b/bin/node/cli/build.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/cli/src/browser.rs b/bin/node/cli/src/browser.rs
index 41770f5fcde6dc68c98e2f2feef0358461d953c8..42886a668d3480af97bfb4a7640e0c21ccc41f15 100644
--- a/bin/node/cli/src/browser.rs
+++ b/bin/node/cli/src/browser.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/cli/src/chain_spec.rs b/bin/node/cli/src/chain_spec.rs
index 90824a5572f12f9e50f19703e96f2a9c046c5e40..7bee74d6c677ebca220e740a1dac4f463e244a12 100644
--- a/bin/node/cli/src/chain_spec.rs
+++ b/bin/node/cli/src/chain_spec.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -218,7 +218,7 @@ pub fn testnet_genesis(
endowed_accounts: Option>,
enable_println: bool,
) -> GenesisConfig {
- let endowed_accounts: Vec = endowed_accounts.unwrap_or_else(|| {
+ let mut endowed_accounts: Vec = endowed_accounts.unwrap_or_else(|| {
vec![
get_account_id_from_seed::("Alice"),
get_account_id_from_seed::("Bob"),
@@ -234,10 +234,16 @@ pub fn testnet_genesis(
get_account_id_from_seed::("Ferdie//stash"),
]
});
+ initial_authorities.iter().for_each(|x|
+ if !endowed_accounts.contains(&x.0) {
+ endowed_accounts.push(x.0.clone())
+ }
+ );
+
let num_endowed_accounts = endowed_accounts.len();
const ENDOWMENT: Balance = 10_000_000 * DOLLARS;
- const STASH: Balance = 100 * DOLLARS;
+ const STASH: Balance = ENDOWMENT / 1000;
GenesisConfig {
frame_system: Some(SystemConfig {
@@ -246,9 +252,8 @@ pub fn testnet_genesis(
}),
pallet_balances: Some(BalancesConfig {
balances: endowed_accounts.iter().cloned()
- .map(|k| (k, ENDOWMENT))
- .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH)))
- .collect(),
+ .map(|x| (x, ENDOWMENT))
+ .collect()
}),
pallet_indices: Some(IndicesConfig {
indices: vec![],
diff --git a/bin/node/cli/src/cli.rs b/bin/node/cli/src/cli.rs
index 2130ff1e4b106b0ad294b84b4ec443d1d4806264..63a07e00e2197c65807f931583d697ab00208a14 100644
--- a/bin/node/cli/src/cli.rs
+++ b/bin/node/cli/src/cli.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/cli/src/command.rs b/bin/node/cli/src/command.rs
index f8a0f3f9b3a3485f9af99d5c43dd6bd93f67cdd2..ed3aff88c75de629209a4f54511de12df8e4ca9c 100644
--- a/bin/node/cli/src/command.rs
+++ b/bin/node/cli/src/command.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -94,7 +94,7 @@ pub fn run() -> Result<()> {
You can enable it with `--features runtime-benchmarks`.".into())
}
}
- Some(Subcommand::Key(cmd)) => cmd.run(),
+ Some(Subcommand::Key(cmd)) => cmd.run(&cli),
Some(Subcommand::Sign(cmd)) => cmd.run(),
Some(Subcommand::Verify(cmd)) => cmd.run(),
Some(Subcommand::Vanity(cmd)) => cmd.run(),
diff --git a/bin/node/cli/src/lib.rs b/bin/node/cli/src/lib.rs
index bd2298514a7a2f1ed57fa008615b11ac0947d20b..d29836c7499f3cfedbe153de75aa228e797bdebd 100644
--- a/bin/node/cli/src/lib.rs
+++ b/bin/node/cli/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/cli/src/service.rs b/bin/node/cli/src/service.rs
index 5eb8e35e69ec5e36c6f282919905d855accdad24..0b4e24f2ce644815ed85622f586d7188657002d4 100644
--- a/bin/node/cli/src/service.rs
+++ b/bin/node/cli/src/service.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/cli/tests/build_spec_works.rs b/bin/node/cli/tests/build_spec_works.rs
index 800a4a8c51e6175e2eb8fbfb1e5ddf375d30c264..6d863ea7f949d10a5ab4800f0733764331943912 100644
--- a/bin/node/cli/tests/build_spec_works.rs
+++ b/bin/node/cli/tests/build_spec_works.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/cli/tests/check_block_works.rs b/bin/node/cli/tests/check_block_works.rs
index 34078b08cf074f218865df548ee20b3b94f19d74..39963fb002876bb4f098ad1bdc9a18c1e354547f 100644
--- a/bin/node/cli/tests/check_block_works.rs
+++ b/bin/node/cli/tests/check_block_works.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/cli/tests/common.rs b/bin/node/cli/tests/common.rs
index 61a07dd1ca877c8814169f2babdfccd3a506ec76..c3bb96555da56a64f3c16c988ff3a3b1b1dadea0 100644
--- a/bin/node/cli/tests/common.rs
+++ b/bin/node/cli/tests/common.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/cli/tests/export_import_flow.rs b/bin/node/cli/tests/export_import_flow.rs
index 557e722ddb7b505a13fa8daa8361838dcfd93c45..02fba49e834efc4ac61f802d9223c190134cac99 100644
--- a/bin/node/cli/tests/export_import_flow.rs
+++ b/bin/node/cli/tests/export_import_flow.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/cli/tests/inspect_works.rs b/bin/node/cli/tests/inspect_works.rs
index aa9653acadba5a1db8ccd295da9d802967604a77..67dbc97056cf6789ef78ecd052c4de5e4e7e26a8 100644
--- a/bin/node/cli/tests/inspect_works.rs
+++ b/bin/node/cli/tests/inspect_works.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/cli/tests/purge_chain_works.rs b/bin/node/cli/tests/purge_chain_works.rs
index 001bed8b136f5d2349f83fe86c557466f0b7a7ca..4c0727d26cb1776622a19c8c424ce90882735dc4 100644
--- a/bin/node/cli/tests/purge_chain_works.rs
+++ b/bin/node/cli/tests/purge_chain_works.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/cli/tests/running_the_node_and_interrupt.rs b/bin/node/cli/tests/running_the_node_and_interrupt.rs
index bd79dcd77a49a9e6a81b28ae360ef90b3174b565..05eb9a7027b714667d66d8704f4b6d18a205e835 100644
--- a/bin/node/cli/tests/running_the_node_and_interrupt.rs
+++ b/bin/node/cli/tests/running_the_node_and_interrupt.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/cli/tests/temp_base_path_works.rs b/bin/node/cli/tests/temp_base_path_works.rs
index 9351568d87955b130bdde3d9f82f5ce977bc2b20..0152ddb464dc7bd3cf8d4575af6d86f650e6bf7a 100644
--- a/bin/node/cli/tests/temp_base_path_works.rs
+++ b/bin/node/cli/tests/temp_base_path_works.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/cli/tests/version.rs b/bin/node/cli/tests/version.rs
index bbc9139d4f0f8de78dfc5affd3557eb6f6b16a17..38e4b1fbda72eae4d5dc483c0da8b8cb39f21b41 100644
--- a/bin/node/cli/tests/version.rs
+++ b/bin/node/cli/tests/version.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/executor/benches/bench.rs b/bin/node/executor/benches/bench.rs
index 168cff0ff456887246ef679d54b11ac15efabb83..554e6c4af428df7162306eb31c13423cf859b9ef 100644
--- a/bin/node/executor/benches/bench.rs
+++ b/bin/node/executor/benches/bench.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/bin/node/executor/src/lib.rs b/bin/node/executor/src/lib.rs
index 4c3b82bc7d3b538234d470a5560ca61db28976b7..e7fb09a19c514f6d9773c71137da8d3aec16886b 100644
--- a/bin/node/executor/src/lib.rs
+++ b/bin/node/executor/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/bin/node/executor/tests/basic.rs b/bin/node/executor/tests/basic.rs
index 09438bfacd455ca73e8718d9785c1bef6329e208..2b644fad2915b21639e69d513f0b57cbcb89008a 100644
--- a/bin/node/executor/tests/basic.rs
+++ b/bin/node/executor/tests/basic.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/bin/node/executor/tests/common.rs b/bin/node/executor/tests/common.rs
index efc54ebebf1990188862460b26d5d314080e2a83..b376ebc35bae88bcb63fe38ec4d76c949bbe9f35 100644
--- a/bin/node/executor/tests/common.rs
+++ b/bin/node/executor/tests/common.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/bin/node/executor/tests/fees.rs b/bin/node/executor/tests/fees.rs
index d04af1d827009f51340daeacc9e055ab6ec5e00e..07460e54680d973f50a8ae3638d52f708bfc3799 100644
--- a/bin/node/executor/tests/fees.rs
+++ b/bin/node/executor/tests/fees.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/bin/node/executor/tests/submit_transaction.rs b/bin/node/executor/tests/submit_transaction.rs
index 5bac6b5e374c73a55d8fe721db52bb05f4e0e9ea..f3cb90cbecdd285fdd44bc642b62ee49a55dc1dd 100644
--- a/bin/node/executor/tests/submit_transaction.rs
+++ b/bin/node/executor/tests/submit_transaction.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/bin/node/inspect/src/cli.rs b/bin/node/inspect/src/cli.rs
index d66644bab52fa78788098e3713ceae1576f25b6c..abdbedc296d022ab65c3bff12955abd6710a423e 100644
--- a/bin/node/inspect/src/cli.rs
+++ b/bin/node/inspect/src/cli.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/inspect/src/command.rs b/bin/node/inspect/src/command.rs
index fae6c10c7fe7846dc63e990dcf03254655467705..a1a9c947a561b00f03a890c71c83948e68ffa493 100644
--- a/bin/node/inspect/src/command.rs
+++ b/bin/node/inspect/src/command.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/inspect/src/lib.rs b/bin/node/inspect/src/lib.rs
index 02f5614b81a78044d1418d9d23f87322da2c298c..2a55fdcda62ee34482a361fefaa30bd3e38cd25b 100644
--- a/bin/node/inspect/src/lib.rs
+++ b/bin/node/inspect/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
//
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
//
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/primitives/src/lib.rs b/bin/node/primitives/src/lib.rs
index 137fb1d94c778aafa6b2f45713d4954070caa1d5..9470adc399f9680d4e185e081980416d980a5df3 100644
--- a/bin/node/primitives/src/lib.rs
+++ b/bin/node/primitives/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/bin/node/rpc-client/Cargo.toml b/bin/node/rpc-client/Cargo.toml
index 26d9de133c6883c8e2404fd6d996985f336e09df..e88a18032698ebbe0636a82ffd394d36ed5361c7 100644
--- a/bin/node/rpc-client/Cargo.toml
+++ b/bin/node/rpc-client/Cargo.toml
@@ -12,7 +12,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
futures = "0.1.29"
-hyper = "0.12.35"
+hyper = "~0.12.35"
jsonrpc-core-client = { version = "15.1.0", default-features = false, features = ["http"] }
log = "0.4.8"
node-primitives = { version = "2.0.0", path = "../primitives" }
diff --git a/bin/node/rpc-client/src/main.rs b/bin/node/rpc-client/src/main.rs
index 31f1efa28ccd0684c363f577d491ce6e98b34e7f..ddd8a50ad36e44344466ccc20648f755e7cb7311 100644
--- a/bin/node/rpc-client/src/main.rs
+++ b/bin/node/rpc-client/src/main.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/bin/node/rpc/src/lib.rs b/bin/node/rpc/src/lib.rs
index 1ced3d60ab362bf0817d0b654712720a9a4f6950..e68ca6843bc944aa7c92538e55b7e544dda00a7c 100644
--- a/bin/node/rpc/src/lib.rs
+++ b/bin/node/rpc/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/bin/node/runtime/Cargo.toml b/bin/node/runtime/Cargo.toml
index eabc9f61c62e5b5f5c39f343832bed976eefdd2b..3aa906ba0fc53bdc22829b69dc0dad6b6c56ef06 100644
--- a/bin/node/runtime/Cargo.toml
+++ b/bin/node/runtime/Cargo.toml
@@ -43,10 +43,12 @@ frame-support = { version = "2.0.0", default-features = false, path = "../../../
frame-system = { version = "2.0.0", default-features = false, path = "../../../frame/system" }
frame-system-benchmarking = { version = "2.0.0", default-features = false, path = "../../../frame/system/benchmarking", optional = true }
frame-system-rpc-runtime-api = { version = "2.0.0", default-features = false, path = "../../../frame/system/rpc/runtime-api/" }
+pallet-assets = { version = "2.0.0", default-features = false, path = "../../../frame/assets" }
pallet-authority-discovery = { version = "2.0.0", default-features = false, path = "../../../frame/authority-discovery" }
pallet-authorship = { version = "2.0.0", default-features = false, path = "../../../frame/authorship" }
pallet-babe = { version = "2.0.0", default-features = false, path = "../../../frame/babe" }
pallet-balances = { version = "2.0.0", default-features = false, path = "../../../frame/balances" }
+pallet-bounties = { version = "2.0.0", default-features = false, path = "../../../frame/bounties" }
pallet-collective = { version = "2.0.0", default-features = false, path = "../../../frame/collective" }
pallet-contracts = { version = "2.0.0", default-features = false, path = "../../../frame/contracts" }
pallet-contracts-primitives = { version = "2.0.0", default-features = false, path = "../../../frame/contracts/common/" }
@@ -57,7 +59,9 @@ pallet-grandpa = { version = "2.0.0", default-features = false, path = "../../..
pallet-im-online = { version = "2.0.0", default-features = false, path = "../../../frame/im-online" }
pallet-indices = { version = "2.0.0", default-features = false, path = "../../../frame/indices" }
pallet-identity = { version = "2.0.0", default-features = false, path = "../../../frame/identity" }
+pallet-lottery = { version = "2.0.0", default-features = false, path = "../../../frame/lottery" }
pallet-membership = { version = "2.0.0", default-features = false, path = "../../../frame/membership" }
+pallet-mmr = { version = "2.0.0", default-features = false, path = "../../../frame/merkle-mountain-range" }
pallet-multisig = { version = "2.0.0", default-features = false, path = "../../../frame/multisig" }
pallet-offences = { version = "2.0.0", default-features = false, path = "../../../frame/offences" }
pallet-offences-benchmarking = { version = "2.0.0", path = "../../../frame/offences/benchmarking", default-features = false, optional = true }
@@ -72,6 +76,7 @@ pallet-scheduler = { version = "2.0.0", default-features = false, path = "../../
pallet-society = { version = "2.0.0", default-features = false, path = "../../../frame/society" }
pallet-sudo = { version = "2.0.0", default-features = false, path = "../../../frame/sudo" }
pallet-timestamp = { version = "2.0.0", default-features = false, path = "../../../frame/timestamp" }
+pallet-tips = { version = "2.0.0", default-features = false, path = "../../../frame/tips" }
pallet-treasury = { version = "2.0.0", default-features = false, path = "../../../frame/treasury" }
pallet-utility = { version = "2.0.0", default-features = false, path = "../../../frame/utility" }
pallet-transaction-payment = { version = "2.0.0", default-features = false, path = "../../../frame/transaction-payment" }
@@ -89,11 +94,13 @@ default = ["std"]
with-tracing = [ "frame-executive/with-tracing" ]
std = [
"sp-authority-discovery/std",
+ "pallet-assets/std",
"pallet-authority-discovery/std",
"pallet-authorship/std",
"sp-consensus-babe/std",
"pallet-babe/std",
"pallet-balances/std",
+ "pallet-bounties/std",
"sp-block-builder/std",
"codec/std",
"pallet-collective/std",
@@ -107,7 +114,9 @@ std = [
"pallet-im-online/std",
"pallet-indices/std",
"sp-inherents/std",
+ "pallet-lottery/std",
"pallet-membership/std",
+ "pallet-mmr/std",
"pallet-multisig/std",
"pallet-identity/std",
"pallet-scheduler/std",
@@ -132,6 +141,7 @@ std = [
"frame-system-rpc-runtime-api/std",
"frame-system/std",
"pallet-timestamp/std",
+ "pallet-tips/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
"pallet-treasury/std",
@@ -147,8 +157,10 @@ runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
+ "pallet-assets/runtime-benchmarks",
"pallet-babe/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
+ "pallet-bounties/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"pallet-contracts/runtime-benchmarks",
"pallet-democracy/runtime-benchmarks",
@@ -157,12 +169,15 @@ runtime-benchmarks = [
"pallet-identity/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
"pallet-indices/runtime-benchmarks",
+ "pallet-lottery/runtime-benchmarks",
+ "pallet-mmr/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
"pallet-society/runtime-benchmarks",
"pallet-staking/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
+ "pallet-tips/runtime-benchmarks",
"pallet-treasury/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-vesting/runtime-benchmarks",
diff --git a/bin/node/runtime/build.rs b/bin/node/runtime/build.rs
index 8a0b4d7a0c15745cbc743130b522ddf693d3822b..a1c4b2d892cfeda075e361c69b8f7fc7e4ebb980 100644
--- a/bin/node/runtime/build.rs
+++ b/bin/node/runtime/build.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/bin/node/runtime/src/constants.rs b/bin/node/runtime/src/constants.rs
index 0301c30d5b6396a18e9b1e7ec5efd2b68067f122..f447486c7ffc49365123d76bedbc73d16d699368 100644
--- a/bin/node/runtime/src/constants.rs
+++ b/bin/node/runtime/src/constants.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/bin/node/runtime/src/impls.rs b/bin/node/runtime/src/impls.rs
index acd8def68353db93ea7bfdde1e373b791b017f32..c6a56e5ac0dab54c5d9b30c526f34aa10c046ec6 100644
--- a/bin/node/runtime/src/impls.rs
+++ b/bin/node/runtime/src/impls.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -34,13 +34,15 @@ mod multiplier_tests {
use crate::{
constants::{currency::*, time::*},
- TransactionPayment, MaximumBlockWeight, AvailableBlockRatio, Runtime, TargetBlockFullness,
+ TransactionPayment, Runtime, TargetBlockFullness,
AdjustmentVariable, System, MinimumMultiplier,
+ RuntimeBlockWeights as BlockWeights,
};
- use frame_support::weights::{Weight, WeightToFeePolynomial};
+ use frame_support::weights::{Weight, WeightToFeePolynomial, DispatchClass};
- fn max() -> Weight {
- AvailableBlockRatio::get() * MaximumBlockWeight::get()
+ fn max_normal() -> Weight {
+ BlockWeights::get().get(DispatchClass::Normal).max_total
+ .unwrap_or_else(|| BlockWeights::get().max_block)
}
fn min_multiplier() -> Multiplier {
@@ -48,7 +50,7 @@ mod multiplier_tests {
}
fn target() -> Weight {
- TargetBlockFullness::get() * max()
+ TargetBlockFullness::get() * max_normal()
}
// update based on runtime impl.
@@ -69,7 +71,7 @@ mod multiplier_tests {
let previous_float = previous_float.max(min_multiplier().into_inner() as f64 / accuracy);
// maximum tx weight
- let m = max() as f64;
+ let m = max_normal() as f64;
// block weight always truncated to max weight
let block_weight = (block_weight as f64).min(m);
let v: f64 = AdjustmentVariable::get().to_fraction();
@@ -89,7 +91,7 @@ mod multiplier_tests {
let mut t: sp_io::TestExternalities =
frame_system::GenesisConfig::default().build_storage::().unwrap().into();
t.execute_with(|| {
- System::set_block_limits(w, 0);
+ System::set_block_consumed_resources(w, 0);
assertions()
});
}
@@ -102,8 +104,8 @@ mod multiplier_tests {
(100, fm.clone()),
(1000, fm.clone()),
(target(), fm.clone()),
- (max() / 2, fm.clone()),
- (max(), fm.clone()),
+ (max_normal() / 2, fm.clone()),
+ (max_normal(), fm.clone()),
];
test_set.into_iter().for_each(|(w, fm)| {
run_with_system_weight(w, || {
@@ -164,7 +166,7 @@ mod multiplier_tests {
#[test]
fn min_change_per_day() {
- run_with_system_weight(max(), || {
+ run_with_system_weight(max_normal(), || {
let mut fm = Multiplier::one();
// See the example in the doc of `TargetedFeeAdjustment`. are at least 0.234, hence
// `fm > 1.234`.
@@ -182,7 +184,7 @@ mod multiplier_tests {
// `cargo test congested_chain_simulation -- --nocapture` to get some insight.
// almost full. The entire quota of normal transactions is taken.
- let block_weight = AvailableBlockRatio::get() * max() - 100;
+ let block_weight = BlockWeights::get().get(DispatchClass::Normal).max_total.unwrap() - 100;
// Default substrate weight.
let tx_weight = frame_support::weights::constants::ExtrinsicBaseWeight::get();
@@ -320,15 +322,19 @@ mod multiplier_tests {
10 * mb,
2147483647,
4294967295,
- MaximumBlockWeight::get() / 2,
- MaximumBlockWeight::get(),
+ BlockWeights::get().max_block / 2,
+ BlockWeights::get().max_block,
Weight::max_value() / 2,
Weight::max_value(),
].into_iter().for_each(|i| {
run_with_system_weight(i, || {
let next = runtime_multiplier_update(Multiplier::one());
let truth = truth_value_update(i, Multiplier::one());
- assert_eq_error_rate!(truth, next, Multiplier::from_inner(50_000_000));
+ assert_eq_error_rate!(
+ truth,
+ next,
+ Multiplier::from_inner(50_000_000)
+ );
});
});
diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs
index be3783cd7ca5c148e00ae5a760a9c4f5c4a12064..2afa89f86c024ea68f28548796ae7fa01eb664ee 100644
--- a/bin/node/runtime/src/lib.rs
+++ b/bin/node/runtime/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-//! The Substrate runtime. This can be compiled with ``#[no_std]`, ready for Wasm.
+//! The Substrate runtime. This can be compiled with `#[no_std]`, ready for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
@@ -28,14 +28,17 @@ use frame_support::{
construct_runtime, parameter_types, debug, RuntimeDebug,
weights::{
Weight, IdentityFee,
- constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
+ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, DispatchClass,
},
traits::{
Currency, Imbalance, KeyOwnerProofSystem, OnUnbalanced, Randomness, LockIdentifier,
U128CurrencyToVote,
},
};
-use frame_system::{EnsureRoot, EnsureOneOf};
+use frame_system::{
+ EnsureRoot, EnsureOneOf,
+ limits::{BlockWeights, BlockLength}
+};
use frame_support::traits::InstanceFilter;
use codec::{Encode, Decode};
use sp_core::{
@@ -54,7 +57,7 @@ use sp_runtime::curve::PiecewiseLinear;
use sp_runtime::transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority};
use sp_runtime::traits::{
self, BlakeTwo256, Block as BlockT, StaticLookup, SaturatedConversion,
- ConvertInto, OpaqueKeys, NumberFor, Saturating,
+ ConvertInto, OpaqueKeys, NumberFor,
};
use sp_version::RuntimeVersion;
#[cfg(any(feature = "std", test))]
@@ -68,6 +71,7 @@ pub use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment, Currency
use pallet_session::{historical as pallet_session_historical};
use sp_inherents::{InherentData, CheckInherentsResult};
use static_assertions::const_assert;
+use pallet_contracts::WeightInfo;
#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
@@ -108,7 +112,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
- spec_version: 260,
+ spec_version: 261,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
@@ -141,23 +145,48 @@ impl OnUnbalanced for DealWithFees {
}
}
-const AVERAGE_ON_INITIALIZE_WEIGHT: Perbill = Perbill::from_percent(10);
+/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.
+/// This is used to limit the maximal weight of a single extrinsic.
+const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);
+/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used
+/// by Operational extrinsics.
+const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
+/// We allow for 2 seconds of compute with a 6 second average block time.
+const MAXIMUM_BLOCK_WEIGHT: Weight = 2 * WEIGHT_PER_SECOND;
+
parameter_types! {
pub const BlockHashCount: BlockNumber = 2400;
- /// We allow for 2 seconds of compute with a 6 second average block time.
- pub const MaximumBlockWeight: Weight = 2 * WEIGHT_PER_SECOND;
- pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
- /// Assume 10% of weight for average on_initialize calls.
- pub MaximumExtrinsicWeight: Weight = AvailableBlockRatio::get().saturating_sub(AVERAGE_ON_INITIALIZE_WEIGHT)
- * MaximumBlockWeight::get();
- pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
pub const Version: RuntimeVersion = VERSION;
-}
-
-const_assert!(AvailableBlockRatio::get().deconstruct() >= AVERAGE_ON_INITIALIZE_WEIGHT.deconstruct());
+ pub RuntimeBlockLength: BlockLength =
+ BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
+ pub RuntimeBlockWeights: BlockWeights = BlockWeights::builder()
+ .base_block(BlockExecutionWeight::get())
+ .for_class(DispatchClass::all(), |weights| {
+ weights.base_extrinsic = ExtrinsicBaseWeight::get();
+ })
+ .for_class(DispatchClass::Normal, |weights| {
+ weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
+ })
+ .for_class(DispatchClass::Operational, |weights| {
+ weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);
+ // Operational transactions have some extra reserved space, so that they
+ // are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.
+ weights.reserved = Some(
+ MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT
+ );
+ })
+ .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
+ .build_or_panic();
+ pub const SS58Prefix: u8 = 42;
+}
+
+const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct());
impl frame_system::Config for Runtime {
type BaseCallFilter = ();
+ type BlockWeights = RuntimeBlockWeights;
+ type BlockLength = RuntimeBlockLength;
+ type DbWeight = RocksDbWeight;
type Origin = Origin;
type Call = Call;
type Index = Index;
@@ -169,19 +198,13 @@ impl frame_system::Config for Runtime {
type Header = generic::Header;
type Event = Event;
type BlockHashCount = BlockHashCount;
- type MaximumBlockWeight = MaximumBlockWeight;
- type DbWeight = RocksDbWeight;
- type BlockExecutionWeight = BlockExecutionWeight;
- type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
- type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
- type MaximumBlockLength = MaximumBlockLength;
- type AvailableBlockRatio = AvailableBlockRatio;
type Version = Version;
type PalletInfo = PalletInfo;
type AccountData = pallet_balances::AccountData;
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = frame_system::weights::SubstrateWeight;
+ type SS58Prefix = SS58Prefix;
}
impl pallet_utility::Config for Runtime {
@@ -277,7 +300,8 @@ impl pallet_proxy::Config for Runtime {
}
parameter_types! {
- pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * MaximumBlockWeight::get();
+ pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) *
+ RuntimeBlockWeights::get().max_block;
pub const MaxScheduledPerBlock: u32 = 50;
}
@@ -438,9 +462,10 @@ parameter_types! {
pub const MaxIterations: u32 = 10;
// 0.05%. The higher the value, the more strict solution acceptance becomes.
pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000);
- pub OffchainSolutionWeightLimit: Weight = MaximumExtrinsicWeight::get()
- .saturating_sub(BlockExecutionWeight::get())
- .saturating_sub(ExtrinsicBaseWeight::get());
+ pub OffchainSolutionWeightLimit: Weight = RuntimeBlockWeights::get()
+ .get(DispatchClass::Normal)
+ .max_extrinsic.expect("Normal extrinsics have a weight limit configured; qed")
+ .saturating_sub(BlockExecutionWeight::get());
}
impl pallet_staking::Config for Runtime {
@@ -649,25 +674,38 @@ impl pallet_treasury::Config for Runtime {
EnsureRoot,
pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>
>;
- type Tippers = Elections;
- type TipCountdown = TipCountdown;
- type TipFindersFee = TipFindersFee;
- type TipReportDepositBase = TipReportDepositBase;
- type DataDepositPerByte = DataDepositPerByte;
type Event = Event;
type OnSlash = ();
type ProposalBond = ProposalBond;
type ProposalBondMinimum = ProposalBondMinimum;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
+ type BurnDestination = ();
+ type SpendFunds = Bounties;
+ type WeightInfo = pallet_treasury::weights::SubstrateWeight;
+}
+
+impl pallet_bounties::Config for Runtime {
+ type Event = Event;
type BountyDepositBase = BountyDepositBase;
type BountyDepositPayoutDelay = BountyDepositPayoutDelay;
type BountyUpdatePeriod = BountyUpdatePeriod;
type BountyCuratorDeposit = BountyCuratorDeposit;
type BountyValueMinimum = BountyValueMinimum;
+ type DataDepositPerByte = DataDepositPerByte;
type MaximumReasonLength = MaximumReasonLength;
- type BurnDestination = ();
- type WeightInfo = pallet_treasury::weights::SubstrateWeight;
+ type WeightInfo = pallet_bounties::weights::SubstrateWeight;
+}
+
+impl pallet_tips::Config for Runtime {
+ type Event = Event;
+ type DataDepositPerByte = DataDepositPerByte;
+ type MaximumReasonLength = MaximumReasonLength;
+ type Tippers = Elections;
+ type TipCountdown = TipCountdown;
+ type TipFindersFee = TipFindersFee;
+ type TipReportDepositBase = TipReportDepositBase;
+ type WeightInfo = pallet_tips::weights::SubstrateWeight;
}
parameter_types! {
@@ -679,6 +717,15 @@ parameter_types! {
pub const MaxDepth: u32 = 32;
pub const StorageSizeOffset: u32 = 8;
pub const MaxValueSize: u32 = 16 * 1024;
+ // The lazy deletion runs inside on_initialize.
+ pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *
+ RuntimeBlockWeights::get().max_block;
+ // The weight needed for decoding the queue should be less or equal than a fifth
+ // of the overall weight dedicated to the lazy deletion.
+ pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / (
+ ::WeightInfo::on_initialize_per_queue_item(1) -
+ ::WeightInfo::on_initialize_per_queue_item(0)
+ )) / 5) as u32;
}
impl pallet_contracts::Config for Runtime {
@@ -697,6 +744,9 @@ impl pallet_contracts::Config for Runtime {
type MaxValueSize = MaxValueSize;
type WeightPrice = pallet_transaction_payment::Module;
type WeightInfo = pallet_contracts::weights::SubstrateWeight;
+ type ChainExtension = ();
+ type DeletionQueueDepth = DeletionQueueDepth;
+ type DeletionWeightLimit = DeletionWeightLimit;
}
impl pallet_sudo::Config for Runtime {
@@ -779,7 +829,8 @@ impl pallet_im_online::Config for Runtime {
}
parameter_types! {
- pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get();
+ pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) *
+ RuntimeBlockWeights::get().max_block;
}
impl pallet_offences::Config for Runtime {
@@ -892,6 +943,50 @@ impl pallet_vesting::Config for Runtime {
type WeightInfo = pallet_vesting::weights::SubstrateWeight;
}
+impl pallet_mmr::Config for Runtime {
+ const INDEXING_PREFIX: &'static [u8] = b"mmr";
+ type Hashing = ::Hashing;
+ type Hash = ::Hash;
+ type LeafData = frame_system::Module;
+ type OnNewRoot = ();
+ type WeightInfo = ();
+}
+
+parameter_types! {
+ pub const LotteryModuleId: ModuleId = ModuleId(*b"py/lotto");
+ pub const MaxCalls: usize = 10;
+ pub const MaxGenerateRandom: u32 = 10;
+}
+
+impl pallet_lottery::Config for Runtime {
+ type ModuleId = LotteryModuleId;
+ type Call = Call;
+ type Event = Event;
+ type Currency = Balances;
+ type Randomness = RandomnessCollectiveFlip;
+ type ManagerOrigin = EnsureRoot;
+ type MaxCalls = MaxCalls;
+ type ValidateCall = Lottery;
+ type MaxGenerateRandom = MaxGenerateRandom;
+ type WeightInfo = pallet_lottery::weights::SubstrateWeight;
+}
+
+parameter_types! {
+ pub const AssetDepositBase: Balance = 100 * DOLLARS;
+ pub const AssetDepositPerZombie: Balance = 1 * DOLLARS;
+}
+
+impl pallet_assets::Config for Runtime {
+ type Event = Event;
+ type Balance = u64;
+ type AssetId = u32;
+ type Currency = Balances;
+ type ForceOrigin = EnsureRoot;
+ type AssetDepositBase = AssetDepositBase;
+ type AssetDepositPerZombie = AssetDepositPerZombie;
+ type WeightInfo = pallet_assets::weights::SubstrateWeight;
+}
+
construct_runtime!(
pub enum Runtime where
Block = Block,
@@ -929,6 +1024,11 @@ construct_runtime!(
Scheduler: pallet_scheduler::{Module, Call, Storage, Event},
Proxy: pallet_proxy::{Module, Call, Storage, Event},
Multisig: pallet_multisig::{Module, Call, Storage, Event},
+ Bounties: pallet_bounties::{Module, Call, Storage, Event},
+ Tips: pallet_tips::{Module, Call, Storage, Event},
+ Assets: pallet_assets::{Module, Call, Storage, Event},
+ Mmr: pallet_mmr::{Module, Storage},
+ Lottery: pallet_lottery::{Module, Call, Storage, Event},
}
);
@@ -1076,6 +1176,10 @@ impl_runtime_apis! {
Babe::current_epoch_start()
}
+ fn current_epoch() -> sp_consensus_babe::Epoch {
+ Babe::current_epoch()
+ }
+
fn generate_key_ownership_proof(
_slot_number: sp_consensus_babe::SlotNumber,
authority_id: sp_consensus_babe::AuthorityId,
@@ -1195,8 +1299,10 @@ impl_runtime_apis! {
let mut batches = Vec::::new();
let params = (&config, &whitelist);
+ add_benchmark!(params, batches, pallet_assets, Assets);
add_benchmark!(params, batches, pallet_babe, Babe);
add_benchmark!(params, batches, pallet_balances, Balances);
+ add_benchmark!(params, batches, pallet_bounties, Bounties);
add_benchmark!(params, batches, pallet_collective, Council);
add_benchmark!(params, batches, pallet_contracts, Contracts);
add_benchmark!(params, batches, pallet_democracy, Democracy);
@@ -1205,6 +1311,8 @@ impl_runtime_apis! {
add_benchmark!(params, batches, pallet_identity, Identity);
add_benchmark!(params, batches, pallet_im_online, ImOnline);
add_benchmark!(params, batches, pallet_indices, Indices);
+ add_benchmark!(params, batches, pallet_lottery, Lottery);
+ add_benchmark!(params, batches, pallet_mmr, Mmr);
add_benchmark!(params, batches, pallet_multisig, Multisig);
add_benchmark!(params, batches, pallet_offences, OffencesBench::);
add_benchmark!(params, batches, pallet_proxy, Proxy);
@@ -1213,6 +1321,7 @@ impl_runtime_apis! {
add_benchmark!(params, batches, pallet_staking, Staking);
add_benchmark!(params, batches, frame_system, SystemBench::);
add_benchmark!(params, batches, pallet_timestamp, Timestamp);
+ add_benchmark!(params, batches, pallet_tips, Tips);
add_benchmark!(params, batches, pallet_treasury, Treasury);
add_benchmark!(params, batches, pallet_utility, Utility);
add_benchmark!(params, batches, pallet_vesting, Vesting);
diff --git a/bin/node/testing/src/bench.rs b/bin/node/testing/src/bench.rs
index f9eb6174d6b9d6c2daeedc08a6c5ba8d58258990..b9908af79ca36a412f10b650ab47d31602bdebda 100644
--- a/bin/node/testing/src/bench.rs
+++ b/bin/node/testing/src/bench.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/testing/src/client.rs b/bin/node/testing/src/client.rs
index f44747b26b7a6eb6409e76063b23914f3fb43f66..c4ace4ced9b42b39ccab9b23ea1d3b86ead77897 100644
--- a/bin/node/testing/src/client.rs
+++ b/bin/node/testing/src/client.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/testing/src/genesis.rs b/bin/node/testing/src/genesis.rs
index 6fa178ba4bcddbc7cadb8e61fad4433d852ace22..75d0d18e6ef811cd91e0bf57eb38c2a72a3b414a 100644
--- a/bin/node/testing/src/genesis.rs
+++ b/bin/node/testing/src/genesis.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/testing/src/keyring.rs b/bin/node/testing/src/keyring.rs
index f0b8ff707294eb6bed32daf6d7fa18505b1c2333..da61040206ea4f8a41bc963226bb8a70eb1acdea 100644
--- a/bin/node/testing/src/keyring.rs
+++ b/bin/node/testing/src/keyring.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/node/testing/src/lib.rs b/bin/node/testing/src/lib.rs
index d682347e40019dd4a7ff74a8716929130623f31e..c5792bccee80da8f787424517653d484fe2f2ce6 100644
--- a/bin/node/testing/src/lib.rs
+++ b/bin/node/testing/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/utils/chain-spec-builder/build.rs b/bin/utils/chain-spec-builder/build.rs
index 8d5aac1a08742486a9b0e5d55aaf7959941abd77..57424f016f3e520e98345432cc105469a43efefc 100644
--- a/bin/utils/chain-spec-builder/build.rs
+++ b/bin/utils/chain-spec-builder/build.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/utils/chain-spec-builder/src/main.rs b/bin/utils/chain-spec-builder/src/main.rs
index c2db944050eb452708e50001edaeb609bbc0057c..f3336b1d53a84eceaac50a89887075e8152f90cd 100644
--- a/bin/utils/chain-spec-builder/src/main.rs
+++ b/bin/utils/chain-spec-builder/src/main.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/bin/utils/subkey/src/lib.rs b/bin/utils/subkey/src/lib.rs
index c38a48576524301f85f323b6986ece5ab052b3d0..5f7787f022405af96924bf54627285c7ec6e9cd1 100644
--- a/bin/utils/subkey/src/lib.rs
+++ b/bin/utils/subkey/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -18,8 +18,8 @@
use structopt::StructOpt;
use sc_cli::{
- Error, VanityCmd, SignCmd, VerifyCmd, InsertCmd,
- GenerateNodeKeyCmd, GenerateCmd, InspectKeyCmd, InspectNodeKeyCmd
+ Error, VanityCmd, SignCmd, VerifyCmd, GenerateNodeKeyCmd, GenerateCmd, InspectKeyCmd,
+ InspectNodeKeyCmd
};
use substrate_frame_cli::ModuleIdCmd;
use sp_core::crypto::Ss58Codec;
@@ -44,9 +44,6 @@ pub enum Subkey {
/// Print the peer ID corresponding to the node key in the given file
InspectNodeKey(InspectNodeKeyCmd),
- /// Insert a key to the keystore of a node.
- Insert(InsertCmd),
-
/// Inspect a module ID address
ModuleId(ModuleIdCmd),
@@ -71,7 +68,6 @@ pub fn run() -> Result<(), Error>
Subkey::Generate(cmd) => cmd.run()?,
Subkey::Inspect(cmd) => cmd.run()?,
Subkey::InspectNodeKey(cmd) => cmd.run()?,
- Subkey::Insert(cmd) => cmd.run()?,
Subkey::ModuleId(cmd) => cmd.run::()?,
Subkey::Vanity(cmd) => cmd.run()?,
Subkey::Verify(cmd) => cmd.run()?,
diff --git a/bin/utils/subkey/src/main.rs b/bin/utils/subkey/src/main.rs
index dd14425130b7d32ce9ddb7123929a74aa63da93d..39f2f9e2e5b9b2610717181cf415b03c803c2e70 100644
--- a/bin/utils/subkey/src/main.rs
+++ b/bin/utils/subkey/src/main.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/api/src/backend.rs b/client/api/src/backend.rs
index 47fec977f5e827361b6190bce8fbd49f045b61be..c2b42d1b34442dc30ef7b4afddfa734ea2c8278d 100644
--- a/client/api/src/backend.rs
+++ b/client/api/src/backend.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/api/src/call_executor.rs b/client/api/src/call_executor.rs
index 86e3440f19c93b6f25b5623bacefbce336a01d47..9c0ea87ea718e782365195763f0e80e15431eeb0 100644
--- a/client/api/src/call_executor.rs
+++ b/client/api/src/call_executor.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/api/src/cht.rs b/client/api/src/cht.rs
index 8ecccdf32c5c74e711f3cd4ab0167ec1211584d2..8c027da60f1773f43987049b500ce897e3e56a38 100644
--- a/client/api/src/cht.rs
+++ b/client/api/src/cht.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -22,7 +22,7 @@
//! One is generated for every `SIZE` blocks, allowing us to discard those blocks in
//! favor of the trie root. When the "ancient" blocks need to be accessed, we simply
//! request an inclusion proof of a specific block number against the trie with the
-//! root has. A correct proof implies that the claimed block is identical to the one
+//! root hash. A correct proof implies that the claimed block is identical to the one
//! we discarded.
use hash_db;
diff --git a/client/api/src/client.rs b/client/api/src/client.rs
index f97daa487638fb58fbf4812074d04c864ef9ca2e..4dc2b6bb524e410da7d657571160163953f02f34 100644
--- a/client/api/src/client.rs
+++ b/client/api/src/client.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! A set of APIs supported by the client along with their primitives.
diff --git a/client/api/src/execution_extensions.rs b/client/api/src/execution_extensions.rs
index c187e7580023570d91e57fa64472ac2514a4e665..68b412a0d778b0b6636700cc2a38a6f53e52062c 100644
--- a/client/api/src/execution_extensions.rs
+++ b/client/api/src/execution_extensions.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Execution extensions for runtime calls.
//!
diff --git a/client/api/src/in_mem.rs b/client/api/src/in_mem.rs
index ded030fb8046f6279d384d1b9e395e3b8345d6fd..cef52982f167b26e007ab31975a86c5a4becd833 100644
--- a/client/api/src/in_mem.rs
+++ b/client/api/src/in_mem.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/api/src/leaves.rs b/client/api/src/leaves.rs
index d10fa7ac0e565347803999d7a63a6aa2a0536fb5..1971012c6aabc1a696c175d3480d5cf6c448f039 100644
--- a/client/api/src/leaves.rs
+++ b/client/api/src/leaves.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/api/src/lib.rs b/client/api/src/lib.rs
index 677066936330e07b6b7b6df010fe78e4be031b6e..0f860b95e780550d0b68ec2c6f7a96f0ae383ed3 100644
--- a/client/api/src/lib.rs
+++ b/client/api/src/lib.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Substrate client interfaces.
#![warn(missing_docs)]
diff --git a/client/api/src/light.rs b/client/api/src/light.rs
index f9ba64544a8c0199072e82b010a33d72de6c2a79..a068e2d4a3417c8576a9964b23d75058de3e6f45 100644
--- a/client/api/src/light.rs
+++ b/client/api/src/light.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Substrate light client interfaces
diff --git a/client/api/src/notifications.rs b/client/api/src/notifications.rs
index ec63c372c7e5969b28e5dfdbd54afae0b757b1b6..bfd419ec9a581a9cb87fe4ee6f96832598ad03b1 100644
--- a/client/api/src/notifications.rs
+++ b/client/api/src/notifications.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/api/src/proof_provider.rs b/client/api/src/proof_provider.rs
index 5749ae0576fc38799d8c2eeb9b2aeaccd49b2bca..a0dbcf1d1e807c2425be12499d582af024532d65 100644
--- a/client/api/src/proof_provider.rs
+++ b/client/api/src/proof_provider.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/authority-discovery/Cargo.toml b/client/authority-discovery/Cargo.toml
index 4cd2dae1388a1558ae8b5aaa8cf6403619fcb15e..5c1d0b9d91f831d8b7df61508132e34ad09b7548 100644
--- a/client/authority-discovery/Cargo.toml
+++ b/client/authority-discovery/Cargo.toml
@@ -23,7 +23,7 @@ derive_more = "0.99.2"
either = "1.5.3"
futures = "0.3.4"
futures-timer = "3.0.1"
-libp2p = { version = "0.31.2", default-features = false, features = ["kad"] }
+libp2p = { version = "0.33.0", default-features = false, features = ["kad"] }
log = "0.4.8"
prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../utils/prometheus", version = "0.8.0"}
prost = "0.6.1"
diff --git a/client/authority-discovery/src/error.rs b/client/authority-discovery/src/error.rs
index 82e4a6dd6f3fde8d25b54ab7304de77f9908b35c..f482d19248353f8fb7b2397e606317b560aaf6ed 100644
--- a/client/authority-discovery/src/error.rs
+++ b/client/authority-discovery/src/error.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Authority discovery errors.
diff --git a/client/authority-discovery/src/interval.rs b/client/authority-discovery/src/interval.rs
index b3aa5b1c0f6785f68a9689e6f45a94e7e08b9d19..0710487203d5360f556c62ae621744851301f6aa 100644
--- a/client/authority-discovery/src/interval.rs
+++ b/client/authority-discovery/src/interval.rs
@@ -1,18 +1,20 @@
-// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
use futures::stream::Stream;
use futures::future::FutureExt;
diff --git a/client/authority-discovery/src/lib.rs b/client/authority-discovery/src/lib.rs
index 41aa01e56bde20f36fbcde6eeee3156ac4addb6e..26d4396ca88302f5b4179744c1cd44903e4b1467 100644
--- a/client/authority-discovery/src/lib.rs
+++ b/client/authority-discovery/src/lib.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
#![warn(missing_docs)]
#![recursion_limit = "1024"]
diff --git a/client/authority-discovery/src/service.rs b/client/authority-discovery/src/service.rs
index 7eabeb3daf52e3fb6e3c16bd965d357c178915c7..1da97cbb03b53cbc2a7ecf1b07eb18666c4d2e17 100644
--- a/client/authority-discovery/src/service.rs
+++ b/client/authority-discovery/src/service.rs
@@ -1,18 +1,20 @@
-// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
use crate::ServicetoWorkerMsg;
@@ -22,14 +24,14 @@ use futures::SinkExt;
use sc_network::{Multiaddr, PeerId};
use sp_authority_discovery::AuthorityId;
-/// Service to interact with the [`Worker`].
+/// Service to interact with the [`crate::Worker`].
#[derive(Clone)]
pub struct Service {
to_worker: mpsc::Sender,
}
-/// A [`Service`] allows to interact with a [`Worker`], e.g. by querying the
-/// [`Worker`]'s local address cache for a given [`AuthorityId`].
+/// A [`Service`] allows to interact with a [`crate::Worker`], e.g. by querying the
+/// [`crate::Worker`]'s local address cache for a given [`AuthorityId`].
impl Service {
pub(crate) fn new(to_worker: mpsc::Sender) -> Self {
Self {
@@ -44,7 +46,7 @@ impl Service {
/// [`crate::Worker`] failed.
///
/// Note: [`Multiaddr`]s returned always include a [`PeerId`] via a
- /// [`libp2p::core::multiaddr:Protocol::P2p`] component. Equality of
+ /// [`libp2p::core::multiaddr::Protocol::P2p`] component. Equality of
/// [`PeerId`]s across [`Multiaddr`]s returned by a single call is not
/// enforced today, given that there are still authorities out there
/// publishing the addresses of their sentry nodes on the DHT. In the future
diff --git a/client/authority-discovery/src/tests.rs b/client/authority-discovery/src/tests.rs
index 414ffc1e3f3947718241f6586ff1e5cfda4d8fb8..78e978e07a1a0418f1f6705b56f32e236ddf7e5e 100644
--- a/client/authority-discovery/src/tests.rs
+++ b/client/authority-discovery/src/tests.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/authority-discovery/src/worker.rs b/client/authority-discovery/src/worker.rs
index 45b55f76673c281d9826fc02c5f9cfe0b7333eef..0f4986a4a146cbf391f82e8ca29a8553671dbcce 100644
--- a/client/authority-discovery/src/worker.rs
+++ b/client/authority-discovery/src/worker.rs
@@ -1,18 +1,20 @@
-// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
use crate::{error::{Error, Result}, interval::ExpIncInterval, ServicetoWorkerMsg};
@@ -100,7 +102,7 @@ pub enum Role {
///
/// 5. Allow querying of the collected addresses via the [`crate::Service`].
pub struct Worker {
- /// Channel receiver for messages send by a [`Service`].
+ /// Channel receiver for messages send by a [`crate::Service`].
from_service: Fuse>,
client: Arc,
@@ -615,8 +617,8 @@ where
}
/// NetworkProvider provides [`Worker`] with all necessary hooks into the
-/// underlying Substrate networking. Using this trait abstraction instead of [`NetworkService`]
-/// directly is necessary to unit test [`Worker`].
+/// underlying Substrate networking. Using this trait abstraction instead of
+/// [`sc_network::NetworkService`] directly is necessary to unit test [`Worker`].
#[async_trait]
pub trait NetworkProvider: NetworkStateInfo {
/// Modify a peerset priority group.
diff --git a/client/authority-discovery/src/worker/addr_cache.rs b/client/authority-discovery/src/worker/addr_cache.rs
index 75fcaa840176656998ef413fe4315587d39b27a5..4ae6ae0cdeb724e9b268f1766576894073e353b5 100644
--- a/client/authority-discovery/src/worker/addr_cache.rs
+++ b/client/authority-discovery/src/worker/addr_cache.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
use libp2p::core::multiaddr::{Multiaddr, Protocol};
use rand::seq::SliceRandom;
diff --git a/client/authority-discovery/src/worker/tests.rs b/client/authority-discovery/src/worker/tests.rs
index fee861dfeb0c7da2c09646ab1eada17261401872..2bc9c1ba6aafebccb776e3a7f63f7488f98a9741 100644
--- a/client/authority-discovery/src/worker/tests.rs
+++ b/client/authority-discovery/src/worker/tests.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/basic-authorship/Cargo.toml b/client/basic-authorship/Cargo.toml
index f097d8044f612c1d9d6e2413013a4ef43f36ff92..c5a67c0a6436ea35bce8e6d61129505c25e65b02 100644
--- a/client/basic-authorship/Cargo.toml
+++ b/client/basic-authorship/Cargo.toml
@@ -31,6 +31,6 @@ sc-block-builder = { version = "0.8.0", path = "../block-builder" }
sc-proposer-metrics = { version = "0.8.0", path = "../proposer-metrics" }
[dev-dependencies]
-sc-transaction-pool = { version = "2.0.0", path = "../../client/transaction-pool" }
+sc-transaction-pool = { version = "2.0.0", path = "../transaction-pool" }
substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" }
parking_lot = "0.10.0"
diff --git a/client/basic-authorship/src/basic_authorship.rs b/client/basic-authorship/src/basic_authorship.rs
index 8c022ef3a97416796592d0d5a2ff8bd7f626aa55..8a7750c69fe2e35ede972730b9804bbdac02f5e6 100644
--- a/client/basic-authorship/src/basic_authorship.rs
+++ b/client/basic-authorship/src/basic_authorship.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -44,7 +44,7 @@ use sc_proposer_metrics::MetricsLink as PrometheusMetrics;
/// Default maximum block size in bytes used by [`Proposer`].
///
-/// Can be overwritten by [`ProposerFactory::set_maxium_block_size`].
+/// Can be overwritten by [`ProposerFactory::set_maximum_block_size`].
///
/// Be aware that there is also an upper packet size on what the networking code
/// will accept. If the block doesn't fit in such a package, it can not be
diff --git a/client/basic-authorship/src/lib.rs b/client/basic-authorship/src/lib.rs
index 9b0c4915082316126858aa8d98690950c518aedd..3bb0a0b7e5c0e1fd017cf17bee9b05c9d04c2a09 100644
--- a/client/basic-authorship/src/lib.rs
+++ b/client/basic-authorship/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -71,4 +71,4 @@
mod basic_authorship;
-pub use crate::basic_authorship::{ProposerFactory, Proposer};
+pub use crate::basic_authorship::{ProposerFactory, Proposer, DEFAULT_MAX_BLOCK_SIZE};
diff --git a/client/block-builder/src/lib.rs b/client/block-builder/src/lib.rs
index cc1431ea349bf807ca3ea46974cdd64df7e53084..5a7e0277d9e8c61a9e4d41c3c3843e8069a642c9 100644
--- a/client/block-builder/src/lib.rs
+++ b/client/block-builder/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/chain-spec/derive/src/impls.rs b/client/chain-spec/derive/src/impls.rs
index ded961a6da8159d8cc5f1db8c3c7fe80dc94d77c..bb72270ed551ab5d8df7a6f5035748d8e74d3cd4 100644
--- a/client/chain-spec/derive/src/impls.rs
+++ b/client/chain-spec/derive/src/impls.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
use proc_macro2::{Span, TokenStream};
use quote::quote;
diff --git a/client/chain-spec/derive/src/lib.rs b/client/chain-spec/derive/src/lib.rs
index 0dc053f7e301edcd36c4f9057f590d52d13785a2..53f0c69491ecd7a7e60b094d426588996535968e 100644
--- a/client/chain-spec/derive/src/lib.rs
+++ b/client/chain-spec/derive/src/lib.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Macros to derive chain spec extension traits implementation.
diff --git a/client/chain-spec/src/chain_spec.rs b/client/chain-spec/src/chain_spec.rs
index 39c47e32908df7dae31cb5b61493a82ef2d56f16..2faf95568290e288ef9e2bc54f401ecdd9a6f4c3 100644
--- a/client/chain-spec/src/chain_spec.rs
+++ b/client/chain-spec/src/chain_spec.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/chain-spec/src/extension.rs b/client/chain-spec/src/extension.rs
index c0338203eb10edb822217082c8d81b4a55f24adf..c0352529f86738082657253ad83ab1af333f4bbf 100644
--- a/client/chain-spec/src/extension.rs
+++ b/client/chain-spec/src/extension.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Chain Spec extensions helpers.
diff --git a/client/chain-spec/src/lib.rs b/client/chain-spec/src/lib.rs
index 27657ccb7f8692427b408e34fe89326af729eda6..ee4f757f8cf0e3670f64d064cb0cb7f70e6be8e8 100644
--- a/client/chain-spec/src/lib.rs
+++ b/client/chain-spec/src/lib.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Substrate chain configurations.
//!
diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml
index f323f1940b181a72787d4ada2422019cffda4a21..cd8afb1cce1e4ca191ada218f021157d8ecdcd77 100644
--- a/client/cli/Cargo.toml
+++ b/client/cli/Cargo.toml
@@ -19,7 +19,7 @@ regex = "1.4.2"
tokio = { version = "0.2.21", features = [ "signal", "rt-core", "rt-threaded", "blocking" ] }
futures = "0.3.4"
fdlimit = "0.2.1"
-libp2p = "0.31.2"
+libp2p = "0.33.0"
parity-scale-codec = "1.3.0"
hex = "0.4.2"
rand = "0.7.3"
diff --git a/client/cli/proc-macro/src/lib.rs b/client/cli/proc-macro/src/lib.rs
index 775d1eb96ea383ec0d17e6b20c78795715811e1d..0e2466ec3ae77981988eea05bffc7284dda0808a 100644
--- a/client/cli/proc-macro/src/lib.rs
+++ b/client/cli/proc-macro/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/arg_enums.rs b/client/cli/src/arg_enums.rs
index 85400f2a27759fe3743173239fd44c67a39e9ab8..2ebfa38925e23b232e198e2ae7e6430591f65fb6 100644
--- a/client/cli/src/arg_enums.rs
+++ b/client/cli/src/arg_enums.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/commands/build_spec_cmd.rs b/client/cli/src/commands/build_spec_cmd.rs
index 616c5139f64f0d370373bda2b221bacea8700b6c..3d66e752b81ecb6aa4c0feddcb3aa1269ff2d9a6 100644
--- a/client/cli/src/commands/build_spec_cmd.rs
+++ b/client/cli/src/commands/build_spec_cmd.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/commands/check_block_cmd.rs b/client/cli/src/commands/check_block_cmd.rs
index b536d4f26bb6c875745e0ee180eca07a31158b68..74e2d34f975b2d874cfa15eafbda82d2353e9806 100644
--- a/client/cli/src/commands/check_block_cmd.rs
+++ b/client/cli/src/commands/check_block_cmd.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/commands/export_blocks_cmd.rs b/client/cli/src/commands/export_blocks_cmd.rs
index 497531ad393ba299909703b0104f1ee9fa201e1b..55f05d9d7f3030079b5d4eccae2f4895468ce161 100644
--- a/client/cli/src/commands/export_blocks_cmd.rs
+++ b/client/cli/src/commands/export_blocks_cmd.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/commands/export_state_cmd.rs b/client/cli/src/commands/export_state_cmd.rs
index c078db0d8aea922e23ddfda88112e22f5979bbbe..2211b3131a01362b26c8a700800f55ae8b017eb0 100644
--- a/client/cli/src/commands/export_state_cmd.rs
+++ b/client/cli/src/commands/export_state_cmd.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/commands/generate.rs b/client/cli/src/commands/generate.rs
index 86b039ce6a4c5bd8f3f15fabcb03dfb2c6f42c6d..08b5f20772363bbc1267e84c888f0dd8bc5fc7d6 100644
--- a/client/cli/src/commands/generate.rs
+++ b/client/cli/src/commands/generate.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/client/cli/src/commands/generate_node_key.rs b/client/cli/src/commands/generate_node_key.rs
index ad292e4712d840efa5f015acb6341a0805ba9ebc..ec22c6298adb6f3b2d000b2668734f7be45ca0e5 100644
--- a/client/cli/src/commands/generate_node_key.rs
+++ b/client/cli/src/commands/generate_node_key.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/client/cli/src/commands/import_blocks_cmd.rs b/client/cli/src/commands/import_blocks_cmd.rs
index 00f8ec43b02fe937b26db243ab930adf793e75bc..89f70d06813ce2da2bec94460e87c8fa96a8ca7b 100644
--- a/client/cli/src/commands/import_blocks_cmd.rs
+++ b/client/cli/src/commands/import_blocks_cmd.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/commands/insert.rs b/client/cli/src/commands/insert.rs
deleted file mode 100644
index fc307e45e7ce427bf2c1705447e97038db38ee85..0000000000000000000000000000000000000000
--- a/client/cli/src/commands/insert.rs
+++ /dev/null
@@ -1,94 +0,0 @@
-// This file is part of Substrate.
-
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
-// SPDX-License-Identifier: Apache-2.0
-
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-//! Implementation of the `insert` subcommand
-
-use crate::{Error, KeystoreParams, CryptoSchemeFlag, SharedParams, utils, with_crypto_scheme};
-use std::sync::Arc;
-use structopt::StructOpt;
-use sp_core::crypto::KeyTypeId;
-use sp_keystore::{SyncCryptoStorePtr, SyncCryptoStore};
-use std::convert::TryFrom;
-use sc_service::config::KeystoreConfig;
-use sc_keystore::LocalKeystore;
-use sp_core::crypto::SecretString;
-
-/// The `insert` command
-#[derive(Debug, StructOpt)]
-#[structopt(
- name = "insert",
- about = "Insert a key to the keystore of a node."
-)]
-pub struct InsertCmd {
- /// The secret key URI.
- /// If the value is a file, the file content is used as URI.
- /// If not given, you will be prompted for the URI.
- #[structopt(long)]
- suri: Option,
-
- /// Key type, examples: "gran", or "imon"
- #[structopt(long)]
- key_type: String,
-
- #[allow(missing_docs)]
- #[structopt(flatten)]
- pub shared_params: SharedParams,
-
- #[allow(missing_docs)]
- #[structopt(flatten)]
- pub keystore_params: KeystoreParams,
-
- #[allow(missing_docs)]
- #[structopt(flatten)]
- pub crypto_scheme: CryptoSchemeFlag,
-}
-
-impl InsertCmd {
- /// Run the command
- pub fn run(&self) -> Result<(), Error> {
- let suri = utils::read_uri(self.suri.as_ref())?;
- let base_path = self.shared_params.base_path.as_ref()
- .ok_or_else(|| Error::MissingBasePath)?;
-
- let (keystore, public) = match self.keystore_params.keystore_config(base_path)? {
- KeystoreConfig::Path { path, password } => {
- let public = with_crypto_scheme!(
- self.crypto_scheme.scheme,
- to_vec(&suri, password.clone())
- )?;
- let keystore: SyncCryptoStorePtr = Arc::new(LocalKeystore::open(path, password)?);
- (keystore, public)
- },
- _ => unreachable!("keystore_config always returns path and password; qed")
- };
-
- let key_type = KeyTypeId::try_from(self.key_type.as_str())
- .map_err(|_e| {
- Error::KeyTypeInvalid
- })?;
-
- SyncCryptoStore::insert_unknown(&*keystore, key_type, &suri, &public[..])
- .map_err(|_| Error::KeyStoreOperation)?;
-
- Ok(())
- }
-}
-
-fn to_vec(uri: &str, pass: Option) -> Result, Error> {
- let p = utils::pair_from_suri::
(uri, pass)?;
- Ok(p.public().as_ref().to_vec())
-}
diff --git a/client/cli/src/commands/insert_key.rs b/client/cli/src/commands/insert_key.rs
new file mode 100644
index 0000000000000000000000000000000000000000..90588f96d20b03bd683612d9d72b7cbddb2baf41
--- /dev/null
+++ b/client/cli/src/commands/insert_key.rs
@@ -0,0 +1,173 @@
+// This file is part of Substrate.
+
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: Apache-2.0
+
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//! Implementation of the `insert` subcommand
+
+use crate::{
+ Error, KeystoreParams, CryptoSchemeFlag, SharedParams, utils, with_crypto_scheme,
+ SubstrateCli,
+};
+use std::{sync::Arc, convert::TryFrom};
+use structopt::StructOpt;
+use sp_core::{crypto::KeyTypeId, crypto::SecretString};
+use sp_keystore::{SyncCryptoStorePtr, SyncCryptoStore};
+use sc_keystore::LocalKeystore;
+use sc_service::config::{KeystoreConfig, BasePath};
+
+/// The `insert` command
+#[derive(Debug, StructOpt)]
+#[structopt(
+ name = "insert",
+ about = "Insert a key to the keystore of a node."
+)]
+pub struct InsertKeyCmd {
+ /// The secret key URI.
+ /// If the value is a file, the file content is used as URI.
+ /// If not given, you will be prompted for the URI.
+ #[structopt(long)]
+ suri: Option,
+
+ /// Key type, examples: "gran", or "imon"
+ #[structopt(long)]
+ key_type: String,
+
+ #[allow(missing_docs)]
+ #[structopt(flatten)]
+ pub shared_params: SharedParams,
+
+ #[allow(missing_docs)]
+ #[structopt(flatten)]
+ pub keystore_params: KeystoreParams,
+
+ #[allow(missing_docs)]
+ #[structopt(flatten)]
+ pub crypto_scheme: CryptoSchemeFlag,
+}
+
+impl InsertKeyCmd {
+ /// Run the command
+ pub fn run(&self, cli: &C) -> Result<(), Error> {
+ let suri = utils::read_uri(self.suri.as_ref())?;
+ let base_path = self.shared_params
+ .base_path()
+ .unwrap_or_else(|| BasePath::from_project("", "", &C::executable_name()));
+ let chain_id = self.shared_params.chain_id(self.shared_params.is_dev());
+ let chain_spec = cli.load_spec(&chain_id)?;
+ let config_dir = base_path.config_dir(chain_spec.id());
+
+ let (keystore, public) = match self.keystore_params.keystore_config(&config_dir)? {
+ (_, KeystoreConfig::Path { path, password }) => {
+ let public = with_crypto_scheme!(
+ self.crypto_scheme.scheme,
+ to_vec(&suri, password.clone())
+ )?;
+ let keystore: SyncCryptoStorePtr = Arc::new(LocalKeystore::open(path, password)?);
+ (keystore, public)
+ },
+ _ => unreachable!("keystore_config always returns path and password; qed")
+ };
+
+ let key_type = KeyTypeId::try_from(self.key_type.as_str()).map_err(|_| Error::KeyTypeInvalid)?;
+
+ SyncCryptoStore::insert_unknown(&*keystore, key_type, &suri, &public[..])
+ .map_err(|_| Error::KeyStoreOperation)?;
+
+ Ok(())
+ }
+}
+
+fn to_vec(uri: &str, pass: Option) -> Result, Error> {
+ let p = utils::pair_from_suri::
(uri, pass)?;
+ Ok(p.public().as_ref().to_vec())
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use structopt::StructOpt;
+ use tempfile::TempDir;
+ use sp_core::{sr25519::Pair, Pair as _, Public};
+ use sc_service::{ChainSpec, GenericChainSpec, ChainType, NoExtension};
+
+ struct Cli;
+
+ impl SubstrateCli for Cli {
+ fn impl_name() -> String {
+ "test".into()
+ }
+
+ fn impl_version() -> String {
+ "2.0".into()
+ }
+
+ fn description() -> String {
+ "test".into()
+ }
+
+ fn support_url() -> String {
+ "test.test".into()
+ }
+
+ fn copyright_start_year() -> i32 {
+ 2020
+ }
+
+ fn author() -> String {
+ "test".into()
+ }
+
+ fn native_runtime_version(_: &Box) -> &'static sp_version::RuntimeVersion {
+ unimplemented!("Not required in tests")
+ }
+
+ fn load_spec(&self, _: &str) -> std::result::Result, String> {
+ Ok(
+ Box::new(
+ GenericChainSpec::from_genesis(
+ "test",
+ "test_id",
+ ChainType::Development,
+ || unimplemented!("Not required in tests"),
+ Vec::new(),
+ None,
+ None,
+ None,
+ NoExtension::None,
+ ),
+ ),
+ )
+ }
+ }
+
+ #[test]
+ fn insert_with_custom_base_path() {
+ let path = TempDir::new().unwrap();
+ let path_str = format!("{}", path.path().display());
+ let (key, uri, _) = Pair::generate_with_phrase(None);
+
+ let inspect = InsertKeyCmd::from_iter(
+ &["insert-key", "-d", &path_str, "--key-type", "test", "--suri", &uri],
+ );
+ assert!(inspect.run(&Cli).is_ok());
+
+ let keystore = LocalKeystore::open(
+ path.path().join("chains").join("test_id").join("keystore"),
+ None,
+ ).unwrap();
+ assert!(keystore.has_keys(&[(key.public().to_raw_vec(), KeyTypeId(*b"test"))]));
+ }
+}
diff --git a/client/cli/src/commands/inspect_key.rs b/client/cli/src/commands/inspect_key.rs
index fb3a7ef4f3b4413856ac738abc639d98f10378bc..2642eee88adcdd944b7b3a160417a99841eb433a 100644
--- a/client/cli/src/commands/inspect_key.rs
+++ b/client/cli/src/commands/inspect_key.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/client/cli/src/commands/inspect_node_key.rs b/client/cli/src/commands/inspect_node_key.rs
index be0b88589d5e9dfd2cc84d0a543ba2ccb4cd836f..4db32aefb5fbb51f1cb8e3719f8900e54dc8b275 100644
--- a/client/cli/src/commands/inspect_node_key.rs
+++ b/client/cli/src/commands/inspect_node_key.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/client/cli/src/commands/key.rs b/client/cli/src/commands/key.rs
index e5bce08145cb8bd482b1b150b81be8e3b2a1b5e2..546454159718d6da5f76de6029dd612e6fa14020 100644
--- a/client/cli/src/commands/key.rs
+++ b/client/cli/src/commands/key.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,11 +17,11 @@
//! Key related CLI utilities
-use crate::Error;
+use crate::{Error, SubstrateCli};
use structopt::StructOpt;
use super::{
- insert::InsertCmd,
+ insert_key::InsertKeyCmd,
inspect_key::InspectKeyCmd,
generate::GenerateCmd,
inspect_node_key::InspectNodeKeyCmd,
@@ -45,17 +45,17 @@ pub enum KeySubcommand {
InspectNodeKey(InspectNodeKeyCmd),
/// Insert a key to the keystore of a node.
- Insert(InsertCmd),
+ Insert(InsertKeyCmd),
}
impl KeySubcommand {
/// run the key subcommands
- pub fn run(&self) -> Result<(), Error> {
+ pub fn run(&self, cli: &C) -> Result<(), Error> {
match self {
KeySubcommand::GenerateNodeKey(cmd) => cmd.run(),
KeySubcommand::Generate(cmd) => cmd.run(),
KeySubcommand::InspectKey(cmd) => cmd.run(),
- KeySubcommand::Insert(cmd) => cmd.run(),
+ KeySubcommand::Insert(cmd) => cmd.run(cli),
KeySubcommand::InspectNodeKey(cmd) => cmd.run(),
}
}
diff --git a/client/cli/src/commands/mod.rs b/client/cli/src/commands/mod.rs
index 9867f61cd277fc626144d5ba8d3aedbe73032c3e..8c0d6acd6a51159bc6ec83fe275895ff44a34a51 100644
--- a/client/cli/src/commands/mod.rs
+++ b/client/cli/src/commands/mod.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -28,7 +28,7 @@ mod revert_cmd;
mod run_cmd;
mod generate_node_key;
mod generate;
-mod insert;
+mod insert_key;
mod inspect_node_key;
mod inspect_key;
mod key;
@@ -43,7 +43,7 @@ pub use self::{
purge_chain_cmd::PurgeChainCmd,
sign::SignCmd,
generate::GenerateCmd,
- insert::InsertCmd,
+ insert_key::InsertKeyCmd,
inspect_key::InspectKeyCmd,
generate_node_key::GenerateNodeKeyCmd,
inspect_node_key::InspectNodeKeyCmd,
diff --git a/client/cli/src/commands/purge_chain_cmd.rs b/client/cli/src/commands/purge_chain_cmd.rs
index 9c9c6e91fb2416c56e8a6e9a3894a8a7aeb31c10..1902d92e6345ad166c557e21012097040a2ab71c 100644
--- a/client/cli/src/commands/purge_chain_cmd.rs
+++ b/client/cli/src/commands/purge_chain_cmd.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/commands/revert_cmd.rs b/client/cli/src/commands/revert_cmd.rs
index b2e3c1bf8e2b674e4313253aa6abd2431701d587..2745ce2c652417b53bbadb90ace51e2cf9d207fd 100644
--- a/client/cli/src/commands/revert_cmd.rs
+++ b/client/cli/src/commands/revert_cmd.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/commands/run_cmd.rs b/client/cli/src/commands/run_cmd.rs
index 019b760e5b4aefc394b01fb29e29ece2ee1956e8..bbb8d6f68d7f97e162efbac1b201a2d49e069407 100644
--- a/client/cli/src/commands/run_cmd.rs
+++ b/client/cli/src/commands/run_cmd.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -75,7 +75,8 @@ pub struct RunCmd {
/// Listen to all RPC interfaces.
///
/// Default is local. Note: not all RPC methods are safe to be exposed publicly. Use an RPC proxy
- /// server to filter out dangerous methods. More details: https://github.com/paritytech/substrate/wiki/Public-RPC.
+ /// server to filter out dangerous methods. More details:
+ /// .
/// Use `--unsafe-rpc-external` to suppress the warning if you understand the risks.
#[structopt(long = "rpc-external")]
pub rpc_external: bool,
@@ -105,7 +106,7 @@ pub struct RunCmd {
/// Listen to all Websocket interfaces.
///
/// Default is local. Note: not all RPC methods are safe to be exposed publicly. Use an RPC proxy
- /// server to filter out dangerous methods. More details: https://github.com/paritytech/substrate/wiki/Public-RPC.
+ /// server to filter out dangerous methods. More details: .
/// Use `--unsafe-ws-external` to suppress the warning if you understand the risks.
#[structopt(long = "ws-external")]
pub ws_external: bool,
@@ -142,7 +143,7 @@ pub struct RunCmd {
///
/// A comma-separated list of origins (protocol://domain or special `null`
/// value). Value of `all` will disable origin validation. Default is to
- /// allow localhost and https://polkadot.js.org origins. When running in
+ /// allow localhost and origins. When running in
/// --dev mode the default is to allow all origins.
#[structopt(long = "rpc-cors", value_name = "ORIGINS", parse(try_from_str = parse_cors))]
pub rpc_cors: Option,
diff --git a/client/cli/src/commands/sign.rs b/client/cli/src/commands/sign.rs
index 605fd5b12313f0c75fee8eef4951fafe9ee9f680..a39e14697b9956bf577c601b72969e265ba9184f 100644
--- a/client/cli/src/commands/sign.rs
+++ b/client/cli/src/commands/sign.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/commands/utils.rs b/client/cli/src/commands/utils.rs
index 6e48d04e1328bda8ca234dd3e4bec2f2d1263f9b..1bbff392eca435b902729f725a912ee65c69d012 100644
--- a/client/cli/src/commands/utils.rs
+++ b/client/cli/src/commands/utils.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -57,7 +57,7 @@ pub fn read_uri(uri: Option<&String>) -> error::Result {
/// 2. Try to construct the `Pair` while using `uri` as input for [`sp_core::Pair::from_string_with_seed`].
///
/// 3. Try to construct the `Pair::Public` while using `uri` as input for
-/// [`sp_core::Pair::Public::from_string_with_version`].
+/// [`sp_core::crypto::Ss58Codec::from_string_with_version`].
pub fn print_from_uri(
uri: &str,
password: Option,
diff --git a/client/cli/src/commands/vanity.rs b/client/cli/src/commands/vanity.rs
index 33b9025c13fbc2e8e3c82a20205ba97ac7a74c5b..da47e8bb26cc870b1eea88048894b3cd2efeef47 100644
--- a/client/cli/src/commands/vanity.rs
+++ b/client/cli/src/commands/vanity.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/commands/verify.rs b/client/cli/src/commands/verify.rs
index 15abc04002f4c891d9be4f655e6915c6b7d28780..f5bd5a06060c6add64815e52d656de5f7d5038f8 100644
--- a/client/cli/src/commands/verify.rs
+++ b/client/cli/src/commands/verify.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/config.rs b/client/cli/src/config.rs
index e4411e49408e551717c578437cac0b56410cb1ed..017d2b421683fd2357b03daacb9cc77a63ffa486 100644
--- a/client/cli/src/config.rs
+++ b/client/cli/src/config.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -22,7 +22,7 @@ use crate::arg_enums::Database;
use crate::error::Result;
use crate::{
init_logger, DatabaseParams, ImportParams, KeystoreParams, NetworkParams, NodeKeyParams,
- OffchainWorkerParams, PruningParams, SharedParams, SubstrateCli,
+ OffchainWorkerParams, PruningParams, SharedParams, SubstrateCli, InitLoggerParams,
};
use log::warn;
use names::{Generator, Name};
@@ -47,7 +47,7 @@ const RECOMMENDED_OPEN_FILE_DESCRIPTOR_LIMIT: u64 = 10_000;
/// Default configuration values used by Substrate
///
-/// These values will be used by [`CliConfiguritation`] to set
+/// These values will be used by [`CliConfiguration`] to set
/// default values for e.g. the listen port or the RPC port.
pub trait DefaultConfigurationValues {
/// The port Substrate should listen on for p2p connections.
@@ -186,12 +186,12 @@ pub trait CliConfiguration: Sized {
/// Get the keystore configuration.
///
- /// Bu default this is retrieved from `KeystoreParams` if it is available. Otherwise it uses
+ /// By default this is retrieved from `KeystoreParams` if it is available. Otherwise it uses
/// `KeystoreConfig::InMemory`.
- fn keystore_config(&self, base_path: &PathBuf) -> Result {
+ fn keystore_config(&self, config_dir: &PathBuf) -> Result<(Option, KeystoreConfig)> {
self.keystore_params()
- .map(|x| x.keystore_config(base_path))
- .unwrap_or(Ok(KeystoreConfig::InMemory))
+ .map(|x| x.keystore_config(config_dir))
+ .unwrap_or_else(|| Ok((None, KeystoreConfig::InMemory)))
}
/// Get the database cache size.
@@ -454,15 +454,11 @@ pub trait CliConfiguration: Sized {
) -> Result {
let is_dev = self.is_dev()?;
let chain_id = self.chain_id(is_dev)?;
- let chain_spec = cli.load_spec(chain_id.as_str())?;
+ let chain_spec = cli.load_spec(&chain_id)?;
let base_path = self
.base_path()?
.unwrap_or_else(|| BasePath::from_project("", "", &C::executable_name()));
- let config_dir = base_path
- .path()
- .to_path_buf()
- .join("chains")
- .join(chain_spec.id());
+ let config_dir = base_path.config_dir(chain_spec.id());
let net_config_dir = config_dir.join(DEFAULT_NETWORK_CONFIG_PATH);
let client_id = C::client_id();
let database_cache_size = self.database_cache_size()?.unwrap_or(128);
@@ -471,6 +467,7 @@ pub trait CliConfiguration: Sized {
let role = self.role(is_dev)?;
let max_runtime_instances = self.max_runtime_instances()?.unwrap_or(8);
let is_validator = role.is_network_authority();
+ let (keystore_remote, keystore) = self.keystore_config(&config_dir)?;
let unsafe_pruning = self
.import_params()
@@ -491,7 +488,8 @@ pub trait CliConfiguration: Sized {
node_key,
DCV::p2p_listen_port(),
)?,
- keystore: self.keystore_config(&config_dir)?,
+ keystore_remote,
+ keystore,
database: self.database_config(&config_dir, database_cache_size, database)?,
state_cache_size: self.state_cache_size()?,
state_cache_child_ratio: self.state_cache_child_ratio()?,
@@ -540,6 +538,11 @@ pub trait CliConfiguration: Sized {
Ok(self.shared_params().is_log_filter_reloading_disabled())
}
+ /// Should the log color output be disabled?
+ fn disable_log_color(&self) -> Result {
+ Ok(self.shared_params().disable_log_color())
+ }
+
/// Initialize substrate. This must be done only once per process.
///
/// This method:
@@ -552,15 +555,17 @@ pub trait CliConfiguration: Sized {
let tracing_receiver = self.tracing_receiver()?;
let tracing_targets = self.tracing_targets()?;
let disable_log_reloading = self.is_log_filter_reloading_disabled()?;
+ let disable_log_color = self.disable_log_color()?;
sp_panic_handler::set(&C::support_url(), &C::impl_version());
- init_logger(
- &logger_pattern,
+ init_logger(InitLoggerParams {
+ pattern: logger_pattern,
tracing_receiver,
tracing_targets,
disable_log_reloading,
- )?;
+ disable_log_color,
+ })?;
if let Some(new_limit) = fdlimit::raise_fd_limit() {
if new_limit < RECOMMENDED_OPEN_FILE_DESCRIPTOR_LIMIT {
diff --git a/client/cli/src/error.rs b/client/cli/src/error.rs
index 5190cae2c2ff89edc1b9a3916afe428c3969f51a..75867e2f76b280992b43ee1485515f739abee3df 100644
--- a/client/cli/src/error.rs
+++ b/client/cli/src/error.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -59,9 +59,6 @@ pub enum Error {
expected: usize,
},
- #[error("The base path is missing, please provide one")]
- MissingBasePath,
-
#[error("Unknown key type, must be a known 4-character sequence")]
KeyTypeInvalid,
diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs
index 80882924bd3ad2c67a2e16aba571c5a58bc46640..1402e5e7ae44c64d3e92f8a9c30da49311c78b41 100644
--- a/client/cli/src/lib.rs
+++ b/client/cli/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -112,10 +112,7 @@ pub trait SubstrateCli: Sized {
///
/// Gets the struct from the command line arguments. Print the
/// error message and quit the program in case of failure.
- fn from_args() -> Self
- where
- Self: StructOpt + Sized,
- {
+ fn from_args() -> Self where Self: StructOpt + Sized {
::from_iter(&mut std::env::args_os())
}
@@ -240,30 +237,50 @@ pub trait SubstrateCli: Sized {
fn native_runtime_version(chain_spec: &Box) -> &'static RuntimeVersion;
}
+/// The parameters for [`init_logger`].
+#[derive(Default)]
+pub struct InitLoggerParams {
+ /// A comma seperated list of logging patterns.
+ ///
+ /// E.g.: `test-crate=debug`
+ pub pattern: String,
+ /// The tracing receiver.
+ pub tracing_receiver: sc_tracing::TracingReceiver,
+ /// Optional comma seperated list of tracing targets.
+ pub tracing_targets: Option,
+ /// Should log reloading be disabled?
+ pub disable_log_reloading: bool,
+ /// Should the log color output be disabled?
+ pub disable_log_color: bool,
+}
+
/// Initialize the global logger
///
/// This sets various global logging and tracing instances and thus may only be called once.
pub fn init_logger(
- pattern: &str,
- tracing_receiver: sc_tracing::TracingReceiver,
- profiling_targets: Option,
- disable_log_reloading: bool,
+ InitLoggerParams {
+ pattern,
+ tracing_receiver,
+ tracing_targets,
+ disable_log_reloading,
+ disable_log_color,
+ }: InitLoggerParams,
) -> std::result::Result<(), String> {
use sc_tracing::parse_default_directive;
// Accept all valid directives and print invalid ones
- fn parse_user_directives(mut env_filter: EnvFilter, dirs: &str) -> std::result::Result {
+ fn parse_user_directives(
+ mut env_filter: EnvFilter,
+ dirs: &str,
+ ) -> std::result::Result {
for dir in dirs.split(',') {
env_filter = env_filter.add_directive(parse_default_directive(&dir)?);
}
Ok(env_filter)
}
- if let Err(e) = tracing_log::LogTracer::init() {
- return Err(format!(
- "Registering Substrate logger failed: {:}!", e
- ))
- }
+ tracing_log::LogTracer::init()
+ .map_err(|e| format!("Registering Substrate logger failed: {:}!", e))?;
// Initialize filter - ensure to use `parse_default_directive` for any defaults to persist
// after log filter reloading by RPC
@@ -293,7 +310,7 @@ pub fn init_logger(
if pattern != "" {
// We're not sure if log or tracing is available at this moment, so silently ignore the
// parse error.
- env_filter = parse_user_directives(env_filter, pattern)?;
+ env_filter = parse_user_directives(env_filter, &pattern)?;
}
// If we're only logging `INFO` entries then we'll use a simplified logging format.
@@ -311,11 +328,11 @@ pub fn init_logger(
);
// Make sure to include profiling targets in the filter
- if let Some(profiling_targets) = profiling_targets.clone() {
- env_filter = parse_user_directives(env_filter, &profiling_targets)?;
+ if let Some(tracing_targets) = tracing_targets.clone() {
+ env_filter = parse_user_directives(env_filter, &tracing_targets)?;
}
- let enable_color = atty::is(atty::Stream::Stderr);
+ let enable_color = atty::is(atty::Stream::Stderr) && !disable_log_color;
let timer = ChronoLocal::with_format(if simple {
"%Y-%m-%d %H:%M:%S".to_string()
} else {
@@ -336,7 +353,7 @@ pub fn init_logger(
let subscriber = subscriber_builder
.finish()
.with(logging::NodeNameLayer);
- initialize_tracing(subscriber, tracing_receiver, profiling_targets)
+ initialize_tracing(subscriber, tracing_receiver, tracing_targets)
} else {
let subscriber_builder = subscriber_builder.with_filter_reloading();
let handle = subscriber_builder.reload_handle();
@@ -344,7 +361,7 @@ pub fn init_logger(
let subscriber = subscriber_builder
.finish()
.with(logging::NodeNameLayer);
- initialize_tracing(subscriber, tracing_receiver, profiling_targets)
+ initialize_tracing(subscriber, tracing_receiver, tracing_targets)
}
}
@@ -383,7 +400,9 @@ mod tests {
#[test]
fn test_logger_filters() {
let test_pattern = "afg=debug,sync=trace,client=warn,telemetry,something-with-dash=error";
- init_logger(&test_pattern, Default::default(), Default::default(), false).unwrap();
+ init_logger(
+ InitLoggerParams { pattern: test_pattern.into(), ..Default::default() },
+ ).unwrap();
tracing::dispatcher::get_default(|dispatcher| {
let test_filter = |target, level| {
@@ -442,7 +461,9 @@ mod tests {
fn log_something_with_dash_target_name() {
if env::var("ENABLE_LOGGING").is_ok() {
let test_pattern = "test-target=info";
- init_logger(&test_pattern, Default::default(), Default::default(), false).unwrap();
+ init_logger(
+ InitLoggerParams { pattern: test_pattern.into(), ..Default::default() },
+ ).unwrap();
log::info!(target: "test-target", "{}", EXPECTED_LOG_MESSAGE);
}
@@ -478,7 +499,9 @@ mod tests {
fn prefix_in_log_lines_entrypoint() {
if env::var("ENABLE_LOGGING").is_ok() {
let test_pattern = "test-target=info";
- init_logger(&test_pattern, Default::default(), Default::default(), false).unwrap();
+ init_logger(
+ InitLoggerParams { pattern: test_pattern.into(), ..Default::default() },
+ ).unwrap();
prefix_in_log_lines_process();
}
}
@@ -494,7 +517,7 @@ mod tests {
#[test]
fn do_not_write_with_colors_on_tty_entrypoint() {
if env::var("ENABLE_LOGGING").is_ok() {
- init_logger("", Default::default(), Default::default(), false).unwrap();
+ init_logger(InitLoggerParams::default()).unwrap();
log::info!("{}", ansi_term::Colour::Yellow.paint(EXPECTED_LOG_MESSAGE));
}
}
diff --git a/client/cli/src/params/database_params.rs b/client/cli/src/params/database_params.rs
index 24b23f6076a02302071c76a6da614c8e5c11e6a0..21529f65a56b0b76f6557d31a89e2adb66b4053f 100644
--- a/client/cli/src/params/database_params.rs
+++ b/client/cli/src/params/database_params.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/params/import_params.rs b/client/cli/src/params/import_params.rs
index 376a72b8421f5446e4ccdfae606145478d329c73..7409dbf79dc0f7b1db5d08bc343ec1e4fbe0c5a5 100644
--- a/client/cli/src/params/import_params.rs
+++ b/client/cli/src/params/import_params.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/params/keystore_params.rs b/client/cli/src/params/keystore_params.rs
index 2ecd21cb3dd00693190810c26e56a422306e34ef..d75cdebc5a56839db2a9104a12da7fc8f346825e 100644
--- a/client/cli/src/params/keystore_params.rs
+++ b/client/cli/src/params/keystore_params.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -18,8 +18,7 @@
use crate::error::Result;
use sc_service::config::KeystoreConfig;
-use std::fs;
-use std::path::PathBuf;
+use std::{fs, path::{PathBuf, Path}};
use structopt::StructOpt;
use crate::error;
use sp_core::crypto::SecretString;
@@ -30,6 +29,10 @@ const DEFAULT_KEYSTORE_CONFIG_PATH: &'static str = "keystore";
/// Parameters of the keystore
#[derive(Debug, StructOpt)]
pub struct KeystoreParams {
+ /// Specify custom URIs to connect to for keystore-services
+ #[structopt(long = "keystore-uri")]
+ pub keystore_uri: Option,
+
/// Specify custom keystore path.
#[structopt(long = "keystore-path", value_name = "PATH", parse(from_os_str))]
pub keystore_path: Option,
@@ -61,13 +64,14 @@ pub struct KeystoreParams {
/// Parse a sercret string, returning a displayable error.
pub fn secret_string_from_str(s: &str) -> std::result::Result {
- Ok(std::str::FromStr::from_str(s)
- .map_err(|_e| "Could not get SecretString".to_string())?)
+ std::str::FromStr::from_str(s).map_err(|_| "Could not get SecretString".to_string())
}
impl KeystoreParams {
/// Get the keystore configuration for the parameters
- pub fn keystore_config(&self, base_path: &PathBuf) -> Result {
+ ///
+ /// Returns a vector of remote-urls and the local Keystore configuration
+ pub fn keystore_config(&self, config_dir: &Path) -> Result<(Option, KeystoreConfig)> {
let password = if self.password_interactive {
#[cfg(not(target_os = "unknown"))]
{
@@ -87,9 +91,9 @@ impl KeystoreParams {
let path = self
.keystore_path
.clone()
- .unwrap_or_else(|| base_path.join(DEFAULT_KEYSTORE_CONFIG_PATH));
+ .unwrap_or_else(|| config_dir.join(DEFAULT_KEYSTORE_CONFIG_PATH));
- Ok(KeystoreConfig::Path { path, password })
+ Ok((self.keystore_uri.clone(), KeystoreConfig::Path { path, password }))
}
/// helper method to fetch password from `KeyParams` or read from stdin
diff --git a/client/cli/src/params/mod.rs b/client/cli/src/params/mod.rs
index 93467bc8ec63778e95d116b57cf8b6dc92c12636..8308b123f71f3c5e83fa709cf4ddbc9d910df132 100644
--- a/client/cli/src/params/mod.rs
+++ b/client/cli/src/params/mod.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/params/network_params.rs b/client/cli/src/params/network_params.rs
index a973d61272ced7c47c65121f50e6c18054cc3416..2040bd9bc78ed9c45550c69ec8e61d7c380d6be9 100644
--- a/client/cli/src/params/network_params.rs
+++ b/client/cli/src/params/network_params.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/params/node_key_params.rs b/client/cli/src/params/node_key_params.rs
index 875411fbfb62000d3e8c5bfc00cce52d3082fa04..d43c87804dd3ba1404e5a3753effa5e3a63e8b09 100644
--- a/client/cli/src/params/node_key_params.rs
+++ b/client/cli/src/params/node_key_params.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/params/offchain_worker_params.rs b/client/cli/src/params/offchain_worker_params.rs
index f8d48edc4729d5f97e4f389fe78dd3cd794423b9..ef39a1ed41be26bb8f94e5391fbcff1d62006f7f 100644
--- a/client/cli/src/params/offchain_worker_params.rs
+++ b/client/cli/src/params/offchain_worker_params.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/params/pruning_params.rs b/client/cli/src/params/pruning_params.rs
index 7db808e6d8f2f8e249ff0e057a05297bfcf92a72..80118cafd8769b40c2dc4204b8b4b9de9bb9dbcf 100644
--- a/client/cli/src/params/pruning_params.rs
+++ b/client/cli/src/params/pruning_params.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/params/shared_params.rs b/client/cli/src/params/shared_params.rs
index 52b1488ea9ccdf9383f2dd6222a478e9b3528fb4..45ce41846bf120319e3b2952ae112340938b3ac4 100644
--- a/client/cli/src/params/shared_params.rs
+++ b/client/cli/src/params/shared_params.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -46,6 +46,10 @@ pub struct SharedParams {
#[structopt(short = "l", long, value_name = "LOG_PATTERN")]
pub log: Vec,
+ /// Disable log color output.
+ #[structopt(long)]
+ pub disable_log_color: bool,
+
/// Disable feature to dynamically update and reload the log filter.
///
/// By default this feature is enabled, however it leads to a small performance decrease.
@@ -99,6 +103,11 @@ impl SharedParams {
&self.log
}
+ /// Should the log color output be disabled?
+ pub fn disable_log_color(&self) -> bool {
+ self.disable_log_color
+ }
+
/// Is log reloading disabled
pub fn is_log_filter_reloading_disabled(&self) -> bool {
self.disable_log_reloading
diff --git a/client/cli/src/params/transaction_pool_params.rs b/client/cli/src/params/transaction_pool_params.rs
index 3ad278426922ec99ccc42e192cbda9db1d04207b..bf0ed53e531c9745dcd8351b9edebd0a55808997 100644
--- a/client/cli/src/params/transaction_pool_params.rs
+++ b/client/cli/src/params/transaction_pool_params.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/cli/src/runner.rs b/client/cli/src/runner.rs
index e6d35282ada2b491cacbe2b9a112b5cba82bd968..9836471fb9fa2ddd413aeb2c76d7df677a2d8ca3 100644
--- a/client/cli/src/runner.rs
+++ b/client/cli/src/runner.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/consensus/aura/Cargo.toml b/client/consensus/aura/Cargo.toml
index ccc4d515a8e1104ebbd058abeec0595e6ba6be21..c240fa4cb4da698953f69f9ff7244fe6b3cee84a 100644
--- a/client/consensus/aura/Cargo.toml
+++ b/client/consensus/aura/Cargo.toml
@@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
sp-application-crypto = { version = "2.0.0", path = "../../../primitives/application-crypto" }
sp-consensus-aura = { version = "0.8.0", path = "../../../primitives/consensus/aura" }
sp-block-builder = { version = "2.0.0", path = "../../../primitives/block-builder" }
-sc-block-builder = { version = "0.8.0", path = "../../../client/block-builder" }
+sc-block-builder = { version = "0.8.0", path = "../../block-builder" }
sc-client-api = { version = "2.0.0", path = "../../api" }
codec = { package = "parity-scale-codec", version = "1.3.4" }
sp-consensus = { version = "0.8.0", path = "../../../primitives/consensus/common" }
diff --git a/client/consensus/aura/src/digests.rs b/client/consensus/aura/src/digests.rs
index 3332e4c6a6dff99f2ee9ad367031fde15a33ada6..fec412b62d1eaf3b38f696a12510fdeeab31832f 100644
--- a/client/consensus/aura/src/digests.rs
+++ b/client/consensus/aura/src/digests.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/consensus/aura/src/lib.rs b/client/consensus/aura/src/lib.rs
index 246b39771277d3e54bc95db097e852a99447e68e..84d3783927e54c6588ffebf2cb8cc26c92dfe702 100644
--- a/client/consensus/aura/src/lib.rs
+++ b/client/consensus/aura/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2018-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -256,7 +256,7 @@ where
) -> Option {
let expected_author = slot_author::
(slot_number, epoch_data);
expected_author.and_then(|p| {
- if SyncCryptoStore::has_keys(
+ if SyncCryptoStore::has_keys(
&*self.keystore,
&[(p.to_raw_vec(), sp_application_crypto::key_types::AURA)],
) {
diff --git a/client/consensus/babe/rpc/src/lib.rs b/client/consensus/babe/rpc/src/lib.rs
index a90964cdf73f71860365d08a8f4067939e5dfea5..4d5c091e0cbbd88add7aa93d17aeef63e418a790 100644
--- a/client/consensus/babe/rpc/src/lib.rs
+++ b/client/consensus/babe/rpc/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/consensus/babe/src/authorship.rs b/client/consensus/babe/src/authorship.rs
index 28a3692958e180430ba7a847505bdac5c68a8e0a..90ad12c4558c828cab7610b61c497ccabac9a361 100644
--- a/client/consensus/babe/src/authorship.rs
+++ b/client/consensus/babe/src/authorship.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! BABE authority selection and slot claiming.
diff --git a/client/consensus/babe/src/aux_schema.rs b/client/consensus/babe/src/aux_schema.rs
index 287121566a417247b835a6c8be55c781ecafb304..d399a12ea8a5b63f6d9c1c6da8235ea3a0a56475 100644
--- a/client/consensus/babe/src/aux_schema.rs
+++ b/client/consensus/babe/src/aux_schema.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Schema for BABE epoch changes in the aux-db.
diff --git a/client/consensus/babe/src/lib.rs b/client/consensus/babe/src/lib.rs
index 3f2a583482afb5d7486f44e0f6c45b7e0f5d6111..ea3ca29dad0e09011558475cb4d437e42bdd5eb1 100644
--- a/client/consensus/babe/src/lib.rs
+++ b/client/consensus/babe/src/lib.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! # BABE (Blind Assignment for Blockchain Extension)
//!
@@ -342,6 +344,11 @@ impl Config {
}
}
}
+
+ /// Get the inner slot duration, in milliseconds.
+ pub fn slot_duration(&self) -> u64 {
+ self.0.slot_duration()
+ }
}
impl std::ops::Deref for Config {
diff --git a/client/consensus/babe/src/tests.rs b/client/consensus/babe/src/tests.rs
index 6e0536c85ced76ff1242361e2ab4b4205a990642..82d8f9de5af02e12311e33afa0a02c789d789a6e 100644
--- a/client/consensus/babe/src/tests.rs
+++ b/client/consensus/babe/src/tests.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! BABE testsuite
diff --git a/client/consensus/babe/src/verification.rs b/client/consensus/babe/src/verification.rs
index fd3c27be4f34ef9bb00ba1ef12a4215d0e2a313d..47c4da0834d096c55c0cdf7c11b5e9c492ecd572 100644
--- a/client/consensus/babe/src/verification.rs
+++ b/client/consensus/babe/src/verification.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Verification for BABE headers.
use sp_runtime::{traits::Header, traits::DigestItemFor};
diff --git a/client/consensus/common/src/lib.rs b/client/consensus/common/src/lib.rs
index 1d9b072cfe964f168ac471b2bfcf3cac29009048..a53517c5c35ead9aa8d11c9280972564025251a2 100644
--- a/client/consensus/common/src/lib.rs
+++ b/client/consensus/common/src/lib.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Collection of common consensus specific implementations
mod longest_chain;
diff --git a/client/consensus/common/src/longest_chain.rs b/client/consensus/common/src/longest_chain.rs
index 981dbad0f607029671b7ad858f2327578fa24e94..8cf32a1dbd3c1587ea61dd9bb3fb23b40c71ddad 100644
--- a/client/consensus/common/src/longest_chain.rs
+++ b/client/consensus/common/src/longest_chain.rs
@@ -1,18 +1,21 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
+
//! Longest chain implementation
use std::sync::Arc;
@@ -98,4 +101,4 @@ impl SelectChain for LongestChain
self.backend.blockchain().best_containing(target_hash, maybe_max_number, import_lock)
.map_err(|e| ConsensusError::ChainLookup(e.to_string()).into())
}
-}
\ No newline at end of file
+}
diff --git a/client/consensus/epochs/src/lib.rs b/client/consensus/epochs/src/lib.rs
index acb07dd668a3c4f3b2c7a2350451d9ac93008926..76e8c8ed5419d3d013407d15648329978449358d 100644
--- a/client/consensus/epochs/src/lib.rs
+++ b/client/consensus/epochs/src/lib.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Generic utilities for epoch-based consensus engines.
diff --git a/client/consensus/epochs/src/migration.rs b/client/consensus/epochs/src/migration.rs
index e4717b5584e0ec67801ce3d264e90ff350286deb..6e7baba8053af65bfa06cd983b675b90e851d870 100644
--- a/client/consensus/epochs/src/migration.rs
+++ b/client/consensus/epochs/src/migration.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Migration types for epoch changes.
diff --git a/client/consensus/manual-seal/src/consensus.rs b/client/consensus/manual-seal/src/consensus.rs
index 7bafeb50207d486f93055c20e5bfe2649586e743..0cfd99cab5c99419c219b2a6483efa2a30299780 100644
--- a/client/consensus/manual-seal/src/consensus.rs
+++ b/client/consensus/manual-seal/src/consensus.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/consensus/manual-seal/src/consensus/babe.rs b/client/consensus/manual-seal/src/consensus/babe.rs
index c2fdf6243c30407504a74b0aba4fd370b9595e3d..1566b647f2c01556acf9a1bc3388c4aaa406eecf 100644
--- a/client/consensus/manual-seal/src/consensus/babe.rs
+++ b/client/consensus/manual-seal/src/consensus/babe.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/consensus/manual-seal/src/error.rs b/client/consensus/manual-seal/src/error.rs
index e2628008c24c7c2a3c203af47c0088ea635d13b5..77140c835a3eea86c651f841de8b3c03ca25630a 100644
--- a/client/consensus/manual-seal/src/error.rs
+++ b/client/consensus/manual-seal/src/error.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/consensus/manual-seal/src/finalize_block.rs b/client/consensus/manual-seal/src/finalize_block.rs
index 5780a25f97256331eb1d11b2370dd838ec112ac7..76ae6eeeae5aceebab426be0af8c7f66f13c3aa5 100644
--- a/client/consensus/manual-seal/src/finalize_block.rs
+++ b/client/consensus/manual-seal/src/finalize_block.rs
@@ -1,18 +1,20 @@
-// Copyright 2019 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Block finalization utilities
diff --git a/client/consensus/manual-seal/src/lib.rs b/client/consensus/manual-seal/src/lib.rs
index 9c4465f82fda1ef57e2e18be6ba88be05518531a..5bf08571195d2b501b6850192ca1e85c3e3ab292 100644
--- a/client/consensus/manual-seal/src/lib.rs
+++ b/client/consensus/manual-seal/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/consensus/manual-seal/src/rpc.rs b/client/consensus/manual-seal/src/rpc.rs
index 690b6c1eb9996d086d0a2397b00cdc2c1d5145d0..293d4487a5d5972adacb9c00482868ee90cf4135 100644
--- a/client/consensus/manual-seal/src/rpc.rs
+++ b/client/consensus/manual-seal/src/rpc.rs
@@ -1,18 +1,20 @@
-// Copyright 2019 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! RPC interface for the `ManualSeal` Engine.
diff --git a/client/consensus/manual-seal/src/seal_block.rs b/client/consensus/manual-seal/src/seal_block.rs
index a4afaa343e9052561204a60cadf731907c863c73..59b99349bf9b2a6b6834d6d8f166be8738bfbd95 100644
--- a/client/consensus/manual-seal/src/seal_block.rs
+++ b/client/consensus/manual-seal/src/seal_block.rs
@@ -1,18 +1,20 @@
-// Copyright 2019 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Block sealing utilities
diff --git a/client/consensus/pow/src/lib.rs b/client/consensus/pow/src/lib.rs
index e353ed6358a00fc94f5069bbeff356ba93347cd6..975a6f17e795f34106448f77518ec2c3b2261ed0 100644
--- a/client/consensus/pow/src/lib.rs
+++ b/client/consensus/pow/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/consensus/pow/src/worker.rs b/client/consensus/pow/src/worker.rs
index 4ed863dcd9ed986e6045ac1a96061a03b030a3b7..c19c5524d9774cf84863845ed911c8a8e160d5c4 100644
--- a/client/consensus/pow/src/worker.rs
+++ b/client/consensus/pow/src/worker.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/consensus/slots/build.rs b/client/consensus/slots/build.rs
index 513cc234d4363a854961db1efdea1cbc7007ce56..57424f016f3e520e98345432cc105469a43efefc 100644
--- a/client/consensus/slots/build.rs
+++ b/client/consensus/slots/build.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
use std::env;
diff --git a/client/consensus/slots/src/aux_schema.rs b/client/consensus/slots/src/aux_schema.rs
index 1f1fe37068f82b2fef9c789bf0877068d0b1d0c3..c8095f238ec8cefb9235c314650189d61787bfab 100644
--- a/client/consensus/slots/src/aux_schema.rs
+++ b/client/consensus/slots/src/aux_schema.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Schema for slots in the aux-db.
diff --git a/client/consensus/slots/src/lib.rs b/client/consensus/slots/src/lib.rs
index 571766bc44b1ae3c584f384fd7872ff4c4c535e4..93d3614584f8f2b196afa4c107fb385d07a2adb1 100644
--- a/client/consensus/slots/src/lib.rs
+++ b/client/consensus/slots/src/lib.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Slots functionality for Substrate.
//!
diff --git a/client/consensus/slots/src/slots.rs b/client/consensus/slots/src/slots.rs
index e7c84a2c1fd283e437566a342e62cb3c75fe4e3f..0c93e16461ccb1c4783bdcce95bc06c5398b825b 100644
--- a/client/consensus/slots/src/slots.rs
+++ b/client/consensus/slots/src/slots.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Utility stream for yielding slots in a loop.
//!
diff --git a/client/consensus/uncles/src/lib.rs b/client/consensus/uncles/src/lib.rs
index 2a129b200063b97db9cd1bc8b3811d8b16abd75c..f38849300d0da2edf2a70cce0b6ff1c0556ddab1 100644
--- a/client/consensus/uncles/src/lib.rs
+++ b/client/consensus/uncles/src/lib.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Uncles functionality for Substrate.
#![forbid(unsafe_code, missing_docs)]
diff --git a/client/db/src/bench.rs b/client/db/src/bench.rs
index 72824a379fc5218812a8ddaa5fbe7021f6db8da2..f2b22560aedee00af4d8a9b439014cdca477abd9 100644
--- a/client/db/src/bench.rs
+++ b/client/db/src/bench.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -350,13 +350,13 @@ impl StateBackend> for BenchmarkingState {
}
}
- fn for_keys_in_child_storage(
+ fn apply_to_child_keys_while bool>(
&self,
child_info: &ChildInfo,
f: F,
) {
if let Some(ref state) = *self.state.borrow() {
- state.for_keys_in_child_storage(child_info, f)
+ state.apply_to_child_keys_while(child_info, f)
}
}
diff --git a/client/db/src/cache/list_cache.rs b/client/db/src/cache/list_cache.rs
index 15ad339b1f2c1a387fd3e5dbac70eaef5df3a79b..341105b16a5b3f324fa35102a4e6085e8a6d1a78 100644
--- a/client/db/src/cache/list_cache.rs
+++ b/client/db/src/cache/list_cache.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/db/src/cache/list_entry.rs b/client/db/src/cache/list_entry.rs
index d14fab9274ccb830694082491b5f16bcf27ecf2b..94d4eb9f49b2739c3a0325da899c8a7b57dc3ad6 100644
--- a/client/db/src/cache/list_entry.rs
+++ b/client/db/src/cache/list_entry.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/db/src/cache/list_storage.rs b/client/db/src/cache/list_storage.rs
index 377d744effa60faf57521d2a490852ef757ce1bf..e4b3677b4ab310de91323f0a208ec6a327c57115 100644
--- a/client/db/src/cache/list_storage.rs
+++ b/client/db/src/cache/list_storage.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/db/src/cache/mod.rs b/client/db/src/cache/mod.rs
index 5501f0f1864c156745c6a3e63e4d8ced9a1cf25c..005d25b90f933491a7dde3a62ae7041a8c155a13 100644
--- a/client/db/src/cache/mod.rs
+++ b/client/db/src/cache/mod.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/db/src/changes_tries_storage.rs b/client/db/src/changes_tries_storage.rs
index a2299a82337a05f58ec7ba8dc867270813cc4444..6233eab3ea396fa70cb114552ebff1de4dc4ca8d 100644
--- a/client/db/src/changes_tries_storage.rs
+++ b/client/db/src/changes_tries_storage.rs
@@ -1,18 +1,20 @@
-// Copyright 2019 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! DB-backed changes tries storage.
diff --git a/client/db/src/children.rs b/client/db/src/children.rs
index bfba797cd467bdbc3f7a1db5d23b7f97511b5be5..62352e6d0614aced3ca0fccee9c33b47a258befe 100644
--- a/client/db/src/children.rs
+++ b/client/db/src/children.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Functionality for reading and storing children hashes from db.
diff --git a/client/db/src/lib.rs b/client/db/src/lib.rs
index 24ebb9149cbbf0ca7b7ee6bd3596eb59aa9601b6..65c9083861c53baf718b0edce02fc55c01381bce 100644
--- a/client/db/src/lib.rs
+++ b/client/db/src/lib.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
@@ -195,12 +195,12 @@ impl StateBackend> for RefTrackingState {
self.state.for_key_values_with_prefix(prefix, f)
}
- fn for_keys_in_child_storage(
+ fn apply_to_child_keys_while bool>(
&self,
child_info: &ChildInfo,
f: F,
) {
- self.state.for_keys_in_child_storage(child_info, f)
+ self.state.apply_to_child_keys_while(child_info, f)
}
fn for_child_keys_with_prefix(
diff --git a/client/db/src/light.rs b/client/db/src/light.rs
index acfb6217ce9e034dd66324e34642aa78eb0a8a95..91f37dd374d9f8912f40529cf1bbe89acc58288c 100644
--- a/client/db/src/light.rs
+++ b/client/db/src/light.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/db/src/offchain.rs b/client/db/src/offchain.rs
index c4f0ce115ca54f1453e857cc34b96fd26918f8a8..aead4397343ea32c23142988ad9c1b36e3d94780 100644
--- a/client/db/src/offchain.rs
+++ b/client/db/src/offchain.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/db/src/parity_db.rs b/client/db/src/parity_db.rs
index 313069706f33f5128004ada17d58ab241855227f..e56ca4de6cb78d028dd527ad098c1c5ee001f085 100644
--- a/client/db/src/parity_db.rs
+++ b/client/db/src/parity_db.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/db/src/stats.rs b/client/db/src/stats.rs
index 8d208024b4bb29a1f064dfc00f3fa14b8df07f85..3fd93db931d029fcb2a8da73fa75f674f6a5b438 100644
--- a/client/db/src/stats.rs
+++ b/client/db/src/stats.rs
@@ -1,6 +1,6 @@
// This file is part of Substrate.
-// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
+// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
diff --git a/client/db/src/storage_cache.rs b/client/db/src/storage_cache.rs
index 74b95e73140ab3bae695526a62820749bab27d3e..af58d2a50eb262f08ab4654962286d662897805f 100644
--- a/client/db/src/storage_cache.rs
+++ b/client/db/src/storage_cache.rs
@@ -1,18 +1,20 @@
-// Copyright 2019-2020 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
-// Substrate is free software: you can redistribute it and/or modify
+// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
+// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
+
+// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-// Substrate is distributed in the hope that it will be useful,
+// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
-// along with Substrate. If not, see .
+// along with this program. If not, see .
//! Global cache state.
@@ -584,12 +586,12 @@ impl>, B: BlockT> StateBackend> for Cachin
self.state.exists_child_storage(child_info, key)
}
- fn for_keys_in_child_storage(
+ fn apply_to_child_keys_while bool>(
&self,
child_info: &ChildInfo,
f: F,
) {
- self.state.for_keys_in_child_storage(child_info, f)
+ self.state.apply_to_child_keys_while(child_info, f)
}
fn next_storage_key(&self, key: &[u8]) -> Result