diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 07b0dd319cf792dbee99c64b5addc4307ab14dd5..62e438645e10382cfbbc83962291a3746f648bdc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -24,8 +24,6 @@ stages:
- check
- test
- build
- - chaos-env
- - chaos
- publish
- deploy
- flaming-fir
@@ -399,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
@@ -490,118 +487,40 @@ build-rust-doc:
- echo "" > ./crate-docs/index.html
- sccache -s
-#### 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
@@ -615,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
@@ -629,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 76f89eafbaeee28a638d8407a8058a4e214bfbdc..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");
diff --git a/.maintain/gitlab/check_polkadot_companion_build.sh b/.maintain/gitlab/check_polkadot_companion_build.sh
index 4a7e9869abf5e1cc238011a81ca584c4a567a8f7..f2b61c6192d620bf8f5bed5fcb510538174b8484 100755
--- a/.maintain/gitlab/check_polkadot_companion_build.sh
+++ b/.maintain/gitlab/check_polkadot_companion_build.sh
@@ -45,7 +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 20 origin
+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 c775fbb062e16c39163db9edee67b8b156905b8e..c99c439eee607f5d7e8e50e376ff0a3ae598b273 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -716,6 +716,15 @@ 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"
@@ -2819,9 +2828,9 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a"
[[package]]
name = "libp2p"
-version = "0.32.2"
+version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "022cdac4ab124be12de581e591796d4dfb7d1f1eef94669d2c1eaa0e98dd2f0e"
+checksum = "2e17c636b5fe5ff900ccc2840b643074bfac321551d821243a781d0d46f06588"
dependencies = [
"atomic",
"bytes 0.5.6",
@@ -2857,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",
@@ -2902,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",
@@ -2913,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",
@@ -2924,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",
@@ -2942,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",
@@ -2968,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",
@@ -2984,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",
@@ -3010,9 +3018,9 @@ dependencies = [
[[package]]
name = "libp2p-mdns"
-version = "0.26.0"
+version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b934ee03a361f317df7d75defa4177b285534c58f49d5e6e240278e13ef3f65"
+checksum = "8a9e12688e8f14008c950c1efde587cb44dbf316fa805f419cd4e524991236f5"
dependencies = [
"async-io",
"data-encoding",
@@ -3031,9 +3039,9 @@ dependencies = [
[[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",
@@ -3049,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",
@@ -3071,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",
@@ -3086,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",
@@ -3103,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",
@@ -3117,9 +3125,9 @@ dependencies = [
[[package]]
name = "libp2p-request-response"
-version = "0.7.0"
+version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bd96c3580fe59a9379ac7906c2f61c7f5ad3b7515362af0e72153a7cc9a45550"
+checksum = "620e2950decbf77554b5aed3824f7d0e2c04923f28c70f9bff1a402c47ef6b1e"
dependencies = [
"async-trait",
"bytes 0.5.6",
@@ -3137,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",
@@ -3153,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",
@@ -3169,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",
@@ -3181,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",
@@ -3195,9 +3203,9 @@ dependencies = [
[[package]]
name = "libp2p-websocket"
-version = "0.26.3"
+version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "522a877ce42ededf1f5dd011dbc40ea116f1776818f09dacb3d7a206f3ad6305"
+checksum = "270c80528e21089ea25b41dd1ab8fd834bdf093ebee422fed3b68699a857a083"
dependencies = [
"async-tls",
"either",
@@ -3215,9 +3223,9 @@ dependencies = [
[[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",
@@ -6372,11 +6380,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]]
@@ -7101,7 +7109,6 @@ dependencies = [
"linked-hash-map",
"linked_hash_set",
"log",
- "lru",
"nohash-hasher",
"parity-scale-codec",
"parking_lot 0.11.1",
@@ -9744,8 +9751,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",
@@ -9763,7 +9771,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",
]
@@ -9978,11 +9986,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",
@@ -9990,9 +9998,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",
@@ -10017,9 +10025,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",
@@ -10027,9 +10035,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",
@@ -10040,9 +10048,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"
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/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/pallets/template/src/mock.rs b/bin/node-template/pallets/template/src/mock.rs
index 84af63a1c3bb8c0a5b21b33511385d0ff5f1be0a..60d22aad7bc66eb9a78b6680c6e45e0ca2944a03 100644
--- a/bin/node-template/pallets/template/src/mock.rs
+++ b/bin/node-template/pallets/template/src/mock.rs
@@ -16,6 +16,7 @@ impl_outer_origin! {
pub struct Test;
parameter_types! {
pub const BlockHashCount: u64 = 250;
+ pub const SS58Prefix: u8 = 42;
}
impl system::Config for Test {
@@ -40,6 +41,7 @@ impl system::Config for Test {
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 51df3dd5a3e4507e2ca51435a5126d0c4941b245..0812346779646e7a2d552c6c98db35e3159b5d78 100644
--- a/bin/node-template/runtime/src/lib.rs
+++ b/bin/node-template/runtime/src/lib.rs
@@ -136,6 +136,7 @@ parameter_types! {
::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.
@@ -185,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 f60dc55b6f7e6c9643097a923b870e1961abc447..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.32.2", 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 f4dc0908567828eb7cd658b76cb27d8575274ad5..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");
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 83dc95e3b64dffec313816a1d251935777538f5d..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
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/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/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 d7910c2c63b8a81c498f764e912ea1a48ee70886..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");
diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs
index fb77fd2ebd405c7a738c27ab12e64115f5ea3e1a..a36448c47081123048836226f6b60589708fdf48 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
@@ -71,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;
@@ -111,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,
@@ -176,6 +177,7 @@ parameter_types! {
})
.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());
@@ -202,6 +204,7 @@ impl frame_system::Config for Runtime {
type OnNewAccount = ();
type OnKilledAccount = ();
type SystemWeightInfo = frame_system::weights::SubstrateWeight;
+ type SS58Prefix = SS58Prefix;
}
impl pallet_utility::Config for Runtime {
@@ -714,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 {
@@ -732,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 {
@@ -1141,6 +1156,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,
diff --git a/bin/node/testing/src/bench.rs b/bin/node/testing/src/bench.rs
index 35af52a2f36c1ad3170ff418fb4900c2f3a758f0..3bc31c6e414a698931ae20f09642ef04c335c89d 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 7fd7aa0dbcb7e7c18a35f7ce1da31bae173c2fc7..b4c4ce70cb3e96c7f8ea403e17ef13a39b2202bb 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
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 8878becd7e02a34e3986185dc6d53588a1b48e6c..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.32.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 d23d2f3a480f7be7c97aa09dfde62d05d5c3da56..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;
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 d886f24542d76885f15d5d854466af1a42bfc12d..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};
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 065acbde2cc95ea6019afc59f977305315774374..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
diff --git a/client/basic-authorship/src/lib.rs b/client/basic-authorship/src/lib.rs
index 2cb66d4ccc40b7129dc8a67762701f8245e82d1b..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
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 02d14d0d1941c1ac70a52460c9990dbaeb260e02..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.32.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 8b7fe98fc0b9d31a76d813f384717ea32a8bb8e7..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 48bad16afb677336772990404841ed1f9f08d1b9..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
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 25c7294fd1e0afa906338c85e3f6e8183da25e9a..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
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 4e1ad19fc46f57569459965b26de22681c82e3d8..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};
@@ -186,11 +186,11 @@ 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<(Option, KeystoreConfig)> {
+ fn keystore_config(&self, config_dir: &PathBuf) -> Result<(Option, KeystoreConfig)> {
self.keystore_params()
- .map(|x| x.keystore_config(base_path))
+ .map(|x| x.keystore_config(config_dir))
.unwrap_or_else(|| Ok((None, KeystoreConfig::InMemory)))
}
@@ -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);
@@ -542,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:
@@ -554,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 f03fafeb965c0bb3489972816bd7adc18192b48e..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;
@@ -33,6 +32,7 @@ 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,
@@ -64,15 +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
- /// returns a vector of remote-urls and the local Keystore configuration
- pub fn keystore_config(&self, base_path: &PathBuf) -> Result<(Option, KeystoreConfig)> {
-
+ ///
+ /// 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"))]
{
@@ -92,7 +91,7 @@ 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((self.keystore_uri.clone(), KeystoreConfig::Path { path, password }))
}
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..60aad59e8f971a85f53bbe330a91bebdbe3e658b 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
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 5696922b4fbb3006689a01f602c65554e81f8511..f0c187bd379f13071828e7fd337a82729dcb3e54 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
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 e32e45a2f314aef92ba3615c4ec615d9156cf13e..e3b94b03c87d80696dcfb714f4d63aa59cda8dc2 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
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 292d3c5162601af1ee02a0463406e62895be4fd9..bbbc8413be797923549973b54b04358f944df12b 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.
diff --git a/client/db/src/upgrade.rs b/client/db/src/upgrade.rs
index 95592d071f777db07cf15e8e2765225f0756bfb2..e87b11b69660cae962f34fa9f11ec27ee602967b 100644
--- a/client/db/src/upgrade.rs
+++ b/client/db/src/upgrade.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 .
//! Database upgrade logic.
diff --git a/client/db/src/utils.rs b/client/db/src/utils.rs
index e999469c18ff0c96f40580f0ed1192aae5a5268a..dfc1e945b3a4cfa0c3e79e1713e9c99a0b33cf91 100644
--- a/client/db/src/utils.rs
+++ b/client/db/src/utils.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/executor/common/src/error.rs b/client/executor/common/src/error.rs
index df0eaf8cc26101c7f611bf2f1ee46d07fd1fe6ee..0af148fd95809ef1d4c6de2f214fb647051d88a4 100644
--- a/client/executor/common/src/error.rs
+++ b/client/executor/common/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
diff --git a/client/executor/common/src/lib.rs b/client/executor/common/src/lib.rs
index df839d4ab65232bc0552e18864fdc2ab16903c12..050bad27d6c3056a7510ce8dd1bbebfa942b87eb 100644
--- a/client/executor/common/src/lib.rs
+++ b/client/executor/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 .
//! A set of common definitions that are needed for defining execution engines.
diff --git a/client/executor/common/src/sandbox.rs b/client/executor/common/src/sandbox.rs
index b2c35b758271829c8771034da08aee46c52dd3db..8ed294bb83983099f5363c4573d2fb0cb61529ba 100644
--- a/client/executor/common/src/sandbox.rs
+++ b/client/executor/common/src/sandbox.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/executor/common/src/util.rs b/client/executor/common/src/util.rs
index 564f9dadcbec691e1344872f330a30bd3c543740..5947be4469cd07211b54e82eb5aaacf7c59a4473 100644
--- a/client/executor/common/src/util.rs
+++ b/client/executor/common/src/util.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/executor/common/src/wasm_runtime.rs b/client/executor/common/src/wasm_runtime.rs
index c407d9967cbf9839941772f17b9f75c74a89ea48..cca0d99c4b91cb5eee9e70cf033897d7a0465780 100644
--- a/client/executor/common/src/wasm_runtime.rs
+++ b/client/executor/common/src/wasm_runtime.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 .
//! Definitions for a wasm runtime.
diff --git a/client/executor/runtime-test/build.rs b/client/executor/runtime-test/build.rs
index a83de21db7f0f387534d6feab29fbfc325474a90..9456d6bc90f4cf567d35a85765a9b0132233e2e9 100644
--- a/client/executor/runtime-test/build.rs
+++ b/client/executor/runtime-test/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 substrate_wasm_builder::WasmBuilder;
diff --git a/client/executor/src/integration_tests/mod.rs b/client/executor/src/integration_tests/mod.rs
index 0a00375145fbad9365532720ff68456ff308caea..5920d269c86e1f87586005f01919f1e63d609d8c 100644
--- a/client/executor/src/integration_tests/mod.rs
+++ b/client/executor/src/integration_tests/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/executor/src/integration_tests/sandbox.rs b/client/executor/src/integration_tests/sandbox.rs
index 447e395c2fb084aa0644504138987a673c40614d..3c964c628046540bcc441d0a8eef700dea92d85a 100644
--- a/client/executor/src/integration_tests/sandbox.rs
+++ b/client/executor/src/integration_tests/sandbox.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/executor/src/lib.rs b/client/executor/src/lib.rs
index 56a81b24b4076e39c1d66a7bc57058ae1dcd8e7d..ccb7aa1b445b222db65924526cfdf6e661017cb4 100644
--- a/client/executor/src/lib.rs
+++ b/client/executor/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/executor/src/native_executor.rs b/client/executor/src/native_executor.rs
index b5d67b9e73f4226a1c20d637c3ad7cb0dc41ea87..766dada331cd1b866a4e41a81d56454d74503104 100644
--- a/client/executor/src/native_executor.rs
+++ b/client/executor/src/native_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/executor/src/wasm_runtime.rs b/client/executor/src/wasm_runtime.rs
index 7288df35f31c42b02a6f66f1dc4222a3f60f446d..a7d8b0ce2387ef18b415ddf68e4e3dfe429f5a98 100644
--- a/client/executor/src/wasm_runtime.rs
+++ b/client/executor/src/wasm_runtime.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 .
//! Traits and accessor functions for calling into the Substrate Wasm runtime.
//!
diff --git a/client/executor/wasmi/src/lib.rs b/client/executor/wasmi/src/lib.rs
index 17b92e04950c9766253af313a115073aed634690..e6a6ef3a61039e73b06e6909ca9bee765eb937f5 100644
--- a/client/executor/wasmi/src/lib.rs
+++ b/client/executor/wasmi/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 .
//! This crate provides an implementation of `WasmModule` that is baked by wasmi.
diff --git a/client/executor/wasmtime/src/host.rs b/client/executor/wasmtime/src/host.rs
index 8d20c9a566dc8c5ad3300e4f50c8a3c4bdfdbdc4..c1eb77ff81f344728721405e316f3769783d255e 100644
--- a/client/executor/wasmtime/src/host.rs
+++ b/client/executor/wasmtime/src/host.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 .
//! This module defines `HostState` and `HostContext` structs which provide logic and state
//! required for execution of host.
diff --git a/client/executor/wasmtime/src/imports.rs b/client/executor/wasmtime/src/imports.rs
index add62df5cef45851451503ce2a00b3d2e537b45f..b5eaeae5e66cd51f1e0baa6f525430e17cd4cbe9 100644
--- a/client/executor/wasmtime/src/imports.rs
+++ b/client/executor/wasmtime/src/imports.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/executor/wasmtime/src/instance_wrapper.rs b/client/executor/wasmtime/src/instance_wrapper.rs
index 089d8cb237b56c42eb43e112d17dde718e6d94c3..2103ab9b7b98c463785aa6912f7e30576b825bd5 100644
--- a/client/executor/wasmtime/src/instance_wrapper.rs
+++ b/client/executor/wasmtime/src/instance_wrapper.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/executor/wasmtime/src/instance_wrapper/globals_snapshot.rs b/client/executor/wasmtime/src/instance_wrapper/globals_snapshot.rs
index 42935d851d95c638b22d35693d7a47d5147356cc..a6b1ed394150d86f38c952563370a1d25508c239 100644
--- a/client/executor/wasmtime/src/instance_wrapper/globals_snapshot.rs
+++ b/client/executor/wasmtime/src/instance_wrapper/globals_snapshot.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/executor/wasmtime/src/lib.rs b/client/executor/wasmtime/src/lib.rs
index 66e4e085235ac3adc2e4026679ec849d002ed94a..db7776d4c58455b7a9d1a571d8f30fbdf85477b8 100644
--- a/client/executor/wasmtime/src/lib.rs
+++ b/client/executor/wasmtime/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 .
///! Defines a `WasmRuntime` that uses the Wasmtime JIT to execute.
diff --git a/client/executor/wasmtime/src/runtime.rs b/client/executor/wasmtime/src/runtime.rs
index 965b0675357218902a50a1f8bb53e4721c7f5f35..a17a034918db74e6749e5bf4fb6102c8c365144c 100644
--- a/client/executor/wasmtime/src/runtime.rs
+++ b/client/executor/wasmtime/src/runtime.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 .
//! Defines the compiled Wasm runtime that uses Wasmtime internally.
diff --git a/client/executor/wasmtime/src/state_holder.rs b/client/executor/wasmtime/src/state_holder.rs
index 711d3bb735d7c04306525ba451f1e4be84ed9d21..0e2684cd25130b8aaffa6280a01a6281b773b4b0 100644
--- a/client/executor/wasmtime/src/state_holder.rs
+++ b/client/executor/wasmtime/src/state_holder.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/executor/wasmtime/src/util.rs b/client/executor/wasmtime/src/util.rs
index d2de95d4cc7150d6ed8768ad48181ae9f9885cb4..1437c6f8509bf0350ce65f302002dd899a7d2f22 100644
--- a/client/executor/wasmtime/src/util.rs
+++ b/client/executor/wasmtime/src/util.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 std::ops::Range;
diff --git a/client/finality-grandpa/Cargo.toml b/client/finality-grandpa/Cargo.toml
index 8966f5e8f657aa922688a10c02b7e806b9ffb6b3..d19fc18b22bd5a5453125f55bf35528553bee9ed 100644
--- a/client/finality-grandpa/Cargo.toml
+++ b/client/finality-grandpa/Cargo.toml
@@ -28,7 +28,7 @@ sp-arithmetic = { version = "2.0.0", path = "../../primitives/arithmetic" }
sp-runtime = { version = "2.0.0", path = "../../primitives/runtime" }
sp-utils = { version = "2.0.0", path = "../../primitives/utils" }
sp-consensus = { version = "0.8.0", path = "../../primitives/consensus/common" }
-sc-consensus = { version = "0.8.0", path = "../../client/consensus/common" }
+sc-consensus = { version = "0.8.0", path = "../consensus/common" }
sp-core = { version = "2.0.0", path = "../../primitives/core" }
sp-keystore = { version = "0.8.0", path = "../../primitives/keystore" }
sp-api = { version = "2.0.0", path = "../../primitives/api" }
diff --git a/client/finality-grandpa/rpc/src/error.rs b/client/finality-grandpa/rpc/src/error.rs
index 6464acbe10ea076ed637d603fbf48692509fb8e6..6122db03f880517d7ae43fbd815a76e751562c68 100644
--- a/client/finality-grandpa/rpc/src/error.rs
+++ b/client/finality-grandpa/rpc/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/finality-grandpa/rpc/src/finality.rs b/client/finality-grandpa/rpc/src/finality.rs
index 1f288b86a0e469efefcbc7b826f23c527a8344fc..9272edb39b64d5ce58934bedff6ff8a111d2e83e 100644
--- a/client/finality-grandpa/rpc/src/finality.rs
+++ b/client/finality-grandpa/rpc/src/finality.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/finality-grandpa/rpc/src/lib.rs b/client/finality-grandpa/rpc/src/lib.rs
index 172473ad6518bc90e709f9bb24ebe98058fb89de..c6e4613c4f5153f58fce2d2bacbf966fb6a91c32 100644
--- a/client/finality-grandpa/rpc/src/lib.rs
+++ b/client/finality-grandpa/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/finality-grandpa/rpc/src/notification.rs b/client/finality-grandpa/rpc/src/notification.rs
index fd03a622b21967c723bcdfb67a56bd70ffd5cdd3..4c9141be3631ae4acd359da36ecc0e6a247bd11d 100644
--- a/client/finality-grandpa/rpc/src/notification.rs
+++ b/client/finality-grandpa/rpc/src/notification.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/finality-grandpa/rpc/src/report.rs b/client/finality-grandpa/rpc/src/report.rs
index a635728cb938adf73d4ae94e1db1a63d5fcb9f50..0482d90f58f0a0bf67001d570c77686440a9f969 100644
--- a/client/finality-grandpa/rpc/src/report.rs
+++ b/client/finality-grandpa/rpc/src/report.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/finality-grandpa/src/authorities.rs b/client/finality-grandpa/src/authorities.rs
index de14c7b3ba390ab64f687e7cf897130fd86d7c4b..62a23a7ceab847fc1460333d122eb0704d020d5f 100644
--- a/client/finality-grandpa/src/authorities.rs
+++ b/client/finality-grandpa/src/authorities.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/finality-grandpa/src/aux_schema.rs b/client/finality-grandpa/src/aux_schema.rs
index 97041f4081a720a35f9de0d0479f84a6071fd69b..0146269c8f71aa27e8fc44eb5b4042542ac214dc 100644
--- a/client/finality-grandpa/src/aux_schema.rs
+++ b/client/finality-grandpa/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 stuff in the aux-db.
diff --git a/client/finality-grandpa/src/communication/gossip.rs b/client/finality-grandpa/src/communication/gossip.rs
index 276529d555ffe062a12e79b8544cc3265272467e..c217218aecc4ff09502b0ea941aebb0ce9423a16 100644
--- a/client/finality-grandpa/src/communication/gossip.rs
+++ b/client/finality-grandpa/src/communication/gossip.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 .
//! Gossip and politeness for polite-grandpa.
//!
diff --git a/client/finality-grandpa/src/communication/mod.rs b/client/finality-grandpa/src/communication/mod.rs
index 29fe8bc7471a0b74ac91e41bd77ad0cef832617f..77d2d15e5d0209e89ba86dbb2697096f8619f279 100644
--- a/client/finality-grandpa/src/communication/mod.rs
+++ b/client/finality-grandpa/src/communication/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
@@ -846,7 +846,7 @@ fn check_catch_up(
}
Ok(())
- };
+ }
check_weight(
voters,
diff --git a/client/finality-grandpa/src/communication/periodic.rs b/client/finality-grandpa/src/communication/periodic.rs
index dadd7deb57fca1d34dd01baf0d434533f1a99fbe..377882ed5dd2d5d4bb2136fbd5314e0d557b890c 100644
--- a/client/finality-grandpa/src/communication/periodic.rs
+++ b/client/finality-grandpa/src/communication/periodic.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 .
//! Periodic rebroadcast of neighbor packets.
diff --git a/client/finality-grandpa/src/communication/tests.rs b/client/finality-grandpa/src/communication/tests.rs
index 27a394a062bc8b99eca9f6af6022f681238991f7..d7db68d0652b1d59db3d06f4838ba0a9ef12b051 100644
--- a/client/finality-grandpa/src/communication/tests.rs
+++ b/client/finality-grandpa/src/communication/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 .
//! Tests for the communication portion of the GRANDPA crate.
diff --git a/client/finality-grandpa/src/environment.rs b/client/finality-grandpa/src/environment.rs
index 790be2a22178878dade0e4961193eade7703df41..5e4203b2a40f634ffd8a2179e8d1ff494ccfd402 100644
--- a/client/finality-grandpa/src/environment.rs
+++ b/client/finality-grandpa/src/environment.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/finality-grandpa/src/finality_proof.rs b/client/finality-grandpa/src/finality_proof.rs
index bf367ab3f4a55e4d6c5e7c06efec686abd46414a..bd29b18bae12a0f5201283d7080e0102e14896e3 100644
--- a/client/finality-grandpa/src/finality_proof.rs
+++ b/client/finality-grandpa/src/finality_proof.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/finality-grandpa/src/import.rs b/client/finality-grandpa/src/import.rs
index 89f9d0c16ad7c6d0b52fb8d08a46b5795d7bf646..d9630e272ef9c0345ce555fbea100cae00f9b5ea 100644
--- a/client/finality-grandpa/src/import.rs
+++ b/client/finality-grandpa/src/import.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
@@ -25,7 +25,7 @@ use parking_lot::RwLockWriteGuard;
use sp_blockchain::{BlockStatus, well_known_cache_keys};
use sc_client_api::{backend::Backend, utils::is_descendent_of};
use sp_utils::mpsc::TracingUnboundedSender;
-use sp_api::{TransactionFor};
+use sp_api::TransactionFor;
use sp_consensus::{
BlockImport, Error as ConsensusError,
diff --git a/client/finality-grandpa/src/justification.rs b/client/finality-grandpa/src/justification.rs
index d5ca92d50e9371cf76e80945b69edc3c3f9e3c13..9429acff06d8ce9f160bc78de66bf16032a79918 100644
--- a/client/finality-grandpa/src/justification.rs
+++ b/client/finality-grandpa/src/justification.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/finality-grandpa/src/lib.rs b/client/finality-grandpa/src/lib.rs
index 0757a484afb4a624ea35e93c5321907668ac691b..0c38d796197c398bfba578974c1ef1f35375535d 100644
--- a/client/finality-grandpa/src/lib.rs
+++ b/client/finality-grandpa/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/client/finality-grandpa/src/notification.rs b/client/finality-grandpa/src/notification.rs
index 8415583051902330a99f5c4cb723311045844ed8..b545f0d8a637e8948939e02e2c2d8003af624524 100644
--- a/client/finality-grandpa/src/notification.rs
+++ b/client/finality-grandpa/src/notification.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/finality-grandpa/src/observer.rs b/client/finality-grandpa/src/observer.rs
index c61998225e32300f542f256f70acdc0aa20102a7..c9db917e1699a89f11c816e6b8edbc7a4f54fc47 100644
--- a/client/finality-grandpa/src/observer.rs
+++ b/client/finality-grandpa/src/observer.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/finality-grandpa/src/tests.rs b/client/finality-grandpa/src/tests.rs
index 452b30941de5cb5f5ab9a4d86106df2af76dbc22..1ee71dddc4d4f6fb08e96ca18d3a6cc5e5af85fe 100644
--- a/client/finality-grandpa/src/tests.rs
+++ b/client/finality-grandpa/src/tests.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
@@ -1068,7 +1068,7 @@ fn voter_persists_its_votes() {
drop(_block_import);
r
})
- };
+ }
runtime.spawn(alice_voter1);
@@ -1110,7 +1110,7 @@ fn voter_persists_its_votes() {
let runtime_handle = runtime_handle.clone();
async move {
- if state.compare_and_swap(0, 1, Ordering::SeqCst) == 0 {
+ if state.compare_exchange(0, 1, Ordering::SeqCst, Ordering::SeqCst).unwrap() == 0 {
// the first message we receive should be a prevote from alice.
let prevote = match signed.message {
finality_grandpa::Message::Prevote(prevote) => prevote,
@@ -1156,7 +1156,7 @@ fn voter_persists_its_votes() {
// we send in a loop including a delay until items are received, this can be
// ignored for the sake of reduced complexity.
Pin::new(&mut *round_tx.lock()).start_send(finality_grandpa::Message::Prevote(prevote)).unwrap();
- } else if state.compare_and_swap(1, 2, Ordering::SeqCst) == 1 {
+ } else if state.compare_exchange(1, 2, Ordering::SeqCst, Ordering::SeqCst).unwrap() == 1 {
// the next message we receive should be our own prevote
let prevote = match signed.message {
finality_grandpa::Message::Prevote(prevote) => prevote,
@@ -1170,7 +1170,7 @@ fn voter_persists_its_votes() {
// therefore we won't ever receive it again since it will be a
// known message on the gossip layer
- } else if state.compare_and_swap(2, 3, Ordering::SeqCst) == 2 {
+ } else if state.compare_exchange(2, 3, Ordering::SeqCst, Ordering::SeqCst).unwrap() == 2 {
// we then receive a precommit from alice for block 15
// even though we casted a prevote for block 30
let precommit = match signed.message {
diff --git a/client/finality-grandpa/src/until_imported.rs b/client/finality-grandpa/src/until_imported.rs
index 3ac94f3b062f0273f975e714c7318b9539243dae..c27eab5351562557ee1fc1a182b98ba6211d859a 100644
--- a/client/finality-grandpa/src/until_imported.rs
+++ b/client/finality-grandpa/src/until_imported.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/finality-grandpa/src/voting_rule.rs b/client/finality-grandpa/src/voting_rule.rs
index 700b0aeb551cd2a647b8722c4ab148bc7885cd52..a861e792755feaed872caff1cc644ceab751e8b8 100644
--- a/client/finality-grandpa/src/voting_rule.rs
+++ b/client/finality-grandpa/src/voting_rule.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/informant/src/display.rs b/client/informant/src/display.rs
index 5c8f5f8ef84aa4354238cb4d02fa7b53896b96b1..0caef4e5fbae8fabc2c0a9b92ccc272d181b407c 100644
--- a/client/informant/src/display.rs
+++ b/client/informant/src/display.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 crate::OutputFormat;
use ansi_term::Colour;
diff --git a/client/informant/src/lib.rs b/client/informant/src/lib.rs
index d4f34cb488a9789eaa36223dd1a077bf071164c5..c955834c0f111dbcce7850b99cb259666ad79197 100644
--- a/client/informant/src/lib.rs
+++ b/client/informant/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/keystore/src/lib.rs b/client/keystore/src/lib.rs
index 0b6d654bc623ecda634b3612ac0df9350a342a28..9cad56efacfd66eb8aac3af9790957f15d02175b 100644
--- a/client/keystore/src/lib.rs
+++ b/client/keystore/src/lib.rs
@@ -1,18 +1,20 @@
-// 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) 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 .
//! Keystore (and session key management) for ed25519 based chains like Polkadot.
diff --git a/client/keystore/src/local.rs b/client/keystore/src/local.rs
index a31e3e1f1e402df5bae884de80993d1f1fdcb630..866a50ae4c93ce43f7382db0053006a9dbabe35b 100644
--- a/client/keystore/src/local.rs
+++ b/client/keystore/src/local.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");
@@ -167,9 +167,7 @@ impl SyncCryptoStore for LocalKeystore {
let all_keys = SyncCryptoStore::keys(self, id)?
.into_iter()
.collect::>();
- Ok(keys.into_iter()
- .filter(|key| all_keys.contains(key))
- .collect::>())
+ Ok(keys.into_iter().filter(|key| all_keys.contains(key)).collect::>())
}
fn sign_with(
diff --git a/client/light/src/backend.rs b/client/light/src/backend.rs
index 74e1d613bcf56ae80b652cef2358fb45927b850c..27e0754eb552e9b29b364e9307436ff5c031af81 100644
--- a/client/light/src/backend.rs
+++ b/client/light/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/light/src/blockchain.rs b/client/light/src/blockchain.rs
index 3b5753f2849d51c8199d98debb99bf8e440386f0..f682e6e35b3d098c6d913cc79a96acaf821ded5e 100644
--- a/client/light/src/blockchain.rs
+++ b/client/light/src/blockchain.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/light/src/call_executor.rs b/client/light/src/call_executor.rs
index 458ea2bd6b844b5b430f08823f94f283a785ad87..7115f24a77d67168ecebbced1c52cee9ec1488c1 100644
--- a/client/light/src/call_executor.rs
+++ b/client/light/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/light/src/fetcher.rs b/client/light/src/fetcher.rs
index 60fce87b8d0c26ecddbdf22d2ebd09e08060a696..b71c4871803da4fa907959cefc924333912c2ef4 100644
--- a/client/light/src/fetcher.rs
+++ b/client/light/src/fetcher.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/light/src/lib.rs b/client/light/src/lib.rs
index 899d1ae31a3dd951a89090a0ed69cc6e5fb71f5f..e647b8743cc0f8865a84b793f9f6fc621dfda8a9 100644
--- a/client/light/src/lib.rs
+++ b/client/light/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/network-gossip/Cargo.toml b/client/network-gossip/Cargo.toml
index 5b82bd679c0112b6f23cc61c4245d419dd1e757c..5c3990d320bb08cd62896d2b110ea1ffc3ec44c5 100644
--- a/client/network-gossip/Cargo.toml
+++ b/client/network-gossip/Cargo.toml
@@ -17,7 +17,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
futures = "0.3.4"
futures-timer = "3.0.1"
-libp2p = { version = "0.32.2", default-features = false }
+libp2p = { version = "0.33.0", default-features = false }
log = "0.4.8"
lru = "0.6.1"
sc-network = { version = "0.8.0", path = "../network" }
diff --git a/client/network-gossip/src/bridge.rs b/client/network-gossip/src/bridge.rs
index 4deaad6d748fd13f7dc11f3f8d41fcfe77976862..9f1813f2224434ae82c7f7da1c35f8469a57c5f7 100644
--- a/client/network-gossip/src/bridge.rs
+++ b/client/network-gossip/src/bridge.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 crate::{Network, Validator};
use crate::state_machine::{ConsensusGossip, TopicNotification, PERIODIC_MAINTENANCE_INTERVAL};
diff --git a/client/network-gossip/src/lib.rs b/client/network-gossip/src/lib.rs
index 2b333610223e2a19c0c4553b8973eb77e65919ee..81575bdc774e97d83b06262211ad7051ec8f1075 100644
--- a/client/network-gossip/src/lib.rs
+++ b/client/network-gossip/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 .
//! Polite gossiping.
//!
diff --git a/client/network-gossip/src/state_machine.rs b/client/network-gossip/src/state_machine.rs
index 88f9d48375dec9e7c834651b87666fd2c7ad9717..7ae630a972326a5863215fccdf0ff04205172752 100644
--- a/client/network-gossip/src/state_machine.rs
+++ b/client/network-gossip/src/state_machine.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/network-gossip/src/validator.rs b/client/network-gossip/src/validator.rs
index fd29aaddafe6dcd89f2e722bdcfa07854fc04225..4b5440c1a06f3c7d7f6fa38b84a64a87e3543629 100644
--- a/client/network-gossip/src/validator.rs
+++ b/client/network-gossip/src/validator.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/network/Cargo.toml b/client/network/Cargo.toml
index b7cb1512dd45a2d09f5a3f0cb0298cd4f4d5c1f4..a300dac19bfccad7563cb6e02b3757dbfc388ae8 100644
--- a/client/network/Cargo.toml
+++ b/client/network/Cargo.toml
@@ -36,7 +36,6 @@ ip_network = "0.3.4"
linked-hash-map = "0.5.2"
linked_hash_set = "0.1.3"
log = "0.4.8"
-lru = "0.6.1"
nohash-hasher = "0.2.0"
parking_lot = "0.11.1"
pin-project = "0.4.6"
@@ -64,13 +63,13 @@ wasm-timer = "0.2"
zeroize = "1.2.0"
[dependencies.libp2p]
-version = "0.32.2"
+version = "0.33.0"
default-features = false
features = ["identify", "kad", "mdns", "mplex", "noise", "ping", "request-response", "tcp-async-std", "websocket", "yamux"]
[dev-dependencies]
assert_matches = "1.3"
-libp2p = { version = "0.32.2", default-features = false }
+libp2p = { version = "0.33.0", default-features = false }
quickcheck = "0.9.0"
rand = "0.7.2"
sp-keyring = { version = "2.0.0", path = "../../primitives/keyring" }
diff --git a/client/network/src/behaviour.rs b/client/network/src/behaviour.rs
index 8b9e321ca599bcda0022b6b36bfcfd623cf72739..a7366d00e7cfb8ded3cd28b861d9eeac30414097 100644
--- a/client/network/src/behaviour.rs
+++ b/client/network/src/behaviour.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 crate::{
config::{ProtocolId, Role}, block_requests, light_client_handler,
@@ -88,7 +90,7 @@ pub enum BehaviourOut {
protocol: Cow<'static, str>,
/// If `Ok`, contains the time elapsed between when we received the request and when we
/// sent back the response. If `Err`, the error that happened.
- result: Result