diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b4933333b3418..d1de666009bf1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -47,7 +47,8 @@ variables: &default-vars
CARGO_INCREMENTAL: 0
DOCKER_OS: "debian:stretch"
ARCH: "x86_64"
- CI_IMAGE: "paritytech/ci-linux:production"
+ # change to production when this image is published
+ CI_IMAGE: "paritytech/ci-linux:staging@sha256:2c90b67f1452ed2d7236c2cd13f6224053a833d521b3630650b679f00874e0a9"
RUSTY_CACHIER_SINGLE_BRANCH: master
RUSTY_CACHIER_DONT_OPERATE_ON_MAIN_BRANCH: "true"
@@ -196,7 +197,6 @@ include:
# publish jobs
- scripts/ci/gitlab/pipeline/publish.yml
-
#### stage: deploy
deploy-prometheus-alerting-rules:
@@ -223,10 +223,16 @@ deploy-prometheus-alerting-rules:
# This job notifies rusty-cachier about the latest commit with the cache.
# This info is later used for the cache distribution and an overlay creation.
+# Note that we don't use any .rusty-cachier references as we assume that a pipeline has reached this stage with working rusty-cachier.
rusty-cachier-notify:
stage: notify
- extends: .docker-env
+ extends: .kubernetes-env
+ variables:
+ CI_IMAGE: paritytech/rusty-cachier-env:latest
+ GIT_STRATEGY: none
+ dependencies: []
script:
+ - curl -s https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.parity.io/parity/infrastructure/ci_cd/rusty-cachier/client/-/raw/release/util/install.sh | bash
- rusty-cachier cache notify
#### stage: .post
@@ -234,23 +240,42 @@ rusty-cachier-notify:
# This job cancels the whole pipeline if any of provided jobs fail.
# In a DAG, every jobs chain is executed independently of others. The `fail_fast` principle suggests
# to fail the pipeline as soon as possible to shorten the feedback loop.
-cancel-pipeline:
+.cancel-pipeline-template:
stage: .post
+ rules:
+ - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
+ when: on_failure
+ variables:
+ PROJECT_ID: "${CI_PROJECT_ID}"
+ PIPELINE_ID: "${CI_PIPELINE_ID}"
+ trigger: "parity/infrastructure/ci_cd/pipeline-stopper"
+
+cancel-pipeline-test-linux-stable:
+ extends: .cancel-pipeline-template
needs:
- job: test-linux-stable
artifacts: false
+
+cancel-pipeline-test-linux-stable-int:
+ extends: .cancel-pipeline-template
+ needs:
- job: test-linux-stable-int
artifacts: false
+
+cancel-pipeline-cargo-check-subkey:
+ extends: .cancel-pipeline-template
+ needs:
- job: cargo-check-subkey
artifacts: false
+
+cancel-pipeline-cargo-check-benches:
+ extends: .cancel-pipeline-template
+ needs:
- job: cargo-check-benches
artifacts: false
+
+cancel-pipeline-check-tracing:
+ extends: .cancel-pipeline-template
+ needs:
- job: check-tracing
artifacts: false
- rules:
- - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- when: on_failure
- variables:
- PROJECT_ID: "${CI_PROJECT_ID}"
- PIPELINE_ID: "${CI_PIPELINE_ID}"
- trigger: "parity/infrastructure/ci_cd/pipeline-stopper"
diff --git a/Cargo.lock b/Cargo.lock
index d68330cfb15c2..50603c6235a23 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -230,7 +230,7 @@ dependencies = [
"parking",
"polling",
"slab",
- "socket2 0.4.4",
+ "socket2",
"waker-fn",
"winapi",
]
@@ -310,7 +310,7 @@ dependencies = [
"futures-io",
"futures-util",
"pin-utils",
- "socket2 0.4.4",
+ "socket2",
"trust-dns-resolver",
]
@@ -382,12 +382,6 @@ dependencies = [
"winapi",
]
-[[package]]
-name = "autocfg"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2"
-
[[package]]
name = "autocfg"
version = "1.0.1"
@@ -512,7 +506,7 @@ name = "beefy-merkle-tree"
version = "4.0.0-dev"
dependencies = [
"beefy-primitives",
- "env_logger 0.9.0",
+ "env_logger",
"hex",
"hex-literal",
"log",
@@ -1005,7 +999,7 @@ version = "3.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c"
dependencies = [
- "heck 0.4.0",
+ "heck",
"proc-macro-error",
"proc-macro2",
"quote",
@@ -1021,15 +1015,6 @@ dependencies = [
"os_str_bytes",
]
-[[package]]
-name = "cloudabi"
-version = "0.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
-dependencies = [
- "bitflags",
-]
-
[[package]]
name = "cmake"
version = "0.1.46"
@@ -1041,9 +1026,9 @@ dependencies = [
[[package]]
name = "comfy-table"
-version = "5.0.1"
+version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b103d85ca6e209388771bfb7aa6b68a7aeec4afbf6f0a0264bfbf50360e5212e"
+checksum = "121d8a5b0346092c18a4b2fd6f620d7a06f0eb7ac0a45860939a0884bc579c56"
dependencies = [
"strum",
"strum_macros",
@@ -1831,7 +1816,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73"
dependencies = [
- "heck 0.4.0",
+ "heck",
"proc-macro2",
"quote",
"syn",
@@ -1898,19 +1883,6 @@ dependencies = [
"syn",
]
-[[package]]
-name = "env_logger"
-version = "0.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
-dependencies = [
- "atty",
- "humantime 1.3.0",
- "log",
- "regex",
- "termcolor",
-]
-
[[package]]
name = "env_logger"
version = "0.9.0"
@@ -1918,7 +1890,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3"
dependencies = [
"atty",
- "humantime 2.1.0",
+ "humantime",
"log",
"regex",
"termcolor",
@@ -2008,11 +1980,11 @@ dependencies = [
[[package]]
name = "file-per-thread-logger"
-version = "0.1.4"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fdbe0d94371f9ce939b555dd342d0686cc4c0cadbcd4b61d70af5ff97eb4126"
+checksum = "21e16290574b39ee41c71aeb90ae960c504ebaf1e2a1c87bd52aa56ed6e1a02f"
dependencies = [
- "env_logger 0.7.1",
+ "env_logger",
"log",
]
@@ -2445,12 +2417,6 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
-[[package]]
-name = "fuchsia-cprng"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
-
[[package]]
name = "funty"
version = "2.0.0"
@@ -2751,9 +2717,9 @@ dependencies = [
[[package]]
name = "h2"
-version = "0.3.9"
+version = "0.3.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f072413d126e57991455e0a922b31e4c8ba7c2ffbebf6b78b4f8521397d65cd"
+checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57"
dependencies = [
"bytes",
"fnv",
@@ -2764,7 +2730,7 @@ dependencies = [
"indexmap",
"slab",
"tokio",
- "tokio-util 0.6.7",
+ "tokio-util",
"tracing",
]
@@ -2821,15 +2787,6 @@ dependencies = [
"ahash",
]
-[[package]]
-name = "heck"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac"
-dependencies = [
- "unicode-segmentation",
-]
-
[[package]]
name = "heck"
version = "0.4.0"
@@ -2950,15 +2907,6 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440"
-[[package]]
-name = "humantime"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
-dependencies = [
- "quick-error 1.2.3",
-]
-
[[package]]
name = "humantime"
version = "2.1.0"
@@ -2982,7 +2930,7 @@ dependencies = [
"httpdate",
"itoa 0.4.8",
"pin-project-lite 0.2.6",
- "socket2 0.4.4",
+ "socket2",
"tokio",
"tower-service",
"tracing",
@@ -3084,7 +3032,7 @@ version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg",
"hashbrown 0.11.2",
"serde",
]
@@ -3131,7 +3079,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "723519edce41262b05d4143ceb95050e4c614f483e78e9fd9e39a8275a84ad98"
dependencies = [
- "socket2 0.4.4",
+ "socket2",
"widestring",
"winapi",
"winreg",
@@ -3207,13 +3155,13 @@ dependencies = [
"http",
"jsonrpsee-core",
"jsonrpsee-types",
- "pin-project 1.0.10",
+ "pin-project",
"rustls-native-certs",
"soketto",
"thiserror",
"tokio",
"tokio-rustls",
- "tokio-util 0.7.1",
+ "tokio-util",
"tracing",
"webpki-roots",
]
@@ -3316,7 +3264,7 @@ dependencies = [
"soketto",
"tokio",
"tokio-stream",
- "tokio-util 0.7.1",
+ "tokio-util",
"tracing",
]
@@ -3461,9 +3409,9 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a"
[[package]]
name = "libp2p"
-version = "0.45.1"
+version = "0.46.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41726ee8f662563fafba2d2d484b14037cc8ecb8c953fbfc8439d4ce3a0a9029"
+checksum = "81327106887e42d004fbdab1fef93675be2e2e07c1b95fce45e2cc813485611d"
dependencies = [
"bytes",
"futures",
@@ -3472,7 +3420,7 @@ dependencies = [
"instant",
"lazy_static",
"libp2p-autonat",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"libp2p-deflate",
"libp2p-dns",
"libp2p-floodsub",
@@ -3498,69 +3446,35 @@ dependencies = [
"libp2p-yamux",
"multiaddr",
"parking_lot 0.12.0",
- "pin-project 1.0.10",
+ "pin-project",
"rand 0.7.3",
"smallvec",
]
[[package]]
name = "libp2p-autonat"
-version = "0.4.0"
+version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50de7c1d5c3f040fccb469e8a2d189e068b7627d760dd74ef914071c16bbe905"
+checksum = "4decc51f3573653a9f4ecacb31b1b922dd20c25a6322bb15318ec04287ec46f9"
dependencies = [
"async-trait",
"futures",
"futures-timer",
"instant",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"libp2p-request-response",
"libp2p-swarm",
"log",
- "prost 0.10.3",
- "prost-build 0.10.4",
- "rand 0.8.4",
-]
-
-[[package]]
-name = "libp2p-core"
-version = "0.32.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db5b02602099fb75cb2d16f9ea860a320d6eb82ce41e95ab680912c454805cd5"
-dependencies = [
- "asn1_der",
- "bs58",
- "ed25519-dalek",
- "either",
- "fnv",
- "futures",
- "futures-timer",
- "instant",
- "lazy_static",
- "log",
- "multiaddr",
- "multihash",
- "multistream-select",
- "parking_lot 0.12.0",
- "pin-project 1.0.10",
- "prost 0.9.0",
- "prost-build 0.9.0",
+ "prost",
+ "prost-build",
"rand 0.8.4",
- "ring",
- "rw-stream-sink 0.2.1",
- "sha2 0.10.2",
- "smallvec",
- "thiserror",
- "unsigned-varint",
- "void",
- "zeroize",
]
[[package]]
name = "libp2p-core"
-version = "0.33.0"
+version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42d46fca305dee6757022e2f5a4f6c023315084d0ed7441c3ab244e76666d979"
+checksum = "fbf9b94cefab7599b2d3dff2f93bee218c6621d68590b23ede4485813cbcece6"
dependencies = [
"asn1_der",
"bs58",
@@ -3577,12 +3491,12 @@ dependencies = [
"multihash",
"multistream-select",
"parking_lot 0.12.0",
- "pin-project 1.0.10",
- "prost 0.10.3",
- "prost-build 0.10.4",
+ "pin-project",
+ "prost",
+ "prost-build",
"rand 0.8.4",
"ring",
- "rw-stream-sink 0.3.0",
+ "rw-stream-sink",
"sha2 0.10.2",
"smallvec",
"thiserror",
@@ -3593,24 +3507,24 @@ dependencies = [
[[package]]
name = "libp2p-deflate"
-version = "0.33.0"
+version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86adefc55ea4ed8201149f052fb441210727481dff1fb0b8318460206a79f5fb"
+checksum = "d0183dc2a3da1fbbf85e5b6cf51217f55b14f5daea0c455a9536eef646bfec71"
dependencies = [
"flate2",
"futures",
- "libp2p-core 0.33.0",
+ "libp2p-core",
]
[[package]]
name = "libp2p-dns"
-version = "0.33.0"
+version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbb462ec3a51fab457b4b44ac295e8b0a4b04dc175127e615cf996b1f0f1a268"
+checksum = "6cbf54723250fa5d521383be789bf60efdabe6bacfb443f87da261019a49b4b5"
dependencies = [
"async-std-resolver",
"futures",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"log",
"parking_lot 0.12.0",
"smallvec",
@@ -3619,27 +3533,27 @@ dependencies = [
[[package]]
name = "libp2p-floodsub"
-version = "0.36.0"
+version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a505d0c6f851cbf2919535150198e530825def8bd3757477f13dc3a57f46cbcc"
+checksum = "98a4b6ffd53e355775d24b76f583fdda54b3284806f678499b57913adb94f231"
dependencies = [
"cuckoofilter",
"fnv",
"futures",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"libp2p-swarm",
"log",
- "prost 0.10.3",
- "prost-build 0.10.4",
+ "prost",
+ "prost-build",
"rand 0.7.3",
"smallvec",
]
[[package]]
name = "libp2p-gossipsub"
-version = "0.38.0"
+version = "0.39.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9be947d8cea8e6b469201314619395826896d2c051053c3723910ba98e68e04"
+checksum = "74b4b888cfbeb1f5551acd3aa1366e01bf88ede26cc3c4645d0d2d004d5ca7b0"
dependencies = [
"asynchronous-codec",
"base64",
@@ -3649,12 +3563,12 @@ dependencies = [
"futures",
"hex_fmt",
"instant",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"libp2p-swarm",
"log",
"prometheus-client",
- "prost 0.10.3",
- "prost-build 0.10.4",
+ "prost",
+ "prost-build",
"rand 0.7.3",
"regex",
"sha2 0.10.2",
@@ -3665,19 +3579,19 @@ dependencies = [
[[package]]
name = "libp2p-identify"
-version = "0.36.1"
+version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b84b53490442d086db1fa5375670c9666e79143dccadef3f7c74a4346899a984"
+checksum = "c50b585518f8efd06f93ac2f976bd672e17cdac794644b3117edd078e96bda06"
dependencies = [
"asynchronous-codec",
"futures",
"futures-timer",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"libp2p-swarm",
"log",
"lru",
- "prost 0.10.3",
- "prost-build 0.10.4",
+ "prost",
+ "prost-build",
"prost-codec",
"smallvec",
"thiserror",
@@ -3686,9 +3600,9 @@ dependencies = [
[[package]]
name = "libp2p-kad"
-version = "0.37.1"
+version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5f6b5d4de90fcd35feb65ea6223fd78f3b747a64ca4b65e0813fbe66a27d56aa"
+checksum = "740862893bb5f06ac24acc9d49bdeadc3a5e52e51818a30a25c1f3519da2c851"
dependencies = [
"arrayvec 0.7.2",
"asynchronous-codec",
@@ -3698,11 +3612,11 @@ dependencies = [
"futures",
"futures-timer",
"instant",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"libp2p-swarm",
"log",
- "prost 0.10.3",
- "prost-build 0.10.4",
+ "prost",
+ "prost-build",
"rand 0.7.3",
"sha2 0.10.2",
"smallvec",
@@ -3714,9 +3628,9 @@ dependencies = [
[[package]]
name = "libp2p-mdns"
-version = "0.37.0"
+version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4783f8cf00c7b6c1ff0f1870b4fcf50b042b45533d2e13b6fb464caf447a6951"
+checksum = "66e5e5919509603281033fd16306c61df7a4428ce274b67af5e14b07de5cdcb2"
dependencies = [
"async-io",
"data-encoding",
@@ -3724,22 +3638,22 @@ dependencies = [
"futures",
"if-watch",
"lazy_static",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"libp2p-swarm",
"log",
"rand 0.8.4",
"smallvec",
- "socket2 0.4.4",
+ "socket2",
"void",
]
[[package]]
name = "libp2p-metrics"
-version = "0.6.0"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "adc4357140141ba9739eee71b20aa735351c0fc642635b2bffc7f57a6b5c1090"
+checksum = "ef8aff4a1abef42328fbb30b17c853fff9be986dc39af17ee39f9c5f755c5e0c"
dependencies = [
- "libp2p-core 0.33.0",
+ "libp2p-core",
"libp2p-gossipsub",
"libp2p-identify",
"libp2p-kad",
@@ -3751,14 +3665,14 @@ dependencies = [
[[package]]
name = "libp2p-mplex"
-version = "0.33.0"
+version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ff9c893f2367631a711301d703c47432af898c9bb8253bea0e2c051a13f7640"
+checksum = "61fd1b20638ec209c5075dfb2e8ce6a7ea4ec3cd3ad7b77f7a477c06d53322e2"
dependencies = [
"asynchronous-codec",
"bytes",
"futures",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"log",
"nohash-hasher",
"parking_lot 0.12.0",
@@ -3769,18 +3683,18 @@ dependencies = [
[[package]]
name = "libp2p-noise"
-version = "0.36.0"
+version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf2cee1dad1c83325bbd182a8e94555778699cec8a9da00086efb7522c4c15ad"
+checksum = "762408cb5d84b49a600422d7f9a42c18012d8da6ebcd570f9a4a4290ba41fb6f"
dependencies = [
"bytes",
"curve25519-dalek 3.0.2",
"futures",
"lazy_static",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"log",
- "prost 0.10.3",
- "prost-build 0.10.4",
+ "prost",
+ "prost-build",
"rand 0.8.4",
"sha2 0.10.2",
"snow",
@@ -3791,14 +3705,14 @@ dependencies = [
[[package]]
name = "libp2p-ping"
-version = "0.36.0"
+version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d41516c82fe8dd148ec925eead0c5ec08a0628f7913597e93e126e4dfb4e0787"
+checksum = "100a6934ae1dbf8a693a4e7dd1d730fd60b774dafc45688ed63b554497c6c925"
dependencies = [
"futures",
"futures-timer",
"instant",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"libp2p-swarm",
"log",
"rand 0.7.3",
@@ -3807,17 +3721,17 @@ dependencies = [
[[package]]
name = "libp2p-plaintext"
-version = "0.33.0"
+version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db007e737adc5d28b2e03223b0210164928ad742591127130796a72aa8eaf54f"
+checksum = "be27bf0820a6238a4e06365b096d428271cce85a129cf16f2fe9eb1610c4df86"
dependencies = [
"asynchronous-codec",
"bytes",
"futures",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"log",
- "prost 0.10.3",
- "prost-build 0.10.4",
+ "prost",
+ "prost-build",
"unsigned-varint",
"void",
]
@@ -3830,7 +3744,7 @@ checksum = "0f1a458bbda880107b5b36fcb9b5a1ef0c329685da0e203ed692a8ebe64cc92c"
dependencies = [
"futures",
"log",
- "pin-project 1.0.10",
+ "pin-project",
"rand 0.7.3",
"salsa20",
"sha3 0.9.1",
@@ -3838,9 +3752,9 @@ dependencies = [
[[package]]
name = "libp2p-relay"
-version = "0.9.1"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "624ead3406f64437a0d4567c31bd128a9a0b8226d5f16c074038f5d0fc32f650"
+checksum = "4931547ee0cce03971ccc1733ff05bb0c4349fd89120a39e9861e2bbe18843c3"
dependencies = [
"asynchronous-codec",
"bytes",
@@ -3848,12 +3762,12 @@ dependencies = [
"futures",
"futures-timer",
"instant",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"libp2p-swarm",
"log",
- "pin-project 1.0.10",
- "prost 0.10.3",
- "prost-build 0.10.4",
+ "pin-project",
+ "prost",
+ "prost-build",
"prost-codec",
"rand 0.8.4",
"smallvec",
@@ -3864,20 +3778,20 @@ dependencies = [
[[package]]
name = "libp2p-rendezvous"
-version = "0.6.0"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c59967ea2db2c7560f641aa58ac05982d42131863fcd3dd6dcf0dd1daf81c60c"
+checksum = "9511c9672ba33284838e349623319c8cad2d18cfad243ae46c6b7e8a2982ea4e"
dependencies = [
"asynchronous-codec",
"bimap",
"futures",
"futures-timer",
"instant",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"libp2p-swarm",
"log",
- "prost 0.10.3",
- "prost-build 0.10.4",
+ "prost",
+ "prost-build",
"rand 0.8.4",
"sha2 0.10.2",
"thiserror",
@@ -3887,15 +3801,15 @@ dependencies = [
[[package]]
name = "libp2p-request-response"
-version = "0.18.0"
+version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b02e0acb725e5a757d77c96b95298fd73a7394fe82ba7b8bbeea510719cbe441"
+checksum = "508a189e2795d892c8f5c1fa1e9e0b1845d32d7b0b249dbf7b05b18811361843"
dependencies = [
"async-trait",
"bytes",
"futures",
"instant",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"libp2p-swarm",
"log",
"rand 0.7.3",
@@ -3905,18 +3819,18 @@ dependencies = [
[[package]]
name = "libp2p-swarm"
-version = "0.36.1"
+version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f4bb21c5abadbf00360c734f16bf87f1712ed4f23cd46148f625d2ddb867346"
+checksum = "95ac5be6c2de2d1ff3f7693fda6faf8a827b1f3e808202277783fea9f527d114"
dependencies = [
"either",
"fnv",
"futures",
"futures-timer",
"instant",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"log",
- "pin-project 1.0.10",
+ "pin-project",
"rand 0.7.3",
"smallvec",
"thiserror",
@@ -3925,9 +3839,9 @@ dependencies = [
[[package]]
name = "libp2p-swarm-derive"
-version = "0.27.1"
+version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "daf2fe8c80b43561355f4d51875273b5b6dfbac37952e8f64b1270769305c9d7"
+checksum = "9f54a64b6957249e0ce782f8abf41d97f69330d02bf229f0672d864f0650cc76"
dependencies = [
"quote",
"syn",
@@ -3935,9 +3849,9 @@ dependencies = [
[[package]]
name = "libp2p-tcp"
-version = "0.33.0"
+version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4f4933e38ef21b50698aefc87799c24f2a365c9d3f6cf50471f3f6a0bc410892"
+checksum = "8a6771dc19aa3c65d6af9a8c65222bfc8fcd446630ddca487acd161fa6096f3b"
dependencies = [
"async-io",
"futures",
@@ -3945,32 +3859,32 @@ dependencies = [
"if-watch",
"ipnet",
"libc",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"log",
- "socket2 0.4.4",
+ "socket2",
]
[[package]]
name = "libp2p-uds"
-version = "0.32.0"
+version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24bdab114f7f2701757d6541266e1131b429bbae382008f207f2114ee4222dcb"
+checksum = "d125e3e5f0d58f3c6ac21815b20cf4b6a88b8db9dc26368ea821838f4161fd4d"
dependencies = [
"async-std",
"futures",
- "libp2p-core 0.32.1",
+ "libp2p-core",
"log",
]
[[package]]
name = "libp2p-wasm-ext"
-version = "0.33.0"
+version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f066f2b8b1a1d64793f05da2256e6842ecd0293d6735ca2e9bda89831a1bdc06"
+checksum = "ec894790eec3c1608f8d1a8a0bdf0dbeb79ed4de2dce964222011c2896dfa05a"
dependencies = [
"futures",
"js-sys",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"parity-send-wrapper",
"wasm-bindgen",
"wasm-bindgen-futures",
@@ -3978,18 +3892,18 @@ dependencies = [
[[package]]
name = "libp2p-websocket"
-version = "0.35.0"
+version = "0.36.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39d398fbb29f432c4128fabdaac2ed155c3bcaf1b9bd40eeeb10a471eefacbf5"
+checksum = "9808e57e81be76ff841c106b4c5974fb4d41a233a7bdd2afbf1687ac6def3818"
dependencies = [
"either",
"futures",
"futures-rustls",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"log",
"parking_lot 0.12.0",
"quicksink",
- "rw-stream-sink 0.3.0",
+ "rw-stream-sink",
"soketto",
"url",
"webpki-roots",
@@ -3997,12 +3911,12 @@ dependencies = [
[[package]]
name = "libp2p-yamux"
-version = "0.37.0"
+version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fe653639ad74877c759720febb0cbcbf4caa221adde4eed2d3126ce5c6f381f"
+checksum = "c6dea686217a06072033dc025631932810e2f6ad784e4fafa42e27d311c7a81c"
dependencies = [
"futures",
- "libp2p-core 0.33.0",
+ "libp2p-core",
"parking_lot 0.12.0",
"thiserror",
"yamux",
@@ -4310,7 +4224,7 @@ version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg",
]
[[package]]
@@ -4355,30 +4269,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b"
dependencies = [
"adler",
- "autocfg 1.0.1",
+ "autocfg",
]
[[package]]
name = "mio"
-version = "0.8.0"
+version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba272f85fa0b41fc91872be579b3bbe0f56b792aa361a380eb669469f68dafb2"
+checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf"
dependencies = [
"libc",
"log",
- "miow",
- "ntapi",
- "winapi",
-]
-
-[[package]]
-name = "miow"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897"
-dependencies = [
- "socket2 0.3.19",
- "winapi",
+ "wasi 0.11.0+wasi-snapshot-preview1",
+ "windows-sys 0.36.1",
]
[[package]]
@@ -4462,7 +4365,7 @@ dependencies = [
"bytes",
"futures",
"log",
- "pin-project 1.0.10",
+ "pin-project",
"smallvec",
"unsigned-varint",
]
@@ -4856,6 +4759,7 @@ dependencies = [
"pallet-multisig",
"pallet-nomination-pools",
"pallet-nomination-pools-benchmarking",
+ "pallet-nomination-pools-runtime-api",
"pallet-offences",
"pallet-offences-benchmarking",
"pallet-preimage",
@@ -5049,22 +4953,13 @@ dependencies = [
"version_check",
]
-[[package]]
-name = "ntapi"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
-dependencies = [
- "winapi",
-]
-
[[package]]
name = "num-bigint"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg",
"num-integer",
"num-traits",
]
@@ -5094,7 +4989,7 @@ version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg",
"num-traits",
]
@@ -5104,7 +4999,7 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg",
"num-bigint",
"num-integer",
"num-traits",
@@ -5116,7 +5011,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg",
"num-integer",
"num-traits",
]
@@ -5127,7 +5022,7 @@ version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg",
"libm",
]
@@ -5534,11 +5429,12 @@ version = "4.0.0-dev"
dependencies = [
"assert_matches",
"bitflags",
- "env_logger 0.9.0",
+ "env_logger",
"frame-benchmarking",
"frame-support",
"frame-system",
"hex-literal",
+ "impl-trait-for-tuples",
"log",
"pallet-balances",
"pallet-contracts-primitives",
@@ -5707,6 +5603,7 @@ dependencies = [
"sp-npos-elections",
"sp-runtime",
"sp-std",
+ "sp-tracing",
"substrate-test-utils",
]
@@ -5898,11 +5795,12 @@ name = "pallet-mmr"
version = "4.0.0-dev"
dependencies = [
"ckb-merkle-mountain-range",
- "env_logger 0.9.0",
+ "env_logger",
"frame-benchmarking",
"frame-support",
"frame-system",
"hex-literal",
+ "itertools",
"parity-scale-codec",
"scale-info",
"sp-core",
@@ -6014,6 +5912,15 @@ dependencies = [
"sp-std",
]
+[[package]]
+name = "pallet-nomination-pools-runtime-api"
+version = "1.0.0-dev"
+dependencies = [
+ "parity-scale-codec",
+ "sp-api",
+ "sp-std",
+]
+
[[package]]
name = "pallet-nomination-pools-test-staking"
version = "1.0.0"
@@ -6836,33 +6743,13 @@ dependencies = [
"indexmap",
]
-[[package]]
-name = "pin-project"
-version = "0.4.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9615c18d31137579e9ff063499264ddc1278e7b1982757ebc111028c4d1dc909"
-dependencies = [
- "pin-project-internal 0.4.29",
-]
-
[[package]]
name = "pin-project"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e"
dependencies = [
- "pin-project-internal 1.0.10",
-]
-
-[[package]]
-name = "pin-project-internal"
-version = "0.4.29"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "044964427019eed9d49d9d5bbce6047ef18f37100ea400912a9fa4a3523ab12a"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "pin-project-internal",
]
[[package]]
@@ -7114,16 +7001,6 @@ dependencies = [
"syn",
]
-[[package]]
-name = "prost"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001"
-dependencies = [
- "bytes",
- "prost-derive 0.9.0",
-]
-
[[package]]
name = "prost"
version = "0.10.3"
@@ -7131,27 +7008,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc03e116981ff7d8da8e5c220e374587b98d294af7ba7dd7fda761158f00086f"
dependencies = [
"bytes",
- "prost-derive 0.10.1",
-]
-
-[[package]]
-name = "prost-build"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5"
-dependencies = [
- "bytes",
- "heck 0.3.2",
- "itertools",
- "lazy_static",
- "log",
- "multimap",
- "petgraph",
- "prost 0.9.0",
- "prost-types 0.9.0",
- "regex",
- "tempfile",
- "which",
+ "prost-derive",
]
[[package]]
@@ -7163,14 +7020,14 @@ dependencies = [
"bytes",
"cfg-if 1.0.0",
"cmake",
- "heck 0.4.0",
+ "heck",
"itertools",
"lazy_static",
"log",
"multimap",
"petgraph",
- "prost 0.10.3",
- "prost-types 0.10.1",
+ "prost",
+ "prost-types",
"regex",
"tempfile",
"which",
@@ -7184,24 +7041,11 @@ checksum = "00af1e92c33b4813cc79fda3f2dbf56af5169709be0202df730e9ebc3e4cd007"
dependencies = [
"asynchronous-codec",
"bytes",
- "prost 0.10.3",
+ "prost",
"thiserror",
"unsigned-varint",
]
-[[package]]
-name = "prost-derive"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe"
-dependencies = [
- "anyhow",
- "itertools",
- "proc-macro2",
- "quote",
- "syn",
-]
-
[[package]]
name = "prost-derive"
version = "0.10.1"
@@ -7215,16 +7059,6 @@ dependencies = [
"syn",
]
-[[package]]
-name = "prost-types"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a"
-dependencies = [
- "bytes",
- "prost 0.9.0",
-]
-
[[package]]
name = "prost-types"
version = "0.10.1"
@@ -7232,7 +7066,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68"
dependencies = [
"bytes",
- "prost 0.10.3",
+ "prost",
]
[[package]]
@@ -7311,25 +7145,6 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
-[[package]]
-name = "rand"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
-dependencies = [
- "autocfg 0.1.7",
- "libc",
- "rand_chacha 0.1.1",
- "rand_core 0.4.2",
- "rand_hc 0.1.0",
- "rand_isaac",
- "rand_jitter",
- "rand_os",
- "rand_pcg 0.1.2",
- "rand_xorshift",
- "winapi",
-]
-
[[package]]
name = "rand"
version = "0.7.3"
@@ -7356,16 +7171,6 @@ dependencies = [
"rand_hc 0.3.0",
]
-[[package]]
-name = "rand_chacha"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"
-dependencies = [
- "autocfg 0.1.7",
- "rand_core 0.3.1",
-]
-
[[package]]
name = "rand_chacha"
version = "0.2.2"
@@ -7386,21 +7191,6 @@ dependencies = [
"rand_core 0.6.2",
]
-[[package]]
-name = "rand_core"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
-dependencies = [
- "rand_core 0.4.2",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
-
[[package]]
name = "rand_core"
version = "0.5.1"
@@ -7429,15 +7219,6 @@ dependencies = [
"rand 0.8.4",
]
-[[package]]
-name = "rand_hc"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
-dependencies = [
- "rand_core 0.3.1",
-]
-
[[package]]
name = "rand_hc"
version = "0.2.0"
@@ -7456,50 +7237,6 @@ dependencies = [
"rand_core 0.6.2",
]
-[[package]]
-name = "rand_isaac"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"
-dependencies = [
- "rand_core 0.3.1",
-]
-
-[[package]]
-name = "rand_jitter"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b"
-dependencies = [
- "libc",
- "rand_core 0.4.2",
- "winapi",
-]
-
-[[package]]
-name = "rand_os"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"
-dependencies = [
- "cloudabi",
- "fuchsia-cprng",
- "libc",
- "rand_core 0.4.2",
- "rdrand",
- "winapi",
-]
-
-[[package]]
-name = "rand_pcg"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44"
-dependencies = [
- "autocfg 0.1.7",
- "rand_core 0.4.2",
-]
-
[[package]]
name = "rand_pcg"
version = "0.2.1"
@@ -7518,15 +7255,6 @@ dependencies = [
"rand_core 0.6.2",
]
-[[package]]
-name = "rand_xorshift"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c"
-dependencies = [
- "rand_core 0.3.1",
-]
-
[[package]]
name = "rawpointer"
version = "0.2.1"
@@ -7539,7 +7267,7 @@ version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674"
dependencies = [
- "autocfg 1.0.1",
+ "autocfg",
"crossbeam-deque",
"either",
"rayon-core",
@@ -7558,15 +7286,6 @@ dependencies = [
"num_cpus",
]
-[[package]]
-name = "rdrand"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
-dependencies = [
- "rand_core 0.3.1",
-]
-
[[package]]
name = "redox_syscall"
version = "0.2.10"
@@ -7684,7 +7403,7 @@ dependencies = [
name = "remote-externalities"
version = "0.10.0-dev"
dependencies = [
- "env_logger 0.9.0",
+ "env_logger",
"frame-support",
"jsonrpsee",
"log",
@@ -7922,17 +7641,6 @@ version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
-[[package]]
-name = "rw-stream-sink"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020"
-dependencies = [
- "futures",
- "pin-project 0.4.29",
- "static_assertions",
-]
-
[[package]]
name = "rw-stream-sink"
version = "0.3.0"
@@ -7940,7 +7648,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26338f5e09bb721b85b135ea05af7767c90b52f6de4f087d4f4a3a9d64e7dc04"
dependencies = [
"futures",
- "pin-project 1.0.10",
+ "pin-project",
"static_assertions",
]
@@ -7998,8 +7706,8 @@ dependencies = [
"libp2p",
"log",
"parity-scale-codec",
- "prost 0.10.3",
- "prost-build 0.10.4",
+ "prost",
+ "prost-build",
"quickcheck",
"rand 0.7.3",
"sc-client-api",
@@ -8432,7 +8140,7 @@ name = "sc-executor"
version = "0.10.0-dev"
dependencies = [
"criterion",
- "env_logger 0.9.0",
+ "env_logger",
"hex-literal",
"lazy_static",
"lru",
@@ -8546,6 +8254,7 @@ dependencies = [
"sc-consensus",
"sc-keystore",
"sc-network",
+ "sc-network-common",
"sc-network-gossip",
"sc-network-test",
"sc-telemetry",
@@ -8651,9 +8360,9 @@ dependencies = [
"lru",
"parity-scale-codec",
"parking_lot 0.12.0",
- "pin-project 1.0.10",
- "prost 0.10.3",
- "prost-build 0.10.4",
+ "pin-project",
+ "prost",
+ "prost-build",
"rand 0.7.3",
"sc-block-builder",
"sc-client-api",
@@ -8670,7 +8379,6 @@ dependencies = [
"sp-blockchain",
"sp-consensus",
"sp-core",
- "sp-finality-grandpa",
"sp-runtime",
"sp-test-primitives",
"sp-tracing",
@@ -8688,12 +8396,17 @@ dependencies = [
name = "sc-network-common"
version = "0.10.0-dev"
dependencies = [
+ "bitflags",
"futures",
"libp2p",
"parity-scale-codec",
- "prost-build 0.10.4",
+ "prost-build",
+ "sc-consensus",
"sc-peerset",
"smallvec",
+ "sp-consensus",
+ "sp-finality-grandpa",
+ "sp-runtime",
]
[[package]]
@@ -8723,8 +8436,8 @@ dependencies = [
"libp2p",
"log",
"parity-scale-codec",
- "prost 0.10.3",
- "prost-build 0.10.4",
+ "prost",
+ "prost-build",
"sc-client-api",
"sc-network-common",
"sc-peerset",
@@ -8738,16 +8451,14 @@ dependencies = [
name = "sc-network-sync"
version = "0.10.0-dev"
dependencies = [
- "bitflags",
- "either",
"fork-tree",
"futures",
"libp2p",
"log",
"lru",
"parity-scale-codec",
- "prost 0.10.3",
- "prost-build 0.10.4",
+ "prost",
+ "prost-build",
"quickcheck",
"sc-block-builder",
"sc-client-api",
@@ -8784,6 +8495,8 @@ dependencies = [
"sc-consensus",
"sc-network",
"sc-network-common",
+ "sc-network-light",
+ "sc-network-sync",
"sc-service",
"sp-blockchain",
"sp-consensus",
@@ -8857,7 +8570,7 @@ name = "sc-rpc"
version = "4.0.0-dev"
dependencies = [
"assert_matches",
- "env_logger 0.9.0",
+ "env_logger",
"futures",
"hash-db",
"jsonrpsee",
@@ -8954,7 +8667,7 @@ dependencies = [
"parity-scale-codec",
"parity-util-mem",
"parking_lot 0.12.0",
- "pin-project 1.0.10",
+ "pin-project",
"rand 0.7.3",
"sc-block-builder",
"sc-chain-spec",
@@ -8966,6 +8679,8 @@ dependencies = [
"sc-keystore",
"sc-network",
"sc-network-common",
+ "sc-network-light",
+ "sc-network-sync",
"sc-offchain",
"sc-rpc",
"sc-rpc-server",
@@ -9099,7 +8814,7 @@ dependencies = [
"libp2p",
"log",
"parking_lot 0.12.0",
- "pin-project 1.0.10",
+ "pin-project",
"rand 0.7.3",
"serde",
"serde_json",
@@ -9297,19 +9012,18 @@ dependencies = [
[[package]]
name = "secp256k1"
-version = "0.21.2"
+version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab7883017d5b21f011ef8040ea9c6c7ac90834c0df26a69e4c0b06276151f125"
+checksum = "b7649a0b3ffb32636e60c7ce0d70511eda9c52c658cd0634e194d5a19943aeff"
dependencies = [
- "rand 0.6.5",
"secp256k1-sys",
]
[[package]]
name = "secp256k1-sys"
-version = "0.4.2"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036"
+checksum = "7058dc8eaf3f2810d7828680320acda0b25a288f6d288e19278e249bbf74226b"
dependencies = [
"cc",
]
@@ -9618,17 +9332,6 @@ dependencies = [
"subtle",
]
-[[package]]
-name = "socket2"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e"
-dependencies = [
- "cfg-if 1.0.0",
- "libc",
- "winapi",
-]
-
[[package]]
name = "socket2"
version = "0.4.4"
@@ -10535,20 +10238,20 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "strum"
-version = "0.23.0"
+version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb"
+checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f"
dependencies = [
"strum_macros",
]
[[package]]
name = "strum_macros"
-version = "0.23.1"
+version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38"
+checksum = "4faebde00e8ff94316c01800f9054fd2ba77d30d9e922541913051d1d978918b"
dependencies = [
- "heck 0.3.2",
+ "heck",
"proc-macro2",
"quote",
"rustversion",
@@ -11055,7 +10758,7 @@ dependencies = [
"parking_lot 0.12.0",
"pin-project-lite 0.2.6",
"signal-hook-registry",
- "socket2 0.4.4",
+ "socket2",
"tokio-macros",
"winapi",
]
@@ -11106,20 +10809,6 @@ dependencies = [
"tokio-stream",
]
-[[package]]
-name = "tokio-util"
-version = "0.6.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1caa0b0c8d94a049db56b5acf8cba99dc0623aab1b26d5b5f5e2d945846b3592"
-dependencies = [
- "bytes",
- "futures-core",
- "futures-sink",
- "log",
- "pin-project-lite 0.2.6",
- "tokio",
-]
-
[[package]]
name = "tokio-util"
version = "0.7.1"
@@ -11132,6 +10821,7 @@ dependencies = [
"futures-sink",
"pin-project-lite 0.2.6",
"tokio",
+ "tracing",
]
[[package]]
@@ -11175,11 +10865,11 @@ dependencies = [
[[package]]
name = "tracing-core"
-version = "0.1.26"
+version = "0.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f"
+checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7"
dependencies = [
- "lazy_static",
+ "once_cell",
"valuable",
]
@@ -11189,7 +10879,7 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2"
dependencies = [
- "pin-project 1.0.10",
+ "pin-project",
"tracing",
]
@@ -11199,10 +10889,8 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922"
dependencies = [
- "ahash",
"lazy_static",
"log",
- "lru",
"tracing-core",
]
@@ -11457,12 +11145,6 @@ dependencies = [
"tinyvec",
]
-[[package]]
-name = "unicode-segmentation"
-version = "1.7.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796"
-
[[package]]
name = "unicode-width"
version = "0.1.8"
@@ -11603,6 +11285,12 @@ version = "0.10.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
+[[package]]
+name = "wasi"
+version = "0.11.0+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
+
[[package]]
name = "wasm-bindgen"
version = "0.2.77"
diff --git a/Cargo.toml b/Cargo.toml
index 9909e6f893877..1f22343c002a8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -116,6 +116,7 @@ members = [
"frame/nomination-pools",
"frame/nomination-pools/benchmarking",
"frame/nomination-pools/test-staking",
+ "frame/nomination-pools/runtime-api",
"frame/randomness-collective-flip",
"frame/ranked-collective",
"frame/recovery",
diff --git a/bin/node-template/node/src/command_helper.rs b/bin/node-template/node/src/benchmarking.rs
similarity index 71%
rename from bin/node-template/node/src/command_helper.rs
rename to bin/node-template/node/src/benchmarking.rs
index 287e81b1e96bd..f0e32104cd3ee 100644
--- a/bin/node-template/node/src/command_helper.rs
+++ b/bin/node-template/node/src/benchmarking.rs
@@ -16,13 +16,14 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-//! Contains code to setup the command invocations in [`super::command`] which would
-//! otherwise bloat that module.
+//! Setup code for [`super::command`] which would otherwise bloat that module.
+//!
+//! Should only be used for benchmarking as it may break in other contexts.
use crate::service::FullClient;
use node_template_runtime as runtime;
-use runtime::SystemCall;
+use runtime::{AccountId, Balance, BalancesCall, SystemCall};
use sc_cli::Result;
use sc_client_api::BlockBackend;
use sp_core::{Encode, Pair};
@@ -35,19 +36,27 @@ use std::{sync::Arc, time::Duration};
/// Generates extrinsics for the `benchmark overhead` command.
///
/// Note: Should only be used for benchmarking.
-pub struct BenchmarkExtrinsicBuilder {
+pub struct RemarkBuilder {
client: Arc,
}
-impl BenchmarkExtrinsicBuilder {
+impl RemarkBuilder {
/// Creates a new [`Self`] from the given client.
pub fn new(client: Arc) -> Self {
Self { client }
}
}
-impl frame_benchmarking_cli::ExtrinsicBuilder for BenchmarkExtrinsicBuilder {
- fn remark(&self, nonce: u32) -> std::result::Result {
+impl frame_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder {
+ fn pallet(&self) -> &str {
+ "system"
+ }
+
+ fn extrinsic(&self) -> &str {
+ "remark"
+ }
+
+ fn build(&self, nonce: u32) -> std::result::Result {
let acc = Sr25519Keyring::Bob.pair();
let extrinsic: OpaqueExtrinsic = create_benchmark_extrinsic(
self.client.as_ref(),
@@ -61,6 +70,49 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for BenchmarkExtrinsicBuilder {
}
}
+/// Generates `Balances::TransferKeepAlive` extrinsics for the benchmarks.
+///
+/// Note: Should only be used for benchmarking.
+pub struct TransferKeepAliveBuilder {
+ client: Arc,
+ dest: AccountId,
+ value: Balance,
+}
+
+impl TransferKeepAliveBuilder {
+ /// Creates a new [`Self`] from the given client.
+ pub fn new(client: Arc, dest: AccountId, value: Balance) -> Self {
+ Self { client, dest, value }
+ }
+}
+
+impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder {
+ fn pallet(&self) -> &str {
+ "balances"
+ }
+
+ fn extrinsic(&self) -> &str {
+ "transfer_keep_alive"
+ }
+
+ fn build(&self, nonce: u32) -> std::result::Result {
+ let acc = Sr25519Keyring::Bob.pair();
+ let extrinsic: OpaqueExtrinsic = create_benchmark_extrinsic(
+ self.client.as_ref(),
+ acc,
+ BalancesCall::transfer_keep_alive {
+ dest: self.dest.clone().into(),
+ value: self.value.into(),
+ }
+ .into(),
+ nonce,
+ )
+ .into();
+
+ Ok(extrinsic)
+ }
+}
+
/// Create a transaction using the given `call`.
///
/// Note: Should only be used for benchmarking.
diff --git a/bin/node-template/node/src/command.rs b/bin/node-template/node/src/command.rs
index e3e10007929e6..142f0b40c325e 100644
--- a/bin/node-template/node/src/command.rs
+++ b/bin/node-template/node/src/command.rs
@@ -1,14 +1,14 @@
use crate::{
+ benchmarking::{inherent_benchmark_data, RemarkBuilder, TransferKeepAliveBuilder},
chain_spec,
cli::{Cli, Subcommand},
- command_helper::{inherent_benchmark_data, BenchmarkExtrinsicBuilder},
service,
};
-use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
-use node_template_runtime::Block;
+use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory, SUBSTRATE_REFERENCE_HARDWARE};
+use node_template_runtime::{Block, EXISTENTIAL_DEPOSIT};
use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli};
use sc_service::PartialComponents;
-use std::sync::Arc;
+use sp_keyring::Sr25519Keyring;
impl SubstrateCli for Cli {
fn impl_name() -> String {
@@ -137,9 +137,23 @@ pub fn run() -> sc_cli::Result<()> {
},
BenchmarkCmd::Overhead(cmd) => {
let PartialComponents { client, .. } = service::new_partial(&config)?;
- let ext_builder = BenchmarkExtrinsicBuilder::new(client.clone());
+ let ext_builder = RemarkBuilder::new(client.clone());
- cmd.run(config, client, inherent_benchmark_data()?, Arc::new(ext_builder))
+ cmd.run(config, client, inherent_benchmark_data()?, &ext_builder)
+ },
+ BenchmarkCmd::Extrinsic(cmd) => {
+ let PartialComponents { client, .. } = service::new_partial(&config)?;
+ // Register the *Remark* and *TKA* builders.
+ let ext_factory = ExtrinsicFactory(vec![
+ Box::new(RemarkBuilder::new(client.clone())),
+ Box::new(TransferKeepAliveBuilder::new(
+ client.clone(),
+ Sr25519Keyring::Alice.to_account_id(),
+ EXISTENTIAL_DEPOSIT,
+ )),
+ ]);
+
+ cmd.run(client, inherent_benchmark_data()?, &ext_factory)
},
BenchmarkCmd::Machine(cmd) =>
cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()),
diff --git a/bin/node-template/node/src/main.rs b/bin/node-template/node/src/main.rs
index 0f2fbd5a909c6..426cbabb6fbf7 100644
--- a/bin/node-template/node/src/main.rs
+++ b/bin/node-template/node/src/main.rs
@@ -4,9 +4,9 @@
mod chain_spec;
#[macro_use]
mod service;
+mod benchmarking;
mod cli;
mod command;
-mod command_helper;
mod rpc;
fn main() -> sc_cli::Result<()> {
diff --git a/bin/node-template/node/src/service.rs b/bin/node-template/node/src/service.rs
index f45f914d94f44..ffb2440caa0ed 100644
--- a/bin/node-template/node/src/service.rs
+++ b/bin/node-template/node/src/service.rs
@@ -296,24 +296,24 @@ pub fn new_full(mut config: Configuration) -> Result
.spawn_blocking("aura", Some("block-authoring"), aura);
}
- // if the node isn't actively participating in consensus then it doesn't
- // need a keystore, regardless of which protocol we use below.
- let keystore =
- if role.is_authority() { Some(keystore_container.sync_keystore()) } else { None };
-
- let grandpa_config = sc_finality_grandpa::Config {
- // FIXME #1578 make this available through chainspec
- gossip_duration: Duration::from_millis(333),
- justification_period: 512,
- name: Some(name),
- observer_enabled: false,
- keystore,
- local_role: role,
- telemetry: telemetry.as_ref().map(|x| x.handle()),
- protocol_name: grandpa_protocol_name,
- };
-
if enable_grandpa {
+ // if the node isn't actively participating in consensus then it doesn't
+ // need a keystore, regardless of which protocol we use below.
+ let keystore =
+ if role.is_authority() { Some(keystore_container.sync_keystore()) } else { None };
+
+ let grandpa_config = sc_finality_grandpa::Config {
+ // FIXME #1578 make this available through chainspec
+ gossip_duration: Duration::from_millis(333),
+ justification_period: 512,
+ name: Some(name),
+ observer_enabled: false,
+ keystore,
+ local_role: role,
+ telemetry: telemetry.as_ref().map(|x| x.handle()),
+ protocol_name: grandpa_protocol_name,
+ };
+
// start the full GRANDPA voter
// NOTE: non-authorities could run the GRANDPA observer protocol, but at
// this point the full voter should provide better guarantees of block
diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs
index 1d14a427a0f5c..a943199ababf2 100644
--- a/bin/node-template/runtime/src/lib.rs
+++ b/bin/node-template/runtime/src/lib.rs
@@ -234,6 +234,9 @@ impl pallet_timestamp::Config for Runtime {
type WeightInfo = ();
}
+/// Existential deposit.
+pub const EXISTENTIAL_DEPOSIT: u128 = 500;
+
impl pallet_balances::Config for Runtime {
type MaxLocks = ConstU32<50>;
type MaxReserves = ();
@@ -243,7 +246,7 @@ impl pallet_balances::Config for Runtime {
/// The ubiquitous event type.
type Event = Event;
type DustRemoval = ();
- type ExistentialDeposit = ConstU128<500>;
+ type ExistentialDeposit = ConstU128;
type AccountStore = System;
type WeightInfo = pallet_balances::weights::SubstrateWeight;
}
diff --git a/bin/node/bench/src/simple_trie.rs b/bin/node/bench/src/simple_trie.rs
index c59389570e534..aa9c96a1cbd3f 100644
--- a/bin/node/bench/src/simple_trie.rs
+++ b/bin/node/bench/src/simple_trie.rs
@@ -33,7 +33,7 @@ pub struct SimpleTrie<'a> {
impl<'a> AsHashDB for SimpleTrie<'a> {
fn as_hash_db(&self) -> &dyn hash_db::HashDB {
- &*self
+ self
}
fn as_hash_db_mut<'b>(&'b mut self) -> &'b mut (dyn HashDB + 'b) {
diff --git a/bin/node/cli/benches/transaction_pool.rs b/bin/node/cli/benches/transaction_pool.rs
index f1fce16d8c1b3..d88c3a65b6138 100644
--- a/bin/node/cli/benches/transaction_pool.rs
+++ b/bin/node/cli/benches/transaction_pool.rs
@@ -16,6 +16,8 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
+use std::time::Duration;
+
use criterion::{criterion_group, criterion_main, BatchSize, Criterion, Throughput};
use futures::{future, StreamExt};
use node_cli::service::{create_extrinsic, fetch_nonce, FullClient, TransactionPool};
@@ -58,6 +60,7 @@ fn new_node(tokio_handle: Handle) -> node_cli::service::NewFullBase {
ready: PoolLimit { count: 100_000, total_bytes: 100 * 1024 * 1024 },
future: PoolLimit { count: 100_000, total_bytes: 100 * 1024 * 1024 },
reject_future_transactions: false,
+ ban_time: Duration::from_secs(30 * 60),
},
network: network_config,
keystore: KeystoreConfig::InMemory,
@@ -240,25 +243,25 @@ fn transaction_pool_benchmarks(c: &mut Criterion) {
move |b| {
b.iter_batched(
|| {
- let prepare_extrinsics = create_account_extrinsics(&*node.client, &accounts);
+ let prepare_extrinsics = create_account_extrinsics(&node.client, &accounts);
runtime.block_on(future::join_all(prepare_extrinsics.into_iter().map(|tx| {
submit_tx_and_wait_for_inclusion(
&node.transaction_pool,
tx,
- &*node.client,
+ &node.client,
true,
)
})));
- create_benchmark_extrinsics(&*node.client, &accounts, extrinsics_per_account)
+ create_benchmark_extrinsics(&node.client, &accounts, extrinsics_per_account)
},
|extrinsics| {
runtime.block_on(future::join_all(extrinsics.into_iter().map(|tx| {
submit_tx_and_wait_for_inclusion(
&node.transaction_pool,
tx,
- &*node.client,
+ &node.client,
false,
)
})));
diff --git a/bin/node/cli/src/command_helper.rs b/bin/node/cli/src/benchmarking.rs
similarity index 52%
rename from bin/node/cli/src/command_helper.rs
rename to bin/node/cli/src/benchmarking.rs
index 84d85ee367cab..52657016c046a 100644
--- a/bin/node/cli/src/command_helper.rs
+++ b/bin/node/cli/src/benchmarking.rs
@@ -16,12 +16,14 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-//! Contains code to setup the command invocations in [`super::command`] which would
-//! otherwise bloat that module.
+//! Setup code for [`super::command`] which would otherwise bloat that module.
+//!
+//! Should only be used for benchmarking as it may break in other contexts.
use crate::service::{create_extrinsic, FullClient};
-use node_runtime::SystemCall;
+use node_primitives::{AccountId, Balance};
+use node_runtime::{BalancesCall, SystemCall};
use sc_cli::Result;
use sp_inherents::{InherentData, InherentDataProvider};
use sp_keyring::Sr25519Keyring;
@@ -29,20 +31,30 @@ use sp_runtime::OpaqueExtrinsic;
use std::{sync::Arc, time::Duration};
-/// Generates extrinsics for the `benchmark overhead` command.
-pub struct BenchmarkExtrinsicBuilder {
+/// Generates `System::Remark` extrinsics for the benchmarks.
+///
+/// Note: Should only be used for benchmarking.
+pub struct RemarkBuilder {
client: Arc,
}
-impl BenchmarkExtrinsicBuilder {
+impl RemarkBuilder {
/// Creates a new [`Self`] from the given client.
pub fn new(client: Arc) -> Self {
Self { client }
}
}
-impl frame_benchmarking_cli::ExtrinsicBuilder for BenchmarkExtrinsicBuilder {
- fn remark(&self, nonce: u32) -> std::result::Result {
+impl frame_benchmarking_cli::ExtrinsicBuilder for RemarkBuilder {
+ fn pallet(&self) -> &str {
+ "system"
+ }
+
+ fn extrinsic(&self) -> &str {
+ "remark"
+ }
+
+ fn build(&self, nonce: u32) -> std::result::Result {
let acc = Sr25519Keyring::Bob.pair();
let extrinsic: OpaqueExtrinsic = create_extrinsic(
self.client.as_ref(),
@@ -56,6 +68,48 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for BenchmarkExtrinsicBuilder {
}
}
+/// Generates `Balances::TransferKeepAlive` extrinsics for the benchmarks.
+///
+/// Note: Should only be used for benchmarking.
+pub struct TransferKeepAliveBuilder {
+ client: Arc,
+ dest: AccountId,
+ value: Balance,
+}
+
+impl TransferKeepAliveBuilder {
+ /// Creates a new [`Self`] from the given client.
+ pub fn new(client: Arc, dest: AccountId, value: Balance) -> Self {
+ Self { client, dest, value }
+ }
+}
+
+impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder {
+ fn pallet(&self) -> &str {
+ "balances"
+ }
+
+ fn extrinsic(&self) -> &str {
+ "transfer_keep_alive"
+ }
+
+ fn build(&self, nonce: u32) -> std::result::Result {
+ let acc = Sr25519Keyring::Bob.pair();
+ let extrinsic: OpaqueExtrinsic = create_extrinsic(
+ self.client.as_ref(),
+ acc,
+ BalancesCall::transfer_keep_alive {
+ dest: self.dest.clone().into(),
+ value: self.value.into(),
+ },
+ Some(nonce),
+ )
+ .into();
+
+ Ok(extrinsic)
+ }
+}
+
/// Generates inherent data for the `benchmark overhead` command.
pub fn inherent_benchmark_data() -> Result {
let mut inherent_data = InherentData::new();
diff --git a/bin/node/cli/src/command.rs b/bin/node/cli/src/command.rs
index b17a26fa02935..df3d5a891e2ab 100644
--- a/bin/node/cli/src/command.rs
+++ b/bin/node/cli/src/command.rs
@@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
-use super::command_helper::{inherent_benchmark_data, BenchmarkExtrinsicBuilder};
+use super::benchmarking::{inherent_benchmark_data, RemarkBuilder, TransferKeepAliveBuilder};
use crate::{
chain_spec, service,
service::{new_partial, FullClient},
@@ -25,9 +25,10 @@ use crate::{
use frame_benchmarking_cli::*;
use node_executor::ExecutorDispatch;
use node_primitives::Block;
-use node_runtime::RuntimeApi;
+use node_runtime::{ExistentialDeposit, RuntimeApi};
use sc_cli::{ChainSpec, Result, RuntimeVersion, SubstrateCli};
use sc_service::PartialComponents;
+use sp_keyring::Sr25519Keyring;
use std::sync::Arc;
@@ -126,9 +127,23 @@ pub fn run() -> Result<()> {
},
BenchmarkCmd::Overhead(cmd) => {
let PartialComponents { client, .. } = new_partial(&config)?;
- let ext_builder = BenchmarkExtrinsicBuilder::new(client.clone());
+ let ext_builder = RemarkBuilder::new(client.clone());
- cmd.run(config, client, inherent_benchmark_data()?, Arc::new(ext_builder))
+ cmd.run(config, client, inherent_benchmark_data()?, &ext_builder)
+ },
+ BenchmarkCmd::Extrinsic(cmd) => {
+ let PartialComponents { client, .. } = service::new_partial(&config)?;
+ // Register the *Remark* and *TKA* builders.
+ let ext_factory = ExtrinsicFactory(vec![
+ Box::new(RemarkBuilder::new(client.clone())),
+ Box::new(TransferKeepAliveBuilder::new(
+ client.clone(),
+ Sr25519Keyring::Alice.to_account_id(),
+ ExistentialDeposit::get(),
+ )),
+ ]);
+
+ cmd.run(client, inherent_benchmark_data()?, &ext_factory)
},
BenchmarkCmd::Machine(cmd) =>
cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()),
diff --git a/bin/node/cli/src/lib.rs b/bin/node/cli/src/lib.rs
index 06c0bcccbc296..13c074268e50f 100644
--- a/bin/node/cli/src/lib.rs
+++ b/bin/node/cli/src/lib.rs
@@ -35,11 +35,11 @@ pub mod chain_spec;
#[macro_use]
pub mod service;
#[cfg(feature = "cli")]
+mod benchmarking;
+#[cfg(feature = "cli")]
mod cli;
#[cfg(feature = "cli")]
mod command;
-#[cfg(feature = "cli")]
-mod command_helper;
#[cfg(feature = "cli")]
pub use cli::*;
diff --git a/bin/node/cli/tests/benchmark_extrinsic_works.rs b/bin/node/cli/tests/benchmark_extrinsic_works.rs
new file mode 100644
index 0000000000000..69800ad3c6c13
--- /dev/null
+++ b/bin/node/cli/tests/benchmark_extrinsic_works.rs
@@ -0,0 +1,46 @@
+// This file is part of Substrate.
+
+// Copyright (C) 2022 Parity Technologies (UK) Ltd.
+// SPDX-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.
+
+// 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
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+use assert_cmd::cargo::cargo_bin;
+use std::process::Command;
+use tempfile::tempdir;
+
+/// Tests that the `benchmark extrinsic` command works for
+/// remark and transfer_keep_alive within the substrate dev runtime.
+#[test]
+fn benchmark_extrinsic_works() {
+ benchmark_extrinsic("system", "remark");
+ benchmark_extrinsic("balances", "transfer_keep_alive");
+}
+
+/// Checks that the `benchmark extrinsic` command works for the given pallet and extrinsic.
+fn benchmark_extrinsic(pallet: &str, extrinsic: &str) {
+ let base_dir = tempdir().expect("could not create a temp dir");
+
+ let status = Command::new(cargo_bin("substrate"))
+ .args(&["benchmark", "extrinsic", "--dev"])
+ .arg("-d")
+ .arg(base_dir.path())
+ .args(&["--pallet", pallet, "--extrinsic", extrinsic])
+ // Run with low repeats for faster execution.
+ .args(["--warmup=10", "--repeat=10", "--max-ext-per-block=10"])
+ .status()
+ .unwrap();
+
+ assert!(status.success());
+}
diff --git a/bin/node/runtime/Cargo.toml b/bin/node/runtime/Cargo.toml
index ca971f29e93c9..d3138ce51de9c 100644
--- a/bin/node/runtime/Cargo.toml
+++ b/bin/node/runtime/Cargo.toml
@@ -79,6 +79,7 @@ pallet-mmr = { version = "4.0.0-dev", default-features = false, path = "../../..
pallet-multisig = { version = "4.0.0-dev", default-features = false, path = "../../../frame/multisig" }
pallet-nomination-pools = { version = "1.0.0", default-features = false, path = "../../../frame/nomination-pools"}
pallet-nomination-pools-benchmarking = { version = "1.0.0", default-features = false, optional = true, path = "../../../frame/nomination-pools/benchmarking" }
+pallet-nomination-pools-runtime-api = { version = "1.0.0-dev", default-features = false, path = "../../../frame/nomination-pools/runtime-api" }
pallet-offences = { version = "4.0.0-dev", default-features = false, path = "../../../frame/offences" }
pallet-offences-benchmarking = { version = "4.0.0-dev", path = "../../../frame/offences/benchmarking", default-features = false, optional = true }
pallet-preimage = { version = "4.0.0-dev", default-features = false, path = "../../../frame/preimage" }
@@ -145,6 +146,7 @@ std = [
"pallet-mmr/std",
"pallet-multisig/std",
"pallet-nomination-pools/std",
+ "pallet-nomination-pools-runtime-api/std",
"pallet-identity/std",
"pallet-scheduler/std",
"node-primitives/std",
diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs
index 7bf6ad440e85d..b638840c65929 100644
--- a/bin/node/runtime/src/lib.rs
+++ b/bin/node/runtime/src/lib.rs
@@ -68,7 +68,7 @@ use sp_runtime::{
SaturatedConversion, StaticLookup,
},
transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity},
- ApplyExtrinsicResult, FixedPointNumber, Perbill, Percent, Permill, Perquintill,
+ ApplyExtrinsicResult, FixedPointNumber, FixedU128, Perbill, Percent, Permill, Perquintill,
};
use sp_std::prelude::*;
#[cfg(any(feature = "std", test))]
@@ -730,7 +730,7 @@ impl pallet_bags_list::Config for Runtime {
parameter_types! {
pub const PostUnbondPoolsWindow: u32 = 4;
pub const NominationPoolsPalletId: PalletId = PalletId(*b"py/nopls");
- pub const MinPointsToBalance: u32 = 10;
+ pub const MaxPointsToBalance: u8 = 10;
}
use sp_runtime::traits::Convert;
@@ -751,6 +751,8 @@ impl pallet_nomination_pools::Config for Runtime {
type WeightInfo = ();
type Event = Event;
type Currency = Balances;
+ type CurrencyBalance = Balance;
+ type RewardCounter = FixedU128;
type BalanceToU256 = BalanceToU256;
type U256ToBalance = U256ToBalance;
type StakingInterface = pallet_staking::Pallet;
@@ -758,7 +760,7 @@ impl pallet_nomination_pools::Config for Runtime {
type MaxMetadataLen = ConstU32<256>;
type MaxUnbonding = ConstU32<8>;
type PalletId = NominationPoolsPalletId;
- type MinPointsToBalance = MinPointsToBalance;
+ type MaxPointsToBalance = MaxPointsToBalance;
}
parameter_types! {
@@ -1675,6 +1677,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext,
Runtime,
AllPalletsWithSystem,
+ pallet_nomination_pools::migration::v2::MigrateToV2,
>;
/// MMR helper types.
@@ -1832,6 +1835,12 @@ impl_runtime_apis! {
}
}
+ impl pallet_nomination_pools_runtime_api::NominationPoolsApi for Runtime {
+ fn pending_rewards(member_account: AccountId) -> Balance {
+ NominationPools::pending_rewards(member_account)
+ }
+ }
+
impl sp_consensus_babe::BabeApi for Runtime {
fn configuration() -> sp_consensus_babe::BabeGenesisConfiguration {
// The choice of `c` parameter (where `1 - c` represents the
diff --git a/client/api/src/leaves.rs b/client/api/src/leaves.rs
index 5859290777433..2e5d4be3a5462 100644
--- a/client/api/src/leaves.rs
+++ b/client/api/src/leaves.rs
@@ -67,8 +67,6 @@ impl FinalizationDisplaced {
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct LeafSet {
storage: BTreeMap, Vec>,
- pending_added: Vec<(H, N)>,
- pending_removed: Vec,
}
impl LeafSet
@@ -78,7 +76,7 @@ where
{
/// Construct a new, blank leaf set.
pub fn new() -> Self {
- Self { storage: BTreeMap::new(), pending_added: Vec::new(), pending_removed: Vec::new() }
+ Self { storage: BTreeMap::new() }
}
/// Read the leaf list from the DB, using given prefix for keys.
@@ -97,21 +95,21 @@ where
},
None => {},
}
- Ok(Self { storage, pending_added: Vec::new(), pending_removed: Vec::new() })
+ Ok(Self { storage })
}
- /// update the leaf list on import. returns a displaced leaf if there was one.
+ /// Update the leaf list on import.
+ /// Returns a displaced leaf if there was one.
pub fn import(&mut self, hash: H, number: N, parent_hash: H) -> Option> {
// avoid underflow for genesis.
let displaced = if number != N::zero() {
- let new_number = Reverse(number.clone() - N::one());
- let was_displaced = self.remove_leaf(&new_number, &parent_hash);
+ let parent_number = Reverse(number.clone() - N::one());
+ let was_displaced = self.remove_leaf(&parent_number, &parent_hash);
if was_displaced {
- self.pending_removed.push(parent_hash.clone());
Some(ImportDisplaced {
new_hash: hash.clone(),
- displaced: LeafSetItem { hash: parent_hash, number: new_number },
+ displaced: LeafSetItem { hash: parent_hash, number: parent_number },
})
} else {
None
@@ -121,7 +119,6 @@ where
};
self.insert_leaf(Reverse(number.clone()), hash.clone());
- self.pending_added.push((hash, number));
displaced
}
@@ -140,8 +137,6 @@ where
};
let below_boundary = self.storage.split_off(&Reverse(boundary));
- self.pending_removed
- .extend(below_boundary.values().flat_map(|h| h.iter()).cloned());
FinalizationDisplaced { leaves: below_boundary }
}
@@ -188,8 +183,6 @@ where
self.remove_leaf(number, hash),
"item comes from an iterator over storage; qed",
);
-
- self.pending_removed.push(hash.clone());
}
}
@@ -203,7 +196,6 @@ where
// this is an invariant of regular block import.
if !leaves_contains_best {
self.insert_leaf(best_number.clone(), best_hash.clone());
- self.pending_added.push((best_hash, best_number.0));
}
}
@@ -213,9 +205,9 @@ where
self.storage.iter().flat_map(|(_, hashes)| hashes.iter()).cloned().collect()
}
- /// Number of known leaves
+ /// Number of known leaves.
pub fn count(&self) -> usize {
- self.storage.len()
+ self.storage.values().map(|level| level.len()).sum()
}
/// Write the leaf list to the database transaction.
@@ -227,8 +219,6 @@ where
) {
let leaves: Vec<_> = self.storage.iter().map(|(n, h)| (n.0.clone(), h.clone())).collect();
tx.set_from_vec(column, prefix, leaves.encode());
- self.pending_added.clear();
- self.pending_removed.clear();
}
/// Check if given block is a leaf.
@@ -242,7 +232,7 @@ where
self.storage.entry(number).or_insert_with(Vec::new).push(hash);
}
- // returns true if this leaf was contained, false otherwise.
+ // Returns true if this leaf was contained, false otherwise.
fn remove_leaf(&mut self, number: &Reverse, hash: &H) -> bool {
let mut empty = false;
let removed = self.storage.get_mut(number).map_or(false, |leaves| {
@@ -285,7 +275,7 @@ where
pub fn undo_import(&mut self, displaced: ImportDisplaced) {
let new_number = Reverse(displaced.displaced.number.0.clone() + N::one());
self.inner.remove_leaf(&new_number, &displaced.new_hash);
- self.inner.insert_leaf(new_number, displaced.displaced.hash);
+ self.inner.insert_leaf(displaced.displaced.number, displaced.displaced.hash);
}
/// Undo a finalization operation by providing the displaced leaves.
@@ -294,13 +284,6 @@ where
}
}
-impl<'a, H: 'a, N: 'a> Drop for Undo<'a, H, N> {
- fn drop(&mut self) {
- self.inner.pending_added.clear();
- self.inner.pending_removed.clear();
- }
-}
-
#[cfg(test)]
mod tests {
use super::*;
@@ -315,15 +298,20 @@ mod tests {
set.import(2_1, 2, 1_1);
set.import(3_1, 3, 2_1);
+ assert_eq!(set.count(), 1);
assert!(set.contains(3, 3_1));
assert!(!set.contains(2, 2_1));
assert!(!set.contains(1, 1_1));
assert!(!set.contains(0, 0));
set.import(2_2, 2, 1_1);
+ set.import(1_2, 1, 0);
+ set.import(2_3, 2, 1_2);
+ assert_eq!(set.count(), 3);
assert!(set.contains(3, 3_1));
assert!(set.contains(2, 2_2));
+ assert!(set.contains(2, 2_3));
}
#[test]
@@ -392,17 +380,42 @@ mod tests {
}
#[test]
- fn undo_finalization() {
+ fn undo_import() {
let mut set = LeafSet::new();
set.import(10_1u32, 10u32, 0u32);
- set.import(11_1, 11, 10_2);
- set.import(11_2, 11, 10_2);
- set.import(12_1, 12, 11_123);
+ set.import(11_1, 11, 10_1);
+ set.import(11_2, 11, 10_1);
+
+ let displaced = set.import(12_1, 12, 11_1).unwrap();
+ assert_eq!(set.count(), 2);
+ assert!(set.contains(11, 11_2));
+ assert!(set.contains(12, 12_1));
+
+ set.undo().undo_import(displaced);
+ assert_eq!(set.count(), 2);
+ assert!(set.contains(11, 11_1));
+ assert!(set.contains(11, 11_2));
+ }
+
+ #[test]
+ fn undo_finalization() {
+ let mut set = LeafSet::new();
+ set.import(9_1u32, 9u32, 0u32);
+ set.import(10_1, 10, 9_1);
+ set.import(10_2, 10, 9_1);
+ set.import(11_1, 11, 10_1);
+ set.import(11_2, 11, 10_1);
+ set.import(12_1, 12, 11_2);
let displaced = set.finalize_height(11);
- assert!(!set.contains(10, 10_1));
+ assert_eq!(set.count(), 2);
+ assert!(set.contains(11, 11_1));
+ assert!(set.contains(12, 12_1));
set.undo().undo_finalization(displaced);
- assert!(set.contains(10, 10_1));
+ assert_eq!(set.count(), 3);
+ assert!(set.contains(11, 11_1));
+ assert!(set.contains(12, 12_1));
+ assert!(set.contains(10, 10_2));
}
}
diff --git a/client/authority-discovery/Cargo.toml b/client/authority-discovery/Cargo.toml
index 32a5e23bd49d9..012e6096aab80 100644
--- a/client/authority-discovery/Cargo.toml
+++ b/client/authority-discovery/Cargo.toml
@@ -22,7 +22,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features =
futures = "0.3.21"
futures-timer = "3.0.1"
ip_network = "0.4.1"
-libp2p = { version = "0.45.1", default-features = false, features = ["kad"] }
+libp2p = { version = "0.46.1", default-features = false, features = ["kad"] }
log = "0.4.17"
prost = "0.10"
rand = "0.7.2"
diff --git a/client/basic-authorship/src/basic_authorship.rs b/client/basic-authorship/src/basic_authorship.rs
index b67008bc6f44b..bc328c40edb3c 100644
--- a/client/basic-authorship/src/basic_authorship.rs
+++ b/client/basic-authorship/src/basic_authorship.rs
@@ -34,9 +34,7 @@ use sc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_INFO};
use sc_transaction_pool_api::{InPoolTransaction, TransactionPool};
use sp_api::{ApiExt, ProvideRuntimeApi};
use sp_blockchain::{ApplyExtrinsicFailed::Validity, Error::ApplyExtrinsicFailed, HeaderBackend};
-use sp_consensus::{
- evaluation, DisableProofRecording, EnableProofRecording, ProofRecording, Proposal,
-};
+use sp_consensus::{DisableProofRecording, EnableProofRecording, ProofRecording, Proposal};
use sp_core::traits::SpawnNamed;
use sp_inherents::InherentData;
use sp_runtime::{
@@ -205,7 +203,6 @@ where
let proposer = Proposer::<_, _, _, _, PR> {
spawn_handle: self.spawn_handle.clone(),
client: self.client.clone(),
- parent_hash,
parent_id: id,
parent_number: *parent_header.number(),
transaction_pool: self.transaction_pool.clone(),
@@ -250,7 +247,6 @@ where
pub struct Proposer {
spawn_handle: Box,
client: Arc,
- parent_hash: ::Hash,
parent_id: BlockId,
parent_number: <::Header as HeaderT>::Number,
transaction_pool: Arc,
@@ -536,12 +532,6 @@ where
"hash" => ?::Hash::from(block.header().hash()),
);
- if let Err(err) =
- evaluation::evaluate_initial(&block, &self.parent_hash, self.parent_number)
- {
- error!("Failed to evaluate authored block: {:?}", err);
- }
-
let proof =
PR::into_proof(proof).map_err(|e| sp_blockchain::Error::Application(Box::new(e)))?;
diff --git a/client/beefy/Cargo.toml b/client/beefy/Cargo.toml
index bd25496f2dfea..b910f7ce307a5 100644
--- a/client/beefy/Cargo.toml
+++ b/client/beefy/Cargo.toml
@@ -39,7 +39,7 @@ sp-runtime = { version = "6.0.0", path = "../../primitives/runtime" }
[dev-dependencies]
serde = "1.0.136"
-strum = { version = "0.23", features = ["derive"] }
+strum = { version = "0.24.1", features = ["derive"] }
tempfile = "3.1.0"
tokio = "1.17.0"
sc-consensus = { version = "0.10.0-dev", path = "../consensus/common" }
diff --git a/client/beefy/src/tests.rs b/client/beefy/src/tests.rs
index b5ff27c808908..78e697a6ada81 100644
--- a/client/beefy/src/tests.rs
+++ b/client/beefy/src/tests.rs
@@ -28,7 +28,6 @@ use sc_chain_spec::{ChainSpec, GenericChainSpec};
use sc_client_api::HeaderBackend;
use sc_consensus::BoxJustificationImport;
use sc_keystore::LocalKeystore;
-use sc_network::config::ProtocolConfig;
use sc_network_test::{
Block, BlockImportAdapter, FullPeerConfig, PassThroughVerifier, Peer, PeersClient,
TestNetFactory,
@@ -111,6 +110,7 @@ pub(crate) struct PeerData {
pub(crate) beefy_link_half: Mutex