diff --git a/.github/workflows/auto-label-issues.yml b/.github/workflows/auto-label-issues.yml
new file mode 100644
index 0000000000000000000000000000000000000000..cd889b5941989a62e0784a73e974b25c166e6f4c
--- /dev/null
+++ b/.github/workflows/auto-label-issues.yml
@@ -0,0 +1,17 @@
+# If the author of the issues is not a contributor to the project, label
+# the issue with 'Z0-unconfirmed'
+
+name: Label New Issues
+on:
+ issues:
+ types: [opened]
+
+jobs:
+ label-new-issues:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Label drafts
+ uses: andymckay/labeler@master
+ if: github.event.issue.author_association == 'NONE'
+ with:
+ add-labels: 'Z0-unconfirmed'
diff --git a/.github/workflows/auto-label-prs.yml b/.github/workflows/auto-label-prs.yml
new file mode 100644
index 0000000000000000000000000000000000000000..f0b8e9b343e29ce7eb25bfb41a3f56277b4d7558
--- /dev/null
+++ b/.github/workflows/auto-label-prs.yml
@@ -0,0 +1,21 @@
+name: Label PRs
+on:
+ pull_request:
+ types: [opened,ready_for_review]
+
+jobs:
+ label-new-prs:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Label drafts
+ uses: andymckay/labeler@master
+ if: github.event.pull_request.draft == true
+ with:
+ add-labels: 'A3-inprogress'
+ remove-labels: 'A0-pleasereview'
+ - name: Label PRs
+ uses: andymckay/labeler@master
+ if: github.event.pull_request.draft == false && ! contains(github.event.pull_request.labels.*.name, 'A2-insubstantial')
+ with:
+ add-labels: 'A0-pleasereview'
+ remove-labels: 'A3-inprogress'
diff --git a/.github/workflows/burnin-label-notification.yml b/.github/workflows/burnin-label-notification.yml
new file mode 100644
index 0000000000000000000000000000000000000000..da422a659ee08600885c4241bbd39ddb5e62f25d
--- /dev/null
+++ b/.github/workflows/burnin-label-notification.yml
@@ -0,0 +1,17 @@
+name: Notify devops when burn-in label applied
+on:
+ pull_request:
+ types: [labeled]
+
+jobs:
+ notify-devops:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Notify devops
+ if: github.event.label.name == 'A1-needsburnin'
+ uses: s3krit/matrix-message-action@v0.0.2
+ with:
+ room_id: ${{ secrets.POLKADOT_DEVOPS_MATRIX_ROOM_ID }}
+ access_token: ${{ secrets.POLKADOT_DEVOPS_MATRIX_ACCESS_TOKEN }}
+ message: "@room Burn-in request received for [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})"
+ server: "matrix.parity.io"
diff --git a/.github/workflows/polkadot-companion-labels.yml b/.github/workflows/polkadot-companion-labels.yml
new file mode 100644
index 0000000000000000000000000000000000000000..27f743e1bd4529dc83ee7dfd5b96c6c5bb4ac3f8
--- /dev/null
+++ b/.github/workflows/polkadot-companion-labels.yml
@@ -0,0 +1,31 @@
+name: Check Polkadot Companion and Label
+
+on:
+ pull_request:
+ types: [opened, synchronize]
+
+jobs:
+ check_status:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Monitor the status of the gitlab-check-companion-build job
+ uses: s3krit/await-status-action@v1.0.1
+ id: 'check-companion-status'
+ with:
+ authToken: ${{ secrets.GITHUB_TOKEN }}
+ ref: ${{ github.event.pull_request.head.sha }}
+ contexts: 'continuous-integration/gitlab-check-polkadot-companion-build'
+ timeout: 1800
+ notPresentTimeout: 3600 # It can take quite a while before the job starts...
+ failureStates: failure
+ interruptedStates: error # Error = job was probably cancelled. We don't want to label the PR in that case
+ - name: Label success
+ uses: andymckay/labeler@master
+ if: steps.check-companion-status.outputs.result == 'success'
+ with:
+ remove-labels: 'A7-needspolkadotpr'
+ - name: Label failure
+ uses: andymckay/labeler@master
+ if: steps.check-companion-status.outputs.result == 'failure'
+ with:
+ add-labels: 'A7-needspolkadotpr'
diff --git a/.gitignore b/.gitignore
index 6398c09fe796278130978c2a8598ee9270399388..353d49df28f34b896567b0aa91bb08e056a5832c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,4 @@ rls*.log
.local
**/hfuzz_target/
**/hfuzz_workspace/
+.cargo/
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0c06ace76cf8e494fb08c1ba03eebeeb7ac5a4d6..d3a7f36980063cb6719eee6494f909d360c42c5c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,7 +10,7 @@
#
# my-example-job:
# stage: test # One of the stages listed below this job (required)
-# image: parity/tools:latest # Any docker image (required)
+# image: paritytech/tools:latest # Any docker image (required)
# allow_failure: true # Allow the pipeline to continue if this job fails (default: false)
# dependencies:
# - build-rust-doc-release # Any jobs that are required to run before this job (optional)
@@ -22,6 +22,7 @@
# - ./.maintain/gitlab/my_amazing_script.sh
stages:
+ - check
- test
- build
- post-build-test
@@ -29,21 +30,18 @@ stages:
- kubernetes
- flaming-fir
-variables:
+variables: &default-vars
GIT_STRATEGY: fetch
GIT_DEPTH: 100
- SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache"
CARGO_INCREMENTAL: 0
- CI_SERVER_NAME: "GitLab CI"
DOCKER_OS: "debian:stretch"
ARCH: "x86_64"
# FIXME set to release
CARGO_UNLEASH_INSTALL_PARAMS: "--version 1.0.0-alpha.10"
CARGO_UNLEASH_PKG_DEF: "--skip node node-* pallet-template pallet-example pallet-example-* subkey chain-spec-builder"
- CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER: "wasm-bindgen-test-runner"
- WASM_BINDGEN_TEST_TIMEOUT: 120
- CHROMEDRIVER_ARGS: "--log-level=INFO --whitelisted-ips=127.0.0.1"
+default:
+ cache: {}
.collect-artifacts: &collect-artifacts
artifacts:
@@ -58,9 +56,10 @@ variables:
- kubernetes-parity-build
environment:
name: parity-build
+ interruptible: true
.docker-env: &docker-env
- image: parity/rust-builder:latest
+ image: paritytech/ci-linux:production
before_script:
- rustup show
- cargo --version
@@ -77,7 +76,6 @@ variables:
- runner_system_failure
- unknown_failure
- api_failure
- dependencies: []
interruptible: true
tags:
- linux-docker
@@ -92,7 +90,7 @@ variables:
#### stage: .pre
skip-if-draft:
- image: parity/tools:latest
+ image: paritytech/tools:latest
<<: *kubernetes-build
stage: .pre
only:
@@ -100,51 +98,53 @@ skip-if-draft:
script:
- ./.maintain/gitlab/skip_if_draft.sh
-#### stage: test
+#### stage: check
check-runtime:
- stage: test
- image: parity/tools:latest
+ stage: check
+ image: paritytech/tools:latest
<<: *kubernetes-build
only:
- /^[0-9]+$/
variables:
+ <<: *default-vars
GITLAB_API: "https://gitlab.parity.io/api/v4"
GITHUB_API_PROJECT: "parity%2Finfrastructure%2Fgithub-api"
script:
- ./.maintain/gitlab/check_runtime.sh
- interruptible: true
allow_failure: true
check-signed-tag:
- stage: test
- image: parity/tools:latest
+ stage: check
+ image: paritytech/tools:latest
<<: *kubernetes-build
only:
- /^ci-release-.*$/
- /^v[0-9]+\.[0-9]+\.[0-9]+.*$/
script:
- ./.maintain/gitlab/check_signed.sh
- allow_failure: false
check-line-width:
- stage: test
- image: parity/tools:latest
+ stage: check
+ image: paritytech/tools:latest
<<: *kubernetes-build
only:
- /^[0-9]+$/
script:
- ./.maintain/gitlab/check_line_width.sh
- interruptible: true
allow_failure: true
-check-polkadot-companion-build:
- stage: build
- <<: *docker-env
+test-dependency-rules:
+ stage: check
+ image: paritytech/tools:latest
+ <<: *kubernetes-build
+ except:
+ variables:
+ - $DEPLOY_TAG
script:
- - ./.maintain/gitlab/check_polkadot_companion_build.sh
- interruptible: true
- allow_failure: true
+ - .maintain/ensure-deps.sh
+
+#### stage: test
cargo-audit:
stage: test
@@ -158,6 +158,10 @@ cargo-audit:
cargo-deny:
stage: test
<<: *docker-env
+ only:
+ - schedules
+ - tags
+ - web
script:
- cargo deny check --hide-inclusion-graph -c .maintain/deny.toml
after_script:
@@ -175,6 +179,8 @@ cargo-check-benches:
<<: *docker-env
script:
- BUILD_DUMMY_WASM_BINARY=1 time cargo +nightly check --benches --all
+ - cargo run --release -p node-bench -- ::node::import::native::sr25519::transfer_keep_alive::paritydb::small
+ - cargo run --release -p node-bench -- ::trie::read::small
- sccache -s
cargo-check-subkey:
@@ -191,33 +197,17 @@ test-linux-stable: &test-linux
stage: test
<<: *docker-env
variables:
+ <<: *default-vars
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
- RUSTFLAGS: -Cdebug-assertions=y
+ RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
+ RUST_BACKTRACE: 1
except:
variables:
- $DEPLOY_TAG
script:
- - WASM_BUILD_NO_COLOR=1 time cargo test --all --release --verbose --locked |&
- tee output.log
+ - WASM_BUILD_NO_COLOR=1 time cargo test --all --release --verbose --locked
- sccache -s
- - echo "____Test job successful, checking for warnings____"
- - awk '/^warning:/,/^$/ { print }' output.log > ${CI_COMMIT_SHORT_SHA}_warnings.log
- - if [ -s ${CI_COMMIT_SHORT_SHA}_warnings.log ]; then
- cat ${CI_COMMIT_SHORT_SHA}_warnings.log;
- exit 1;
- else
- echo "___No warnings___";
- fi
-
-test-dependency-rules:
- stage: test
- <<: *docker-env
- except:
- variables:
- - $DEPLOY_TAG
- script:
- - .maintain/ensure-deps.sh
unleash-check:
stage: test
@@ -230,9 +220,11 @@ unleash-check:
- cargo unleash check ${CARGO_UNLEASH_PKG_DEF}
test-frame-staking:
+ # into one job
stage: test
<<: *docker-env
variables:
+ <<: *default-vars
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: -Cdebug-assertions=y
@@ -242,13 +234,15 @@ test-frame-staking:
- $DEPLOY_TAG
script:
- cd frame/staking/
- - WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --no-default-features --features "std testing-utils"
+ - WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --no-default-features --features "std"
- sccache -s
test-frame-examples-compile-to-wasm:
+ # into one job
stage: test
<<: *docker-env
variables:
+ <<: *default-vars
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: -Cdebug-assertions=y
@@ -267,8 +261,9 @@ test-wasmtime:
stage: test
<<: *docker-env
variables:
+ <<: *default-vars
# Enable debug assertions since we are running optimized builds for testing
- # but still want to have debug assertions.
+ # but still want to have debug assertions.
RUSTFLAGS: -Cdebug-assertions=y
RUST_BACKTRACE: 1
except:
@@ -280,9 +275,11 @@ test-wasmtime:
- sccache -s
test-runtime-benchmarks:
+ # into one job
stage: test
<<: *docker-env
variables:
+ <<: *default-vars
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: -Cdebug-assertions=y
@@ -292,7 +289,7 @@ test-runtime-benchmarks:
- $DEPLOY_TAG
script:
- cd bin/node/cli
- - WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --features runtime-benchmarks
+ - WASM_BUILD_NO_COLOR=1 time cargo test --workspace --release --verbose --features runtime-benchmarks
- sccache -s
test-linux-stable-int:
@@ -305,7 +302,8 @@ test-linux-stable-int:
script:
- echo "___Logs will be partly shown at the end in case of failure.___"
- echo "___Full log will be saved to the job artifacts only in case of failure.___"
- - WASM_BUILD_NO_COLOR=1 RUST_LOG=sync=trace,consensus=trace,client=trace,state-db=trace,db=trace,forks=trace,state_db=trace,storage_cache=trace
+ - WASM_BUILD_NO_COLOR=1
+ RUST_LOG=sync=trace,consensus=trace,client=trace,state-db=trace,db=trace,forks=trace,state_db=trace,storage_cache=trace
time cargo test -p node-cli --release --verbose --locked -- --ignored
&> ${CI_COMMIT_SHORT_SHA}_int_failure.log
- sccache -s
@@ -341,6 +339,7 @@ test-full-crypto-feature:
stage: test
<<: *docker-env
variables:
+ <<: *default-vars
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: -Cdebug-assertions=y
@@ -357,6 +356,7 @@ test-full-crypto-feature:
cargo-check-macos:
stage: test
+ # shell runner on mac ignores the image set in *docker-env
<<: *docker-env
script:
- BUILD_DUMMY_WASM_BINARY=1 time cargo check --release
@@ -364,14 +364,46 @@ cargo-check-macos:
tags:
- osx
+test-prometheus-alerting-rules:
+ stage: test
+ image: paritytech/tools:latest
+ <<: *kubernetes-build
+ script:
+ - promtool check rules .maintain/monitoring/alerting-rules/alerting-rules.yaml
+ - cat .maintain/monitoring/alerting-rules/alerting-rules.yaml | promtool test rules .maintain/monitoring/alerting-rules/alerting-rule-tests.yaml
+
#### stage: build
+check-polkadot-companion-status:
+ stage: build
+ image: paritytech/tools:latest
+ <<: *kubernetes-build
+ only:
+ - /^[0-9]+$/ # PRs
+ script:
+ - ./.maintain/gitlab/check_polkadot_companion_status.sh
+
+check-polkadot-companion-build:
+ stage: build
+ <<: *docker-env
+ needs:
+ - job: test-linux-stable-int
+ artifacts: false
+ script:
+ - ./.maintain/gitlab/check_polkadot_companion_build.sh
+ allow_failure: true
+
test-browser-node:
stage: build
<<: *docker-env
needs:
- job: check-web-wasm
artifacts: false
+ variables:
+ <<: *default-vars
+ CHROMEDRIVER_ARGS: "--log-level=INFO --whitelisted-ips=127.0.0.1"
+ CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER: "wasm-bindgen-test-runner"
+ WASM_BINDGEN_TEST_TIMEOUT: 120
script:
- cargo +nightly test --target wasm32-unknown-unknown -p node-browser-testing -Z features=itarget
@@ -380,6 +412,9 @@ build-linux-substrate: &build-binary
<<: *collect-artifacts
<<: *docker-env
<<: *build-only
+ needs:
+ - job: test-linux-stable
+ artifacts: false
before_script:
- mkdir -p ./artifacts/substrate/
except:
@@ -394,7 +429,7 @@ build-linux-substrate: &build-binary
else
./artifacts/substrate/substrate --version |
sed -n -E 's/^substrate ([0-9.]+.*-[0-9a-f]{7,13})-.*$/\1/p' |
- tee ./artifacts/substrate/VERSION;
+ tee ./artifacts/substrate/VERSION;
fi
- sha256sum ./artifacts/substrate/substrate | tee ./artifacts/substrate/substrate.sha256
- printf '\n# building node-template\n\n'
@@ -405,6 +440,9 @@ build-linux-substrate: &build-binary
build-linux-subkey: &build-subkey
<<: *build-binary
+ needs:
+ - job: cargo-check-subkey
+ artifacts: false
before_script:
- mkdir -p ./artifacts/subkey
script:
@@ -441,23 +479,16 @@ build-rust-doc-release:
<<: *build-only
script:
- rm -f ./crate-docs/index.html # use it as an indicator if the job succeeds
- - BUILD_DUMMY_WASM_BINARY=1 RUSTDOCFLAGS="--html-in-header $(pwd)/.maintain/rustdoc-header.html" time cargo +nightly doc --release --all --verbose
+ - BUILD_DUMMY_WASM_BINARY=1 RUSTDOCFLAGS="--html-in-header $(pwd)/.maintain/rustdoc-header.html"
+ time cargo +nightly doc --release --all --verbose
- cp -R ./target/doc ./crate-docs
- echo "" > ./crate-docs/index.html
- sccache -s
-check-polkadot-companion-status:
- stage: post-build-test
- image: parity/tools:latest
- <<: *kubernetes-build
- only:
- - /^[0-9]+$/
- script:
- - ./.maintain/gitlab/check_polkadot_companion_status.sh
-
+#### stage: post-build-test
trigger-contracts-ci:
- stage: publish
+ stage: post-build-test
needs:
- job: build-linux-substrate
artifacts: false
@@ -473,12 +504,19 @@ trigger-contracts-ci:
#### stage: publish
-.publish-docker-release: &publish-docker-release
+.build-push-docker-image: &build-push-docker-image
<<: *build-only
<<: *kubernetes-build
image: docker:stable
services:
- docker:dind
+ variables: &docker-build-vars
+ <<: *default-vars
+ DOCKER_HOST: tcp://localhost:2375
+ DOCKER_DRIVER: overlay2
+ GIT_STRATEGY: none
+ DOCKERFILE: $PRODUCT.Dockerfile
+ CONTAINER_IMAGE: parity/$PRODUCT
before_script:
- test "$Docker_Hub_User_Parity" -a "$Docker_Hub_Pass_Parity"
|| ( echo "no docker credentials provided"; exit 1 )
@@ -500,18 +538,15 @@ trigger-contracts-ci:
publish-docker-substrate:
stage: publish
- <<: *publish-docker-release
+ <<: *build-push-docker-image
# collect VERSION artifact here to pass it on to kubernetes
<<: *collect-artifacts
- dependencies:
- - build-linux-substrate
+ needs:
+ - job: build-linux-substrate
+ artifacts: true
variables:
- DOCKER_HOST: tcp://localhost:2375
- DOCKER_DRIVER: overlay2
- GIT_STRATEGY: none
+ <<: *docker-build-vars
PRODUCT: substrate
- DOCKERFILE: $PRODUCT.Dockerfile
- CONTAINER_IMAGE: parity/$PRODUCT
after_script:
- docker logout
# only VERSION information is needed for the deployment
@@ -519,16 +554,13 @@ publish-docker-substrate:
publish-docker-subkey:
stage: publish
- <<: *publish-docker-release
- dependencies:
- - build-linux-subkey
+ <<: *build-push-docker-image
+ needs:
+ - job: build-linux-subkey
+ artifacts: true
variables:
- DOCKER_HOST: tcp://localhost:2375
- DOCKER_DRIVER: overlay2
- GIT_STRATEGY: none
+ <<: *docker-build-vars
PRODUCT: subkey
- DOCKERFILE: $PRODUCT.Dockerfile
- CONTAINER_IMAGE: parity/$PRODUCT
after_script:
- docker logout
@@ -536,10 +568,12 @@ publish-s3-release:
stage: publish
<<: *build-only
<<: *kubernetes-build
- dependencies:
- - build-linux-substrate
- - build-linux-subkey
- image: parity/awscli:latest
+ needs:
+ - job: build-linux-substrate
+ artifacts: true
+ - job: build-linux-subkey
+ artifacts: true
+ image: paritytech/awscli:latest
variables:
GIT_STRATEGY: none
BUCKET: "releases.parity.io"
@@ -555,11 +589,11 @@ publish-s3-release:
publish-s3-doc:
stage: publish
- image: parity/awscli:latest
+ image: paritytech/awscli:latest
allow_failure: true
- dependencies:
- - build-rust-doc-release
- cache: {}
+ needs:
+ - job: build-rust-doc-release
+ artifacts: true
<<: *build-only
<<: *kubernetes-build
variables:
@@ -579,13 +613,12 @@ publish-s3-doc:
publish-draft-release:
stage: publish
- image: parity/tools:latest
+ image: paritytech/tools:latest
only:
- /^ci-release-.*$/
- /^v[0-9]+\.[0-9]+\.[0-9]+.*$/
script:
- ./.maintain/gitlab/publish_draft_release.sh
- interruptible: true
allow_failure: true
publish-to-crates-io:
@@ -597,14 +630,13 @@ publish-to-crates-io:
script:
- cargo install cargo-unleash ${CARGO_UNLEASH_INSTALL_PARAMS}
- cargo unleash em-dragons --no-check ${CARGO_UNLEASH_PKG_DEF}
- interruptible: true
allow_failure: true
.deploy-template: &deploy
stage: kubernetes
when: manual
retry: 1
- image: parity/kubetools:latest
+ image: paritytech/kubetools:latest
<<: *build-only
tags:
# this is the runner that is used to deploy it
@@ -618,18 +650,18 @@ publish-to-crates-io:
- echo "Substrate version = ${DEPLOY_TAG}"
# or use helm to render the template
- helm template
- --values ./.maintain/kubernetes/values.yaml
- --set image.tag=${DEPLOY_TAG}
- --set validator.keys=${VALIDATOR_KEYS}
- ./.maintain/kubernetes | kubectl apply -f - --dry-run=false
+ --values ./.maintain/kubernetes/values.yaml
+ --set image.tag=${DEPLOY_TAG}
+ --set validator.keys=${VALIDATOR_KEYS}
+ ./.maintain/kubernetes | kubectl apply -f - --dry-run=false
- echo "# substrate namespace ${KUBE_NAMESPACE}"
- kubectl -n ${KUBE_NAMESPACE} get all
- echo "# substrate's nodes' external ip addresses:"
- kubectl get nodes -l node=substrate
- -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{range @.status.addresses[?(@.type=="ExternalIP")]}{.address}{"\n"}{end}'
+ -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{range @.status.addresses[?(@.type=="ExternalIP")]}{.address}{"\n"}{end}'
- echo "# substrate' nodes"
- kubectl -n ${KUBE_NAMESPACE} get pods
- -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.nodeName}{"\n"}{end}'
+ -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.nodeName}{"\n"}{end}'
- echo "# wait for the rollout to complete"
- kubectl -n ${KUBE_NAMESPACE} rollout status statefulset/substrate
@@ -637,8 +669,9 @@ publish-to-crates-io:
.deploy-cibuild: &deploy-cibuild
<<: *deploy
- dependencies:
- - publish-docker-substrate
+ needs:
+ - job: publish-docker-substrate
+ artifacts: false
.deploy-tag: &deploy-tag
<<: *deploy
@@ -669,14 +702,16 @@ deploy-ue1-tag:
name: parity-prod-ue1
.validator-deploy: &validator-deploy
- # script will fail if there is no artifacts/substrate/VERSION
<<: *build-only
stage: flaming-fir
- dependencies:
- - build-linux-substrate
+ needs:
+ # script will fail if there is no artifacts/substrate/VERSION
+ - job: publish-docker-substrate
+ artifacts: true
image: parity/azure-ansible:v1
allow_failure: true
when: manual
+ interruptible: true
tags:
- linux-docker
@@ -684,15 +719,29 @@ validator 1 4:
<<: *validator-deploy
script:
- ./.maintain/flamingfir-deploy.sh flamingfir-validator1
+
validator 2 4:
<<: *validator-deploy
script:
- ./.maintain/flamingfir-deploy.sh flamingfir-validator2
+
validator 3 4:
<<: *validator-deploy
script:
- ./.maintain/flamingfir-deploy.sh flamingfir-validator3
+
validator 4 4:
<<: *validator-deploy
script:
- ./.maintain/flamingfir-deploy.sh flamingfir-validator4
+
+#### stage: .post
+
+check-labels:
+ stage: .post
+ image: paritytech/tools:latest
+ <<: *kubernetes-build
+ only:
+ - /^[0-9]+$/
+ script:
+ - ./.maintain/gitlab/check_labels.sh
diff --git a/.maintain/flamingfir-deploy.sh b/.maintain/flamingfir-deploy.sh
index 596bb04ece091cd03f3c993d655f5d45770362ea..8f0fb3a2bc016067d0bf11ae993a3bfa1636280f 100755
--- a/.maintain/flamingfir-deploy.sh
+++ b/.maintain/flamingfir-deploy.sh
@@ -5,7 +5,7 @@ RETRY_ATTEMPT=0
SLEEP_TIME=15
TARGET_HOST="$1"
COMMIT=$(cat artifacts/substrate/VERSION)
-DOWNLOAD_URL="https://releases.parity.io/substrate/x86_64-debian:stretch/${COMMIT}/substrate"
+DOWNLOAD_URL="https://releases.parity.io/substrate/x86_64-debian:stretch/${COMMIT}/substrate/substrate"
POST_DATA='{"extra_vars":{"artifact_path":"'${DOWNLOAD_URL}'","target_host":"'${TARGET_HOST}'"}}'
JOB_ID=$(wget -O - --header "Authorization: Bearer ${AWX_TOKEN}" --header "Content-type: application/json" --post-data "${POST_DATA}" https://ansible-awx.parity.io/api/v2/job_templates/32/launch/ | jq .job)
diff --git a/.maintain/gitlab/check_labels.sh b/.maintain/gitlab/check_labels.sh
new file mode 100755
index 0000000000000000000000000000000000000000..5ab099b38291cc66b6f370430b8f06e6b2f5c24f
--- /dev/null
+++ b/.maintain/gitlab/check_labels.sh
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+
+#shellcheck source=lib.sh
+source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/lib.sh"
+
+ensure_labels() {
+ for label in "$@"; do
+ if has_label 'paritytech/substrate' "$CI_COMMIT_BRANCH" "$label"; then
+ return 0
+ fi
+ done
+ return 1
+}
+
+# Must have one of the following labels
+releasenotes_labels=(
+ 'B0-silent'
+ 'B3-apinoteworthy'
+ 'B5-clientnoteworthy'
+ 'B7-runtimenoteworthy'
+)
+
+criticality_labels=(
+ 'C1-low'
+ 'C3-medium'
+ 'C7-high'
+ 'C9-critical'
+)
+
+echo "[+] Checking release notes (B) labels for $CI_COMMIT_BRANCH"
+if ensure_labels "${releasenotes_labels[@]}"; then
+ echo "[+] Release notes label detected. All is well."
+else
+ echo "[!] Release notes label not detected. Please add one of: ${releasenotes_labels[*]}"
+ exit 1
+fi
+
+echo "[+] Checking release criticality (C) labels for $CI_COMMIT_BRANCH"
+if ensure_labels "${criticality_labels[@]}"; then
+ echo "[+] Release criticality label detected. All is well."
+else
+ echo "[!] Release criticality label not detected. Please add one of: ${criticality_labels[*]}"
+ exit 1
+fi
+
+exit 0
diff --git a/.maintain/gitlab/check_line_width.sh b/.maintain/gitlab/check_line_width.sh
index 85092260b6a649187de6d03c0936cb0d54fc751e..611d3ae2681e2ef145753a0f774c5183fc9df7d9 100755
--- a/.maintain/gitlab/check_line_width.sh
+++ b/.maintain/gitlab/check_line_width.sh
@@ -10,14 +10,15 @@ BASE_BRANCH_NAME="master"
LINE_WIDTH="120"
GOOD_LINE_WIDTH="100"
BASE_BRANCH="${BASE_ORIGIN}/${BASE_BRANCH_NAME}"
+git fetch ${BASE_ORIGIN} ${BASE_BRANCH_NAME} --depth 100
+BASE_HASH=$(git merge-base ${BASE_BRANCH} HEAD)
-git fetch ${BASE_ORIGIN} ${BASE_BRANCH_NAME} --depth 1
-git diff --name-only ${BASE_BRANCH} -- \*.rs | ( while read file
+git diff --name-only ${BASE_HASH} -- \*.rs | ( while read file
do
if [ ! -f ${file} ];
then
echo "Skipping removed file."
- elif git diff ${BASE_BRANCH} -- ${file} | grep -q "^+.\{$(( $LINE_WIDTH + 1 ))\}"
+ elif git diff ${BASE_HASH} -- ${file} | grep -q "^+.\{$(( $LINE_WIDTH + 1 ))\}"
then
if [ -z "${FAIL}" ]
then
@@ -29,11 +30,11 @@ do
FAIL="true"
fi
echo "| file: ${file}"
- git diff ${BASE_BRANCH} -- ${file} \
+ git diff ${BASE_HASH} -- ${file} \
| grep -n "^+.\{$(( $LINE_WIDTH + 1))\}"
echo "|"
else
- if git diff ${BASE_BRANCH} -- ${file} | grep -q "^+.\{$(( $GOOD_LINE_WIDTH + 1 ))\}"
+ if git diff ${BASE_HASH} -- ${file} | grep -q "^+.\{$(( $GOOD_LINE_WIDTH + 1 ))\}"
then
if [ -z "${FAIL}" ]
then
@@ -44,7 +45,7 @@ do
echo "|"
fi
echo "| file: ${file}"
- git diff ${BASE_BRANCH} -- ${file} | grep -n "^+.\{$(( $GOOD_LINE_WIDTH + 1 ))\}"
+ git diff ${BASE_HASH} -- ${file} | grep -n "^+.\{$(( $GOOD_LINE_WIDTH + 1 ))\}"
echo "|"
fi
fi
diff --git a/.maintain/gitlab/check_runtime.sh b/.maintain/gitlab/check_runtime.sh
index 5b7e25e3afc4eabef01d984047a98d675ab09757..6d009c5aafc6a8907fb9d8e598e8870854af8db7 100755
--- a/.maintain/gitlab/check_runtime.sh
+++ b/.maintain/gitlab/check_runtime.sh
@@ -67,7 +67,7 @@ sub_spec_version="$(git diff tags/release...${CI_COMMIT_SHA} ${VERSIONS_FILE} \
if [ "${add_spec_version}" != "${sub_spec_version}" ]
then
- github_label "B2-breaksapi"
+ github_label "D2-breaksapi"
boldcat <<-EOT
diff --git a/.maintain/gitlab/generate_changelog.sh b/.maintain/gitlab/generate_changelog.sh
index ba2a507e4cac694f918aa2c88cf1585991faa373..b872d324438d64bd2b64cdf9745bf76a983675ed 100755
--- a/.maintain/gitlab/generate_changelog.sh
+++ b/.maintain/gitlab/generate_changelog.sh
@@ -19,18 +19,17 @@ while IFS= read -r line; do
if has_label 'paritytech/substrate' "$pr_id" 'B0-silent'; then
continue
fi
- if has_label 'paritytech/substrate' "$pr_id" 'B1-runtimenoteworthy'; then
- runtime_changes="$runtime_changes
+ if has_label 'paritytech/substrate' "$pr_id" 'B3-apinoteworthy' ; then
+ api_changes="$api_changes
$line"
fi
- if has_label 'paritytech/substrate' "$pr_id" 'B1-clientnoteworthy'; then
+ if has_label 'paritytech/substrate' "$pr_id" 'B5-clientnoteworthy'; then
client_changes="$client_changes
$line"
fi
- if has_label 'paritytech/substrate' "$pr_id" 'B1-apinoteworthy' ; then
- api_changes="$api_changes
+ if has_label 'paritytech/substrate' "$pr_id" 'B7-runtimenoteworthy'; then
+ runtime_changes="$runtime_changes
$line"
- continue
fi
done <<< "$all_changes"
diff --git a/.maintain/gitlab/lib.sh b/.maintain/gitlab/lib.sh
index ecc9a5f54288cd4636a05cb7f2a2d0535e40ebe9..33477b52f5891a6855f15aec62cd3c41454dc85c 100755
--- a/.maintain/gitlab/lib.sh
+++ b/.maintain/gitlab/lib.sh
@@ -5,7 +5,7 @@ api_base="https://api.github.com/repos"
# Function to take 2 git tags/commits and get any lines from commit messages
# that contain something that looks like a PR reference: e.g., (#1234)
sanitised_git_logs(){
- git --no-pager log --pretty=format:"%s" "$1..$2" |
+ git --no-pager log --pretty=format:"%s" "$1...$2" |
# Only find messages referencing a PR
grep -E '\(#[0-9]+\)' |
# Strip any asterisks
@@ -66,8 +66,12 @@ has_label(){
repo="$1"
pr_id="$2"
label="$3"
- out=$(curl -H "Authorization: token $GITHUB_RELEASE_TOKEN" -s "$api_base/$repo/pulls/$pr_id")
- [ -n "$(echo "$out" | jq ".labels | .[] | select(.name==\"$label\")")" ]
+ if [ -n "$GITHUB_RELEASE_TOKEN" ]; then
+ out=$(curl -H "Authorization: token $GITHUB_RELEASE_TOKEN" -s "$api_base/$repo/pulls/$pr_id")
+ else
+ out=$(curl -H "Authorization: token $GITHUB_PR_TOKEN" -s "$api_base/$repo/pulls/$pr_id")
+ fi
+ [ -n "$(echo "$out" | tr -d '\r\n' | jq ".labels | .[] | select(.name==\"$label\")")" ]
}
# Formats a message into a JSON string for posting to Matrix
diff --git a/.maintain/monitoring/alerting-rules/alerting-rule-tests.yaml b/.maintain/monitoring/alerting-rules/alerting-rule-tests.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..288750be3c108f3f9b820e038d81997626897806
--- /dev/null
+++ b/.maintain/monitoring/alerting-rules/alerting-rule-tests.yaml
@@ -0,0 +1,262 @@
+rule_files:
+ - /dev/stdin
+
+evaluation_interval: 1m
+
+tests:
+ - interval: 1m
+ input_series:
+ - series: 'polkadot_sub_libp2p_peers_count{
+ job="polkadot",
+ pod="polkadot-abcdef01234-abcdef",
+ instance="polkadot-abcdef01234-abcdef",
+ }'
+ values: '3 2+0x4 1+0x9' # 3 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
+
+ - series: 'polkadot_sub_txpool_validations_scheduled{
+ job="polkadot",
+ pod="polkadot-abcdef01234-abcdef",
+ instance="polkadot-abcdef01234-abcdef",
+ }'
+ values: '11+1x10 22+2x30 10043x5'
+
+ - series: 'polkadot_sub_txpool_validations_finished{
+ job="polkadot",
+ pod="polkadot-abcdef01234-abcdef",
+ instance="polkadot-abcdef01234-abcdef",
+ }'
+ values: '0+1x42 42x5'
+
+ - series: 'polkadot_block_height{
+ status="best", job="polkadot",
+ pod="polkadot-abcdef01234-abcdef",
+ instance="polkadot-abcdef01234-abcdef",
+ }'
+ values: '1+1x3 4+0x13' # 1 2 3 4 4 4 4 4 4 4 4 4 ...
+
+ - series: 'polkadot_block_height{
+ status="finalized",
+ job="polkadot",
+ pod="polkadot-abcdef01234-abcdef",
+ instance="polkadot-abcdef01234-abcdef",
+ }'
+ values: '1+1x3 4+0x13' # 1 2 3 4 4 4 4 4 4 4 4 4 ...
+
+ - series: 'polkadot_cpu_usage_percentage{
+ job="polkadot",
+ pod="polkadot-abcdef01234-abcdef",
+ instance="polkadot-abcdef01234-abcdef",
+ }'
+ values: '0+20x5 100+0x5' # 0 20 40 60 80 100 100 100 100 100 100
+
+ alert_rule_test:
+
+ ######################################################################
+ # Resource usage
+ ######################################################################
+
+ - eval_time: 9m
+ alertname: HighCPUUsage
+ exp_alerts:
+ - eval_time: 10m
+ alertname: HighCPUUsage
+ exp_alerts:
+ - exp_labels:
+ severity: warning
+ pod: polkadot-abcdef01234-abcdef
+ instance: polkadot-abcdef01234-abcdef
+ job: polkadot
+ exp_annotations:
+ message: "The node polkadot-abcdef01234-abcdef has a CPU
+ usage higher than 100% for more than 5 minutes"
+
+ ######################################################################
+ # Block production
+ ######################################################################
+
+ - eval_time: 6m
+ alertname: LowNumberOfNewBlocks
+ exp_alerts:
+ - eval_time: 7m
+ alertname: LowNumberOfNewBlocks
+ exp_alerts:
+ - exp_labels:
+ severity: warning
+ pod: polkadot-abcdef01234-abcdef
+ instance: polkadot-abcdef01234-abcdef
+ job: polkadot
+ status: best
+ exp_annotations:
+ message: "Less than one new block per minute on instance
+ polkadot-abcdef01234-abcdef."
+
+ - eval_time: 14m
+ alertname: LowNumberOfNewBlocks
+ exp_alerts:
+ - exp_labels:
+ severity: warning
+ pod: polkadot-abcdef01234-abcdef
+ instance: polkadot-abcdef01234-abcdef
+ job: polkadot
+ status: best
+ exp_annotations:
+ message: "Less than one new block per minute on instance
+ polkadot-abcdef01234-abcdef."
+ - exp_labels:
+ severity: critical
+ pod: polkadot-abcdef01234-abcdef
+ instance: polkadot-abcdef01234-abcdef
+ job: polkadot
+ status: best
+ exp_annotations:
+ message: "Less than one new block per minute on instance
+ polkadot-abcdef01234-abcdef."
+
+ ######################################################################
+ # Block finalization
+ ######################################################################
+
+ - eval_time: 6m
+ alertname: BlockFinalizationSlow
+ exp_alerts:
+ - eval_time: 7m
+ alertname: BlockFinalizationSlow
+ exp_alerts:
+ - exp_labels:
+ severity: warning
+ pod: polkadot-abcdef01234-abcdef
+ instance: polkadot-abcdef01234-abcdef
+ job: polkadot
+ status: finalized
+ exp_annotations:
+ message: "Finalized block on instance
+ polkadot-abcdef01234-abcdef increases by less than 1 per
+ minute."
+
+ - eval_time: 14m
+ alertname: BlockFinalizationSlow
+ exp_alerts:
+ - exp_labels:
+ severity: warning
+ pod: polkadot-abcdef01234-abcdef
+ instance: polkadot-abcdef01234-abcdef
+ job: polkadot
+ status: finalized
+ exp_annotations:
+ message: "Finalized block on instance
+ polkadot-abcdef01234-abcdef increases by less than 1 per
+ minute."
+ - exp_labels:
+ severity: critical
+ pod: polkadot-abcdef01234-abcdef
+ instance: polkadot-abcdef01234-abcdef
+ job: polkadot
+ status: finalized
+ exp_annotations:
+ message: "Finalized block on instance
+ polkadot-abcdef01234-abcdef increases by less than 1 per
+ minute."
+
+ ######################################################################
+ # Transaction queue
+ ######################################################################
+
+ - eval_time: 11m
+ alertname: TransactionQueueSizeIncreasing
+ # Number of validations scheduled and finished both grow at a rate
+ # of 1 in the first 10 minutes, thereby the queue is not increasing
+ # in size, thus don't expect an alert.
+ exp_alerts:
+ - eval_time: 22m
+ alertname: TransactionQueueSizeIncreasing
+ # Number of validations scheduled is growing twice as fast as the
+ # number of validations finished after minute 10. Thus expect
+ # warning alert after 20 minutes.
+ exp_alerts:
+ - exp_labels:
+ severity: warning
+ pod: polkadot-abcdef01234-abcdef
+ instance: polkadot-abcdef01234-abcdef
+ job: polkadot
+ exp_annotations:
+ message: "The transaction pool size on node
+ polkadot-abcdef01234-abcdef has been monotonically
+ increasing for the last 10 minutes."
+ - eval_time: 43m
+ alertname: TransactionQueueSizeIncreasing
+ # Number of validations scheduled is growing twice as fast as the
+ # number of validations finished after minute 10. Thus expect
+ # both warning and critical alert after 40 minutes.
+ exp_alerts:
+ - exp_labels:
+ severity: warning
+ pod: polkadot-abcdef01234-abcdef
+ instance: polkadot-abcdef01234-abcdef
+ job: polkadot
+ exp_annotations:
+ message: "The transaction pool size on node
+ polkadot-abcdef01234-abcdef has been monotonically
+ increasing for the last 10 minutes."
+ - exp_labels:
+ severity: critical
+ pod: polkadot-abcdef01234-abcdef
+ instance: polkadot-abcdef01234-abcdef
+ job: polkadot
+ exp_annotations:
+ message: "The transaction pool size on node
+ polkadot-abcdef01234-abcdef has been monotonically
+ increasing for the last 30 minutes."
+ - eval_time: 49m
+ alertname: TransactionQueueSizeHigh
+ # After minute 43 the number of validations scheduled jumps up
+ # drastically while the number of validations finished stays the
+ # same. Thus expect an alert.
+ exp_alerts:
+ - exp_labels:
+ severity: critical
+ pod: polkadot-abcdef01234-abcdef
+ instance: polkadot-abcdef01234-abcdef
+ job: polkadot
+ exp_annotations:
+ message: "The transaction pool size on node
+ polkadot-abcdef01234-abcdef has been above 10_000 for the
+ last 5 minutes."
+
+ ######################################################################
+ # Networking
+ ######################################################################
+
+ - eval_time: 3m # Values: 3 2 2
+ alertname: LowNumberOfPeers
+ exp_alerts:
+ - eval_time: 4m # Values: 2 2 2
+ alertname: LowNumberOfPeers
+ exp_alerts:
+ - exp_labels:
+ severity: warning
+ pod: polkadot-abcdef01234-abcdef
+ instance: polkadot-abcdef01234-abcdef
+ job: polkadot
+ exp_annotations:
+ message: "The node polkadot-abcdef01234-abcdef has less
+ than 3 peers for more than 3 minutes"
+
+ - eval_time: 16m # Values: 3 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1
+ alertname: LowNumberOfPeers
+ exp_alerts:
+ - exp_labels:
+ severity: warning
+ pod: polkadot-abcdef01234-abcdef
+ instance: polkadot-abcdef01234-abcdef
+ job: polkadot
+ exp_annotations:
+ message: "The node polkadot-abcdef01234-abcdef has less
+ than 3 peers for more than 3 minutes"
+ - exp_labels:
+ severity: critical
+ pod: polkadot-abcdef01234-abcdef
+ instance: polkadot-abcdef01234-abcdef
+ job: polkadot
+ exp_annotations:
+ message: "The node polkadot-abcdef01234-abcdef has less
+ than 3 peers for more than 15 minutes"
diff --git a/.maintain/monitoring/alerting-rules/alerting-rules.yaml b/.maintain/monitoring/alerting-rules/alerting-rules.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..2ed3889a2c2f94d80b79e9376201432d65cf89bc
--- /dev/null
+++ b/.maintain/monitoring/alerting-rules/alerting-rules.yaml
@@ -0,0 +1,138 @@
+groups:
+- name: polkadot.rules
+ rules:
+
+ ##############################################################################
+ # Resource usage
+ ##############################################################################
+
+ - alert: HighCPUUsage
+ expr: polkadot_cpu_usage_percentage >= 100
+ for: 5m
+ labels:
+ severity: warning
+ annotations:
+ message: 'The node {{ $labels.instance }} has a CPU usage higher than 100%
+ for more than 5 minutes'
+
+ ##############################################################################
+ # Block production
+ ##############################################################################
+
+ - alert: LowNumberOfNewBlocks
+ annotations:
+ message: 'Less than one new block per minute on instance {{
+ $labels.instance }}.'
+ expr: increase(polkadot_block_height{status="best"}[1m]) < 1
+ for: 3m
+ labels:
+ severity: warning
+ - alert: LowNumberOfNewBlocks
+ annotations:
+ message: 'Less than one new block per minute on instance {{
+ $labels.instance }}.'
+ expr: increase(polkadot_block_height{status="best"}[1m]) < 1
+ for: 10m
+ labels:
+ severity: critical
+
+ ##############################################################################
+ # Block finalization
+ ##############################################################################
+
+ - alert: BlockFinalizationSlow
+ expr: increase(polkadot_block_height{status="finalized"}[1m]) < 1
+ for: 3m
+ labels:
+ severity: warning
+ annotations:
+ message: 'Finalized block on instance {{ $labels.instance }} increases by
+ less than 1 per minute.'
+ - alert: BlockFinalizationSlow
+ expr: increase(polkadot_block_height{status="finalized"}[1m]) < 1
+ for: 10m
+ labels:
+ severity: critical
+ annotations:
+ message: 'Finalized block on instance {{ $labels.instance }} increases by
+ less than 1 per minute.'
+ - alert: BlockFinalizationLaggingBehind
+ # Under the assumption of an average block production of 6 seconds,
+ # "best" and "finalized" being more than 10 blocks apart would imply
+ # more than a 1 minute delay between block production and finalization.
+ expr: '(polkadot_block_height_number{status="best"} - ignoring(status)
+ polkadot_block_height_number{status="finalized"}) > 10'
+ for: 8m
+ labels:
+ severity: critical
+ annotations:
+ message: "Block finalization on instance {{ $labels.instance }} is behind
+ block production by {{ $value }} for more than 8m"
+
+ ##############################################################################
+ # Transaction queue
+ ##############################################################################
+
+ - alert: TransactionQueueSizeIncreasing
+ expr: 'increase(polkadot_sub_txpool_validations_scheduled[5m]) -
+ increase(polkadot_sub_txpool_validations_finished[5m]) > 0'
+ for: 10m
+ labels:
+ severity: warning
+ annotations:
+ message: 'The transaction pool size on node {{ $labels.instance }} has
+ been monotonically increasing for the last 10 minutes.'
+ - alert: TransactionQueueSizeIncreasing
+ expr: 'increase(polkadot_sub_txpool_validations_scheduled[5m]) -
+ increase(polkadot_sub_txpool_validations_finished[5m]) > 0'
+ for: 30m
+ labels:
+ severity: critical
+ annotations:
+ message: 'The transaction pool size on node {{ $labels.instance }} has
+ been monotonically increasing for the last 30 minutes.'
+ - alert: TransactionQueueSizeHigh
+ expr: 'polkadot_sub_txpool_validations_scheduled -
+ polkadot_sub_txpool_validations_finished > 10000'
+ for: 5m
+ labels:
+ severity: critical
+ annotations:
+ message: 'The transaction pool size on node {{ $labels.instance }} has
+ been above 10_000 for the last 5 minutes.'
+
+ ##############################################################################
+ # Networking
+ ##############################################################################
+
+ - alert: LowNumberOfPeers
+ expr: polkadot_sub_libp2p_peers_count < 3
+ for: 3m
+ labels:
+ severity: warning
+ annotations:
+ message: 'The node {{ $labels.instance }} has less than 3 peers for more
+ than 3 minutes'
+ - alert: LowNumberOfPeers
+ expr: polkadot_sub_libp2p_peers_count < 3
+ for: 15m
+ labels:
+ severity: critical
+ annotations:
+ message: 'The node {{ $labels.instance }} has less than 3 peers for more
+ than 15 minutes'
+
+ ##############################################################################
+ # Others
+ ##############################################################################
+
+ - alert: AuthorityDiscoveryHighDiscoveryFailure
+ expr: 'polkadot_authority_discovery_handle_value_found_event_failure /
+ ignoring(name)
+ polkadot_authority_discovery_dht_event_received{name="value_found"} > 0.5'
+ for: 2h
+ labels:
+ severity: warning
+ annotations:
+ message: "Authority discovery on node {{ $labels.instance }} fails to
+ process more than 50 % of the values found on the DHT."
diff --git a/.maintain/monitoring/grafana-dashboards/substrate-networking.json b/.maintain/monitoring/grafana-dashboards/substrate-networking.json
new file mode 100644
index 0000000000000000000000000000000000000000..f18ca66c13a0774eca86ceef42795cf4b36a35d3
--- /dev/null
+++ b/.maintain/monitoring/grafana-dashboards/substrate-networking.json
@@ -0,0 +1,2722 @@
+{
+ "__inputs": [
+ {
+ "name": "VAR_METRIC_NAMESPACE",
+ "type": "constant",
+ "label": "Prefix of the metrics",
+ "value": "polkadot",
+ "description": ""
+ }
+ ],
+ "__requires": [
+ {
+ "type": "grafana",
+ "id": "grafana",
+ "name": "Grafana",
+ "version": "6.7.3"
+ },
+ {
+ "type": "panel",
+ "id": "graph",
+ "name": "Graph",
+ "version": ""
+ },
+ {
+ "type": "panel",
+ "id": "heatmap",
+ "name": "Heatmap",
+ "version": ""
+ },
+ {
+ "type": "datasource",
+ "id": "prometheus",
+ "name": "Prometheus",
+ "version": "1.0.0"
+ }
+ ],
+ "annotations": {
+ "list": [
+ {
+ "$$hashKey": "object:821",
+ "builtIn": 1,
+ "datasource": "-- Grafana --",
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "limit": 100,
+ "name": "Annotations & Alerts",
+ "showIn": 0,
+ "type": "dashboard"
+ },
+ {
+ "$$hashKey": "object:822",
+ "datasource": "$data_source",
+ "enable": true,
+ "expr": "count(count(${metric_namespace}_sub_libp2p_connections / max_over_time(${metric_namespace}_sub_libp2p_connections[1h]) < 0.1) >= count(${metric_namespace}_sub_libp2p_connections) / 10)",
+ "hide": false,
+ "iconColor": "#C4162A",
+ "limit": 100,
+ "name": "Connection losses events",
+ "showIn": 0,
+ "step": "5m",
+ "tags": [],
+ "titleFormat": "Network-wide connectivity loss",
+ "type": "tags"
+ }
+ ]
+ },
+ "description": "Information related to the networking layer of Substrate",
+ "editable": true,
+ "gnetId": null,
+ "graphTooltip": 0,
+ "id": null,
+ "iteration": 1590742405831,
+ "links": [],
+ "panels": [
+ {
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 0
+ },
+ "id": 167,
+ "title": "Sync",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 0,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 5,
+ "w": 24,
+ "x": 0,
+ "y": 1
+ },
+ "hiddenSeries": false,
+ "id": 101,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "connected",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "repeat": null,
+ "repeatDirection": "v",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": true,
+ "targets": [
+ {
+ "expr": "1 - (${metric_namespace}_sub_libp2p_peerset_num_requested{instance=~\"${nodename}\"} - ${metric_namespace}_sub_libp2p_peers_count{instance=~\"${nodename}\"}) / ${metric_namespace}_sub_libp2p_peerset_num_requested{instance=~\"${nodename}\"}",
+ "interval": "",
+ "legendFormat": "{{instance}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Number of peer slots filled",
+ "tooltip": {
+ "shared": true,
+ "sort": 2,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "$$hashKey": "object:1044",
+ "format": "percentunit",
+ "label": null,
+ "logBase": 1,
+ "max": "1.0",
+ "min": null,
+ "show": true
+ },
+ {
+ "$$hashKey": "object:1045",
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 6
+ },
+ "id": 29,
+ "panels": [],
+ "repeat": "request_protocol",
+ "title": "Requests (${request_protocol})",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 4,
+ "w": 12,
+ "x": 0,
+ "y": 7
+ },
+ "hiddenSeries": false,
+ "id": 148,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "irate(${metric_namespace}_sub_libp2p_requests_out_started_total{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])",
+ "interval": "",
+ "legendFormat": "{{instance}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Requests emitted per second",
+ "tooltip": {
+ "shared": true,
+ "sort": 2,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "reqps",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 4,
+ "w": 12,
+ "x": 12,
+ "y": 7
+ },
+ "hiddenSeries": false,
+ "id": 151,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "irate(${metric_namespace}_sub_libp2p_requests_in_total_count{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])",
+ "interval": "",
+ "legendFormat": "{{instance}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Requests served per second",
+ "tooltip": {
+ "shared": true,
+ "sort": 2,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "reqps",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 0,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 4,
+ "w": 12,
+ "x": 0,
+ "y": 11
+ },
+ "hiddenSeries": false,
+ "id": 146,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null as zero",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "histogram_quantile(0.5, sum(rate(${metric_namespace}_sub_libp2p_requests_out_finished_bucket{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])) by (instance, le)) > 0",
+ "instant": false,
+ "interval": "",
+ "legendFormat": "{{instance}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Median request answer time",
+ "tooltip": {
+ "shared": true,
+ "sort": 2,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "$$hashKey": "object:1230",
+ "format": "s",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "$$hashKey": "object:1231",
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 4,
+ "w": 12,
+ "x": 12,
+ "y": 11
+ },
+ "hiddenSeries": false,
+ "id": 145,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "histogram_quantile(0.5, sum(rate(${metric_namespace}_sub_libp2p_requests_in_total_bucket{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])) by (instance, le))",
+ "interval": "",
+ "legendFormat": "{{instance}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Median request serving time",
+ "tooltip": {
+ "shared": true,
+ "sort": 2,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "s",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 0,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 4,
+ "w": 12,
+ "x": 0,
+ "y": 15
+ },
+ "hiddenSeries": false,
+ "id": 150,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null as zero",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "histogram_quantile(0.99, sum(rate(${metric_namespace}_sub_libp2p_requests_out_finished_bucket{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])) by (instance, le)) > 0",
+ "instant": false,
+ "interval": "",
+ "legendFormat": "{{instance}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "99th percentile request answer time",
+ "tooltip": {
+ "shared": true,
+ "sort": 2,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "s",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 4,
+ "w": 12,
+ "x": 12,
+ "y": 15
+ },
+ "hiddenSeries": false,
+ "id": 149,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null as zero",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "histogram_quantile(0.99, sum(rate(${metric_namespace}_sub_libp2p_requests_in_total_bucket{instance=~\"${nodename}\", protocol=\"${request_protocol}\"}[5m])) by (instance, le))",
+ "interval": "",
+ "legendFormat": "{{instance}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "99th percentile request serving time",
+ "tooltip": {
+ "shared": false,
+ "sort": 2,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "s",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 185
+ },
+ "id": 23,
+ "panels": [],
+ "repeat": "notif_protocol",
+ "title": "Notifications (${notif_protocol})",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 0,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 7,
+ "w": 12,
+ "x": 0,
+ "y": 186
+ },
+ "hiddenSeries": false,
+ "id": 31,
+ "interval": "1m",
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "rightSide": true,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "maxPerRow": 2,
+ "nullPointMode": "null as zero",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "repeat": null,
+ "repeatDirection": "v",
+ "seriesOverrides": [
+ {
+ "$$hashKey": "object:850",
+ "alias": "/(in)/",
+ "color": "#73BF69"
+ },
+ {
+ "$$hashKey": "object:851",
+ "alias": "/(out)/",
+ "color": "#F2495C"
+ }
+ ],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "avg by (direction) (irate(${metric_namespace}_sub_libp2p_notifications_sizes_count{instance=~\"${nodename}\", protocol=\"${notif_protocol}\"}[$__interval]))",
+ "interval": "",
+ "legendFormat": "{{direction}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Average network notifications per second",
+ "tooltip": {
+ "shared": true,
+ "sort": 2,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "$$hashKey": "object:874",
+ "format": "cps",
+ "label": "Notifs/sec",
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "$$hashKey": "object:875",
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 0,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 7,
+ "w": 12,
+ "x": 12,
+ "y": 186
+ },
+ "hiddenSeries": false,
+ "id": 37,
+ "interval": "1m",
+ "legend": {
+ "alignAsTable": false,
+ "avg": false,
+ "current": false,
+ "hideEmpty": false,
+ "hideZero": false,
+ "max": false,
+ "min": false,
+ "rightSide": true,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "maxPerRow": 2,
+ "nullPointMode": "null as zero",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "repeat": null,
+ "repeatDirection": "v",
+ "seriesOverrides": [
+ {
+ "$$hashKey": "object:942",
+ "alias": "/(in)/",
+ "color": "#73BF69"
+ },
+ {
+ "$$hashKey": "object:943",
+ "alias": "/(out)/",
+ "color": "#F2495C"
+ }
+ ],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "avg(irate(${metric_namespace}_sub_libp2p_notifications_sizes_sum{instance=~\"${nodename}\", protocol=\"${notif_protocol}\"}[$__interval])) by (direction)",
+ "instant": false,
+ "interval": "",
+ "legendFormat": "{{direction}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Average bandwidth used by notifications",
+ "tooltip": {
+ "shared": true,
+ "sort": 2,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "$$hashKey": "object:966",
+ "format": "Bps",
+ "label": "Bandwidth",
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "$$hashKey": "object:967",
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 193
+ },
+ "hiddenSeries": false,
+ "id": 16,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "max(${metric_namespace}_sub_libp2p_out_events_notifications_sizes{instance=~\"${nodename}\", protocol=\"${notif_protocol}\", action=\"sent\"} - ignoring(action) ${metric_namespace}_sub_libp2p_out_events_notifications_sizes{instance=~\"${nodename}\", protocol=\"${notif_protocol}\", action=\"received\"}) by (instance) > 0",
+ "interval": "",
+ "legendFormat": "{{instance}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Total sizes of notifications waiting to be delivered to the rest of Substrate",
+ "tooltip": {
+ "shared": false,
+ "sort": 1,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "bytes",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 1,
+ "fillGradient": 1,
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 193
+ },
+ "hiddenSeries": false,
+ "id": 21,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null as zero",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pluginVersion": "6.4.5",
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "sum(rate(${metric_namespace}_sub_libp2p_notifications_sizes_sum{instance=~\"${nodename}\", protocol=\"${notif_protocol}\"}[5m])) by (direction, protocol) / sum(rate(${metric_namespace}_sub_libp2p_notifications_sizes_count{instance=~\"${nodename}\", protocol=\"${notif_protocol}\"}[5m])) by (direction, protocol)",
+ "format": "time_series",
+ "interval": "",
+ "legendFormat": "{{direction}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Average size of sent and received notifications in the past 5 minutes",
+ "tooltip": {
+ "shared": true,
+ "sort": 2,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "$$hashKey": "object:2050",
+ "format": "bytes",
+ "label": "Max. notification size",
+ "logBase": 10,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "$$hashKey": "object:2051",
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "description": "99.9% of the time, the output queue size for this protocol is below the given value",
+ "fill": 0,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 12,
+ "x": 0,
+ "y": 201
+ },
+ "hiddenSeries": false,
+ "id": 14,
+ "legend": {
+ "alignAsTable": false,
+ "avg": false,
+ "current": true,
+ "hideEmpty": false,
+ "hideZero": true,
+ "max": true,
+ "min": false,
+ "rightSide": true,
+ "show": true,
+ "total": false,
+ "values": true
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [
+ {
+ "alias": "max",
+ "fill": 1,
+ "linewidth": 0
+ }
+ ],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "histogram_quantile(0.99, sum(rate(${metric_namespace}_sub_libp2p_notifications_queues_size_bucket{instance=~\"${nodename}\", protocol=\"${notif_protocol}\"}[2m])) by (le, instance))",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "{{protocol}}",
+ "refId": "A"
+ },
+ {
+ "expr": "max(histogram_quantile(0.99, sum(rate(${metric_namespace}_sub_libp2p_notifications_queues_size_bucket{instance=~\"${nodename}\", protocol=\"${notif_protocol}\"}[2m])) by (le, instance)))",
+ "interval": "",
+ "legendFormat": "max",
+ "refId": "B"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "99th percentile of queues sizes",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": "300",
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 1,
+ "fillGradient": 1,
+ "gridPos": {
+ "h": 6,
+ "w": 12,
+ "x": 12,
+ "y": 201
+ },
+ "hiddenSeries": false,
+ "id": 134,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null as zero",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pluginVersion": "6.4.5",
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "histogram_quantile(1.0, sum(rate(${metric_namespace}_sub_libp2p_notifications_sizes_bucket{instance=~\"${nodename}\", protocol=\"${notif_protocol}\"}[5m])) by (direction, le))",
+ "format": "time_series",
+ "interval": "",
+ "legendFormat": "{{direction}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Maximum size of sent and received notifications in the past 5 minutes",
+ "tooltip": {
+ "shared": true,
+ "sort": 2,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "$$hashKey": "object:1524",
+ "format": "bytes",
+ "label": "Max. notification size",
+ "logBase": 10,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "$$hashKey": "object:1525",
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 1853
+ },
+ "id": 27,
+ "panels": [],
+ "title": "Transport",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": true,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 24,
+ "x": 0,
+ "y": 1854
+ },
+ "hiddenSeries": false,
+ "id": 19,
+ "interval": "1m",
+ "legend": {
+ "alignAsTable": false,
+ "avg": false,
+ "current": false,
+ "hideEmpty": false,
+ "max": false,
+ "min": false,
+ "rightSide": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": false,
+ "linewidth": 1,
+ "maxPerRow": 2,
+ "nullPointMode": "null as zero",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "repeat": null,
+ "repeatDirection": "v",
+ "seriesOverrides": [
+ {
+ "alias": "established (in)",
+ "color": "#37872D"
+ },
+ {
+ "alias": "established (out)",
+ "color": "#C4162A"
+ },
+ {
+ "alias": "pending (out)",
+ "color": "#FF7383"
+ },
+ {
+ "alias": "closed-recently",
+ "color": "#FADE2A",
+ "steppedLine": true
+ }
+ ],
+ "spaceLength": 10,
+ "stack": true,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "avg(sum(${metric_namespace}_sub_libp2p_connections_opened_total{direction=\"in\", instance=~\"${nodename}\"}) by (instance) - sum(${metric_namespace}_sub_libp2p_connections_closed_total{direction=\"in\", instance=~\"${nodename}\"}) by (instance))",
+ "format": "time_series",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "established (in)",
+ "refId": "A"
+ },
+ {
+ "expr": "avg(sum(${metric_namespace}_sub_libp2p_connections_opened_total{direction=\"out\", instance=~\"${nodename}\"}) by (instance) - sum(${metric_namespace}_sub_libp2p_connections_closed_total{direction=\"out\", instance=~\"${nodename}\"}) by (instance))",
+ "hide": false,
+ "instant": false,
+ "interval": "",
+ "legendFormat": "established (out)",
+ "refId": "C"
+ },
+ {
+ "expr": "avg(sum by (instance) (${metric_namespace}_sub_libp2p_pending_connections{instance=~\"${nodename}\"}))",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "pending (out)",
+ "refId": "B"
+ },
+ {
+ "expr": "avg(sum by(instance) (increase(${metric_namespace}_sub_libp2p_connections_closed_total{instance=~\"${nodename}\"}[$__interval])))",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "closed-recently",
+ "refId": "D"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Average transport-level (TCP, QUIC, ...) connections per node",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": "Connections",
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": true,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 12,
+ "x": 0,
+ "y": 1860
+ },
+ "hiddenSeries": false,
+ "id": 39,
+ "interval": "1m",
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": false,
+ "linewidth": 1,
+ "nullPointMode": "null as zero",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [
+ {
+ "alias": "/.*/",
+ "color": "#FF780A"
+ }
+ ],
+ "spaceLength": 10,
+ "stack": true,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "avg(increase(${metric_namespace}_sub_libp2p_incoming_connections_handshake_errors_total{instance=~\"${nodename}\"}[$__interval])) by (reason)",
+ "interval": "",
+ "legendFormat": "{{reason}}",
+ "refId": "A"
+ },
+ {
+ "expr": "avg(increase(${metric_namespace}_sub_libp2p_listeners_errors_total{instance=~\"${nodename}\"}[$__interval]))",
+ "interval": "",
+ "legendFormat": "pre-handshake",
+ "refId": "B"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Number of incoming connection errors, averaged by node",
+ "tooltip": {
+ "shared": true,
+ "sort": 2,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": "Errors",
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "cards": {
+ "cardPadding": null,
+ "cardRound": null
+ },
+ "color": {
+ "cardColor": "#b4ff00",
+ "colorScale": "sqrt",
+ "colorScheme": "interpolateOranges",
+ "exponent": 0.5,
+ "max": 100,
+ "min": 0,
+ "mode": "spectrum"
+ },
+ "dataFormat": "timeseries",
+ "datasource": "$data_source",
+ "description": "Each bucket represent a certain number of nodes using a certain bandwidth range.",
+ "gridPos": {
+ "h": 6,
+ "w": 12,
+ "x": 12,
+ "y": 1860
+ },
+ "heatmap": {},
+ "hideZeroBuckets": false,
+ "highlightCards": true,
+ "id": 4,
+ "legend": {
+ "show": false
+ },
+ "reverseYBuckets": false,
+ "targets": [
+ {
+ "expr": "${metric_namespace}_network_per_sec_bytes{instance=~\"${nodename}\"}",
+ "format": "time_series",
+ "interval": "",
+ "legendFormat": "",
+ "refId": "A"
+ }
+ ],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Heatmap of network bandwidth",
+ "tooltip": {
+ "show": true,
+ "showHistogram": false
+ },
+ "type": "heatmap",
+ "xAxis": {
+ "show": true
+ },
+ "xBucketNumber": null,
+ "xBucketSize": "2.5m",
+ "yAxis": {
+ "decimals": null,
+ "format": "Bps",
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true,
+ "splitFactor": null
+ },
+ "yBucketBound": "auto",
+ "yBucketNumber": null,
+ "yBucketSize": null
+ },
+ {
+ "aliasColors": {},
+ "bars": true,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 7,
+ "w": 12,
+ "x": 0,
+ "y": 1866
+ },
+ "hiddenSeries": false,
+ "id": 81,
+ "interval": "1m",
+ "legend": {
+ "alignAsTable": false,
+ "avg": false,
+ "current": false,
+ "hideEmpty": true,
+ "hideZero": true,
+ "max": false,
+ "min": false,
+ "rightSide": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": false,
+ "linewidth": 1,
+ "nullPointMode": "null as zero",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "repeat": null,
+ "repeatDirection": "v",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": true,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "avg(increase(${metric_namespace}_sub_libp2p_pending_connections_errors_total{instance=~\"${nodename}\"}[$__interval])) by (reason)",
+ "interval": "",
+ "legendFormat": "{{reason}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Dialing attempt errors, averaged per node",
+ "tooltip": {
+ "shared": true,
+ "sort": 2,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": true,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 7,
+ "w": 12,
+ "x": 12,
+ "y": 1866
+ },
+ "hiddenSeries": false,
+ "id": 46,
+ "interval": "1m",
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": false,
+ "linewidth": 1,
+ "maxPerRow": 2,
+ "nullPointMode": "null as zero",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "repeat": null,
+ "repeatDirection": "v",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": true,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "avg(increase(${metric_namespace}_sub_libp2p_connections_closed_total{instance=~\"${nodename}\"}[$__interval])) by (reason)",
+ "interval": "",
+ "legendFormat": "{{reason}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Disconnects, averaged per node",
+ "tooltip": {
+ "shared": true,
+ "sort": 2,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "decimals": null,
+ "format": "short",
+ "label": "Disconnects",
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 1873
+ },
+ "id": 52,
+ "panels": [],
+ "title": "GrandPa",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": true,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 24,
+ "x": 0,
+ "y": 1874
+ },
+ "hiddenSeries": false,
+ "id": 54,
+ "interval": "1m",
+ "legend": {
+ "alignAsTable": true,
+ "avg": false,
+ "current": false,
+ "hideEmpty": true,
+ "hideZero": true,
+ "max": false,
+ "min": false,
+ "rightSide": true,
+ "show": true,
+ "total": true,
+ "values": true
+ },
+ "lines": false,
+ "linewidth": 1,
+ "nullPointMode": "null as zero",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "repeat": null,
+ "repeatDirection": "v",
+ "seriesOverrides": [
+ {
+ "alias": "/discard/",
+ "color": "#FA6400",
+ "zindex": -2
+ },
+ {
+ "alias": "/keep/",
+ "color": "#73BF69",
+ "zindex": 2
+ },
+ {
+ "alias": "/process_and_discard/",
+ "color": "#5794F2"
+ }
+ ],
+ "spaceLength": 10,
+ "stack": true,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "avg(increase(${metric_namespace}_finality_grandpa_communication_gossip_validator_messages{instance=~\"${nodename}\"}[$__interval])) by (action, message)",
+ "interval": "",
+ "legendFormat": "{{message}} => {{action}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "GrandPa messages received from the network, and action",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "collapsed": false,
+ "datasource": null,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 1880
+ },
+ "id": 25,
+ "panels": [],
+ "repeat": null,
+ "title": "Kademlia",
+ "type": "row"
+ },
+ {
+ "aliasColors": {},
+ "bars": true,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "description": "",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 12,
+ "x": 0,
+ "y": 1881
+ },
+ "hiddenSeries": false,
+ "id": 33,
+ "legend": {
+ "alignAsTable": false,
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": false,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [
+ {
+ "alias": "/.*/",
+ "color": "#B877D9"
+ }
+ ],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "${metric_namespace}_sub_libp2p_kbuckets_num_nodes{instance=~\"${nodename}\"}",
+ "format": "time_series",
+ "instant": true,
+ "interval": "",
+ "legendFormat": "Number nodes in all kbuckets",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Distribution over number of entries in k-buckets",
+ "tooltip": {
+ "shared": false,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "max": 0,
+ "min": null,
+ "mode": "histogram",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 7,
+ "fillGradient": 7,
+ "gridPos": {
+ "h": 6,
+ "w": 12,
+ "x": 12,
+ "y": 1881
+ },
+ "hiddenSeries": false,
+ "id": 35,
+ "interval": "1m",
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "60 * sum(irate(${metric_namespace}_sub_libp2p_random_kademalia_queries_total{instance=~\"${nodename}\"}[$__interval]))",
+ "interval": "",
+ "legendFormat": "Number of Kademlia random queries started per minute on all nodes",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Number of Kademlia discovery queries per minute on all nodes combined",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "cpm",
+ "label": "Queries per minute",
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 0,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 4,
+ "w": 12,
+ "x": 0,
+ "y": 1887
+ },
+ "hiddenSeries": false,
+ "id": 111,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [
+ {
+ "alias": "max",
+ "fillBelowTo": "min",
+ "lines": false
+ },
+ {
+ "alias": "min",
+ "lines": false
+ }
+ ],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "avg(${metric_namespace}_sub_libp2p_kademlia_records_count{instance=~\"${nodename}\"})",
+ "interval": "",
+ "legendFormat": "avg",
+ "refId": "A"
+ },
+ {
+ "expr": "min(${metric_namespace}_sub_libp2p_kademlia_records_count{instance=~\"${nodename}\"})",
+ "interval": "",
+ "legendFormat": "min",
+ "refId": "B"
+ },
+ {
+ "expr": "max(${metric_namespace}_sub_libp2p_kademlia_records_count{instance=~\"${nodename}\"})",
+ "interval": "",
+ "legendFormat": "max",
+ "refId": "C"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Number of Kademlia records (average/min/max per node)",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 0,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 4,
+ "w": 12,
+ "x": 12,
+ "y": 1887
+ },
+ "hiddenSeries": false,
+ "id": 112,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [
+ {
+ "alias": "max",
+ "fillBelowTo": "min",
+ "lines": false
+ },
+ {
+ "alias": "min",
+ "lines": false
+ }
+ ],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "avg(${metric_namespace}_sub_libp2p_kademlia_records_sizes_total{instance=~\"${nodename}\"})",
+ "interval": "",
+ "legendFormat": "avg",
+ "refId": "A"
+ },
+ {
+ "expr": "min(${metric_namespace}_sub_libp2p_kademlia_records_sizes_total{instance=~\"${nodename}\"})",
+ "interval": "",
+ "legendFormat": "min",
+ "refId": "B"
+ },
+ {
+ "expr": "max(${metric_namespace}_sub_libp2p_kademlia_records_sizes_total{instance=~\"${nodename}\"})",
+ "interval": "",
+ "legendFormat": "max",
+ "refId": "C"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Total size of Kademlia records (average/min/max per node)",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "bytes",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 5,
+ "w": 24,
+ "x": 0,
+ "y": 1891
+ },
+ "hiddenSeries": false,
+ "id": 68,
+ "interval": "1m",
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "connected",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "repeat": null,
+ "repeatDirection": "v",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "avg(\n # The amount of inflight Kademlia queries per node.\r\n sum by (instance) (\r\n # The total amount of Kademlia GET_VALUE queries started.\r\n ${metric_namespace}_authority_discovery_authority_addresses_requested_total{instance=~\"${nodename}\"}\r\n \r\n # The total amount of Kademlia PUT_VALUE queries started.\r\n + ${metric_namespace}_authority_discovery_times_published_total{instance=~\"${nodename}\"}\r\n )\r\n - sum by (instance) (\r\n # The total amount of Kademlia queries (both GET_VALUE and PUT_VALUE) finished.\r\n ${metric_namespace}_authority_discovery_dht_event_received{instance=~\"${nodename}\"}\r\n )\n)",
+ "interval": "",
+ "legendFormat": "in-progress",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Authority discovery Kademlia queries in progress, averaged per node",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": true,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "$data_source",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 4,
+ "w": 24,
+ "x": 0,
+ "y": 1896
+ },
+ "hiddenSeries": false,
+ "id": 72,
+ "interval": "1m",
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": false,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "repeat": null,
+ "repeatDirection": "v",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "avg(sum without(instance) (delta(${metric_namespace}_authority_discovery_times_published_total{instance=~\"${nodename}\"}[$__interval])))",
+ "interval": "",
+ "legendFormat": "publications",
+ "refId": "A"
+ },
+ {
+ "expr": "avg(sum without(instance) (delta(${metric_namespace}_authority_discovery_dht_event_received{instance=~\"${nodename}\", name=\"value_put\"}[$__interval])))",
+ "interval": "",
+ "legendFormat": "successes",
+ "refId": "B"
+ },
+ {
+ "expr": "avg(sum without(instance) (delta(${metric_namespace}_authority_discovery_dht_event_received{instance=~\"${nodename}\", name=\"value_put_failed\"}[$__interval])))",
+ "interval": "",
+ "legendFormat": "failures",
+ "refId": "C"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Authority discovery publications, averaged per node",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ }
+ ],
+ "refresh": "1m",
+ "schemaVersion": 22,
+ "style": "dark",
+ "tags": [],
+ "templating": {
+ "list": [
+ {
+ "allValue": null,
+ "current": {},
+ "datasource": "$data_source",
+ "definition": "${metric_namespace}_cpu_usage_percentage",
+ "hide": 0,
+ "includeAll": true,
+ "index": -1,
+ "label": "Instance name filter",
+ "multi": true,
+ "name": "nodename",
+ "options": [],
+ "query": "${metric_namespace}_cpu_usage_percentage",
+ "refresh": 1,
+ "regex": "/instance=\"(.*?)\"/",
+ "skipUrlSync": false,
+ "sort": 1,
+ "tagValuesQuery": "",
+ "tags": [],
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ },
+ {
+ "allValue": null,
+ "current": {},
+ "datasource": "$data_source",
+ "definition": "${metric_namespace}_sub_libp2p_notifications_sizes_count",
+ "hide": 2,
+ "includeAll": true,
+ "index": -1,
+ "label": null,
+ "multi": false,
+ "name": "notif_protocol",
+ "options": [],
+ "query": "${metric_namespace}_sub_libp2p_notifications_sizes_count",
+ "refresh": 1,
+ "regex": "/protocol=\"(.*?)\"/",
+ "skipUrlSync": false,
+ "sort": 5,
+ "tagValuesQuery": "",
+ "tags": [],
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ },
+ {
+ "allValue": null,
+ "current": {},
+ "datasource": "$data_source",
+ "definition": "${metric_namespace}_sub_libp2p_requests_out_started_total",
+ "hide": 2,
+ "includeAll": true,
+ "index": -1,
+ "label": null,
+ "multi": false,
+ "name": "request_protocol",
+ "options": [],
+ "query": "${metric_namespace}_sub_libp2p_requests_out_started_total",
+ "refresh": 1,
+ "regex": "/protocol=\"(.*?)\"/",
+ "skipUrlSync": false,
+ "sort": 5,
+ "tagValuesQuery": "",
+ "tags": [],
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ },
+ {
+ "current": {
+ "selected": false,
+ "tags": [],
+ "text": "prometheus.parity-mgmt",
+ "value": "prometheus.parity-mgmt"
+ },
+ "hide": 0,
+ "includeAll": false,
+ "label": "Source of data",
+ "multi": false,
+ "name": "data_source",
+ "options": [],
+ "query": "prometheus",
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "type": "datasource"
+ },
+ {
+ "current": {
+ "value": "${VAR_METRIC_NAMESPACE}",
+ "text": "${VAR_METRIC_NAMESPACE}"
+ },
+ "hide": 2,
+ "label": "Prefix of the metrics",
+ "name": "metric_namespace",
+ "options": [
+ {
+ "value": "${VAR_METRIC_NAMESPACE}",
+ "text": "${VAR_METRIC_NAMESPACE}"
+ }
+ ],
+ "query": "${VAR_METRIC_NAMESPACE}",
+ "skipUrlSync": false,
+ "type": "constant"
+ }
+ ]
+ },
+ "time": {
+ "from": "now-6h",
+ "to": "now"
+ },
+ "timepicker": {
+ "refresh_intervals": [
+ "5s",
+ "10s",
+ "30s",
+ "1m",
+ "5m",
+ "15m",
+ "30m",
+ "1h",
+ "2h",
+ "1d"
+ ]
+ },
+ "timezone": "",
+ "title": "Substrate Networking",
+ "uid": "vKVuiD9Zk",
+ "variables": {
+ "list": []
+ },
+ "version": 103
+}
\ No newline at end of file
diff --git a/.maintain/rename-crates-for-2.0.sh b/.maintain/rename-crates-for-2.0.sh
index 5d873d26cdfca69db389ae569b6be534d142af1d..01d559448438b3cb857d1b46af2f8bc544232066 100755
--- a/.maintain/rename-crates-for-2.0.sh
+++ b/.maintain/rename-crates-for-2.0.sh
@@ -64,7 +64,7 @@ TO_RENAME=(
"substrate-keyring sp-keyring"
"substrate-offchain-primitives sp-offchain"
"substrate-panic-handler sp-panic-handler"
- "substrate-phragmen sp-phragmen"
+ "substrate-phragmen sp-npos-elections"
"substrate-rpc-primitives sp-rpc"
"substrate-runtime-interface sp-runtime-interface"
"substrate-runtime-interface-proc-macro sp-runtime-interface-proc-macro"
diff --git a/.maintain/sentry-node/docker-compose.yml b/.maintain/sentry-node/docker-compose.yml
index 376538dde5786e15d1524dc8f75072aa4c1cb59d..2af9449853c771be95d34c8a25aef8adc867d72c 100644
--- a/.maintain/sentry-node/docker-compose.yml
+++ b/.maintain/sentry-node/docker-compose.yml
@@ -47,9 +47,9 @@ services:
- "--validator"
- "--alice"
- "--sentry-nodes"
- - "/dns4/sentry-a/tcp/30333/p2p/QmV7EhW6J6KgmNdr558RH1mPx2xGGznW7At4BhXzntRFsi"
+ - "/dns/sentry-a/tcp/30333/p2p/QmV7EhW6J6KgmNdr558RH1mPx2xGGznW7At4BhXzntRFsi"
- "--reserved-nodes"
- - "/dns4/sentry-a/tcp/30333/p2p/QmV7EhW6J6KgmNdr558RH1mPx2xGGznW7At4BhXzntRFsi"
+ - "/dns/sentry-a/tcp/30333/p2p/QmV7EhW6J6KgmNdr558RH1mPx2xGGznW7At4BhXzntRFsi"
# Not only bind to localhost.
- "--unsafe-ws-external"
- "--unsafe-rpc-external"
@@ -83,11 +83,11 @@ services:
- "--port"
- "30333"
- "--sentry"
- - "/dns4/validator-a/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR"
+ - "/dns/validator-a/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR"
- "--reserved-nodes"
- - "/dns4/validator-a/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR"
+ - "/dns/validator-a/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR"
- "--bootnodes"
- - "/dns4/validator-b/tcp/30333/p2p/QmSVnNf9HwVMT1Y4cK1P6aoJcEZjmoTXpjKBmAABLMnZEk"
+ - "/dns/validator-b/tcp/30333/p2p/QmSVnNf9HwVMT1Y4cK1P6aoJcEZjmoTXpjKBmAABLMnZEk"
- "--no-telemetry"
- "--rpc-cors"
- "all"
@@ -118,9 +118,9 @@ services:
- "--validator"
- "--bob"
- "--bootnodes"
- - "/dns4/validator-a/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR"
+ - "/dns/validator-a/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR"
- "--bootnodes"
- - "/dns4/sentry-a/tcp/30333/p2p/QmV7EhW6J6KgmNdr558RH1mPx2xGGznW7At4BhXzntRFsi"
+ - "/dns/sentry-a/tcp/30333/p2p/QmV7EhW6J6KgmNdr558RH1mPx2xGGznW7At4BhXzntRFsi"
- "--no-telemetry"
- "--rpc-cors"
- "all"
@@ -131,11 +131,6 @@ services:
- "sub-authority-discovery=trace"
- "--prometheus-external"
- ui:
- image: polkadot-js/apps
- ports:
- - "3000:80"
-
prometheus:
image: prom/prometheus
networks:
diff --git a/.maintain/sentry-node/prometheus/prometheus.yml b/.maintain/sentry-node/prometheus/prometheus.yml
index 831b84ba0b7018948ae235619eb600b51e75c75d..547d4bea57ae5c55f210743165b347dd732ec0de 100644
--- a/.maintain/sentry-node/prometheus/prometheus.yml
+++ b/.maintain/sentry-node/prometheus/prometheus.yml
@@ -2,7 +2,7 @@ global:
scrape_interval: 15s
scrape_configs:
- - job_name: 'substrate_validator-a'
+ - job_name: 'substrate-nodes'
static_configs:
- targets: ['validator-a:9615']
labels:
diff --git a/Cargo.lock b/Cargo.lock
index eac3ec05621e22e30be6fb08dbb86b704f42e159..afdfb5e81cc9af20f2ce0bf8e43eaeb3f6b2e36d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -16,6 +16,26 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2"
+[[package]]
+name = "aead"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4cf01b9b56e767bb57b94ebf91a58b338002963785cdd7013e21c0d4679471e4"
+dependencies = [
+ "generic-array",
+]
+
+[[package]]
+name = "aes"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "54eb1d8fe354e5fc611daf4f2ea97dd45a765f4f1e4512306ec183ae2e8f20c9"
+dependencies = [
+ "aes-soft",
+ "aesni",
+ "block-cipher-trait",
+]
+
[[package]]
name = "aes-ctr"
version = "0.3.0"
@@ -28,6 +48,20 @@ dependencies = [
"stream-cipher",
]
+[[package]]
+name = "aes-gcm"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "834a6bda386024dbb7c8fc51322856c10ffe69559f972261c868485f5759c638"
+dependencies = [
+ "aead",
+ "aes",
+ "block-cipher-trait",
+ "ghash",
+ "subtle 2.2.2",
+ "zeroize",
+]
+
[[package]]
name = "aes-soft"
version = "0.3.3"
@@ -35,7 +69,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d"
dependencies = [
"block-cipher-trait",
- "byteorder 1.3.4",
+ "byteorder",
"opaque-debug",
]
@@ -103,18 +137,6 @@ version = "1.0.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9a60d744a80c30fcb657dfe2c1b22bcb3e814c1a1e3674f32bf5820b570fbff"
-[[package]]
-name = "app_dirs"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e73a24bad9bd6a94d6395382a6c69fe071708ae4409f763c5475e14ee896313d"
-dependencies = [
- "ole32-sys",
- "shell32-sys",
- "winapi 0.2.8",
- "xdg",
-]
-
[[package]]
name = "approx"
version = "0.3.2"
@@ -172,7 +194,7 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d0864d84b8e07b145449be9a8537db86bf9de5ce03b913214694643b4743502"
dependencies = [
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -237,7 +259,7 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95fd83426b89b034bf4e9ceb9c533c2f2386b813fd3dcae0a425ec6f1837d78a"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"rustls",
"webpki",
"webpki-roots 0.19.0",
@@ -312,7 +334,7 @@ version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
"serde",
]
@@ -333,7 +355,7 @@ dependencies = [
"log",
"peeking_take_while",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"regex",
"rustc-hash",
"shlex",
@@ -414,7 +436,7 @@ checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b"
dependencies = [
"block-padding",
"byte-tools",
- "byteorder 1.3.4",
+ "byteorder",
"generic-array",
]
@@ -452,9 +474,9 @@ dependencies = [
[[package]]
name = "bs58"
-version = "0.3.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b170cd256a3f9fa6b9edae3e44a7dfdfc77e8124dbc3e2612d75f9c3e2396dae"
+checksum = "476e9cd489f9e121e02ffa6014a8ef220ecb15c05ed23fc34cca13925dc283fb"
[[package]]
name = "bstr"
@@ -495,12 +517,6 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
-[[package]]
-name = "byteorder"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855"
-
[[package]]
name = "byteorder"
version = "1.3.4"
@@ -513,7 +529,7 @@ version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
"either",
"iovec",
]
@@ -532,9 +548,9 @@ checksum = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b"
[[package]]
name = "cargo_metadata"
-version = "0.9.1"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46e3374c604fb39d1a2f35ed5e4a4e30e60d01fab49446e08f1b3e9a90aef202"
+checksum = "b8de60b887edf6d74370fc8eb177040da4847d971d6234c7b13a6da324ef0caf"
dependencies = [
"semver 0.9.0",
"serde",
@@ -576,17 +592,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
-name = "chacha20-poly1305-aead"
-version = "0.1.2"
+name = "chacha20"
+version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77d2058ba29594f69c75e8a9018e0485e3914ca5084e3613cd64529042f5423b"
+checksum = "f6a7ae4c498f8447d86baef0fa0831909333f558866fabcb21600625ac5a31c7"
dependencies = [
- "constant_time_eq",
+ "stream-cipher",
+ "zeroize",
+]
+
+[[package]]
+name = "chacha20poly1305"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "48901293601228db2131606f741db33561f7576b5d19c99cd66222380a7dc863"
+dependencies = [
+ "aead",
+ "chacha20",
+ "poly1305",
+ "stream-cipher",
+ "zeroize",
]
[[package]]
name = "chain-spec-builder"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"ansi_term 0.12.1",
"node-cli",
@@ -740,7 +770,7 @@ version = "0.63.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d166b289fd30062ee6de86284750fc3fe5d037c6b864b3326ce153239b0626e1"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
"cranelift-bforest",
"cranelift-codegen-meta",
"cranelift-codegen-shared",
@@ -749,7 +779,7 @@ dependencies = [
"log",
"regalloc",
"serde",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
"target-lexicon",
"thiserror",
]
@@ -787,7 +817,7 @@ checksum = "e45f82e3446dd1ebb8c2c2f6a6b0e6cd6cd52965c7e5f7b1b35e9a9ace31ccde"
dependencies = [
"cranelift-codegen",
"log",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
"target-lexicon",
]
@@ -837,7 +867,7 @@ dependencies = [
"clap",
"criterion-plot 0.3.1",
"csv",
- "itertools",
+ "itertools 0.8.2",
"lazy_static",
"libc",
"num-traits 0.2.11",
@@ -864,7 +894,7 @@ dependencies = [
"clap",
"criterion-plot 0.4.1",
"csv",
- "itertools",
+ "itertools 0.8.2",
"lazy_static",
"num-traits 0.2.11",
"oorandom",
@@ -884,9 +914,9 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76f9212ddf2f4a9eb2d401635190600656a1f88a932ef53d06e7fa4c7e02fb8e"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
"cast",
- "itertools",
+ "itertools 0.8.2",
]
[[package]]
@@ -896,7 +926,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a01e15e0ea58e8234f96146b1f91fa9d0e4dd7a38da93ff7a75d42c0b9d3a545"
dependencies = [
"cast",
- "itertools",
+ "itertools 0.8.2",
]
[[package]]
@@ -1009,7 +1039,7 @@ version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47c5e5ac752e18207b12e16b10631ae5f7f68f8805f335f9b817ead83d9ffce1"
dependencies = [
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -1023,23 +1053,13 @@ dependencies = [
"stream-cipher",
]
-[[package]]
-name = "cuckoofilter"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8dd43f7cfaffe0a386636a10baea2ee05cc50df3b77bea4a456c9572a939bf1f"
-dependencies = [
- "byteorder 0.5.3",
- "rand 0.3.23",
-]
-
[[package]]
name = "curve25519-dalek"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26778518a7f6cffa1d25a44b602b62b979bd88adb9e99ffec546998cf3404839"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
"digest",
"rand_core 0.5.1",
"subtle 2.2.2",
@@ -1059,7 +1079,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2323f3f47db9a0e77ce7a300605d8d2098597fc451ed1a97bb1f6411bb550a7"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -1106,7 +1126,7 @@ version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbea"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
"quick-error",
]
@@ -1161,7 +1181,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ed9afacaea0301eefb738c9deea725e6d53938004597cdc518a8cf9a7aa2f03"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -1279,7 +1299,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
]
[[package]]
@@ -1314,7 +1334,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "030a733c8287d6213886dd487564ff5c8f6aae10278b3588ed177f9d18f8d231"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
"synstructure",
]
@@ -1357,7 +1377,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8feb87a63249689640ac9c011742c33139204e3c134293d3054022276869133b"
dependencies = [
"either",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 2.0.2",
"log",
"num-traits 0.2.11",
@@ -1372,7 +1392,7 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32529fc42e86ec06e5047092082aab9ad459b070c5d2a76b14f4f5ce70bf2e84"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
"rand 0.7.3",
"rustc-hex",
"static_assertions",
@@ -1405,14 +1425,14 @@ checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
[[package]]
name = "fork-tree"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"parity-scale-codec",
]
[[package]]
name = "frame-benchmarking"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -1428,7 +1448,7 @@ dependencies = [
[[package]]
name = "frame-benchmarking-cli"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"parity-scale-codec",
@@ -1445,7 +1465,7 @@ dependencies = [
[[package]]
name = "frame-executive"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -1465,7 +1485,7 @@ dependencies = [
[[package]]
name = "frame-metadata"
-version = "11.0.0-alpha.8"
+version = "11.0.0-rc4"
dependencies = [
"parity-scale-codec",
"serde",
@@ -1475,7 +1495,7 @@ dependencies = [
[[package]]
name = "frame-support"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"bitmask",
"frame-metadata",
@@ -1488,6 +1508,7 @@ dependencies = [
"paste",
"pretty_assertions",
"serde",
+ "smallvec 1.4.0",
"sp-arithmetic",
"sp-core",
"sp-inherents",
@@ -1500,37 +1521,37 @@ dependencies = [
[[package]]
name = "frame-support-procedural"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support-procedural-tools",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
[[package]]
name = "frame-support-procedural-tools"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support-procedural-tools-derive",
"proc-macro-crate",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
[[package]]
name = "frame-support-procedural-tools-derive"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
[[package]]
name = "frame-support-test"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"parity-scale-codec",
@@ -1542,12 +1563,13 @@ dependencies = [
"sp-io",
"sp-runtime",
"sp-state-machine",
+ "sp-std",
"trybuild",
]
[[package]]
name = "frame-system"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"criterion 0.2.11",
"frame-support",
@@ -1565,7 +1587,7 @@ dependencies = [
[[package]]
name = "frame-system-benchmarking"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -1580,7 +1602,7 @@ dependencies = [
[[package]]
name = "frame-system-rpc-runtime-api"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"parity-scale-codec",
"sp-api",
@@ -1644,9 +1666,9 @@ checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef"
[[package]]
name = "futures"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c329ae8753502fb44ae4fc2b622fa2a94652c41e795143765ba0927f92ab780"
+checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613"
dependencies = [
"futures-channel",
"futures-core",
@@ -1659,9 +1681,9 @@ dependencies = [
[[package]]
name = "futures-channel"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8"
+checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5"
dependencies = [
"futures-core",
"futures-sink",
@@ -1678,9 +1700,9 @@ dependencies = [
[[package]]
name = "futures-core"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a"
+checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399"
[[package]]
name = "futures-core-preview"
@@ -1705,7 +1727,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdcef58a173af8148b182684c9f2d5250875adbcaff7b5794073894f9d8634a9"
dependencies = [
"futures 0.1.29",
- "futures 0.3.4",
+ "futures 0.3.5",
"lazy_static",
"log",
"parking_lot 0.9.0",
@@ -1716,9 +1738,9 @@ dependencies = [
[[package]]
name = "futures-executor"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f674f3e1bcb15b37284a90cedf55afdba482ab061c407a9c0ebbd0f3109741ba"
+checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314"
dependencies = [
"futures-core",
"futures-task",
@@ -1728,33 +1750,36 @@ dependencies = [
[[package]]
name = "futures-io"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6"
+checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789"
[[package]]
name = "futures-macro"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7"
+checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39"
dependencies = [
"proc-macro-hack",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
[[package]]
name = "futures-sink"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6"
+checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc"
[[package]]
name = "futures-task"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27"
+checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626"
+dependencies = [
+ "once_cell",
+]
[[package]]
name = "futures-timer"
@@ -1774,9 +1799,9 @@ dependencies = [
[[package]]
name = "futures-util"
-version = "0.3.4"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5"
+checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6"
dependencies = [
"futures 0.1.29",
"futures-channel",
@@ -1786,6 +1811,7 @@ dependencies = [
"futures-sink",
"futures-task",
"memchr",
+ "pin-project",
"pin-utils",
"proc-macro-hack",
"proc-macro-nested",
@@ -1811,7 +1837,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0a73299e4718f5452e45980fc1d6957a070abe308d3700b63b8673f47e1c2b3"
dependencies = [
"bytes 0.5.4",
- "futures 0.3.4",
+ "futures 0.3.5",
+ "memchr",
+ "pin-project",
+]
+
+[[package]]
+name = "futures_codec"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ce54d63f8b0c75023ed920d46fd71d0cbbb830b0ee012726b5b4f506fb6dea5b"
+dependencies = [
+ "bytes 0.5.4",
+ "futures 0.3.5",
"memchr",
"pin-project",
]
@@ -1865,6 +1903,15 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "ghash"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9f0930ed19a7184089ea46d2fedead2f6dc2b674c5db4276b7da336c7cd83252"
+dependencies = [
+ "polyval",
+]
+
[[package]]
name = "gimli"
version = "0.20.0"
@@ -1872,10 +1919,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81dd6190aad0f05ddbbf3245c54ed14ca4aa6dd32f22312b70d8f168c3e3e633"
dependencies = [
"arrayvec 0.5.1",
- "byteorder 1.3.4",
+ "byteorder",
"fallible-iterator",
"indexmap",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
"stable_deref_trait",
]
@@ -1934,7 +1981,7 @@ version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
"bytes 0.4.12",
"fnv",
"futures 0.1.29",
@@ -2056,9 +2103,9 @@ dependencies = [
[[package]]
name = "honggfuzz"
-version = "0.5.47"
+version = "0.5.49"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3de2c3273ef7735df1c5a72128ca85b1d20105b9aac643cdfd7a6e581311150"
+checksum = "832bac18a82ec7d6c21887daa8616b238fe90d5d5e762d0d4b9372cdaa9e097f"
dependencies = [
"arbitrary",
"lazy_static",
@@ -2261,7 +2308,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ef5550a42e3740a0e71f909d4c861056a284060af885ae7aa6242820f920d9d"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -2286,7 +2333,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 2.0.2",
]
@@ -2320,6 +2367,15 @@ dependencies = [
"either",
]
+[[package]]
+name = "itertools"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
+dependencies = [
+ "either",
+]
+
[[package]]
name = "itoa"
version = "0.4.5"
@@ -2346,9 +2402,9 @@ dependencies = [
[[package]]
name = "jsonrpc-client-transports"
-version = "14.1.0"
+version = "14.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2307a7e78cf969759e390a8a2151ea12e783849a45bb00aa871b468ba58ea79e"
+checksum = "ecbdaacc17243168d9d1fa6b2bd7556a27e1e60a621d8a2a6e590ae2b145d158"
dependencies = [
"failure",
"futures 0.1.29",
@@ -2363,9 +2419,9 @@ dependencies = [
[[package]]
name = "jsonrpc-core"
-version = "14.1.0"
+version = "14.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25525f6002338fb4debb5167a89a0b47f727a5a48418417545ad3429758b7fec"
+checksum = "a0747307121ffb9703afd93afbd0fb4f854c38fb873f2c8b90e0e902f27c7b62"
dependencies = [
"futures 0.1.29",
"log",
@@ -2376,30 +2432,30 @@ dependencies = [
[[package]]
name = "jsonrpc-core-client"
-version = "14.1.0"
+version = "14.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87f9382e831a6d630c658df103aac3f971da096deb57c136ea2b760d3b4e3f9f"
+checksum = "34221123bc79b66279a3fde2d3363553835b43092d629b34f2e760c44dc94713"
dependencies = [
"jsonrpc-client-transports",
]
[[package]]
name = "jsonrpc-derive"
-version = "14.0.5"
+version = "14.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8609af8f63b626e8e211f52441fcdb6ec54f1a446606b10d5c89ae9bf8a20058"
+checksum = "0fadf6945e227246825a583514534d864554e9f23d80b3c77d034b10983db5ef"
dependencies = [
"proc-macro-crate",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
[[package]]
name = "jsonrpc-http-server"
-version = "14.1.0"
+version = "14.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d52860f0549694aa4abb12766856f56952ab46d3fb9f0815131b2db3d9cc2f29"
+checksum = "0da906d682799df05754480dac1b9e70ec92e12c19ebafd2662a5ea1c9fd6522"
dependencies = [
"hyper 0.12.35",
"jsonrpc-core",
@@ -2410,23 +2466,38 @@ dependencies = [
"unicase",
]
+[[package]]
+name = "jsonrpc-ipc-server"
+version = "14.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dedccd693325d833963b549e959137f30a7a0ea650cde92feda81dc0c1393cb5"
+dependencies = [
+ "jsonrpc-core",
+ "jsonrpc-server-utils",
+ "log",
+ "parity-tokio-ipc",
+ "parking_lot 0.10.2",
+ "tokio-service",
+]
+
[[package]]
name = "jsonrpc-pubsub"
-version = "14.1.0"
+version = "14.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4ca5e391d6c6a2261d4adca029f427fe63ea546ad6cef2957c654c08495ec16"
+checksum = "2d44f5602a11d657946aac09357956d2841299ed422035edf140c552cb057986"
dependencies = [
"jsonrpc-core",
"log",
"parking_lot 0.10.2",
+ "rand 0.7.3",
"serde",
]
[[package]]
name = "jsonrpc-server-utils"
-version = "14.1.0"
+version = "14.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f06add502b48351e05dd95814835327fb115e4e9f834ca42fd522d3b769d4d2"
+checksum = "56cbfb462e7f902e21121d9f0d1c2b77b2c5b642e1a4e8f4ebfa2e15b94402bb"
dependencies = [
"bytes 0.4.12",
"globset",
@@ -2440,9 +2511,9 @@ dependencies = [
[[package]]
name = "jsonrpc-ws-server"
-version = "14.1.0"
+version = "14.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "017a7dd5083d9ed62c5e1dd3e317975c33c3115dac5447f4480fe05a8c354754"
+checksum = "903d3109fe7c4acb932b567e1e607e0f524ed04741b09fb0e61841bc40a022fc"
dependencies = [
"jsonrpc-core",
"jsonrpc-server-utils",
@@ -2495,7 +2566,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e763b2a9b500ba47948061d1e8bc3b5f03a8a1f067dbcf822a4d2c84d2b54a3a"
dependencies = [
"parity-util-mem",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
]
[[package]]
@@ -2524,7 +2595,7 @@ dependencies = [
"parking_lot 0.10.2",
"regex",
"rocksdb",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
]
[[package]]
@@ -2533,7 +2604,7 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c7f36acb1841d4c701d30ae1f2cfd242e805991443f75f6935479ed3de64903"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"js-sys",
"kvdb",
"kvdb-memorydb",
@@ -2598,61 +2669,55 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a"
[[package]]
name = "libp2p"
-version = "0.18.1"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32ea742c86405b659c358223a8f0f9f5a9eb27bb6083894c6340959b05269662"
+checksum = "db81113df355dea9dddfcb01cd867555298dca29d915f25d1b1a0aad2e29338b"
dependencies = [
"bytes 0.5.4",
- "futures 0.3.4",
+ "futures 0.3.5",
"lazy_static",
"libp2p-core",
"libp2p-core-derive",
- "libp2p-deflate",
"libp2p-dns",
- "libp2p-floodsub",
- "libp2p-gossipsub",
"libp2p-identify",
"libp2p-kad",
"libp2p-mdns",
"libp2p-mplex",
"libp2p-noise",
"libp2p-ping",
- "libp2p-plaintext",
- "libp2p-pnet",
"libp2p-secio",
"libp2p-swarm",
"libp2p-tcp",
- "libp2p-uds",
"libp2p-wasm-ext",
"libp2p-websocket",
"libp2p-yamux",
"multihash",
- "parity-multiaddr 0.8.0",
+ "parity-multiaddr 0.9.1",
"parking_lot 0.10.2",
"pin-project",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
"wasm-timer",
]
[[package]]
name = "libp2p-core"
-version = "0.18.0"
+version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1d2c17158c4dca984a77a5927aac6f0862d7f50c013470a415f93be498b5739"
+checksum = "3a0387b930c3d4c2533dc4893c1e0394185ddcc019846121b1b27491e45a2c08"
dependencies = [
"asn1_der",
"bs58",
"ed25519-dalek",
"either",
"fnv",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"lazy_static",
"libsecp256k1",
"log",
"multihash",
"multistream-select",
- "parity-multiaddr 0.8.0",
+ "parity-multiaddr 0.9.1",
"parking_lot 0.10.2",
"pin-project",
"prost",
@@ -2661,115 +2726,62 @@ dependencies = [
"ring",
"rw-stream-sink",
"sha2",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
"thiserror",
- "unsigned-varint",
+ "unsigned-varint 0.4.0",
"void",
"zeroize",
]
[[package]]
name = "libp2p-core-derive"
-version = "0.18.0"
+version = "0.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "329127858e4728db5ab60c33d5ae352a999325fdf190ed022ec7d3a4685ae2e6"
+checksum = "f09548626b737ed64080fde595e06ce1117795b8b9fc4d2629fa36561c583171"
dependencies = [
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
-[[package]]
-name = "libp2p-deflate"
-version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ad32b006ea922da8cc66e537cf2df4b0fad8ebaa467d2a8c63d7784ac252ec6"
-dependencies = [
- "flate2",
- "futures 0.3.4",
- "libp2p-core",
-]
-
[[package]]
name = "libp2p-dns"
-version = "0.18.0"
+version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0d0993481203d68e5ce2f787d033fb0cac6b850659ed6c784612db678977c71"
+checksum = "3cc186d9a941fd0207cf8f08ef225a735e2d7296258f570155e525f6ee732f87"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"libp2p-core",
"log",
]
-[[package]]
-name = "libp2p-floodsub"
-version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3673153ca967c179d745fadf047d069355d6669ecf7f261b450fbaebf1bffd3d"
-dependencies = [
- "cuckoofilter",
- "fnv",
- "futures 0.3.4",
- "libp2p-core",
- "libp2p-swarm",
- "prost",
- "prost-build",
- "rand 0.7.3",
- "smallvec 1.3.0",
-]
-
-[[package]]
-name = "libp2p-gossipsub"
-version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f7f3f79f060864db0317cc47641b7d35276dee52a0ffa91553fbd0c153863a3"
-dependencies = [
- "base64 0.11.0",
- "byteorder 1.3.4",
- "bytes 0.5.4",
- "fnv",
- "futures 0.3.4",
- "futures_codec",
- "libp2p-core",
- "libp2p-swarm",
- "log",
- "lru",
- "prost",
- "prost-build",
- "rand 0.7.3",
- "sha2",
- "smallvec 1.3.0",
- "unsigned-varint",
- "wasm-timer",
-]
-
[[package]]
name = "libp2p-identify"
-version = "0.18.0"
+version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a38ca3eb807789e26f41c82ca7cd2b3843c66c5587b8b5f709a2f421f3061414"
+checksum = "62f76075b170d908bae616f550ade410d9d27c013fa69042551dbfc757c7c094"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"libp2p-core",
"libp2p-swarm",
"log",
"prost",
"prost-build",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
"wasm-timer",
]
[[package]]
name = "libp2p-kad"
-version = "0.18.0"
+version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a92cda1fb8149ea64d092a2b99d2bd7a2c309eee38ea322d02e4480bd6ee1759"
+checksum = "f7c819a5425b2eb3416d67e9c868c5c1e922b6658655e06b9eeafaa41304b876"
dependencies = [
"arrayvec 0.5.1",
"bytes 0.5.4",
"either",
"fnv",
- "futures 0.3.4",
- "futures_codec",
+ "futures 0.3.5",
+ "futures_codec 0.4.1",
"libp2p-core",
"libp2p-swarm",
"log",
@@ -2778,59 +2790,59 @@ dependencies = [
"prost-build",
"rand 0.7.3",
"sha2",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
"uint",
- "unsigned-varint",
+ "unsigned-varint 0.4.0",
"void",
"wasm-timer",
]
[[package]]
name = "libp2p-mdns"
-version = "0.18.0"
+version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41e908d2aaf8ff0ec6ad1f02fe1844fd777fb0b03a68a226423630750ab99471"
+checksum = "7f55b2d4b80986e5bf158270ab23268ec0e7f644ece5436fbaabc5155472f357"
dependencies = [
"async-std",
"data-encoding",
"dns-parser",
"either",
- "futures 0.3.4",
+ "futures 0.3.5",
"lazy_static",
"libp2p-core",
"libp2p-swarm",
"log",
"net2",
"rand 0.7.3",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
"void",
"wasm-timer",
]
[[package]]
name = "libp2p-mplex"
-version = "0.18.0"
+version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0832882b06619b2e81d74e71447753ea3c068164a0bca67847d272e856a04a02"
+checksum = "be7d913a4cd57de2013257ec73f07d77bfce390b370023e2d59083e5ca079864"
dependencies = [
"bytes 0.5.4",
"fnv",
- "futures 0.3.4",
- "futures_codec",
+ "futures 0.3.5",
+ "futures_codec 0.4.1",
"libp2p-core",
"log",
"parking_lot 0.10.2",
- "unsigned-varint",
+ "unsigned-varint 0.4.0",
]
[[package]]
name = "libp2p-noise"
-version = "0.18.0"
+version = "0.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "918e94a649e1139c24ee9f1f8c1f2adaba6d157b9471af787f2d9beac8c29c77"
+checksum = "a03db664653369f46ee03fcec483a378c20195089bb43a26cb9fb0058009ac88"
dependencies = [
"curve25519-dalek",
- "futures 0.3.4",
+ "futures 0.3.5",
"lazy_static",
"libp2p-core",
"log",
@@ -2846,11 +2858,11 @@ dependencies = [
[[package]]
name = "libp2p-ping"
-version = "0.18.0"
+version = "0.19.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9bfbf87eebb492d040f9899c5c81c9738730465ac5e78d9b7a7d086d0f07230"
+checksum = "b8dedd34e35a9728d52d59ef36a218e411359a353f9011b2574b86ee790978f6"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"libp2p-core",
"libp2p-swarm",
"log",
@@ -2859,47 +2871,15 @@ dependencies = [
"wasm-timer",
]
-[[package]]
-name = "libp2p-plaintext"
-version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fabb00553a49bf6d4a8ce362f6eefac410227a14d03c3acffbb8cc3f022ea019"
-dependencies = [
- "bytes 0.5.4",
- "futures 0.3.4",
- "futures_codec",
- "libp2p-core",
- "log",
- "prost",
- "prost-build",
- "rw-stream-sink",
- "unsigned-varint",
- "void",
-]
-
-[[package]]
-name = "libp2p-pnet"
-version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f81b8b37ff529e1f51c20c396dac657def2108da174c1d27e57e72c9fe2d411"
-dependencies = [
- "futures 0.3.4",
- "log",
- "pin-project",
- "rand 0.7.3",
- "salsa20",
- "sha3",
-]
-
[[package]]
name = "libp2p-secio"
-version = "0.18.0"
+version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7a0509a7e47245259954fef58b85b81bf4d29ae33a4365e38d718a866698774"
+checksum = "c99b3c33e96bb402486d5b4f7cbeab14e66e6a2ed010abbb5bb032a05460bfda"
dependencies = [
"aes-ctr",
"ctr",
- "futures 0.3.4",
+ "futures 0.3.5",
"hmac",
"js-sys",
"lazy_static",
@@ -2923,53 +2903,42 @@ dependencies = [
[[package]]
name = "libp2p-swarm"
-version = "0.18.1"
+version = "0.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "44ab289ae44cc691da0a6fe96aefa43f26c86c6c7813998e203f6d80f1860f18"
+checksum = "ce53ff4d127cf8b39adf84dbd381ca32d49bd85788cee08e6669da2495993930"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"libp2p-core",
"log",
"rand 0.7.3",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
"void",
"wasm-timer",
]
[[package]]
name = "libp2p-tcp"
-version = "0.18.0"
+version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b37ea44823d3ed223e4605da94b50177bc520f05ae2452286700549a32d81669"
+checksum = "9481500c5774c62e8c413e9535b3f33a0e3dbacf2da63b8d3056c686a9df4146"
dependencies = [
"async-std",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"get_if_addrs",
"ipnet",
"libp2p-core",
"log",
-]
-
-[[package]]
-name = "libp2p-uds"
-version = "0.18.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "281c18ea2faacb9c8a6ff76c4405df5918d9a263770e3847bf03f099abadc010"
-dependencies = [
- "async-std",
- "futures 0.3.4",
- "libp2p-core",
- "log",
+ "socket2",
]
[[package]]
name = "libp2p-wasm-ext"
-version = "0.18.0"
+version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3ac7dbde0f88cad191dcdfd073b8bae28d01823e8ca313f117b6ecb914160c3"
+checksum = "f59fdbb5706f2723ca108c088b1c7a37f735a8c328021f0508007162627e9885"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"js-sys",
"libp2p-core",
"parity-send-wrapper",
@@ -2979,14 +2948,13 @@ dependencies = [
[[package]]
name = "libp2p-websocket"
-version = "0.18.0"
+version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6874c9069ce93d899df9dc7b29f129c706b2a0fdc048f11d878935352b580190"
+checksum = "7e4440551bf6519e0a684cd859ea809aec6d798f686e0d6ed03a28c3e76849b8"
dependencies = [
"async-tls",
- "bytes 0.5.4",
"either",
- "futures 0.3.4",
+ "futures 0.3.5",
"libp2p-core",
"log",
"quicksink",
@@ -3000,11 +2968,11 @@ dependencies = [
[[package]]
name = "libp2p-yamux"
-version = "0.18.0"
+version = "0.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02f91aea50f6571e0bc6c058dc0e9b270afd41ec28dd94e9e4bf607e78b9ab87"
+checksum = "8da33e7b5f49c75c6a8afb0b8d1e229f5fa48be9f39bd14cdbc21459a02ac6fc"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"libp2p-core",
"parking_lot 0.10.2",
"thiserror",
@@ -3170,9 +3138,9 @@ dependencies = [
[[package]]
name = "memory-db"
-version = "0.20.1"
+version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be512cb2ccb4ecbdca937fdd4a62ea5f09f8e7195466a85e4632b3d5bcce82e6"
+checksum = "fb2999ff7a65d5a1d72172f6d51fa2ea03024b51aee709ba5ff81c3c629a2410"
dependencies = [
"ahash",
"hash-db",
@@ -3192,7 +3160,7 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6feca46f4fa3443a01769d768727f10c10a20fdb65e52dc16a81f0c8269bb78"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
"keccak",
"rand_core 0.5.1",
"zeroize",
@@ -3220,7 +3188,7 @@ dependencies = [
"kernel32-sys",
"libc",
"log",
- "miow",
+ "miow 0.2.1",
"net2",
"slab",
"winapi 0.2.8",
@@ -3238,6 +3206,18 @@ dependencies = [
"slab",
]
+[[package]]
+name = "mio-named-pipes"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f5e374eff525ce1c5b7687c4cef63943e7686524a387933ad27ca7ec43779cb3"
+dependencies = [
+ "log",
+ "mio",
+ "miow 0.3.5",
+ "winapi 0.3.8",
+]
+
[[package]]
name = "mio-uds"
version = "0.6.7"
@@ -3261,6 +3241,16 @@ dependencies = [
"ws2_32-sys",
]
+[[package]]
+name = "miow"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e"
+dependencies = [
+ "socket2",
+ "winapi 0.3.8",
+]
+
[[package]]
name = "more-asserts"
version = "0.2.1"
@@ -3269,9 +3259,9 @@ checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238"
[[package]]
name = "multihash"
-version = "0.10.1"
+version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47fbc227f7e2b1cb701f95404579ecb2668abbdd3c7ef7a6cbb3cc0d3b236869"
+checksum = "ae32179a9904ccc6e063de8beee7f5dd55fae85ecb851ca923d55722bc28cf5d"
dependencies = [
"blake2b_simd",
"blake2s_simd",
@@ -3279,7 +3269,7 @@ dependencies = [
"sha-1",
"sha2",
"sha3",
- "unsigned-varint",
+ "unsigned-varint 0.3.3",
]
[[package]]
@@ -3290,16 +3280,16 @@ checksum = "d8883adfde9756c1d30b0f519c9b8c502a94b41ac62f696453c37c7fc0a958ce"
[[package]]
name = "multistream-select"
-version = "0.8.0"
+version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74cdcf7cfb3402881e15a1f95116cb033d69b33c83d481e1234777f5ef0c3d2c"
+checksum = "c9157e87afbc2ef0d84cc0345423d715f445edde00141c93721c162de35a05e5"
dependencies = [
"bytes 0.5.4",
- "futures 0.3.4",
+ "futures 0.3.5",
"log",
"pin-project",
- "smallvec 1.3.0",
- "unsigned-varint",
+ "smallvec 1.4.0",
+ "unsigned-varint 0.4.0",
]
[[package]]
@@ -3346,7 +3336,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29449d242064c48d3057a194b049a2bdcccadda16faa18a91468677b44e8d422"
dependencies = [
"bitflags",
- "byteorder 1.3.4",
+ "byteorder",
"enum-primitive-derive",
"libc",
"num-traits 0.2.11",
@@ -3368,10 +3358,11 @@ dependencies = [
[[package]]
name = "node-bench"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"derive_more",
"fs_extra",
+ "futures 0.3.5",
"hash-db",
"hex",
"kvdb",
@@ -3379,17 +3370,24 @@ dependencies = [
"lazy_static",
"log",
"node-primitives",
+ "node-runtime",
"node-testing",
"parity-db",
"parity-util-mem",
"rand 0.7.3",
+ "sc-basic-authorship",
"sc-cli",
"sc-client-api",
"serde",
"serde_json",
+ "sp-consensus",
"sp-core",
+ "sp-finality-tracker",
+ "sp-inherents",
"sp-runtime",
"sp-state-machine",
+ "sp-timestamp",
+ "sp-transaction-pool",
"sp-trie",
"structopt",
"tempfile",
@@ -3397,9 +3395,9 @@ dependencies = [
[[package]]
name = "node-browser-testing"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"jsonrpc-core",
"libp2p",
@@ -3414,13 +3412,13 @@ dependencies = [
[[package]]
name = "node-cli"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"assert_cmd",
"frame-benchmarking-cli",
"frame-support",
"frame-system",
- "futures 0.3.4",
+ "futures 0.3.5",
"hex-literal",
"jsonrpc-core",
"log",
@@ -3488,7 +3486,7 @@ dependencies = [
[[package]]
name = "node-executor"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"criterion 0.3.1",
"frame-benchmarking",
@@ -3522,7 +3520,7 @@ dependencies = [
[[package]]
name = "node-inspect"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"derive_more",
"log",
@@ -3538,7 +3536,7 @@ dependencies = [
[[package]]
name = "node-primitives"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-system",
"parity-scale-codec",
@@ -3551,7 +3549,7 @@ dependencies = [
[[package]]
name = "node-rpc"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"jsonrpc-core",
"node-primitives",
@@ -3565,7 +3563,9 @@ dependencies = [
"sc-finality-grandpa",
"sc-finality-grandpa-rpc",
"sc-keystore",
+ "sc-rpc-api",
"sp-api",
+ "sp-block-builder",
"sp-blockchain",
"sp-consensus",
"sp-consensus-babe",
@@ -3576,7 +3576,7 @@ dependencies = [
[[package]]
name = "node-rpc-client"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"env_logger 0.7.1",
"futures 0.1.29",
@@ -3589,7 +3589,7 @@ dependencies = [
[[package]]
name = "node-runtime"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-executive",
@@ -3597,6 +3597,7 @@ dependencies = [
"frame-system",
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
+ "hex-literal",
"integer-sqrt",
"node-primitives",
"pallet-authority-discovery",
@@ -3615,8 +3616,10 @@ dependencies = [
"pallet-im-online",
"pallet-indices",
"pallet-membership",
+ "pallet-multisig",
"pallet-offences",
"pallet-offences-benchmarking",
+ "pallet-proxy",
"pallet-randomness-collective-flip",
"pallet-recovery",
"pallet-scheduler",
@@ -3655,9 +3658,9 @@ dependencies = [
[[package]]
name = "node-template"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"log",
"node-template-runtime",
"parking_lot 0.10.2",
@@ -3684,7 +3687,7 @@ dependencies = [
[[package]]
name = "node-template-runtime"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-executive",
"frame-support",
@@ -3716,13 +3719,13 @@ dependencies = [
[[package]]
name = "node-testing"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"criterion 0.3.1",
"frame-support",
"frame-system",
"fs_extra",
- "futures 0.3.4",
+ "futures 0.3.5",
"log",
"node-executor",
"node-primitives",
@@ -3872,16 +3875,6 @@ dependencies = [
"target-lexicon",
]
-[[package]]
-name = "ole32-sys"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d2c49021782e5233cd243168edfa8037574afed4eba4bbaf538b3d8d1789d8c"
-dependencies = [
- "winapi 0.2.8",
- "winapi-build",
-]
-
[[package]]
name = "once_cell"
version = "1.3.1"
@@ -3929,7 +3922,7 @@ dependencies = [
[[package]]
name = "pallet-assets"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -3941,9 +3934,24 @@ dependencies = [
"sp-std",
]
+[[package]]
+name = "pallet-atomic-swap"
+version = "2.0.0-rc4"
+dependencies = [
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "parity-scale-codec",
+ "serde",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
[[package]]
name = "pallet-aura"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -3965,7 +3973,7 @@ dependencies = [
[[package]]
name = "pallet-authority-discovery"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -3983,7 +3991,7 @@ dependencies = [
[[package]]
name = "pallet-authorship"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -3999,7 +4007,7 @@ dependencies = [
[[package]]
name = "pallet-babe"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -4021,7 +4029,7 @@ dependencies = [
[[package]]
name = "pallet-balances"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -4037,7 +4045,7 @@ dependencies = [
[[package]]
name = "pallet-benchmark"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -4051,7 +4059,7 @@ dependencies = [
[[package]]
name = "pallet-collective"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -4068,7 +4076,7 @@ dependencies = [
[[package]]
name = "pallet-contracts"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"assert_matches",
"frame-support",
@@ -4078,9 +4086,9 @@ dependencies = [
"pallet-contracts-primitives",
"pallet-randomness-collective-flip",
"pallet-timestamp",
- "pallet-transaction-payment",
"parity-scale-codec",
"parity-wasm 0.41.0",
+ "pretty_assertions",
"pwasm-utils",
"serde",
"sp-core",
@@ -4094,7 +4102,7 @@ dependencies = [
[[package]]
name = "pallet-contracts-primitives"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"parity-scale-codec",
"sp-runtime",
@@ -4103,7 +4111,7 @@ dependencies = [
[[package]]
name = "pallet-contracts-rpc"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"jsonrpc-core",
"jsonrpc-core-client",
@@ -4122,7 +4130,7 @@ dependencies = [
[[package]]
name = "pallet-contracts-rpc-runtime-api"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"pallet-contracts-primitives",
"parity-scale-codec",
@@ -4133,7 +4141,7 @@ dependencies = [
[[package]]
name = "pallet-democracy"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -4153,7 +4161,7 @@ dependencies = [
[[package]]
name = "pallet-elections"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -4169,7 +4177,7 @@ dependencies = [
[[package]]
name = "pallet-elections-phragmen"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -4180,7 +4188,7 @@ dependencies = [
"serde",
"sp-core",
"sp-io",
- "sp-phragmen",
+ "sp-npos-elections",
"sp-runtime",
"sp-std",
"substrate-test-utils",
@@ -4188,7 +4196,7 @@ dependencies = [
[[package]]
name = "pallet-evm"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"evm",
"frame-support",
@@ -4208,7 +4216,7 @@ dependencies = [
[[package]]
name = "pallet-example"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -4224,7 +4232,7 @@ dependencies = [
[[package]]
name = "pallet-example-offchain-worker"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -4239,7 +4247,7 @@ dependencies = [
[[package]]
name = "pallet-finality-tracker"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -4256,7 +4264,7 @@ dependencies = [
[[package]]
name = "pallet-generic-asset"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -4270,7 +4278,7 @@ dependencies = [
[[package]]
name = "pallet-grandpa"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"finality-grandpa",
"frame-support",
@@ -4297,7 +4305,7 @@ dependencies = [
[[package]]
name = "pallet-identity"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"enumflags2",
"frame-benchmarking",
@@ -4314,7 +4322,7 @@ dependencies = [
[[package]]
name = "pallet-im-online"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -4333,8 +4341,9 @@ dependencies = [
[[package]]
name = "pallet-indices"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
+ "frame-benchmarking",
"frame-support",
"frame-system",
"pallet-balances",
@@ -4349,7 +4358,7 @@ dependencies = [
[[package]]
name = "pallet-membership"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -4361,9 +4370,25 @@ dependencies = [
"sp-std",
]
+[[package]]
+name = "pallet-multisig"
+version = "2.0.0-rc4"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "pallet-balances",
+ "parity-scale-codec",
+ "serde",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-std",
+]
+
[[package]]
name = "pallet-nicks"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -4378,7 +4403,7 @@ dependencies = [
[[package]]
name = "pallet-offences"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -4393,33 +4418,50 @@ dependencies = [
]
[[package]]
-name = "pallet-offences-benchmarking"
-version = "2.0.0-alpha.8"
+name = "pallet-offences-benchmarking"
+version = "2.0.0-rc4"
+dependencies = [
+ "frame-benchmarking",
+ "frame-support",
+ "frame-system",
+ "pallet-babe",
+ "pallet-balances",
+ "pallet-grandpa",
+ "pallet-im-online",
+ "pallet-offences",
+ "pallet-session",
+ "pallet-staking",
+ "pallet-staking-reward-curve",
+ "pallet-timestamp",
+ "parity-scale-codec",
+ "serde",
+ "sp-core",
+ "sp-io",
+ "sp-runtime",
+ "sp-staking",
+ "sp-std",
+]
+
+[[package]]
+name = "pallet-proxy"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
- "pallet-babe",
"pallet-balances",
- "pallet-grandpa",
- "pallet-im-online",
- "pallet-offences",
- "pallet-session",
- "pallet-staking",
- "pallet-staking-reward-curve",
- "pallet-timestamp",
+ "pallet-utility",
"parity-scale-codec",
"serde",
"sp-core",
"sp-io",
"sp-runtime",
- "sp-staking",
"sp-std",
]
[[package]]
name = "pallet-randomness-collective-flip"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -4433,7 +4475,7 @@ dependencies = [
[[package]]
name = "pallet-recovery"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"enumflags2",
"frame-support",
@@ -4449,7 +4491,7 @@ dependencies = [
[[package]]
name = "pallet-scheduler"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -4464,7 +4506,7 @@ dependencies = [
[[package]]
name = "pallet-scored-pool"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -4479,7 +4521,7 @@ dependencies = [
[[package]]
name = "pallet-session"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -4500,7 +4542,7 @@ dependencies = [
[[package]]
name = "pallet-session-benchmarking"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -4520,7 +4562,7 @@ dependencies = [
[[package]]
name = "pallet-society"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -4536,7 +4578,7 @@ dependencies = [
[[package]]
name = "pallet-staking"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"env_logger 0.7.1",
"frame-benchmarking",
@@ -4545,19 +4587,17 @@ dependencies = [
"hex",
"pallet-authorship",
"pallet-balances",
- "pallet-indices",
"pallet-session",
"pallet-staking-reward-curve",
"pallet-timestamp",
"parity-scale-codec",
"parking_lot 0.10.2",
- "rand 0.7.3",
"rand_chacha 0.2.2",
"serde",
"sp-application-crypto",
"sp-core",
"sp-io",
- "sp-phragmen",
+ "sp-npos-elections",
"sp-runtime",
"sp-staking",
"sp-std",
@@ -4582,25 +4622,25 @@ dependencies = [
"parity-scale-codec",
"sp-core",
"sp-io",
- "sp-phragmen",
+ "sp-npos-elections",
"sp-runtime",
"sp-std",
]
[[package]]
name = "pallet-staking-reward-curve"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"proc-macro-crate",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"sp-runtime",
"syn 1.0.17",
]
[[package]]
name = "pallet-sudo"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -4614,7 +4654,7 @@ dependencies = [
[[package]]
name = "pallet-template"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
@@ -4626,7 +4666,7 @@ dependencies = [
[[package]]
name = "pallet-timestamp"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -4644,13 +4684,15 @@ dependencies = [
[[package]]
name = "pallet-transaction-payment"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
"pallet-balances",
"pallet-transaction-payment-rpc-runtime-api",
"parity-scale-codec",
+ "serde",
+ "smallvec 1.4.0",
"sp-core",
"sp-io",
"sp-runtime",
@@ -4660,7 +4702,7 @@ dependencies = [
[[package]]
name = "pallet-transaction-payment-rpc"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"jsonrpc-core",
"jsonrpc-core-client",
@@ -4677,7 +4719,7 @@ dependencies = [
[[package]]
name = "pallet-transaction-payment-rpc-runtime-api"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"parity-scale-codec",
@@ -4690,7 +4732,7 @@ dependencies = [
[[package]]
name = "pallet-treasury"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -4702,11 +4744,12 @@ dependencies = [
"sp-io",
"sp-runtime",
"sp-std",
+ "sp-storage",
]
[[package]]
name = "pallet-utility"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
@@ -4722,7 +4765,7 @@ dependencies = [
[[package]]
name = "pallet-vesting"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"enumflags2",
"frame-benchmarking",
@@ -4761,31 +4804,31 @@ checksum = "f77055f9e81921a8cc7bebeb6cded3d128931d51f1e3dd6251f0770a6d431477"
dependencies = [
"arrayref",
"bs58",
- "byteorder 1.3.4",
+ "byteorder",
"data-encoding",
"parity-multihash",
"percent-encoding 2.1.0",
"serde",
"static_assertions",
- "unsigned-varint",
+ "unsigned-varint 0.3.3",
"url 2.1.1",
]
[[package]]
name = "parity-multiaddr"
-version = "0.8.0"
+version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4db35e222f783ef4e6661873f6c165c4eb7b65e0c408349818517d5705c2d7d3"
+checksum = "cc20af3143a62c16e7c9e92ea5c6ae49f7d271d97d4d8fe73afc28f0514a3d0f"
dependencies = [
"arrayref",
"bs58",
- "byteorder 1.3.4",
+ "byteorder",
"data-encoding",
"multihash",
"percent-encoding 2.1.0",
"serde",
"static_assertions",
- "unsigned-varint",
+ "unsigned-varint 0.4.0",
"url 2.1.1",
]
@@ -4801,14 +4844,14 @@ dependencies = [
"sha-1",
"sha2",
"sha3",
- "unsigned-varint",
+ "unsigned-varint 0.3.3",
]
[[package]]
name = "parity-scale-codec"
-version = "1.3.0"
+version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "329c8f7f4244ddb5c37c103641027a76c530e65e8e4b8240b29f81ea40508b17"
+checksum = "a74f02beb35d47e0706155c9eac554b50c671e0d868fe8296bcdf44a9a4847bf"
dependencies = [
"arrayvec 0.5.1",
"bitvec",
@@ -4825,7 +4868,7 @@ checksum = "5a0ec292e92e8ec7c58e576adacc1e3f399c597c8f263c42f18420abe58e7245"
dependencies = [
"proc-macro-crate",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -4835,6 +4878,25 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f"
+[[package]]
+name = "parity-tokio-ipc"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e57fea504fea33f9fbb5f49f378359030e7e026a6ab849bb9e8f0787376f1bf"
+dependencies = [
+ "bytes 0.4.12",
+ "futures 0.1.29",
+ "libc",
+ "log",
+ "mio-named-pipes",
+ "miow 0.3.5",
+ "rand 0.7.3",
+ "tokio 0.1.22",
+ "tokio-named-pipes",
+ "tokio-uds",
+ "winapi 0.3.8",
+]
+
[[package]]
name = "parity-util-mem"
version = "0.6.1"
@@ -4846,7 +4908,7 @@ dependencies = [
"parity-util-mem-derive",
"parking_lot 0.10.2",
"primitive-types",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
"winapi 0.3.8",
]
@@ -4867,7 +4929,7 @@ version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16ad52817c4d343339b3bc2e26861bd21478eda0b7509acf83505727000512ac"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
]
[[package]]
@@ -4922,7 +4984,7 @@ dependencies = [
"cloudabi",
"libc",
"redox_syscall",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
"winapi 0.3.8",
]
@@ -4944,7 +5006,7 @@ checksum = "a62486e111e571b1e93b710b61e8f493c0013be39629b714cb166bdb06aa5a8a"
dependencies = [
"proc-macro-hack",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -4954,7 +5016,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "006c038a43a45995a9670da19e67600114740e8511d4333bf97a56e66a7542d9"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
"crypto-mac",
]
@@ -4994,21 +5056,21 @@ dependencies = [
[[package]]
name = "pin-project"
-version = "0.4.9"
+version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f6a7f5eee6292c559c793430c55c00aea9d3b3d1905e855806ca4d7253426a2"
+checksum = "12e3a6cdbfe94a5e4572812a0201f8c0ed98c1c452c7b8563ce2276988ef9c17"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
-version = "0.4.9"
+version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8988430ce790d8682672117bc06dda364c0be32d3abd738234f19f3240bad99a"
+checksum = "6a0ffd45cf79d88737d7cc85bfd5d2894bee1139b356e616fe85dc389c61aaf7"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -5020,9 +5082,9 @@ checksum = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae"
[[package]]
name = "pin-utils"
-version = "0.1.0-alpha.4"
+version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587"
+checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "pkg-config"
@@ -5054,6 +5116,25 @@ dependencies = [
"web-sys",
]
+[[package]]
+name = "poly1305"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b5829f50f48e9ddb79f3f7c3097029d0caee30f8286accb241416df603b080b8"
+dependencies = [
+ "universal-hash",
+]
+
+[[package]]
+name = "polyval"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ec3341498978de3bfd12d1b22f1af1de22818f5473a11e8a6ef997989e3a212"
+dependencies = [
+ "cfg-if",
+ "universal-hash",
+]
+
[[package]]
name = "ppv-lite86"
version = "0.2.6"
@@ -5128,7 +5209,7 @@ checksum = "98e9e4b82e0ef281812565ea4751049f1bdcdfccda7d3f459f2e138a40c08678"
dependencies = [
"proc-macro-error-attr",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
"version_check",
]
@@ -5140,7 +5221,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f5444ead4e9935abd7f27dc51f7e852a0569ac888096d5ec2499470794e2e53"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
"syn-mid",
"version_check",
@@ -5174,7 +5255,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe50036aa1b71e553a4a0c48ab7baabf8aa8c7a5a61aae06bf38c2eab7430475"
dependencies = [
"bitflags",
- "byteorder 1.3.4",
+ "byteorder",
"chrono",
"hex",
"lazy_static",
@@ -5214,7 +5295,7 @@ checksum = "02b10678c913ecbd69350e8535c3aef91a8676c0773fc1d7b95cdd196d7f2f26"
dependencies = [
"bytes 0.5.4",
"heck",
- "itertools",
+ "itertools 0.8.2",
"log",
"multimap",
"petgraph",
@@ -5231,9 +5312,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72"
dependencies = [
"anyhow",
- "itertools",
+ "itertools 0.8.2",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -5259,7 +5340,7 @@ version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f7a12f176deee919f4ba55326ee17491c8b707d0987aed822682c821b660192"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
"log",
"parity-wasm 0.41.0",
]
@@ -5301,9 +5382,9 @@ checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
[[package]]
name = "quote"
-version = "1.0.3"
+version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f"
+checksum = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea"
dependencies = [
"proc-macro2",
]
@@ -5514,7 +5595,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03b418169fb9c46533f326efd6eed2576699c44ca92d3052a066214a8d828929"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
"rand_core 0.3.1",
]
@@ -5601,7 +5682,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "602eb59cda66fcb9aec25841fb76bc01d2b34282dcdd705028da297db6f3eec8"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -5613,7 +5694,7 @@ checksum = "b27b256b41986ac5141b37b8bbba85d314fbf546c182eb255af6720e07e4f804"
dependencies = [
"log",
"rustc-hash",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
]
[[package]]
@@ -5634,7 +5715,7 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
]
[[package]]
@@ -5664,6 +5745,27 @@ dependencies = [
"winapi 0.3.8",
]
+[[package]]
+name = "rental"
+version = "0.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8545debe98b2b139fb04cad8618b530e9b07c152d99a5de83c860b877d67847f"
+dependencies = [
+ "rental-impl",
+ "stable_deref_trait",
+]
+
+[[package]]
+name = "rental-impl"
+version = "0.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "475e68978dc5b743f2f40d8e0a8fdc83f1c5e78cbf4b8fa5e74e73beebc340de"
+dependencies = [
+ "proc-macro2",
+ "quote 1.0.6",
+ "syn 1.0.17",
+]
+
[[package]]
name = "ring"
version = "0.16.12"
@@ -5785,7 +5887,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3bba175698996010c4f6dce5e7f173b6eb781fce25d2cfc45e27091ce0b79f6"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -5795,7 +5897,7 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"pin-project",
"static_assertions",
]
@@ -5815,26 +5917,6 @@ dependencies = [
"rustc_version",
]
-[[package]]
-name = "salsa20"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2324b0e8c3bb9a586a571fdb3136f70e7e2c748de00a78043f86e0cff91f91fe"
-dependencies = [
- "byteorder 1.3.4",
- "salsa20-core",
- "stream-cipher",
-]
-
-[[package]]
-name = "salsa20-core"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2fe6cc1b9f5a5867853ade63099de70f042f7679e408d1ffe52821c9248e6e69"
-dependencies = [
- "stream-cipher",
-]
-
[[package]]
name = "same-file"
version = "1.0.6"
@@ -5846,12 +5928,12 @@ dependencies = [
[[package]]
name = "sc-authority-discovery"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"bytes 0.5.4",
"derive_more",
"env_logger 0.7.1",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"libp2p",
"log",
@@ -5876,15 +5958,16 @@ dependencies = [
[[package]]
name = "sc-basic-authorship"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"log",
"parity-scale-codec",
"parking_lot 0.10.2",
"sc-block-builder",
"sc-client-api",
+ "sc-proposer-metrics",
"sc-telemetry",
"sc-transaction-pool",
"sp-api",
@@ -5894,13 +5977,14 @@ dependencies = [
"sp-inherents",
"sp-runtime",
"sp-transaction-pool",
+ "substrate-prometheus-endpoint",
"substrate-test-runtime-client",
"tokio-executor 0.2.0-alpha.6",
]
[[package]]
name = "sc-block-builder"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"parity-scale-codec",
"sc-client-api",
@@ -5917,7 +6001,7 @@ dependencies = [
[[package]]
name = "sc-chain-spec"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"impl-trait-for-tuples",
"sc-chain-spec-derive",
@@ -5932,27 +6016,25 @@ dependencies = [
[[package]]
name = "sc-chain-spec-derive"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"proc-macro-crate",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
[[package]]
name = "sc-cli"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"ansi_term 0.12.1",
- "app_dirs",
"atty",
"chrono",
- "clap",
"derive_more",
"env_logger 0.7.1",
"fdlimit",
- "futures 0.3.4",
+ "futures 0.3.5",
"lazy_static",
"log",
"names",
@@ -5984,11 +6066,11 @@ dependencies = [
[[package]]
name = "sc-client-api"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"derive_more",
"fnv",
- "futures 0.3.4",
+ "futures 0.3.5",
"hash-db",
"hex-literal",
"kvdb",
@@ -6022,7 +6104,7 @@ dependencies = [
[[package]]
name = "sc-client-db"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"blake2-rfc",
"env_logger 0.7.1",
@@ -6055,7 +6137,7 @@ dependencies = [
[[package]]
name = "sc-consensus"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"sc-client-api",
"sp-blockchain",
@@ -6065,11 +6147,11 @@ dependencies = [
[[package]]
name = "sc-consensus-aura"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"derive_more",
"env_logger 0.7.1",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"log",
"parity-scale-codec",
@@ -6103,12 +6185,12 @@ dependencies = [
[[package]]
name = "sc-consensus-babe"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"derive_more",
"env_logger 0.7.1",
"fork-tree",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"log",
"merlin",
@@ -6119,6 +6201,7 @@ dependencies = [
"parking_lot 0.10.2",
"pdqselect",
"rand 0.7.3",
+ "rand_chacha 0.2.2",
"sc-block-builder",
"sc-client-api",
"sc-consensus-epochs",
@@ -6153,17 +6236,20 @@ dependencies = [
[[package]]
name = "sc-consensus-babe-rpc"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"derive_more",
- "futures 0.3.4",
+ "futures 0.3.5",
"jsonrpc-core",
"jsonrpc-core-client",
"jsonrpc-derive",
+ "sc-consensus",
"sc-consensus-babe",
"sc-consensus-epochs",
"sc-keystore",
+ "sc-rpc-api",
"serde",
+ "serde_json",
"sp-api",
"sp-application-crypto",
"sp-blockchain",
@@ -6178,7 +6264,7 @@ dependencies = [
[[package]]
name = "sc-consensus-epochs"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"fork-tree",
"parity-scale-codec",
@@ -6190,12 +6276,12 @@ dependencies = [
[[package]]
name = "sc-consensus-manual-seal"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"assert_matches",
"derive_more",
"env_logger 0.7.1",
- "futures 0.3.4",
+ "futures 0.3.5",
"jsonrpc-core",
"jsonrpc-core-client",
"jsonrpc-derive",
@@ -6220,10 +6306,10 @@ dependencies = [
[[package]]
name = "sc-consensus-pow"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"derive_more",
- "futures 0.3.4",
+ "futures 0.3.5",
"log",
"parity-scale-codec",
"sc-client-api",
@@ -6241,9 +6327,9 @@ dependencies = [
[[package]]
name = "sc-consensus-slots"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"log",
"parity-scale-codec",
@@ -6263,7 +6349,7 @@ dependencies = [
[[package]]
name = "sc-consensus-uncles"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"log",
"sc-client-api",
@@ -6276,7 +6362,7 @@ dependencies = [
[[package]]
name = "sc-executor"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"assert_matches",
"derive_more",
@@ -6291,6 +6377,7 @@ dependencies = [
"sc-executor-wasmi",
"sc-executor-wasmtime",
"sc-runtime-test",
+ "sc-tracing",
"sp-api",
"sp-core",
"sp-externalities",
@@ -6300,18 +6387,20 @@ dependencies = [
"sp-runtime-interface",
"sp-serializer",
"sp-state-machine",
+ "sp-tracing",
"sp-trie",
"sp-version",
"sp-wasm-interface",
"substrate-test-runtime",
"test-case",
+ "tracing",
"wabt",
"wasmi",
]
[[package]]
name = "sc-executor-common"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"derive_more",
"log",
@@ -6327,7 +6416,7 @@ dependencies = [
[[package]]
name = "sc-executor-wasmi"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"log",
"parity-scale-codec",
@@ -6341,7 +6430,7 @@ dependencies = [
[[package]]
name = "sc-executor-wasmtime"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"assert_matches",
"cranelift-codegen",
@@ -6362,14 +6451,14 @@ dependencies = [
[[package]]
name = "sc-finality-grandpa"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"assert_matches",
"derive_more",
"env_logger 0.7.1",
"finality-grandpa",
"fork-tree",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"log",
"parity-scale-codec",
@@ -6386,6 +6475,7 @@ dependencies = [
"sc-telemetry",
"serde_json",
"sp-api",
+ "sp-application-crypto",
"sp-arithmetic",
"sp-blockchain",
"sp-consensus",
@@ -6406,11 +6496,11 @@ dependencies = [
[[package]]
name = "sc-finality-grandpa-rpc"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"derive_more",
"finality-grandpa",
- "futures 0.3.4",
+ "futures 0.3.5",
"jsonrpc-core",
"jsonrpc-core-client",
"jsonrpc-derive",
@@ -6423,26 +6513,29 @@ dependencies = [
[[package]]
name = "sc-informant"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"ansi_term 0.12.1",
- "futures 0.3.4",
+ "futures 0.3.5",
"log",
"parity-util-mem",
+ "parking_lot 0.10.2",
"sc-client-api",
"sc-network",
- "sc-service",
"sp-blockchain",
"sp-runtime",
+ "sp-transaction-pool",
+ "sp-utils",
"wasm-timer",
]
[[package]]
name = "sc-keystore"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"derive_more",
"hex",
+ "merlin",
"parking_lot 0.10.2",
"rand 0.7.3",
"serde_json",
@@ -6452,13 +6545,32 @@ dependencies = [
"tempfile",
]
+[[package]]
+name = "sc-light"
+version = "2.0.0-rc4"
+dependencies = [
+ "hash-db",
+ "lazy_static",
+ "parity-scale-codec",
+ "parking_lot 0.10.2",
+ "sc-client-api",
+ "sc-executor",
+ "sp-api",
+ "sp-blockchain",
+ "sp-core",
+ "sp-externalities",
+ "sp-runtime",
+ "sp-state-machine",
+]
+
[[package]]
name = "sc-network"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"assert_matches",
"async-std",
"bitflags",
+ "bs58",
"bytes 0.5.4",
"derive_more",
"either",
@@ -6466,9 +6578,9 @@ dependencies = [
"erased-serde",
"fnv",
"fork-tree",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
- "futures_codec",
+ "futures_codec 0.3.4",
"hex",
"ip_network",
"libp2p",
@@ -6505,7 +6617,7 @@ dependencies = [
"substrate-test-runtime-client",
"tempfile",
"thiserror",
- "unsigned-varint",
+ "unsigned-varint 0.3.3",
"void",
"wasm-timer",
"zeroize",
@@ -6513,10 +6625,10 @@ dependencies = [
[[package]]
name = "sc-network-gossip"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"async-std",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"libp2p",
"log",
@@ -6531,10 +6643,10 @@ dependencies = [
[[package]]
name = "sc-network-test"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"env_logger 0.7.1",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"libp2p",
"log",
@@ -6557,16 +6669,16 @@ dependencies = [
[[package]]
name = "sc-offchain"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"bytes 0.5.4",
"env_logger 0.7.1",
- "fdlimit",
"fnv",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"hyper 0.13.4",
"hyper-rustls",
+ "lazy_static",
"log",
"num_cpus",
"parity-scale-codec",
@@ -6590,9 +6702,9 @@ dependencies = [
[[package]]
name = "sc-peerset"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"libp2p",
"log",
"rand 0.7.3",
@@ -6601,13 +6713,21 @@ dependencies = [
"wasm-timer",
]
+[[package]]
+name = "sc-proposer-metrics"
+version = "0.8.0-rc4"
+dependencies = [
+ "log",
+ "substrate-prometheus-endpoint",
+]
+
[[package]]
name = "sc-rpc"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"assert_matches",
"futures 0.1.29",
- "futures 0.3.4",
+ "futures 0.3.5",
"hash-db",
"jsonrpc-core",
"jsonrpc-pubsub",
@@ -6642,10 +6762,10 @@ dependencies = [
[[package]]
name = "sc-rpc-api"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"derive_more",
- "futures 0.3.4",
+ "futures 0.3.5",
"jsonrpc-core",
"jsonrpc-core-client",
"jsonrpc-derive",
@@ -6665,10 +6785,11 @@ dependencies = [
[[package]]
name = "sc-rpc-server"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"jsonrpc-core",
"jsonrpc-http-server",
+ "jsonrpc-ipc-server",
"jsonrpc-pubsub",
"jsonrpc-ws-server",
"log",
@@ -6679,7 +6800,7 @@ dependencies = [
[[package]]
name = "sc-runtime-test"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"sp-allocator",
"sp-core",
@@ -6692,14 +6813,16 @@ dependencies = [
[[package]]
name = "sc-service"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"derive_more",
+ "directories",
"exit-future",
"futures 0.1.29",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"hash-db",
+ "jsonrpc-pubsub",
"lazy_static",
"log",
"netstat2",
@@ -6716,7 +6839,9 @@ dependencies = [
"sc-client-db",
"sc-executor",
"sc-finality-grandpa",
+ "sc-informant",
"sc-keystore",
+ "sc-light",
"sc-network",
"sc-offchain",
"sc-rpc",
@@ -6747,18 +6872,19 @@ dependencies = [
"substrate-prometheus-endpoint",
"substrate-test-runtime-client",
"sysinfo",
+ "tempfile",
"tracing",
"wasm-timer",
]
[[package]]
name = "sc-service-test"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"env_logger 0.7.1",
"fdlimit",
"futures 0.1.29",
- "futures 0.3.4",
+ "futures 0.3.5",
"hex-literal",
"log",
"parity-scale-codec",
@@ -6767,6 +6893,7 @@ dependencies = [
"sc-client-api",
"sc-client-db",
"sc-executor",
+ "sc-light",
"sc-network",
"sc-service",
"sp-api",
@@ -6788,7 +6915,7 @@ dependencies = [
[[package]]
name = "sc-state-db"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"env_logger 0.7.1",
"log",
@@ -6802,10 +6929,9 @@ dependencies = [
[[package]]
name = "sc-telemetry"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
- "bytes 0.5.4",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"libp2p",
"log",
@@ -6823,27 +6949,29 @@ dependencies = [
[[package]]
name = "sc-tracing"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"erased-serde",
"log",
"parking_lot 0.10.2",
+ "rustc-hash",
"sc-telemetry",
"serde",
"serde_json",
"slog",
+ "sp-tracing",
"tracing",
"tracing-core",
]
[[package]]
name = "sc-transaction-graph"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"assert_matches",
"criterion 0.3.1",
"derive_more",
- "futures 0.3.4",
+ "futures 0.3.5",
"linked-hash-map",
"log",
"parity-scale-codec",
@@ -6861,11 +6989,11 @@ dependencies = [
[[package]]
name = "sc-transaction-pool"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"assert_matches",
"derive_more",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-diagnose",
"hex",
"intervalier",
@@ -6873,10 +7001,12 @@ dependencies = [
"parity-scale-codec",
"parity-util-mem",
"parking_lot 0.10.2",
+ "sc-block-builder",
"sc-client-api",
"sc-transaction-graph",
"sp-api",
"sp-blockchain",
+ "sp-consensus",
"sp-core",
"sp-keyring",
"sp-runtime",
@@ -6945,7 +7075,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8584eea9b9ff42825b46faf46a8c24d2cff13ec152fa2a50df788b87c07ee28"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -6959,6 +7089,15 @@ dependencies = [
"untrusted",
]
+[[package]]
+name = "secrecy"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9182278ed645df3477a9c27bfee0621c621aa16f6972635f7f795dae3d81070f"
+dependencies = [
+ "zeroize",
+]
+
[[package]]
name = "security-framework"
version = "0.4.2"
@@ -7027,21 +7166,21 @@ checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0"
[[package]]
name = "serde"
-version = "1.0.106"
+version = "1.0.110"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399"
+checksum = "99e7b308464d16b56eba9964e4972a3eee817760ab60d88c3f86e1fecb08204c"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.106"
+version = "1.0.110"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c"
+checksum = "818fbf6bfa9a42d3bfcaca148547aa00c7b915bec71d1757aa2d44ca68771984"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -7068,12 +7207,6 @@ dependencies = [
"opaque-debug",
]
-[[package]]
-name = "sha1"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d"
-
[[package]]
name = "sha2"
version = "0.8.1"
@@ -7099,16 +7232,6 @@ dependencies = [
"opaque-debug",
]
-[[package]]
-name = "shell32-sys"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ee04b46101f57121c9da2b151988283b6beb79b34f5bb29a58ee48cb695122c"
-dependencies = [
- "winapi 0.2.8",
- "winapi-build",
-]
-
[[package]]
name = "shlex"
version = "0.1.1"
@@ -7171,7 +7294,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a945ec7f7ce853e89ffa36be1e27dce9a43e82ff9093bf3461c30d5da74ed11b"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -7186,19 +7309,19 @@ dependencies = [
[[package]]
name = "smallvec"
-version = "1.3.0"
+version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05720e22615919e4734f6a99ceae50d00226c3c5aca406e102ebc33298214e0a"
+checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4"
[[package]]
name = "snow"
-version = "0.6.2"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "afb767eee7d257ba202f0b9b08673bc13b22281632ef45267b19f13100accd2f"
+checksum = "ce0f91be479494dd92e69d9971bd23ed27037dd1c94fcf558f6c6e74e6afa654"
dependencies = [
- "arrayref",
- "blake2-rfc",
- "chacha20-poly1305-aead",
+ "aes-gcm",
+ "blake2",
+ "chacha20poly1305",
"rand 0.7.3",
"rand_core 0.5.1",
"ring",
@@ -7208,29 +7331,37 @@ dependencies = [
"x25519-dalek",
]
+[[package]]
+name = "socket2"
+version = "0.3.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918"
+dependencies = [
+ "cfg-if",
+ "libc",
+ "redox_syscall",
+ "winapi 0.3.8",
+]
+
[[package]]
name = "soketto"
-version = "0.3.2"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c9dab3f95c9ebdf3a88268c19af668f637a3c5039c2c56ff2d40b1b2d64a25b"
+checksum = "85457366ae0c6ce56bf05a958aef14cd38513c236568618edbcd9a8c52cb80b0"
dependencies = [
- "base64 0.11.0",
+ "base64 0.12.0",
"bytes 0.5.4",
"flate2",
- "futures 0.3.4",
- "http 0.2.1",
+ "futures 0.3.5",
"httparse",
"log",
"rand 0.7.3",
- "sha1",
- "smallvec 1.3.0",
- "static_assertions",
- "thiserror",
+ "sha-1",
]
[[package]]
name = "sp-allocator"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"derive_more",
"log",
@@ -7241,7 +7372,7 @@ dependencies = [
[[package]]
name = "sp-api"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"hash-db",
"parity-scale-codec",
@@ -7256,18 +7387,18 @@ dependencies = [
[[package]]
name = "sp-api-proc-macro"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"blake2-rfc",
"proc-macro-crate",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
[[package]]
name = "sp-api-test"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"criterion 0.3.1",
"parity-scale-codec",
@@ -7286,7 +7417,7 @@ dependencies = [
[[package]]
name = "sp-application-crypto"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"parity-scale-codec",
"serde",
@@ -7297,7 +7428,7 @@ dependencies = [
[[package]]
name = "sp-application-crypto-test"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"sp-api",
"sp-application-crypto",
@@ -7308,7 +7439,7 @@ dependencies = [
[[package]]
name = "sp-arithmetic"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"criterion 0.3.1",
"integer-sqrt",
@@ -7324,7 +7455,7 @@ dependencies = [
[[package]]
name = "sp-arithmetic-fuzzer"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"honggfuzz",
"num-bigint",
@@ -7335,7 +7466,7 @@ dependencies = [
[[package]]
name = "sp-authority-discovery"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"parity-scale-codec",
"sp-api",
@@ -7346,7 +7477,7 @@ dependencies = [
[[package]]
name = "sp-authorship"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"parity-scale-codec",
"sp-inherents",
@@ -7356,7 +7487,7 @@ dependencies = [
[[package]]
name = "sp-block-builder"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"parity-scale-codec",
"sp-api",
@@ -7367,7 +7498,7 @@ dependencies = [
[[package]]
name = "sp-blockchain"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"derive_more",
"log",
@@ -7382,7 +7513,7 @@ dependencies = [
[[package]]
name = "sp-chain-spec"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"serde",
"serde_json",
@@ -7390,10 +7521,10 @@ dependencies = [
[[package]]
name = "sp-consensus"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"derive_more",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"libp2p",
"log",
@@ -7409,11 +7540,12 @@ dependencies = [
"sp-utils",
"sp-version",
"substrate-prometheus-endpoint",
+ "wasm-timer",
]
[[package]]
name = "sp-consensus-aura"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"parity-scale-codec",
"sp-api",
@@ -7426,7 +7558,7 @@ dependencies = [
[[package]]
name = "sp-consensus-babe"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"merlin",
"parity-scale-codec",
@@ -7434,6 +7566,7 @@ dependencies = [
"sp-application-crypto",
"sp-consensus",
"sp-consensus-vrf",
+ "sp-core",
"sp-inherents",
"sp-runtime",
"sp-std",
@@ -7442,7 +7575,7 @@ dependencies = [
[[package]]
name = "sp-consensus-pow"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"parity-scale-codec",
"sp-api",
@@ -7453,7 +7586,7 @@ dependencies = [
[[package]]
name = "sp-consensus-vrf"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"parity-scale-codec",
"schnorrkel",
@@ -7464,15 +7597,15 @@ dependencies = [
[[package]]
name = "sp-core"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"base58",
"blake2-rfc",
- "byteorder 1.3.4",
+ "byteorder",
"criterion 0.2.11",
"derive_more",
"ed25519-dalek",
- "futures 0.3.4",
+ "futures 0.3.5",
"hash-db",
"hash256-std-hasher",
"hex",
@@ -7489,8 +7622,10 @@ dependencies = [
"pretty_assertions",
"primitive-types",
"rand 0.7.3",
+ "rand_chacha 0.2.2",
"regex",
"schnorrkel",
+ "secrecy",
"serde",
"serde_json",
"sha2",
@@ -7510,7 +7645,7 @@ dependencies = [
[[package]]
name = "sp-database"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"kvdb",
"parking_lot 0.10.2",
@@ -7518,16 +7653,16 @@ dependencies = [
[[package]]
name = "sp-debug-derive"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
[[package]]
name = "sp-externalities"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"environmental",
"parity-scale-codec",
@@ -7537,7 +7672,7 @@ dependencies = [
[[package]]
name = "sp-finality-grandpa"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"finality-grandpa",
"log",
@@ -7552,7 +7687,7 @@ dependencies = [
[[package]]
name = "sp-finality-tracker"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"parity-scale-codec",
"sp-inherents",
@@ -7561,7 +7696,7 @@ dependencies = [
[[package]]
name = "sp-inherents"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"derive_more",
"parity-scale-codec",
@@ -7572,9 +7707,9 @@ dependencies = [
[[package]]
name = "sp-io"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"hash-db",
"libsecp256k1",
"log",
@@ -7585,13 +7720,14 @@ dependencies = [
"sp-runtime-interface",
"sp-state-machine",
"sp-std",
+ "sp-tracing",
"sp-trie",
"sp-wasm-interface",
]
[[package]]
name = "sp-keyring"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"lazy_static",
"sp-core",
@@ -7600,62 +7736,61 @@ dependencies = [
]
[[package]]
-name = "sp-offchain"
-version = "2.0.0-alpha.8"
-dependencies = [
- "sp-api",
- "sp-core",
- "sp-runtime",
- "sp-state-machine",
-]
-
-[[package]]
-name = "sp-panic-handler"
-version = "2.0.0-alpha.8"
-dependencies = [
- "backtrace",
- "log",
-]
-
-[[package]]
-name = "sp-phragmen"
-version = "2.0.0-alpha.8"
+name = "sp-npos-elections"
+version = "2.0.0-rc4"
dependencies = [
"parity-scale-codec",
"rand 0.7.3",
"serde",
"sp-arithmetic",
- "sp-phragmen",
- "sp-phragmen-compact",
+ "sp-npos-elections-compact",
"sp-runtime",
"sp-std",
"substrate-test-utils",
]
[[package]]
-name = "sp-phragmen-compact"
-version = "2.0.0-alpha.8"
+name = "sp-npos-elections-compact"
+version = "2.0.0-rc4"
dependencies = [
"proc-macro-crate",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
[[package]]
-name = "sp-phragmen-fuzzer"
+name = "sp-npos-elections-fuzzer"
version = "2.0.0-alpha.5"
dependencies = [
"honggfuzz",
"rand 0.7.3",
- "sp-phragmen",
+ "sp-npos-elections",
"sp-runtime",
"sp-std",
]
+[[package]]
+name = "sp-offchain"
+version = "2.0.0-rc4"
+dependencies = [
+ "sp-api",
+ "sp-core",
+ "sp-runtime",
+ "sp-state-machine",
+]
+
+[[package]]
+name = "sp-panic-handler"
+version = "2.0.0-rc4"
+dependencies = [
+ "backtrace",
+ "log",
+]
+
[[package]]
name = "sp-rpc"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"serde",
"serde_json",
@@ -7664,8 +7799,9 @@ dependencies = [
[[package]]
name = "sp-runtime"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
+ "either",
"hash256-std-hasher",
"impl-trait-for-tuples",
"log",
@@ -7686,7 +7822,7 @@ dependencies = [
[[package]]
name = "sp-runtime-interface"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"parity-scale-codec",
"primitive-types",
@@ -7706,18 +7842,18 @@ dependencies = [
[[package]]
name = "sp-runtime-interface-proc-macro"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"Inflector",
"proc-macro-crate",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
[[package]]
name = "sp-runtime-interface-test"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"sc-executor",
"sp-core",
@@ -7732,7 +7868,7 @@ dependencies = [
[[package]]
name = "sp-runtime-interface-test-wasm"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"sp-core",
"sp-io",
@@ -7743,7 +7879,7 @@ dependencies = [
[[package]]
name = "sp-runtime-interface-test-wasm-deprecated"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"sp-core",
"sp-io",
@@ -7754,7 +7890,7 @@ dependencies = [
[[package]]
name = "sp-sandbox"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"assert_matches",
"parity-scale-codec",
@@ -7768,7 +7904,7 @@ dependencies = [
[[package]]
name = "sp-serializer"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"serde",
"serde_json",
@@ -7776,7 +7912,7 @@ dependencies = [
[[package]]
name = "sp-session"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"parity-scale-codec",
"sp-api",
@@ -7788,7 +7924,7 @@ dependencies = [
[[package]]
name = "sp-staking"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"parity-scale-codec",
"sp-runtime",
@@ -7797,15 +7933,18 @@ dependencies = [
[[package]]
name = "sp-state-machine"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"hash-db",
"hex-literal",
+ "itertools 0.9.0",
"log",
"num-traits 0.2.11",
"parity-scale-codec",
"parking_lot 0.10.2",
+ "pretty_assertions",
"rand 0.7.3",
+ "smallvec 1.4.0",
"sp-core",
"sp-externalities",
"sp-panic-handler",
@@ -7817,11 +7956,11 @@ dependencies = [
[[package]]
name = "sp-std"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
[[package]]
name = "sp-storage"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"impl-serde 0.2.3",
"ref-cast",
@@ -7832,7 +7971,7 @@ dependencies = [
[[package]]
name = "sp-test-primitives"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"parity-scale-codec",
"parity-util-mem",
@@ -7844,7 +7983,7 @@ dependencies = [
[[package]]
name = "sp-timestamp"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"impl-trait-for-tuples",
"parity-scale-codec",
@@ -7857,28 +7996,31 @@ dependencies = [
[[package]]
name = "sp-tracing"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
+ "log",
+ "rental",
"tracing",
]
[[package]]
name = "sp-transaction-pool"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"derive_more",
- "futures 0.3.4",
+ "futures 0.3.5",
"log",
"parity-scale-codec",
"serde",
"sp-api",
+ "sp-blockchain",
"sp-runtime",
"sp-utils",
]
[[package]]
name = "sp-trie"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"criterion 0.2.11",
"hash-db",
@@ -7896,17 +8038,18 @@ dependencies = [
[[package]]
name = "sp-utils"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-core",
+ "futures-timer 3.0.2",
"lazy_static",
"prometheus",
]
[[package]]
name = "sp-version"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"impl-serde 0.2.3",
"parity-scale-codec",
@@ -7917,7 +8060,7 @@ dependencies = [
[[package]]
name = "sp-wasm-interface"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"impl-trait-for-tuples",
"parity-scale-codec",
@@ -8005,7 +8148,7 @@ dependencies = [
"heck",
"proc-macro-error",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -8026,13 +8169,13 @@ checksum = "0054a7df764039a6cd8592b9de84be4bec368ff081d203a7d5371cbfa8e65c81"
dependencies = [
"heck",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
[[package]]
name = "subkey"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"clap",
"derive_more",
@@ -8041,7 +8184,7 @@ dependencies = [
"hex",
"hex-literal",
"hyper 0.12.35",
- "itertools",
+ "itertools 0.8.2",
"jsonrpc-core-client",
"libp2p",
"node-primitives",
@@ -8074,14 +8217,14 @@ dependencies = [
[[package]]
name = "substrate-browser-utils"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"chrono",
"clear_on_drop",
"console_error_panic_hook",
"console_log",
"futures 0.1.29",
- "futures 0.3.4",
+ "futures 0.3.5",
"futures-timer 3.0.2",
"js-sys",
"kvdb-web",
@@ -8100,18 +8243,18 @@ dependencies = [
[[package]]
name = "substrate-build-script-utils"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"platforms",
]
[[package]]
name = "substrate-frame-rpc-support"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"frame-support",
"frame-system",
- "futures 0.3.4",
+ "futures 0.3.5",
"jsonrpc-client-transports",
"jsonrpc-core",
"parity-scale-codec",
@@ -8123,20 +8266,22 @@ dependencies = [
[[package]]
name = "substrate-frame-rpc-system"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"env_logger 0.7.1",
"frame-system-rpc-runtime-api",
- "futures 0.3.4",
+ "futures 0.3.5",
"jsonrpc-core",
"jsonrpc-core-client",
"jsonrpc-derive",
"log",
"parity-scale-codec",
"sc-client-api",
+ "sc-rpc-api",
"sc-transaction-pool",
"serde",
"sp-api",
+ "sp-block-builder",
"sp-blockchain",
"sp-core",
"sp-runtime",
@@ -8146,7 +8291,7 @@ dependencies = [
[[package]]
name = "substrate-prometheus-endpoint"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
dependencies = [
"async-std",
"derive_more",
@@ -8159,15 +8304,16 @@ dependencies = [
[[package]]
name = "substrate-test-client"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"hash-db",
"parity-scale-codec",
"sc-client-api",
"sc-client-db",
"sc-consensus",
"sc-executor",
+ "sc-light",
"sc-service",
"sp-blockchain",
"sp-consensus",
@@ -8179,7 +8325,7 @@ dependencies = [
[[package]]
name = "substrate-test-runtime"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"cfg-if",
"frame-executive",
@@ -8222,13 +8368,14 @@ dependencies = [
[[package]]
name = "substrate-test-runtime-client"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"parity-scale-codec",
"sc-block-builder",
"sc-client-api",
"sc-consensus",
+ "sc-light",
"sc-service",
"sp-api",
"sp-blockchain",
@@ -8241,10 +8388,10 @@ dependencies = [
[[package]]
name = "substrate-test-runtime-transaction-pool"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
dependencies = [
"derive_more",
- "futures 0.3.4",
+ "futures 0.3.5",
"parity-scale-codec",
"parking_lot 0.10.2",
"sc-transaction-graph",
@@ -8256,17 +8403,17 @@ dependencies = [
[[package]]
name = "substrate-test-utils"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
[[package]]
name = "substrate-wasm-builder"
-version = "1.0.10"
+version = "1.0.11"
dependencies = [
"atty",
"build-helper",
"cargo_metadata",
"fs2",
- "itertools",
+ "itertools 0.8.2",
"tempfile",
"toml",
"walkdir",
@@ -8279,9 +8426,9 @@ version = "1.0.6"
[[package]]
name = "substrate-wasmtime"
-version = "0.16.0-threadsafe.2"
+version = "0.16.0-threadsafe.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b40a6f3d5d3c00754e348863fead4f37763c32eedf950f5b23df87769882311"
+checksum = "6bd62264edc1a5f3ef44d86fb0c11c9fb142894b9a2da034f34afae482080d7a"
dependencies = [
"anyhow",
"backtrace",
@@ -8302,9 +8449,9 @@ dependencies = [
[[package]]
name = "substrate-wasmtime-jit"
-version = "0.16.0-threadsafe.2"
+version = "0.16.0-threadsafe.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09712de4f56a2c2912bee7763b0877d17d72cfb2237987d63ab78956907e7692"
+checksum = "4ce43c159d4f3ef6b19641e1ae045847fd202d8e2cc74df7ccb2b6475e069d4a"
dependencies = [
"anyhow",
"cfg-if",
@@ -8329,9 +8476,9 @@ dependencies = [
[[package]]
name = "substrate-wasmtime-profiling"
-version = "0.16.0-threadsafe.2"
+version = "0.16.0-threadsafe.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31505dd221f001634a54ea51472bc0058bcbde9186eaf8dd31d0859638121385"
+checksum = "c77f0ce539b5a09a54dc80a1cf0c7cd7e694df11029354fe50a2d5fe889bdb97"
dependencies = [
"anyhow",
"cfg-if",
@@ -8348,9 +8495,9 @@ dependencies = [
[[package]]
name = "substrate-wasmtime-runtime"
-version = "0.16.0-threadsafe.2"
+version = "0.16.0-threadsafe.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3708081f04d9216d4dee487abf94872065f930cf82e287bd0c5bdb57895460ba"
+checksum = "46516af0a64a7d9b652c5aa7436b6ce13edfa54435a66ef177fc02d2283e2dc2"
dependencies = [
"backtrace",
"cc",
@@ -8396,7 +8543,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"unicode-xid 0.2.0",
]
@@ -8407,7 +8554,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -8427,7 +8574,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
"unicode-xid 0.2.0",
]
@@ -8490,7 +8637,7 @@ checksum = "a605baa797821796a751f4a959e1206079b24a4b7e1ed302b7d785d81a9276c9"
dependencies = [
"lazy_static",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
"version_check",
]
@@ -8520,7 +8667,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca972988113b7715266f91250ddb98070d033c62a011fa0fcc57434a649310dd"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -8726,10 +8873,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
]
+[[package]]
+name = "tokio-named-pipes"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9d282d483052288b2308ba5ee795f5673b159c9bdf63c385a05609da782a5eae"
+dependencies = [
+ "bytes 0.4.12",
+ "futures 0.1.29",
+ "mio",
+ "mio-named-pipes",
+ "tokio 0.1.22",
+]
+
[[package]]
name = "tokio-reactor"
version = "0.1.12"
@@ -8751,9 +8911,9 @@ dependencies = [
[[package]]
name = "tokio-rustls"
-version = "0.13.0"
+version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4adb8b3e5f86b707f1b54e7c15b6de52617a823608ccda98a15d3a24222f265a"
+checksum = "15cb62a0d2770787abc96e99c1cd98fcf17f94959f3af63ca85bdfb203f051b4"
dependencies = [
"futures-core",
"rustls",
@@ -8761,6 +8921,15 @@ dependencies = [
"webpki",
]
+[[package]]
+name = "tokio-service"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162"
+dependencies = [
+ "futures 0.1.29",
+]
+
[[package]]
name = "tokio-sync"
version = "0.1.8"
@@ -8889,9 +9058,9 @@ checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860"
[[package]]
name = "tracing"
-version = "0.1.13"
+version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1721cc8cf7d770cc4257872507180f35a4797272f5962f24c806af9e7faf52ab"
+checksum = "a7c6b59d116d218cb2d990eb06b77b64043e0268ef7323aae63d8b30ae462923"
dependencies = [
"cfg-if",
"tracing-attributes",
@@ -8900,11 +9069,12 @@ dependencies = [
[[package]]
name = "tracing-attributes"
-version = "0.1.7"
+version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fbad39da2f9af1cae3016339ad7f2c7a9e870f12e8fd04c4fd7ef35b30c0d2b"
+checksum = "99bbad0de3fd923c9c3232ead88510b783e5a4d16a6154adffa3d53308de984c"
dependencies = [
- "quote 1.0.3",
+ "proc-macro2",
+ "quote 1.0.6",
"syn 1.0.17",
]
@@ -8925,9 +9095,9 @@ checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41"
[[package]]
name = "trie-bench"
-version = "0.21.1"
+version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c48b309cdda1abbdada28424bdc46f8b85362b3e66d6786d91223e83874429c7"
+checksum = "ed8419971832eb3333dc26066e50943a20e0934efeb451b3df5ee94f7f7323ab"
dependencies = [
"criterion 0.2.11",
"hash-db",
@@ -8941,15 +9111,15 @@ dependencies = [
[[package]]
name = "trie-db"
-version = "0.20.1"
+version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcc309f34008563989045a4c4dbcc5770467f3a3785ee80a9b5cc0d83362475f"
+checksum = "cb230c24c741993b04cfccbabb45acff6f6480c5f00d3ed8794ea43db3a9d727"
dependencies = [
"hash-db",
"hashbrown",
"log",
"rustc-hex",
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
]
[[package]]
@@ -8998,7 +9168,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712d261e83e727c8e2dbb75dacac67c36e35db36a958ee504f2164fc052434e1"
dependencies = [
"block-cipher-trait",
- "byteorder 1.3.4",
+ "byteorder",
"opaque-debug",
]
@@ -9023,7 +9193,7 @@ version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e75a4cdd7b87b28840dba13c483b9a88ee6bbf16ba5c951ee1ecfcf723078e0d"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
"crunchy",
"rustc-hex",
"static_assertions",
@@ -9053,7 +9223,7 @@ version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4"
dependencies = [
- "smallvec 1.3.0",
+ "smallvec 1.4.0",
]
[[package]]
@@ -9080,6 +9250,16 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
+[[package]]
+name = "universal-hash"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "df0c900f2f9b4116803415878ff48b63da9edb268668e08cf9292d7503114a01"
+dependencies = [
+ "generic-array",
+ "subtle 2.2.2",
+]
+
[[package]]
name = "unsigned-varint"
version = "0.3.3"
@@ -9089,7 +9269,17 @@ dependencies = [
"bytes 0.5.4",
"futures-io",
"futures-util",
- "futures_codec",
+ "futures_codec 0.3.4",
+]
+
+[[package]]
+name = "unsigned-varint"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "669d776983b692a906c881fcd0cfb34271a48e197e4d6cb8df32b05bfc3d3fa5"
+dependencies = [
+ "bytes 0.5.4",
+ "futures_codec 0.4.1",
]
[[package]]
@@ -9236,7 +9426,7 @@ dependencies = [
"lazy_static",
"log",
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
"wasm-bindgen-shared",
]
@@ -9259,7 +9449,7 @@ version = "0.2.62"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cd85aa2c579e8892442954685f0d801f9129de24fa2136b2c6a539c76b65776"
dependencies = [
- "quote 1.0.3",
+ "quote 1.0.6",
"wasm-bindgen-macro-support",
]
@@ -9270,7 +9460,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8eb197bd3a47553334907ffd2f16507b4f4f01bbec3ac921a7719e0decdfe72a"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
@@ -9303,7 +9493,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf2f86cd78a2aa7b1fb4bb6ed854eccb7f9263089c79542dca1576a1518a8467"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
]
[[package]]
@@ -9323,7 +9513,7 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "324c5e65a08699c9c4334ba136597ab22b85dccd4b65dd1e36ccf8f723a95b54"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"js-sys",
"parking_lot 0.9.0",
"pin-utils",
@@ -9528,7 +9718,7 @@ version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c51a2c47b5798ccc774ffb93ff536aec7c4275d722fd9c740c83cdd1af1f2d94"
dependencies = [
- "byteorder 1.3.4",
+ "byteorder",
"bytes 0.4.12",
"httparse",
"log",
@@ -9561,19 +9751,13 @@ dependencies = [
"zeroize",
]
-[[package]]
-name = "xdg"
-version = "2.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57"
-
[[package]]
name = "yamux"
-version = "0.4.5"
+version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "84300bb493cc878f3638b981c62b4632ec1a5c52daaa3036651e8c106d3b55ea"
+checksum = "cd37e58a1256a0b328ce9c67d8b62ecdd02f4803ba443df478835cb1a41a637c"
dependencies = [
- "futures 0.3.4",
+ "futures 0.3.5",
"log",
"nohash-hasher",
"parking_lot 0.10.2",
@@ -9597,7 +9781,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de251eec69fc7c1bc3923403d18ececb929380e016afe103da75f396704f8ca2"
dependencies = [
"proc-macro2",
- "quote 1.0.3",
+ "quote 1.0.6",
"syn 1.0.17",
"synstructure",
]
diff --git a/Cargo.toml b/Cargo.toml
index d9ee8709d1334f7ffbab48f02028a94f79b5e295..ba146e55bca3fb5d5b0c2b0e5e1f5bbc37b1c4ed 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -38,6 +38,7 @@ members = [
"client/executor/runtime-test",
"client/finality-grandpa",
"client/informant",
+ "client/light",
"client/tracing",
"client/keystore",
"client/network",
@@ -45,6 +46,7 @@ members = [
"client/network-gossip",
"client/offchain",
"client/peerset",
+ "client/proposer-metrics",
"client/rpc-servers",
"client/rpc",
"client/rpc-api",
@@ -58,6 +60,7 @@ members = [
"utils/wasm-builder-runner",
"frame/assets",
"frame/aura",
+ "frame/atomic-swap",
"frame/authority-discovery",
"frame/authorship",
"frame/babe",
@@ -83,8 +86,10 @@ members = [
"frame/indices",
"frame/membership",
"frame/metadata",
+ "frame/multisig",
"frame/nicks",
"frame/offences",
+ "frame/proxy",
"frame/randomness-collective-flip",
"frame/recovery",
"frame/scheduler",
@@ -135,9 +140,9 @@ members = [
"primitives/keyring",
"primitives/offchain",
"primitives/panic-handler",
- "primitives/phragmen",
- "primitives/phragmen/fuzzer",
- "primitives/phragmen/compact",
+ "primitives/npos-elections",
+ "primitives/npos-elections/fuzzer",
+ "primitives/npos-elections/compact",
"primitives/rpc",
"primitives/runtime-interface",
"primitives/runtime-interface/proc-macro",
@@ -178,6 +183,74 @@ members = [
"utils/wasm-builder",
]
+# The list of dependencies below (which can be both direct and indirect dependencies) are crates
+# that are suspected to be CPU-intensive, and that are unlikely to require debugging (as some of
+# their debug info might be missing) or to require to be frequently recompiled. We compile these
+# dependencies with `opt-level=3` even in "dev" mode in order to make "dev" mode more usable.
+# The majority of these crates are cryptographic libraries.
+#
+# Note that this does **not** affect crates that depend on Substrate. In other words, if you add
+# a dependency on Substrate, you have to copy-paste this list in your own `Cargo.toml` (assuming
+# that you want the same list). This list is only relevant when running `cargo build` from within
+# the Substrate workspace.
+#
+# If you see an error mentioning "profile package spec ... did not match any packages", it
+# probably concerns this list.
+#
+# This list is ordered alphabetically.
+[profile.dev.package]
+aes-ctr = { opt-level = 3 }
+aes-soft = { opt-level = 3 }
+aesni = { opt-level = 3 }
+blake2 = { opt-level = 3 }
+blake2-rfc = { opt-level = 3 }
+blake2b_simd = { opt-level = 3 }
+blake2s_simd = { opt-level = 3 }
+chacha20poly1305 = { opt-level = 3 }
+cranelift-codegen = { opt-level = 3 }
+cranelift-wasm = { opt-level = 3 }
+crc32fast = { opt-level = 3 }
+crossbeam-deque = { opt-level = 3 }
+crossbeam-queue = { opt-level = 3 }
+crypto-mac = { opt-level = 3 }
+ctr = { opt-level = 3 }
+curve25519-dalek = { opt-level = 3 }
+ed25519-dalek = { opt-level = 3 }
+evm-core = { opt-level = 3 }
+evm-runtime = { opt-level = 3 }
+flate2 = { opt-level = 3 }
+futures-channel = { opt-level = 3 }
+hashbrown = { opt-level = 3 }
+h2 = { opt-level = 3 }
+hash-db = { opt-level = 3 }
+hmac = { opt-level = 3 }
+httparse = { opt-level = 3 }
+integer-sqrt = { opt-level = 3 }
+keccak = { opt-level = 3 }
+libm = { opt-level = 3 }
+librocksdb-sys = { opt-level = 3 }
+libsecp256k1 = { opt-level = 3 }
+libz-sys = { opt-level = 3 }
+mio = { opt-level = 3 }
+nalgebra = { opt-level = 3 }
+num-bigint = { opt-level = 3 }
+parking_lot = { opt-level = 3 }
+parking_lot_core = { opt-level = 3 }
+percent-encoding = { opt-level = 3 }
+primitive-types = { opt-level = 3 }
+ring = { opt-level = 3 }
+rustls = { opt-level = 3 }
+sha2 = { opt-level = 3 }
+sha3 = { opt-level = 3 }
+smallvec = { opt-level = 3 }
+snow = { opt-level = 3 }
+twox-hash = { opt-level = 3 }
+uint = { opt-level = 3 }
+wasmi = { opt-level = 3 }
+x25519-dalek = { opt-level = 3 }
+yamux = { opt-level = 3 }
+zeroize = { opt-level = 3 }
+
[profile.release]
# Substrate runtime requires unwinding.
panic = "unwind"
diff --git a/README.md b/README.md
index 874ec99e69f89a8947095b5d62e9aa4ffea033cb..5764722373d434289d2c0c29d42144869af87b11 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Substrate · [![GitHub license](https://img.shields.io/github/license/paritytech/substrate)](LICENSE) [![GitLab Status](https://gitlab.parity.io/parity/substrate/badges/master/pipeline.svg)](https://gitlab.parity.io/parity/substrate/pipelines) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](docs/CONTRIBUTING.adoc)
+# Substrate · [![GitHub license](https://img.shields.io/badge/license-GPL3%2FApache2-blue)](LICENSE) [![GitLab Status](https://gitlab.parity.io/parity/substrate/badges/master/pipeline.svg)](https://gitlab.parity.io/parity/substrate/pipelines) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](docs/CONTRIBUTING.adoc)
@@ -9,7 +9,9 @@ Substrate is a next-generation framework for blockchain innovation 🚀.
## Trying it out
-Simply go to [substrate.dev](https://substrate.dev) and follow the [getting started](https://substrate.dev/docs/en/overview/getting-started/) instructions.
+Simply go to [substrate.dev](https://substrate.dev) and follow the
+[installation](https://substrate.dev/docs/en/knowledgebase/getting-started/) instructions. You can
+also try out one of the [tutorials](https://substrate.dev/en/tutorials).
## Contributions & Code of Conduct
@@ -21,4 +23,9 @@ The security policy and procedures can be found in [`docs/SECURITY.md`](docs/SEC
## License
-Substrate Client (`/client/*` / `sc-*`) is licensed under [GPL v3.0 with a classpath linking exception](LICENSE-GPL3), primitives (`sp-*`), FRAME (`frame-*`) and pallets (`pallets-*`), binaries (`/bin`) and all other utilities are licensed under [Apache 2.0](LICENSE-APACHE2).
\ No newline at end of file
+- Substrate Primitives (`sp-*`), Frame (`frame-*`) and the pallets (`pallets-*`), binaries (`/bin`) and all other utilities are licensed under [Apache 2.0](LICENSE-APACHE2).
+- Substrate Client (`/client/*` / `sc-*`) is licensed under [GPL v3.0 with a classpath linking exception](LICENSE-GPL3).
+
+The reason for the split-licensing is to ensure that for the vast majority of teams using Substrate to create feature-chains, then all changes can be made entirely in Apache2-licensed code, allowing teams full freedom over what and how they release and giving licensing clarity to commercial teams.
+
+In the interests of the community, we require any deeper improvements made to Substrate's core logic (e.g. Substrate's internal consensus, crypto or database code) to be contributed back so everyone can benefit.
diff --git a/bin/node-template/node/Cargo.toml b/bin/node-template/node/Cargo.toml
index c4df4f18a251e034071a6faac15de91274cb870f..6689062390b0bc8135a1b3f15284f3b932bd5fb1 100644
--- a/bin/node-template/node/Cargo.toml
+++ b/bin/node-template/node/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "node-template"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
authors = ["Anonymous"]
description = "Substrate Node template"
edition = "2018"
@@ -21,25 +21,25 @@ log = "0.4.8"
structopt = "0.3.8"
parking_lot = "0.10.0"
-sc-cli = { version = "0.8.0-alpha.8", path = "../../../client/cli" }
-sp-core = { version = "2.0.0-alpha.8", path = "../../../primitives/core" }
-sc-executor = { version = "0.8.0-alpha.8", path = "../../../client/executor" }
-sc-service = { version = "0.8.0-alpha.8", path = "../../../client/service" }
-sp-inherents = { version = "2.0.0-alpha.8", path = "../../../primitives/inherents" }
-sc-transaction-pool = { version = "2.0.0-alpha.8", path = "../../../client/transaction-pool" }
-sp-transaction-pool = { version = "2.0.0-alpha.8", path = "../../../primitives/transaction-pool" }
-sc-network = { version = "0.8.0-alpha.8", path = "../../../client/network" }
-sc-consensus-aura = { version = "0.8.0-alpha.8", path = "../../../client/consensus/aura" }
-sp-consensus-aura = { version = "0.8.0-alpha.8", path = "../../../primitives/consensus/aura" }
-sp-consensus = { version = "0.8.0-alpha.8", path = "../../../primitives/consensus/common" }
-sc-consensus = { version = "0.8.0-alpha.8", path = "../../../client/consensus/common" }
-sc-finality-grandpa = { version = "0.8.0-alpha.8", path = "../../../client/finality-grandpa" }
-sp-finality-grandpa = { version = "2.0.0-alpha.8", path = "../../../primitives/finality-grandpa" }
-sc-client-api = { version = "2.0.0-alpha.8", path = "../../../client/api" }
-sp-runtime = { version = "2.0.0-alpha.8", path = "../../../primitives/runtime" }
-sc-basic-authorship = { path = "../../../client/basic-authorship", version = "0.8.0-alpha.8"}
+sc-cli = { version = "0.8.0-rc4", path = "../../../client/cli", features = ["wasmtime"] }
+sp-core = { version = "2.0.0-rc4", path = "../../../primitives/core" }
+sc-executor = { version = "0.8.0-rc4", path = "../../../client/executor", features = ["wasmtime"] }
+sc-service = { version = "0.8.0-rc4", path = "../../../client/service", features = ["wasmtime"] }
+sp-inherents = { version = "2.0.0-rc4", path = "../../../primitives/inherents" }
+sc-transaction-pool = { version = "2.0.0-rc4", path = "../../../client/transaction-pool" }
+sp-transaction-pool = { version = "2.0.0-rc4", path = "../../../primitives/transaction-pool" }
+sc-network = { version = "0.8.0-rc4", path = "../../../client/network" }
+sc-consensus-aura = { version = "0.8.0-rc4", path = "../../../client/consensus/aura" }
+sp-consensus-aura = { version = "0.8.0-rc4", path = "../../../primitives/consensus/aura" }
+sp-consensus = { version = "0.8.0-rc4", path = "../../../primitives/consensus/common" }
+sc-consensus = { version = "0.8.0-rc4", path = "../../../client/consensus/common" }
+sc-finality-grandpa = { version = "0.8.0-rc4", path = "../../../client/finality-grandpa" }
+sp-finality-grandpa = { version = "2.0.0-rc4", path = "../../../primitives/finality-grandpa" }
+sc-client-api = { version = "2.0.0-rc4", path = "../../../client/api" }
+sp-runtime = { version = "2.0.0-rc4", path = "../../../primitives/runtime" }
+sc-basic-authorship = { path = "../../../client/basic-authorship", version = "0.8.0-rc4"}
-node-template-runtime = { version = "2.0.0-alpha.8", path = "../runtime" }
+node-template-runtime = { version = "2.0.0-rc4", path = "../runtime" }
[build-dependencies]
-substrate-build-script-utils = { version = "2.0.0-alpha.8", path = "../../../utils/build-script-utils" }
+substrate-build-script-utils = { version = "2.0.0-rc4", path = "../../../utils/build-script-utils" }
diff --git a/bin/node-template/node/src/command.rs b/bin/node-template/node/src/command.rs
index 18e1b22a53f8ef1eac2f441d00b356fae6fe3e69..4f2fd3aad6fd3f30e3af2739705c023c2eb53dd4 100644
--- a/bin/node-template/node/src/command.rs
+++ b/bin/node-template/node/src/command.rs
@@ -18,7 +18,7 @@
use crate::chain_spec;
use crate::cli::Cli;
use crate::service;
-use sc_cli::SubstrateCli;
+use sc_cli::{SubstrateCli, RuntimeVersion, Role, ChainSpec};
impl SubstrateCli for Cli {
fn impl_name() -> &'static str {
@@ -58,6 +58,10 @@ impl SubstrateCli for Cli {
)?),
})
}
+
+ fn native_runtime_version(_: &Box) -> &'static RuntimeVersion {
+ &node_template_runtime::VERSION
+ }
}
/// Parse and run command line arguments
@@ -71,11 +75,10 @@ pub fn run() -> sc_cli::Result<()> {
}
None => {
let runner = cli.create_runner(&cli.run)?;
- runner.run_node(
- service::new_light,
- service::new_full,
- node_template_runtime::VERSION
- )
+ runner.run_node_until_exit(|config| match config.role {
+ Role::Light => service::new_light(config),
+ _ => service::new_full(config),
+ })
}
}
}
diff --git a/bin/node-template/node/src/lib.rs b/bin/node-template/node/src/lib.rs
new file mode 100644
index 0000000000000000000000000000000000000000..38e43372ca3ff45d40015e83fc45a221f599f16d
--- /dev/null
+++ b/bin/node-template/node/src/lib.rs
@@ -0,0 +1,2 @@
+pub mod chain_spec;
+pub mod service;
diff --git a/bin/node-template/node/src/service.rs b/bin/node-template/node/src/service.rs
index d02e9ea95e4943ccc14a6b206a0c22efea0716ca..89bf159927fc648dc965e1a0800f82cfdb2ca927 100644
--- a/bin/node-template/node/src/service.rs
+++ b/bin/node-template/node/src/service.rs
@@ -5,7 +5,10 @@ use std::time::Duration;
use sc_client_api::ExecutorProvider;
use sc_consensus::LongestChain;
use node_template_runtime::{self, opaque::Block, RuntimeApi};
-use sc_service::{error::{Error as ServiceError}, AbstractService, Configuration, ServiceBuilder};
+use sc_service::{
+ error::{Error as ServiceError}, Configuration, ServiceBuilder, ServiceComponents,
+ TaskManager,
+};
use sp_inherents::InherentDataProviders;
use sc_executor::native_executor_instance;
pub use sc_executor::NativeExecutor;
@@ -34,14 +37,22 @@ macro_rules! new_full_start {
let inherent_data_providers = sp_inherents::InherentDataProviders::new();
let builder = sc_service::ServiceBuilder::new_full::<
- node_template_runtime::opaque::Block, node_template_runtime::RuntimeApi, crate::service::Executor
+ node_template_runtime::opaque::Block,
+ node_template_runtime::RuntimeApi,
+ crate::service::Executor
>($config)?
.with_select_chain(|_config, backend| {
Ok(sc_consensus::LongestChain::new(backend.clone()))
})?
- .with_transaction_pool(|config, client, _fetcher, prometheus_registry| {
- let pool_api = sc_transaction_pool::FullChainApi::new(client.clone());
- Ok(sc_transaction_pool::BasicPool::new(config, std::sync::Arc::new(pool_api), prometheus_registry))
+ .with_transaction_pool(|builder| {
+ let pool_api = sc_transaction_pool::FullChainApi::new(
+ builder.client().clone(),
+ );
+ Ok(sc_transaction_pool::BasicPool::new(
+ builder.config().transaction_pool.clone(),
+ std::sync::Arc::new(pool_api),
+ builder.prometheus_registry(),
+ ))
})?
.with_import_queue(|
_config,
@@ -85,7 +96,7 @@ macro_rules! new_full_start {
}
/// Builds a new service for a full client.
-pub fn new_full(config: Configuration) -> Result {
+pub fn new_full(config: Configuration) -> Result {
let role = config.role.clone();
let force_authoring = config.force_authoring;
let name = config.network.node_name.clone();
@@ -97,20 +108,25 @@ pub fn new_full(config: Configuration) -> Result>;
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
})?
- .build()?;
+ .build_full()?;
if role.is_authority() {
- let proposer =
- sc_basic_authorship::ProposerFactory::new(service.client(), service.transaction_pool());
+ let proposer = sc_basic_authorship::ProposerFactory::new(
+ client.clone(),
+ transaction_pool,
+ prometheus_registry.as_ref(),
+ );
- let client = service.client();
- let select_chain = service.select_chain()
+ let select_chain = select_chain
.ok_or(ServiceError::SelectChainRequired)?;
let can_author_with =
@@ -118,26 +134,26 @@ pub fn new_full(config: Configuration) -> Result(
sc_consensus_aura::slot_duration(&*client)?,
- client,
+ client.clone(),
select_chain,
block_import,
proposer,
- service.network(),
+ network.clone(),
inherent_data_providers.clone(),
force_authoring,
- service.keystore(),
+ keystore.clone(),
can_author_with,
)?;
// the AURA authoring task is considered essential, i.e. if it
// fails we take down the service with it.
- service.spawn_essential_task("aura", aura);
+ task_manager.spawn_essential_handle().spawn_blocking("aura", 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(service.keystore())
+ Some(keystore.clone() as sp_core::traits::BareCryptoStorePtr)
} else {
None
};
@@ -163,46 +179,52 @@ pub fn new_full(config: Configuration) -> Result Result {
+pub fn new_light(config: Configuration) -> Result {
let inherent_data_providers = InherentDataProviders::new();
ServiceBuilder::new_light::(config)?
.with_select_chain(|_config, backend| {
Ok(LongestChain::new(backend.clone()))
})?
- .with_transaction_pool(|config, client, fetcher, prometheus_registry| {
- let fetcher = fetcher
+ .with_transaction_pool(|builder| {
+ let fetcher = builder.fetcher()
.ok_or_else(|| "Trying to start light transaction pool without active fetcher")?;
- let pool_api = sc_transaction_pool::LightChainApi::new(client.clone(), fetcher.clone());
+ let pool_api = sc_transaction_pool::LightChainApi::new(
+ builder.client().clone(),
+ fetcher.clone(),
+ );
let pool = sc_transaction_pool::BasicPool::with_revalidation_type(
- config, Arc::new(pool_api), prometheus_registry, sc_transaction_pool::RevalidationType::Light,
+ builder.config().transaction_pool.clone(),
+ Arc::new(pool_api),
+ builder.prometheus_registry(),
+ sc_transaction_pool::RevalidationType::Light,
);
Ok(pool)
})?
@@ -247,5 +269,6 @@ pub fn new_light(config: Configuration) -> Result>;
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
})?
- .build()
+ .build_light()
+ .map(|ServiceComponents { task_manager, .. }| task_manager)
}
diff --git a/bin/node-template/pallets/template/Cargo.toml b/bin/node-template/pallets/template/Cargo.toml
index 24f40f41269281f90a0fdea47cfe405a69792bcf..442fb7203098cde8c071e889b6628bfa11e3d175 100644
--- a/bin/node-template/pallets/template/Cargo.toml
+++ b/bin/node-template/pallets/template/Cargo.toml
@@ -2,7 +2,7 @@
authors = ['Anonymous']
edition = '2018'
name = 'pallet-template'
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
license = "Unlicense"
homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/substrate/"
@@ -12,30 +12,31 @@ description = "FRAME pallet template"
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] }
+codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false, features = ["derive"] }
[dependencies.frame-support]
default-features = false
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
path = "../../../../frame/support"
[dependencies.frame-system]
default-features = false
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
path = "../../../../frame/system"
+
[dev-dependencies.sp-core]
default-features = false
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
path = "../../../../primitives/core"
[dev-dependencies.sp-io]
default-features = false
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
path = "../../../../primitives/io"
[dev-dependencies.sp-runtime]
default-features = false
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
path = "../../../../primitives/runtime"
diff --git a/bin/node-template/pallets/template/src/mock.rs b/bin/node-template/pallets/template/src/mock.rs
index 33c66e2a4e80d616a64255701279bdc9170a9240..0d9ae7cff775322853152d78db610b38ab891415 100644
--- a/bin/node-template/pallets/template/src/mock.rs
+++ b/bin/node-template/pallets/template/src/mock.rs
@@ -24,6 +24,7 @@ parameter_types! {
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
}
impl system::Trait for Test {
+ type BaseCallFilter = ();
type Origin = Origin;
type Call = ();
type Index = u64;
@@ -39,6 +40,7 @@ impl system::Trait for Test {
type DbWeight = ();
type BlockExecutionWeight = ();
type ExtrinsicBaseWeight = ();
+ type MaximumExtrinsicWeight = MaximumBlockWeight;
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = ();
diff --git a/bin/node-template/runtime/Cargo.toml b/bin/node-template/runtime/Cargo.toml
index b1151c64d9e6d89f3371624320c0c0b8fc2f40b2..ea44c805d0b1beee0691836ed5826de75bee7885 100644
--- a/bin/node-template/runtime/Cargo.toml
+++ b/bin/node-template/runtime/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "node-template-runtime"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
authors = ["Anonymous"]
edition = "2018"
license = "Unlicense"
@@ -11,33 +11,33 @@ repository = "https://github.com/paritytech/substrate/"
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] }
+codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false, features = ["derive"] }
-aura = { version = "2.0.0-alpha.8", default-features = false, package = "pallet-aura", path = "../../../frame/aura" }
-balances = { version = "2.0.0-alpha.8", default-features = false, package = "pallet-balances", path = "../../../frame/balances" }
-frame-support = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/support" }
-grandpa = { version = "2.0.0-alpha.8", default-features = false, package = "pallet-grandpa", path = "../../../frame/grandpa" }
-randomness-collective-flip = { version = "2.0.0-alpha.8", default-features = false, package = "pallet-randomness-collective-flip", path = "../../../frame/randomness-collective-flip" }
-sudo = { version = "2.0.0-alpha.8", default-features = false, package = "pallet-sudo", path = "../../../frame/sudo" }
-system = { version = "2.0.0-alpha.8", default-features = false, package = "frame-system", path = "../../../frame/system" }
-timestamp = { version = "2.0.0-alpha.8", default-features = false, package = "pallet-timestamp", path = "../../../frame/timestamp" }
-transaction-payment = { version = "2.0.0-alpha.8", default-features = false, package = "pallet-transaction-payment", path = "../../../frame/transaction-payment" }
-frame-executive = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/executive" }
+aura = { version = "2.0.0-rc4", default-features = false, package = "pallet-aura", path = "../../../frame/aura" }
+balances = { version = "2.0.0-rc4", default-features = false, package = "pallet-balances", path = "../../../frame/balances" }
+frame-support = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/support" }
+grandpa = { version = "2.0.0-rc4", default-features = false, package = "pallet-grandpa", path = "../../../frame/grandpa" }
+randomness-collective-flip = { version = "2.0.0-rc4", default-features = false, package = "pallet-randomness-collective-flip", path = "../../../frame/randomness-collective-flip" }
+sudo = { version = "2.0.0-rc4", default-features = false, package = "pallet-sudo", path = "../../../frame/sudo" }
+system = { version = "2.0.0-rc4", default-features = false, package = "frame-system", path = "../../../frame/system" }
+timestamp = { version = "2.0.0-rc4", default-features = false, package = "pallet-timestamp", path = "../../../frame/timestamp" }
+transaction-payment = { version = "2.0.0-rc4", default-features = false, package = "pallet-transaction-payment", path = "../../../frame/transaction-payment" }
+frame-executive = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/executive" }
serde = { version = "1.0.101", optional = true, features = ["derive"] }
-sp-api = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/api" }
-sp-block-builder = { path = "../../../primitives/block-builder", default-features = false, version = "2.0.0-alpha.8"}
-sp-consensus-aura = { version = "0.8.0-alpha.8", default-features = false, path = "../../../primitives/consensus/aura" }
-sp-core = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/core" }
-sp-inherents = { path = "../../../primitives/inherents", default-features = false, version = "2.0.0-alpha.8"}
-sp-io = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/io" }
-sp-offchain = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/offchain" }
-sp-runtime = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/runtime" }
-sp-session = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/session" }
-sp-std = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/std" }
-sp-transaction-pool = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/transaction-pool" }
-sp-version = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/version" }
+sp-api = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/api" }
+sp-block-builder = { path = "../../../primitives/block-builder", default-features = false, version = "2.0.0-rc4"}
+sp-consensus-aura = { version = "0.8.0-rc4", default-features = false, path = "../../../primitives/consensus/aura" }
+sp-core = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/core" }
+sp-inherents = { path = "../../../primitives/inherents", default-features = false, version = "2.0.0-rc4"}
+sp-io = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/io" }
+sp-offchain = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/offchain" }
+sp-runtime = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/runtime" }
+sp-session = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/session" }
+sp-std = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/std" }
+sp-transaction-pool = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/transaction-pool" }
+sp-version = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/version" }
-template = { version = "2.0.0-alpha.8", default-features = false, path = "../pallets/template", package = "pallet-template" }
+template = { version = "2.0.0-rc4", default-features = false, path = "../pallets/template", package = "pallet-template" }
[build-dependencies]
wasm-builder-runner = { version = "1.0.5", package = "substrate-wasm-builder-runner", path = "../../../utils/wasm-builder-runner" }
diff --git a/bin/node-template/runtime/build.rs b/bin/node-template/runtime/build.rs
index 39f7f56feb0b1730d7f2c9a7daa898fe54bfd052..1f40a41ff8ee62a560785bc426c80787028a048f 100644
--- a/bin/node-template/runtime/build.rs
+++ b/bin/node-template/runtime/build.rs
@@ -3,7 +3,7 @@ use wasm_builder_runner::WasmBuilder;
fn main() {
WasmBuilder::new()
.with_current_project()
- .with_wasm_builder_from_crates("1.0.9")
+ .with_wasm_builder_from_crates("1.0.11")
.export_heap_base()
.import_memory()
.build()
diff --git a/bin/node-template/runtime/src/lib.rs b/bin/node-template/runtime/src/lib.rs
index 0a35b329e340e4849b1657109224024a37ce75ce..30571b7e0b36ffd1d45551f692422b71fc7ba5c4 100644
--- a/bin/node-template/runtime/src/lib.rs
+++ b/bin/node-template/runtime/src/lib.rs
@@ -15,7 +15,7 @@ use sp_runtime::{
transaction_validity::{TransactionValidity, TransactionSource},
};
use sp_runtime::traits::{
- BlakeTwo256, Block as BlockT, IdentityLookup, Verify, ConvertInto, IdentifyAccount, NumberFor,
+ BlakeTwo256, Block as BlockT, IdentityLookup, Verify, IdentifyAccount, NumberFor, Saturating,
};
use sp_api::impl_runtime_apis;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
@@ -35,7 +35,7 @@ pub use frame_support::{
construct_runtime, parameter_types, StorageValue,
traits::{KeyOwnerProofSystem, Randomness},
weights::{
- Weight,
+ Weight, IdentityFee,
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
},
};
@@ -127,11 +127,16 @@ parameter_types! {
/// We allow for 2 seconds of compute with a 6 second average block time.
pub const MaximumBlockWeight: Weight = 2 * WEIGHT_PER_SECOND;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
+ /// Assume 10% of weight for average on_initialize calls.
+ pub MaximumExtrinsicWeight: Weight = AvailableBlockRatio::get()
+ .saturating_sub(Perbill::from_percent(10)) * MaximumBlockWeight::get();
pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
pub const Version: RuntimeVersion = VERSION;
}
impl system::Trait for Runtime {
+ /// The basic call filter to use in dispatchable.
+ type BaseCallFilter = ();
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
/// The aggregated dispatch type that is available for extrinsics.
@@ -164,6 +169,10 @@ impl system::Trait for Runtime {
/// The base weight of any extrinsic processed by the runtime, independent of the
/// logic of that extrinsic. (Signature verification, nonce increment, fee, etc...)
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
+ /// The maximum weight that a single extrinsic of `Normal` dispatch class can have,
+ /// idependent of the logic of that extrinsics. (Roughly max block weight - average on
+ /// initialize cost).
+ type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
/// Maximum size of all encoded transactions (in bytes) that are allowed in one block.
type MaximumBlockLength = MaximumBlockLength;
/// Portion of the block weight that is available to all normal transactions.
@@ -236,7 +245,7 @@ impl transaction_payment::Trait for Runtime {
type Currency = balances::Module;
type OnTransactionPayment = ();
type TransactionByteFee = TransactionByteFee;
- type WeightToFee = ConvertInto;
+ type WeightToFee = IdentityFee;
type FeeMultiplierUpdate = ();
}
diff --git a/bin/node/bench/Cargo.toml b/bin/node/bench/Cargo.toml
index 443bfaeede6eb1e3427d540122b68e51e28c7eb5..07db27a1f18099dbfcbb4b5a7551cdc7564b52aa 100644
--- a/bin/node/bench/Cargo.toml
+++ b/bin/node/bench/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "node-bench"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
authors = ["Parity Technologies "]
description = "Substrate node integration benchmarks."
edition = "2018"
@@ -10,20 +10,27 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
log = "0.4.8"
-node-primitives = { version = "2.0.0-alpha.8", path = "../primitives" }
-node-testing = { version = "2.0.0-alpha.8", path = "../testing" }
-sc-cli = { version = "0.8.0-alpha.8", path = "../../../client/cli" }
-sc-client-api = { version = "2.0.0-alpha.8", path = "../../../client/api/" }
-sp-runtime = { version = "2.0.0-alpha.8", path = "../../../primitives/runtime" }
-sp-state-machine = { version = "0.8.0-alpha.8", path = "../../../primitives/state-machine" }
+node-primitives = { version = "2.0.0-rc4", path = "../primitives" }
+node-testing = { version = "2.0.0-rc4", path = "../testing" }
+node-runtime = { version = "2.0.0-rc4", path = "../runtime" }
+sc-cli = { version = "0.8.0-rc4", path = "../../../client/cli" }
+sc-client-api = { version = "2.0.0-rc4", path = "../../../client/api/" }
+sp-runtime = { version = "2.0.0-rc4", path = "../../../primitives/runtime" }
+sp-state-machine = { version = "0.8.0-rc4", path = "../../../primitives/state-machine" }
serde = "1.0.101"
serde_json = "1.0.41"
structopt = "0.3"
derive_more = "0.99.2"
kvdb = "0.6"
kvdb-rocksdb = "0.8"
-sp-trie = { version = "2.0.0-alpha.8", path = "../../../primitives/trie" }
-sp-core = { version = "2.0.0-alpha.8", path = "../../../primitives/core" }
+sp-trie = { version = "2.0.0-rc4", path = "../../../primitives/trie" }
+sp-core = { version = "2.0.0-rc4", path = "../../../primitives/core" }
+sp-consensus = { version = "0.8.0-rc4", path = "../../../primitives/consensus/common" }
+sp-transaction-pool = { version = "2.0.0-rc4", path = "../../../primitives/transaction-pool" }
+sc-basic-authorship = { version = "0.8.0-rc4", path = "../../../client/basic-authorship" }
+sp-inherents = { version = "2.0.0-rc4", path = "../../../primitives/inherents" }
+sp-finality-tracker = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/finality-tracker" }
+sp-timestamp = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/timestamp" }
hash-db = "0.15.2"
tempfile = "3.1.0"
fs_extra = "1"
@@ -32,3 +39,4 @@ rand = { version = "0.7.2", features = ["small_rng"] }
lazy_static = "1.4.0"
parity-util-mem = { version = "0.6.1", default-features = false, features = ["primitive-types"] }
parity-db = { version = "0.1.2" }
+futures = "0.3.1"
diff --git a/bin/node/bench/src/common.rs b/bin/node/bench/src/common.rs
new file mode 100644
index 0000000000000000000000000000000000000000..2637d6e9bd04d809af5b374790adcc6e5207993f
--- /dev/null
+++ b/bin/node/bench/src/common.rs
@@ -0,0 +1,48 @@
+
+// This file is part of Substrate.
+
+// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// SPDX-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 .
+
+#[derive(Clone, Copy, Debug, derive_more::Display)]
+pub enum SizeType {
+ #[display(fmt = "empty")]
+ Empty,
+ #[display(fmt = "small")]
+ Small,
+ #[display(fmt = "medium")]
+ Medium,
+ #[display(fmt = "large")]
+ Large,
+ #[display(fmt = "full")]
+ Full,
+ #[display(fmt = "custom")]
+ Custom(usize),
+}
+
+impl SizeType {
+ pub fn transactions(&self) -> Option {
+ match self {
+ SizeType::Empty => Some(0),
+ SizeType::Small => Some(10),
+ SizeType::Medium => Some(100),
+ SizeType::Large => Some(500),
+ SizeType::Full => None,
+ // Custom SizeType will use the `--transactions` input parameter
+ 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
new file mode 100644
index 0000000000000000000000000000000000000000..e23594dd4364a1de30d65096fe69ab1627599a36
--- /dev/null
+++ b/bin/node/bench/src/construct.rs
@@ -0,0 +1,296 @@
+// This file is part of Substrate.
+
+// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// SPDX-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 .
+
+//! Block construction benchmark.
+//!
+//! This benchmark is expected to measure block construction.
+//! We want to protect against cold-cache attacks, and so this
+//! benchmark should not rely on any caching (except those entries that
+//! DO NOT depend on user input). Thus transaction generation should be
+//! based on randomized data.
+
+use std::{
+ borrow::Cow,
+ collections::HashMap,
+ pin::Pin,
+ sync::Arc,
+};
+use futures::Future;
+
+use node_primitives::Block;
+use node_testing::bench::{BenchDb, Profile, BlockType, KeyTypes, DatabaseType};
+use sp_runtime::{
+ generic::BlockId,
+ traits::NumberFor,
+ OpaqueExtrinsic,
+};
+use sp_transaction_pool::{
+ ImportNotificationStream,
+ PoolFuture,
+ PoolStatus,
+ TransactionFor,
+ TransactionSource,
+ TransactionStatusStreamFor,
+ TxHash,
+};
+use sp_consensus::{Environment, Proposer, RecordProof};
+
+use crate::{
+ common::SizeType,
+ core::{self, Path, Mode},
+};
+
+pub struct ConstructionBenchmarkDescription {
+ pub profile: Profile,
+ pub key_types: KeyTypes,
+ pub block_type: BlockType,
+ pub size: SizeType,
+ pub database_type: DatabaseType,
+}
+
+pub struct ConstructionBenchmark {
+ profile: Profile,
+ database: BenchDb,
+ transactions: Transactions,
+}
+
+impl core::BenchmarkDescription for ConstructionBenchmarkDescription {
+ fn path(&self) -> Path {
+
+ let mut path = Path::new(&["node", "proposer"]);
+
+ match self.profile {
+ Profile::Wasm => path.push("wasm"),
+ Profile::Native => path.push("native"),
+ }
+
+ match self.key_types {
+ KeyTypes::Sr25519 => path.push("sr25519"),
+ KeyTypes::Ed25519 => path.push("ed25519"),
+ }
+
+ match self.block_type {
+ BlockType::RandomTransfersKeepAlive => path.push("transfer"),
+ BlockType::RandomTransfersReaping => path.push("transfer_reaping"),
+ BlockType::Noop => path.push("noop"),
+ }
+
+ match self.database_type {
+ DatabaseType::RocksDb => path.push("rocksdb"),
+ DatabaseType::ParityDb => path.push("paritydb"),
+ }
+
+ path.push(&format!("{}", self.size));
+
+ path
+ }
+
+ fn setup(self: Box) -> Box {
+ let mut extrinsics: Vec> = Vec::new();
+
+ let mut bench_db = BenchDb::with_key_types(
+ self.database_type,
+ 50_000,
+ self.key_types
+ );
+
+ let client = bench_db.client();
+
+ let content_type = self.block_type.to_content(self.size.transactions());
+ for transaction in bench_db.block_content(content_type, &client) {
+ extrinsics.push(Arc::new(transaction.into()));
+ }
+
+ Box::new(ConstructionBenchmark {
+ profile: self.profile,
+ database: bench_db,
+ transactions: Transactions(extrinsics),
+ })
+ }
+
+ fn name(&self) -> Cow<'static, str> {
+ format!(
+ "Block construction ({:?}/{}, {:?}, {:?} backend)",
+ self.block_type,
+ self.size,
+ self.profile,
+ self.database_type,
+ ).into()
+ }
+}
+
+impl core::Benchmark for ConstructionBenchmark {
+ fn run(&mut self, mode: Mode) -> std::time::Duration {
+ let context = self.database.create_context(self.profile);
+
+ let _ = context.client.runtime_version_at(&BlockId::Number(0))
+ .expect("Failed to get runtime version")
+ .spec_version;
+
+ if mode == Mode::Profile {
+ std::thread::park_timeout(std::time::Duration::from_secs(3));
+ }
+
+ let mut proposer_factory = sc_basic_authorship::ProposerFactory::new(
+ context.client.clone(),
+ self.transactions.clone().into(),
+ None,
+ );
+ let inherent_data_providers = sp_inherents::InherentDataProviders::new();
+ inherent_data_providers
+ .register_provider(sp_timestamp::InherentDataProvider)
+ .expect("Failed to register timestamp data provider");
+
+ let start = std::time::Instant::now();
+
+ let proposer = futures::executor::block_on(proposer_factory.init(
+ &context.client.header(&BlockId::number(0))
+ .expect("Database error querying block #0")
+ .expect("Block #0 should exist"),
+ )).expect("Proposer initialization failed");
+
+ let _block = futures::executor::block_on(
+ proposer.propose(
+ inherent_data_providers.create_inherent_data().expect("Create inherent data failed"),
+ Default::default(),
+ std::time::Duration::from_secs(20),
+ RecordProof::Yes,
+ ),
+ ).map(|r| r.block).expect("Proposing failed");
+
+ let elapsed = start.elapsed();
+
+ if mode == Mode::Profile {
+ std::thread::park_timeout(std::time::Duration::from_secs(1));
+ }
+
+ elapsed
+ }
+}
+
+#[derive(Clone, Debug)]
+pub struct PoolTransaction {
+ data: OpaqueExtrinsic,
+ hash: node_primitives::Hash,
+}
+
+impl From for PoolTransaction {
+ fn from(e: OpaqueExtrinsic) -> Self {
+ PoolTransaction {
+ data: e,
+ hash: node_primitives::Hash::zero(),
+ }
+ }
+}
+
+impl sp_transaction_pool::InPoolTransaction for PoolTransaction {
+ type Transaction = OpaqueExtrinsic;
+ type Hash = node_primitives::Hash;
+
+ fn data(&self) -> &Self::Transaction {
+ &self.data
+ }
+
+ fn hash(&self) -> &Self::Hash {
+ &self.hash
+ }
+
+ fn priority(&self) -> &u64 { unimplemented!() }
+
+ fn longevity(&self) -> &u64 { unimplemented!() }
+
+ fn requires(&self) -> &[Vec] { unimplemented!() }
+
+ fn provides(&self) -> &[Vec] { unimplemented!() }
+
+ fn is_propagable(&self) -> bool { unimplemented!() }
+}
+
+#[derive(Clone, Debug)]
+pub struct Transactions(Vec>);
+
+impl sp_transaction_pool::TransactionPool for Transactions {
+ type Block = Block;
+ type Hash = node_primitives::Hash;
+ type InPoolTransaction = PoolTransaction;
+ type Error = sp_transaction_pool::error::Error;
+
+ /// Returns a future that imports a bunch of unverified transactions to the pool.
+ fn submit_at(
+ &self,
+ _at: &BlockId,
+ _source: TransactionSource,
+ _xts: Vec>,
+ ) -> PoolFuture>, Self::Error> {
+ unimplemented!()
+ }
+
+ /// Returns a future that imports one unverified transaction to the pool.
+ fn submit_one(
+ &self,
+ _at: &BlockId,
+ _source: TransactionSource,
+ _xt: TransactionFor,
+ ) -> PoolFuture, Self::Error> {
+ unimplemented!()
+ }
+
+ fn submit_and_watch(
+ &self,
+ _at: &BlockId,
+ _source: TransactionSource,
+ _xt: TransactionFor,
+ ) -> PoolFuture>, Self::Error> {
+ unimplemented!()
+ }
+
+ fn ready_at(&self, _at: NumberFor)
+ -> Pin> + Send>> + Send>>
+ {
+ let iter: Box> + Send> = Box::new(self.0.clone().into_iter());
+ Box::pin(futures::future::ready(iter))
+ }
+
+ fn ready(&self) -> Box> + Send> {
+ unimplemented!()
+ }
+
+ fn remove_invalid(&self, _hashes: &[TxHash]) -> Vec> {
+ Default::default()
+ }
+
+ fn status(&self) -> PoolStatus {
+ unimplemented!()
+ }
+
+ fn import_notification_stream(&self) -> ImportNotificationStream> {
+ unimplemented!()
+ }
+
+ fn on_broadcasted(&self, _propagations: HashMap, Vec>) {
+ unimplemented!()
+ }
+
+ fn hash_of(&self, _xt: &TransactionFor) -> TxHash {
+ unimplemented!()
+ }
+
+ fn ready_transaction(&self, _hash: &TxHash) -> Option> {
+ unimplemented!()
+ }
+}
\ No newline at end of file
diff --git a/bin/node/bench/src/core.rs b/bin/node/bench/src/core.rs
index ca297b1a90cb694f336b2d343f80d511bf9b231b..c1b1711549be17daf43024caae16ee356d0c889c 100644
--- a/bin/node/bench/src/core.rs
+++ b/bin/node/bench/src/core.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -75,14 +75,14 @@ impl fmt::Display for NsFormatter {
}
if self.0 < 1_000_000 {
- return write!(f, "{:.2} ms", v as f64 / 1_000_000.0)
+ return write!(f, "{:.4} ms", v as f64 / 1_000_000.0)
}
if self.0 < 100_000_000 {
- return write!(f, "{} ms", v as f64 / 1_000_000.0)
+ return write!(f, "{:.1} ms", v as f64 / 1_000_000.0)
}
- write!(f, "{:.2} s", v as f64 / 1_000_000_000.0)
+ write!(f, "{:.4} s", v as f64 / 1_000_000_000.0)
}
}
diff --git a/bin/node/bench/src/generator.rs b/bin/node/bench/src/generator.rs
index a42dbd748f3ef6dd05e7019008dc31dee8d25d37..759a4299c72758f540e92349de6a25591c506d39 100644
--- a/bin/node/bench/src/generator.rs
+++ b/bin/node/bench/src/generator.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/node/bench/src/import.rs b/bin/node/bench/src/import.rs
index d98b54ce702aa20fffb841843fce7607fb1ab07b..e49a359fb6af16fc26a7f252ca759442c35bbe1a 100644
--- a/bin/node/bench/src/import.rs
+++ b/bin/node/bench/src/import.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -36,38 +36,12 @@ use node_testing::bench::{BenchDb, Profile, BlockType, KeyTypes, DatabaseType};
use node_primitives::Block;
use sc_client_api::backend::Backend;
use sp_runtime::generic::BlockId;
+use sp_state_machine::InspectState;
-use crate::core::{self, Path, Mode};
-
-#[derive(Clone, Copy, Debug, derive_more::Display)]
-pub enum SizeType {
- #[display(fmt = "empty")]
- Empty,
- #[display(fmt = "small")]
- Small,
- #[display(fmt = "medium")]
- Medium,
- #[display(fmt = "large")]
- Large,
- #[display(fmt = "full")]
- Full,
- #[display(fmt = "custom")]
- Custom(usize),
-}
-
-impl SizeType {
- pub fn transactions(&self) -> Option {
- match self {
- SizeType::Empty => Some(0),
- SizeType::Small => Some(10),
- SizeType::Medium => Some(100),
- SizeType::Large => Some(500),
- SizeType::Full => None,
- // Custom SizeType will use the `--transactions` input parameter
- SizeType::Custom(val) => Some(*val),
- }
- }
-}
+use crate::{
+ common::SizeType,
+ core::{self, Path, Mode},
+};
pub struct ImportBenchmarkDescription {
pub profile: Profile,
@@ -81,6 +55,7 @@ pub struct ImportBenchmark {
profile: Profile,
database: BenchDb,
block: Block,
+ block_type: BlockType,
}
impl core::BenchmarkDescription for ImportBenchmarkDescription {
@@ -124,6 +99,7 @@ impl core::BenchmarkDescription for ImportBenchmarkDescription {
let block = bench_db.generate_block(self.block_type.to_content(self.size.transactions()));
Box::new(ImportBenchmark {
database: bench_db,
+ block_type: self.block_type,
block,
profile,
})
@@ -131,8 +107,9 @@ impl core::BenchmarkDescription for ImportBenchmarkDescription {
fn name(&self) -> Cow<'static, str> {
format!(
- "Import benchmark ({:?}, {:?}, {:?} backend)",
+ "Block import ({:?}/{}, {:?}, {:?} backend)",
self.block_type,
+ self.size,
self.profile,
self.database_type,
).into()
@@ -155,6 +132,41 @@ impl core::Benchmark for ImportBenchmark {
context.import_block(self.block.clone());
let elapsed = start.elapsed();
+ // Sanity checks.
+ context.client.state_at(&BlockId::number(1)).expect("state_at failed for block#1")
+ .inspect_with(|| {
+ match self.block_type {
+ BlockType::RandomTransfersKeepAlive => {
+ // should be 5 per signed extrinsic + 1 per unsigned
+ // we have 1 unsigned and the rest are signed in the block
+ // those 5 events per signed are:
+ // - new account (RawEvent::NewAccount) as we always transfer fund to non-existant account
+ // - endowed (RawEvent::Endowed) for this new account
+ // - successful transfer (RawEvent::Transfer) for this transfer operation
+ // - deposit event for charging transaction fee
+ // - extrinsic success
+ assert_eq!(
+ node_runtime::System::events().len(),
+ (self.block.extrinsics.len() - 1) * 5 + 1,
+ );
+ },
+ BlockType::Noop => {
+ assert_eq!(
+ node_runtime::System::events().len(),
+
+ // should be 2 per signed extrinsic + 1 per unsigned
+ // we have 1 unsigned and the rest are signed in the block
+ // those 2 events per signed are:
+ // - deposit event for charging transaction fee
+ // - extrinsic success
+ (self.block.extrinsics.len() - 1) * 2 + 1,
+ );
+ },
+ _ => {},
+ }
+ }
+ );
+
if mode == Mode::Profile {
std::thread::park_timeout(std::time::Duration::from_secs(1));
}
diff --git a/bin/node/bench/src/main.rs b/bin/node/bench/src/main.rs
index fbf203d29e31ab41324a9cef7d193a0f387e62be..11820247112f8c99891c54b7ea4cb60fcf22c87f 100644
--- a/bin/node/bench/src/main.rs
+++ b/bin/node/bench/src/main.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -16,21 +16,29 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
+mod common;
+mod construct;
#[macro_use] mod core;
mod import;
-mod trie;
-mod simple_trie;
mod generator;
-mod tempdb;
+mod simple_trie;
mod state_sizes;
+mod tempdb;
+mod trie;
-use crate::core::{run_benchmark, Mode as BenchmarkMode};
-use crate::tempdb::DatabaseType;
-use import::{ImportBenchmarkDescription, SizeType};
-use trie::{TrieReadBenchmarkDescription, TrieWriteBenchmarkDescription, DatabaseSize};
-use node_testing::bench::{Profile, KeyTypes, BlockType, DatabaseType as BenchDataBaseType};
use structopt::StructOpt;
+use node_testing::bench::{Profile, KeyTypes, BlockType, DatabaseType as BenchDataBaseType};
+
+use crate::{
+ common::SizeType,
+ core::{run_benchmark, Mode as BenchmarkMode},
+ tempdb::DatabaseType,
+ import::ImportBenchmarkDescription,
+ trie::{TrieReadBenchmarkDescription, TrieWriteBenchmarkDescription, DatabaseSize},
+ construct::ConstructionBenchmarkDescription,
+};
+
#[derive(Debug, StructOpt)]
#[structopt(name = "node-bench", about = "Node integration benchmarks")]
struct Opt {
@@ -126,6 +134,20 @@ fn main() {
]
.iter().map(move |db_type| (size, db_type)))
=> TrieWriteBenchmarkDescription { database_size: *size, database_type: *db_type },
+ ConstructionBenchmarkDescription {
+ profile: Profile::Wasm,
+ key_types: KeyTypes::Sr25519,
+ block_type: BlockType::RandomTransfersKeepAlive,
+ size: SizeType::Medium,
+ database_type: BenchDataBaseType::RocksDb,
+ },
+ ConstructionBenchmarkDescription {
+ profile: Profile::Wasm,
+ key_types: KeyTypes::Sr25519,
+ block_type: BlockType::RandomTransfersKeepAlive,
+ size: SizeType::Large,
+ database_type: BenchDataBaseType::RocksDb,
+ },
);
if opt.list {
@@ -152,6 +174,11 @@ fn main() {
}
}
+ if results.is_empty() {
+ eprintln!("No benchmark was found for query");
+ std::process::exit(1);
+ }
+
if opt.json {
let json_result: String = serde_json::to_string(&results).expect("Failed to construct json");
println!("{}", json_result);
diff --git a/bin/node/bench/src/simple_trie.rs b/bin/node/bench/src/simple_trie.rs
index 01ad1bb9b4f19f1f5ae02656c1f44c3e168b66c1..3cfd7ddb300a9101b22d55a2d460526a283fa0e2 100644
--- a/bin/node/bench/src/simple_trie.rs
+++ b/bin/node/bench/src/simple_trie.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/node/bench/src/tempdb.rs b/bin/node/bench/src/tempdb.rs
index 19f9b9099ce91ce414031a074f78ea39e93634f3..770bafec6f38dc092ac3a905152e2c0861f54e5f 100644
--- a/bin/node/bench/src/tempdb.rs
+++ b/bin/node/bench/src/tempdb.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/node/bench/src/trie.rs b/bin/node/bench/src/trie.rs
index ada18c1016d71fab68697a06ef45a584968112c9..886dc6011492f4564aa679f6f5f483025c057b58 100644
--- a/bin/node/bench/src/trie.rs
+++ b/bin/node/bench/src/trie.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/node/browser-testing/Cargo.toml b/bin/node/browser-testing/Cargo.toml
index 2178fc631f649bc296482566ef353ffae75ccba7..0fa2c4d51aba0256ad56fe90c8935c7ab8a179dc 100644
--- a/bin/node/browser-testing/Cargo.toml
+++ b/bin/node/browser-testing/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "node-browser-testing"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
authors = ["Parity Technologies "]
description = "Tests for the in-browser light client."
edition = "2018"
@@ -8,8 +8,8 @@ license = "Apache-2.0"
[dependencies]
futures-timer = "3.0.2"
-libp2p = { version = "0.18.0", default-features = false }
-jsonrpc-core = "14.0.5"
+libp2p = { version = "0.20.1", default-features = false }
+jsonrpc-core = "14.2.0"
serde = "1.0.106"
serde_json = "1.0.48"
wasm-bindgen = { version = "=0.2.62", features = ["serde-serialize"] }
@@ -17,5 +17,5 @@ wasm-bindgen-futures = "0.4.10"
wasm-bindgen-test = "0.3.10"
futures = "0.3.4"
-node-cli = { path = "../cli", default-features = false, features = ["browser"] , version = "2.0.0-alpha.8"}
-sc-rpc-api = { path = "../../../client/rpc-api" , version = "0.8.0-alpha.8"}
+node-cli = { path = "../cli", default-features = false, features = ["browser"] , version = "2.0.0-rc4"}
+sc-rpc-api = { path = "../../../client/rpc-api" , version = "0.8.0-rc4"}
diff --git a/bin/node/cli/Cargo.toml b/bin/node/cli/Cargo.toml
index 1e4c9b6be37479c5957c30ecaec449b59a9360f7..6202c1af69e8d62ba82b4bb43b58b22e9698ea4c 100644
--- a/bin/node/cli/Cargo.toml
+++ b/bin/node/cli/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "node-cli"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
authors = ["Parity Technologies "]
description = "Generic Substrate node implementation in Rust."
build = "build.rs"
@@ -20,7 +20,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[badges]
travis-ci = { repository = "paritytech/substrate" }
-maintenance = { status = "actively-alpha.8eloped" }
+maintenance = { status = "actively-developed" }
is-it-maintained-issue-resolution = { repository = "paritytech/substrate" }
is-it-maintained-open-issues = { repository = "paritytech/substrate" }
@@ -34,11 +34,11 @@ crate-type = ["cdylib", "rlib"]
[dependencies]
# third-party dependencies
-codec = { package = "parity-scale-codec", version = "1.3.0" }
+codec = { package = "parity-scale-codec", version = "1.3.1" }
serde = { version = "1.0.102", features = ["derive"] }
futures = { version = "0.3.1", features = ["compat"] }
hex-literal = "0.2.1"
-jsonrpc-core = "14.0.3"
+jsonrpc-core = "14.2.0"
log = "0.4.8"
rand = "0.7.2"
structopt = { version = "0.3.8", optional = true }
@@ -46,76 +46,76 @@ tracing = "0.1.10"
parking_lot = "0.10.0"
# primitives
-sp-authority-discovery = { version = "2.0.0-alpha.8", path = "../../../primitives/authority-discovery" }
-sp-consensus-babe = { version = "0.8.0-alpha.8", path = "../../../primitives/consensus/babe" }
-grandpa-primitives = { version = "2.0.0-alpha.8", package = "sp-finality-grandpa", path = "../../../primitives/finality-grandpa" }
-sp-core = { version = "2.0.0-alpha.8", path = "../../../primitives/core" }
-sp-runtime = { version = "2.0.0-alpha.8", path = "../../../primitives/runtime" }
-sp-timestamp = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/timestamp" }
-sp-finality-tracker = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/finality-tracker" }
-sp-inherents = { version = "2.0.0-alpha.8", path = "../../../primitives/inherents" }
-sp-keyring = { version = "2.0.0-alpha.8", path = "../../../primitives/keyring" }
-sp-io = { version = "2.0.0-alpha.8", path = "../../../primitives/io" }
-sp-consensus = { version = "0.8.0-alpha.8", path = "../../../primitives/consensus/common" }
-sp-transaction-pool = { version = "2.0.0-alpha.8", path = "../../../primitives/transaction-pool" }
+sp-authority-discovery = { version = "2.0.0-rc4", path = "../../../primitives/authority-discovery" }
+sp-consensus-babe = { version = "0.8.0-rc4", path = "../../../primitives/consensus/babe" }
+grandpa-primitives = { version = "2.0.0-rc4", package = "sp-finality-grandpa", path = "../../../primitives/finality-grandpa" }
+sp-core = { version = "2.0.0-rc4", path = "../../../primitives/core" }
+sp-runtime = { version = "2.0.0-rc4", path = "../../../primitives/runtime" }
+sp-timestamp = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/timestamp" }
+sp-finality-tracker = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/finality-tracker" }
+sp-inherents = { version = "2.0.0-rc4", path = "../../../primitives/inherents" }
+sp-keyring = { version = "2.0.0-rc4", path = "../../../primitives/keyring" }
+sp-io = { version = "2.0.0-rc4", path = "../../../primitives/io" }
+sp-consensus = { version = "0.8.0-rc4", path = "../../../primitives/consensus/common" }
+sp-transaction-pool = { version = "2.0.0-rc4", path = "../../../primitives/transaction-pool" }
# client dependencies
-sc-client-api = { version = "2.0.0-alpha.8", path = "../../../client/api" }
-sc-chain-spec = { version = "2.0.0-alpha.8", path = "../../../client/chain-spec" }
-sc-consensus = { version = "0.8.0-alpha.8", path = "../../../client/consensus/common" }
-sc-transaction-pool = { version = "2.0.0-alpha.8", path = "../../../client/transaction-pool" }
-sc-network = { version = "0.8.0-alpha.8", path = "../../../client/network" }
-sc-consensus-babe = { version = "0.8.0-alpha.8", path = "../../../client/consensus/babe" }
-grandpa = { version = "0.8.0-alpha.8", package = "sc-finality-grandpa", path = "../../../client/finality-grandpa" }
-sc-client-db = { version = "0.8.0-alpha.8", default-features = false, path = "../../../client/db" }
-sc-offchain = { version = "2.0.0-alpha.8", path = "../../../client/offchain" }
-sc-rpc = { version = "2.0.0-alpha.8", path = "../../../client/rpc" }
-sc-basic-authorship = { version = "0.8.0-alpha.8", path = "../../../client/basic-authorship" }
-sc-service = { version = "0.8.0-alpha.8", default-features = false, path = "../../../client/service" }
-sc-tracing = { version = "2.0.0-alpha.8", path = "../../../client/tracing" }
-sc-telemetry = { version = "2.0.0-alpha.8", path = "../../../client/telemetry" }
-sc-authority-discovery = { version = "0.8.0-alpha.8", path = "../../../client/authority-discovery" }
+sc-client-api = { version = "2.0.0-rc4", path = "../../../client/api" }
+sc-chain-spec = { version = "2.0.0-rc4", path = "../../../client/chain-spec" }
+sc-consensus = { version = "0.8.0-rc4", path = "../../../client/consensus/common" }
+sc-transaction-pool = { version = "2.0.0-rc4", path = "../../../client/transaction-pool" }
+sc-network = { version = "0.8.0-rc4", path = "../../../client/network" }
+sc-consensus-babe = { version = "0.8.0-rc4", path = "../../../client/consensus/babe" }
+grandpa = { version = "0.8.0-rc4", package = "sc-finality-grandpa", path = "../../../client/finality-grandpa" }
+sc-client-db = { version = "0.8.0-rc4", default-features = false, path = "../../../client/db" }
+sc-offchain = { version = "2.0.0-rc4", path = "../../../client/offchain" }
+sc-rpc = { version = "2.0.0-rc4", path = "../../../client/rpc" }
+sc-basic-authorship = { version = "0.8.0-rc4", path = "../../../client/basic-authorship" }
+sc-service = { version = "0.8.0-rc4", default-features = false, path = "../../../client/service" }
+sc-tracing = { version = "2.0.0-rc4", path = "../../../client/tracing" }
+sc-telemetry = { version = "2.0.0-rc4", path = "../../../client/telemetry" }
+sc-authority-discovery = { version = "0.8.0-rc4", path = "../../../client/authority-discovery" }
# frame dependencies
-pallet-indices = { version = "2.0.0-alpha.8", path = "../../../frame/indices" }
-pallet-timestamp = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/timestamp" }
-pallet-contracts = { version = "2.0.0-alpha.8", path = "../../../frame/contracts" }
-frame-system = { version = "2.0.0-alpha.8", path = "../../../frame/system" }
-pallet-balances = { version = "2.0.0-alpha.8", path = "../../../frame/balances" }
-pallet-transaction-payment = { version = "2.0.0-alpha.8", path = "../../../frame/transaction-payment" }
-frame-support = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/support" }
-pallet-im-online = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/im-online" }
-pallet-authority-discovery = { version = "2.0.0-alpha.8", path = "../../../frame/authority-discovery" }
-pallet-staking = { version = "2.0.0-alpha.8", path = "../../../frame/staking" }
-pallet-grandpa = { version = "2.0.0-alpha.8", path = "../../../frame/grandpa" }
+pallet-indices = { version = "2.0.0-rc4", path = "../../../frame/indices" }
+pallet-timestamp = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/timestamp" }
+pallet-contracts = { version = "2.0.0-rc4", path = "../../../frame/contracts" }
+frame-system = { version = "2.0.0-rc4", path = "../../../frame/system" }
+pallet-balances = { version = "2.0.0-rc4", path = "../../../frame/balances" }
+pallet-transaction-payment = { version = "2.0.0-rc4", path = "../../../frame/transaction-payment" }
+frame-support = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/support" }
+pallet-im-online = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/im-online" }
+pallet-authority-discovery = { version = "2.0.0-rc4", path = "../../../frame/authority-discovery" }
+pallet-staking = { version = "2.0.0-rc4", path = "../../../frame/staking" }
+pallet-grandpa = { version = "2.0.0-rc4", path = "../../../frame/grandpa" }
# node-specific dependencies
-node-runtime = { version = "2.0.0-alpha.8", path = "../runtime" }
-node-rpc = { version = "2.0.0-alpha.8", path = "../rpc" }
-node-primitives = { version = "2.0.0-alpha.8", path = "../primitives" }
-node-executor = { version = "2.0.0-alpha.8", path = "../executor" }
+node-runtime = { version = "2.0.0-rc4", path = "../runtime" }
+node-rpc = { version = "2.0.0-rc4", path = "../rpc" }
+node-primitives = { version = "2.0.0-rc4", path = "../primitives" }
+node-executor = { version = "2.0.0-rc4", path = "../executor" }
# CLI-specific dependencies
-sc-cli = { version = "0.8.0-alpha.8", optional = true, path = "../../../client/cli" }
-frame-benchmarking-cli = { version = "2.0.0-alpha.8", optional = true, path = "../../../utils/frame/benchmarking-cli" }
-node-inspect = { version = "0.8.0-alpha.8", optional = true, path = "../inspect" }
+sc-cli = { version = "0.8.0-rc4", optional = true, path = "../../../client/cli" }
+frame-benchmarking-cli = { version = "2.0.0-rc4", optional = true, path = "../../../utils/frame/benchmarking-cli" }
+node-inspect = { version = "0.8.0-rc4", optional = true, path = "../inspect" }
# WASM-specific dependencies
wasm-bindgen = { version = "0.2.57", optional = true }
wasm-bindgen-futures = { version = "0.4.7", optional = true }
-browser-utils = { package = "substrate-browser-utils", path = "../../../utils/browser", optional = true, version = "0.8.0-alpha.8"}
+browser-utils = { package = "substrate-browser-utils", path = "../../../utils/browser", optional = true, version = "0.8.0-rc4"}
[target.'cfg(target_arch="x86_64")'.dependencies]
-node-executor = { version = "2.0.0-alpha.8", path = "../executor", features = [ "wasmtime" ] }
-sc-cli = { version = "0.8.0-alpha.8", optional = true, path = "../../../client/cli", features = [ "wasmtime" ] }
-sc-service = { version = "0.8.0-alpha.8", default-features = false, path = "../../../client/service", features = [ "wasmtime" ] }
+node-executor = { version = "2.0.0-rc4", path = "../executor", features = [ "wasmtime" ] }
+sc-cli = { version = "0.8.0-rc4", optional = true, path = "../../../client/cli", features = [ "wasmtime" ] }
+sc-service = { version = "0.8.0-rc4", default-features = false, path = "../../../client/service", features = [ "wasmtime" ] }
[dev-dependencies]
-sc-keystore = { version = "2.0.0-alpha.8", path = "../../../client/keystore" }
-sc-consensus = { version = "0.8.0-alpha.8", path = "../../../client/consensus/common" }
-sc-consensus-babe = { version = "0.8.0-alpha.8", features = ["test-helpers"], path = "../../../client/consensus/babe" }
-sc-consensus-epochs = { version = "0.8.0-alpha.8", path = "../../../client/consensus/epochs" }
-sc-service-test = { version = "2.0.0-alpha.8", path = "../../../client/service/test" }
+sc-keystore = { version = "2.0.0-rc4", path = "../../../client/keystore" }
+sc-consensus = { version = "0.8.0-rc4", path = "../../../client/consensus/common" }
+sc-consensus-babe = { version = "0.8.0-rc4", features = ["test-helpers"], path = "../../../client/consensus/babe" }
+sc-consensus-epochs = { version = "0.8.0-rc4", path = "../../../client/consensus/epochs" }
+sc-service-test = { version = "2.0.0-rc4", path = "../../../client/service/test" }
futures = "0.3.4"
tempfile = "3.1.0"
assert_cmd = "1.0"
@@ -126,12 +126,12 @@ platforms = "0.2.1"
[build-dependencies]
structopt = { version = "0.3.8", optional = true }
-node-inspect = { version = "0.8.0-alpha.8", optional = true, path = "../inspect" }
-frame-benchmarking-cli = { version = "2.0.0-alpha.8", optional = true, path = "../../../utils/frame/benchmarking-cli" }
-substrate-build-script-utils = { version = "2.0.0-alpha.8", optional = true, path = "../../../utils/build-script-utils" }
+node-inspect = { version = "0.8.0-rc4", optional = true, path = "../inspect" }
+frame-benchmarking-cli = { version = "2.0.0-rc4", optional = true, path = "../../../utils/frame/benchmarking-cli" }
+substrate-build-script-utils = { version = "2.0.0-rc4", optional = true, path = "../../../utils/build-script-utils" }
[build-dependencies.sc-cli]
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
package = "sc-cli"
path = "../../../client/cli"
optional = true
diff --git a/bin/node/cli/bin/main.rs b/bin/node/cli/bin/main.rs
index 1d0fa639c06146d6e470e3b014c4189c77c7550f..299b760c82e36b2b6540f6ae4efd8111cf430640 100644
--- a/bin/node/cli/bin/main.rs
+++ b/bin/node/cli/bin/main.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/node/cli/build.rs b/bin/node/cli/build.rs
index 1c47dadc8dcf57ba8e2ede0fe7a132e0bd01ff13..a36f0d01a0a034a10686d3565e6abf538e6a5886 100644
--- a/bin/node/cli/build.rs
+++ b/bin/node/cli/build.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/node/cli/res/flaming-fir.json b/bin/node/cli/res/flaming-fir.json
index 7cc2c11c327e158842332faf6405d91983b6886c..5f2eb265880efa1853e095486b3fe18d58fa233c 100644
--- a/bin/node/cli/res/flaming-fir.json
+++ b/bin/node/cli/res/flaming-fir.json
@@ -14,7 +14,7 @@
],
"telemetryEndpoints": [
[
- "/dns4/telemetry.polkadot.io/tcp/443/x-parity-wss/%2Fsubmit%2F",
+ "/dns/telemetry.polkadot.io/tcp/443/x-parity-wss/%2Fsubmit%2F",
0
]
],
diff --git a/bin/node/cli/src/browser.rs b/bin/node/cli/src/browser.rs
index df74ef3f75455dfc6aa2a28cbdfe7cd3ee65c8c5..3aec486c103700f9e7fd9e9c9a8218b78cf555ab 100644
--- a/bin/node/cli/src/browser.rs
+++ b/bin/node/cli/src/browser.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -52,8 +52,10 @@ async fn start_inner(chain_spec: Option, log_level: String) -> Result ChainSpec {
#[cfg(test)]
pub(crate) mod tests {
use super::*;
- use crate::service::{new_full, new_light};
+ use crate::service::{new_full_base, new_light_base};
use sc_service_test;
use sp_runtime::BuildStorage;
@@ -430,8 +430,14 @@ pub(crate) mod tests {
fn test_connectivity() {
sc_service_test::connectivity(
integration_test_config_with_two_authorities(),
- |config| new_full(config),
- |config| new_light(config),
+ |config| {
+ let (keep_alive, _, client, network, transaction_pool) = new_full_base(config,|_, _| ())?;
+ Ok(sc_service_test::TestNetComponents::new(keep_alive, client, network, transaction_pool))
+ },
+ |config| {
+ let (keep_alive, _, client, network, transaction_pool) = new_light_base(config)?;
+ Ok(sc_service_test::TestNetComponents::new(keep_alive, client, network, transaction_pool))
+ }
);
}
diff --git a/bin/node/cli/src/cli.rs b/bin/node/cli/src/cli.rs
index a6532790641b2b4e50536255ed8113c8b6249cef..29e916fe0180ec2c8ffde4cacdfba361b24cf86c 100644
--- a/bin/node/cli/src/cli.rs
+++ b/bin/node/cli/src/cli.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -20,7 +20,7 @@ use sc_cli::RunCmd;
use structopt::StructOpt;
/// An overarching CLI command definition.
-#[derive(Clone, Debug, StructOpt)]
+#[derive(Debug, StructOpt)]
pub struct Cli {
/// Possible subcommand with parameters.
#[structopt(subcommand)]
@@ -31,7 +31,7 @@ pub struct Cli {
}
/// Possible subcommands of the main binary.
-#[derive(Clone, Debug, StructOpt)]
+#[derive(Debug, StructOpt)]
pub enum Subcommand {
/// A set of base subcommands handled by `sc_cli`.
#[structopt(flatten)]
diff --git a/bin/node/cli/src/command.rs b/bin/node/cli/src/command.rs
index 3034c81bac15373ddaa8c22c5bb20f2a12b700e7..b07e0cdc907e03ff1e5c56dc6daea7ee75ed88f3 100644
--- a/bin/node/cli/src/command.rs
+++ b/bin/node/cli/src/command.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -19,7 +19,7 @@
use crate::{chain_spec, service, Cli, Subcommand};
use node_executor::Executor;
use node_runtime::{Block, RuntimeApi};
-use sc_cli::{Result, SubstrateCli};
+use sc_cli::{Result, SubstrateCli, RuntimeVersion, Role, ChainSpec};
impl SubstrateCli for Cli {
fn impl_name() -> &'static str {
@@ -61,6 +61,10 @@ impl SubstrateCli for Cli {
)?),
})
}
+
+ fn native_runtime_version(_: &Box) -> &'static RuntimeVersion {
+ &node_runtime::VERSION
+ }
}
/// Parse command line arguments into service configuration.
@@ -70,11 +74,10 @@ pub fn run() -> Result<()> {
match &cli.subcommand {
None => {
let runner = cli.create_runner(&cli.run)?;
- runner.run_node(
- service::new_light,
- service::new_full,
- node_runtime::VERSION
- )
+ runner.run_node_until_exit(|config| match config.role {
+ Role::Light => service::new_light(config),
+ _ => service::new_full(config),
+ })
}
Some(Subcommand::Inspect(cmd)) => {
let runner = cli.create_runner(cmd)?;
diff --git a/bin/node/cli/src/lib.rs b/bin/node/cli/src/lib.rs
index 8edfb5e3fb0b2a1534109fedf305618307624b88..bd2298514a7a2f1ed57fa008615b11ac0947d20b 100644
--- a/bin/node/cli/src/lib.rs
+++ b/bin/node/cli/src/lib.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/node/cli/src/service.rs b/bin/node/cli/src/service.rs
index ee6d11de57640c1980c34b8b2dadc0526a652315..9707e3d8caf08cc79b683f1b50fa399ddd5561f0 100644
--- a/bin/node/cli/src/service.rs
+++ b/bin/node/cli/src/service.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -21,7 +21,6 @@
//! Service implementation. Specialized wrapper over substrate service.
use std::sync::Arc;
-
use sc_consensus_babe;
use grandpa::{
self, FinalityProofProvider as GrandpaFinalityProofProvider, StorageAndProofProvider,
@@ -30,10 +29,16 @@ use node_executor;
use node_primitives::Block;
use node_runtime::RuntimeApi;
use sc_service::{
- AbstractService, ServiceBuilder, config::Configuration, error::{Error as ServiceError},
+ ServiceBuilder, config::{Role, Configuration}, error::{Error as ServiceError},
+ RpcHandlers, ServiceComponents, TaskManager,
};
use sp_inherents::InherentDataProviders;
use sc_consensus::LongestChain;
+use sc_network::{Event, NetworkService};
+use sp_runtime::traits::Block as BlockT;
+use futures::prelude::*;
+use sc_client_api::ExecutorProvider;
+use sp_core::traits::BareCryptoStorePtr;
/// Starts a `ServiceBuilder` for a full service.
///
@@ -43,7 +48,6 @@ macro_rules! new_full_start {
($config:expr) => {{
use std::sync::Arc;
- type RpcExtension = jsonrpc_core::IoHandler;
let mut import_setup = None;
let mut rpc_setup = None;
let inherent_data_providers = sp_inherents::InherentDataProviders::new();
@@ -54,12 +58,16 @@ macro_rules! new_full_start {
.with_select_chain(|_config, backend| {
Ok(sc_consensus::LongestChain::new(backend.clone()))
})?
- .with_transaction_pool(|config, client, _fetcher, prometheus_registry| {
- let pool_api = sc_transaction_pool::FullChainApi::new(client.clone());
+ .with_transaction_pool(|builder| {
+ let pool_api = sc_transaction_pool::FullChainApi::new(
+ builder.client().clone(),
+ );
+ let config = builder.config();
+
Ok(sc_transaction_pool::BasicPool::new(
- config,
+ config.transaction_pool.clone(),
std::sync::Arc::new(pool_api),
- prometheus_registry,
+ builder.prometheus_registry(),
))
})?
.with_import_queue(|
@@ -99,221 +107,258 @@ macro_rules! new_full_start {
import_setup = Some((block_import, grandpa_link, babe_link));
Ok(import_queue)
})?
- .with_rpc_extensions(|builder| -> std::result::Result {
- let babe_link = import_setup.as_ref().map(|s| &s.2)
- .expect("BabeLink is present for full services or set up failed; qed.");
+ .with_rpc_extensions_builder(|builder| {
let grandpa_link = import_setup.as_ref().map(|s| &s.1)
.expect("GRANDPA LinkHalf is present for full services or set up failed; qed.");
- let shared_authority_set = grandpa_link.shared_authority_set();
+
+ let shared_authority_set = grandpa_link.shared_authority_set().clone();
let shared_voter_state = grandpa::SharedVoterState::empty();
- let deps = node_rpc::FullDeps {
- client: builder.client().clone(),
- pool: builder.pool(),
- select_chain: builder.select_chain().cloned()
- .expect("SelectChain is present for full services or set up failed; qed."),
- babe: node_rpc::BabeDeps {
- keystore: builder.keystore(),
- babe_config: sc_consensus_babe::BabeLink::config(babe_link).clone(),
- shared_epoch_changes: sc_consensus_babe::BabeLink::epoch_changes(babe_link).clone()
- },
- grandpa: node_rpc::GrandpaDeps {
- shared_voter_state: shared_voter_state.clone(),
- shared_authority_set: shared_authority_set.clone(),
- },
- };
- rpc_setup = Some((shared_voter_state));
- Ok(node_rpc::create_full(deps))
+
+ rpc_setup = Some((shared_voter_state.clone()));
+
+ let babe_link = import_setup.as_ref().map(|s| &s.2)
+ .expect("BabeLink is present for full services or set up failed; qed.");
+
+ let babe_config = babe_link.config().clone();
+ let shared_epoch_changes = babe_link.epoch_changes().clone();
+
+ let client = builder.client().clone();
+ let pool = builder.pool().clone();
+ let select_chain = builder.select_chain().cloned()
+ .expect("SelectChain is present for full services or set up failed; qed.");
+ let keystore = builder.keystore().clone();
+
+ Ok(move |deny_unsafe| {
+ let deps = node_rpc::FullDeps {
+ client: client.clone(),
+ pool: pool.clone(),
+ select_chain: select_chain.clone(),
+ deny_unsafe,
+ babe: node_rpc::BabeDeps {
+ babe_config: babe_config.clone(),
+ shared_epoch_changes: shared_epoch_changes.clone(),
+ keystore: keystore.clone(),
+ },
+ grandpa: node_rpc::GrandpaDeps {
+ shared_voter_state: shared_voter_state.clone(),
+ shared_authority_set: shared_authority_set.clone(),
+ },
+ };
+
+ node_rpc::create_full(deps)
+ })
})?;
(builder, import_setup, inherent_data_providers, rpc_setup)
}}
}
-/// Creates a full service from the configuration.
-///
-/// We need to use a macro because the test suit doesn't work with an opaque service. It expects
-/// concrete types instead.
-macro_rules! new_full {
- ($config:expr, $with_startup_data: expr) => {{
- use futures::prelude::*;
- use sc_network::Event;
- use sc_client_api::ExecutorProvider;
-
- let (
- role,
- force_authoring,
- name,
- disable_grandpa,
- ) = (
- $config.role.clone(),
- $config.force_authoring,
- $config.network.node_name.clone(),
- $config.disable_grandpa,
- );
+type FullClient = sc_service::TFullClient;
+type FullBackend = sc_service::TFullBackend;
+type GrandpaBlockImport = grandpa::GrandpaBlockImport<
+ FullBackend, Block, FullClient, sc_consensus::LongestChain
+>;
+type BabeBlockImport = sc_consensus_babe::BabeBlockImport;
- let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) =
- new_full_start!($config);
+/// Creates a full service from the configuration.
+pub fn new_full_base(
+ config: Configuration,
+ with_startup_data: impl FnOnce(&BabeBlockImport, &sc_consensus_babe::BabeLink)
+) -> Result<(
+ TaskManager,
+ InherentDataProviders,
+ Arc, Arc::Hash>>,
+ Arc, Block>>
+), ServiceError> {
+ let (
+ role,
+ force_authoring,
+ name,
+ disable_grandpa,
+ ) = (
+ config.role.clone(),
+ config.force_authoring,
+ config.network.node_name.clone(),
+ config.disable_grandpa,
+ );
+
+ let (builder, mut import_setup, inherent_data_providers, mut rpc_setup) =
+ new_full_start!(config);
+
+ let ServiceComponents {
+ client, transaction_pool, task_manager, keystore, network, select_chain,
+ prometheus_registry, telemetry_on_connect_sinks, ..
+ } = builder
+ .with_finality_proof_provider(|client, backend| {
+ // GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
+ let provider = client as Arc>;
+ Ok(Arc::new(grandpa::FinalityProofProvider::new(backend, provider)) as _)
+ })?
+ .build_full()?;
- let service = builder
- .with_finality_proof_provider(|client, backend| {
- // GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
- let provider = client as Arc>;
- Ok(Arc::new(grandpa::FinalityProofProvider::new(backend, provider)) as _)
- })?
- .build()?;
+ let (block_import, grandpa_link, babe_link) = import_setup.take()
+ .expect("Link Half and Block Import are present for Full Services or setup failed before. qed");
- let (block_import, grandpa_link, babe_link) = import_setup.take()
- .expect("Link Half and Block Import are present for Full Services or setup failed before. qed");
+ let shared_voter_state = rpc_setup.take()
+ .expect("The SharedVoterState is present for Full Services or setup failed before. qed");
- let shared_voter_state = rpc_setup.take()
- .expect("The SharedVoterState is present for Full Services or setup failed before. qed");
+ (with_startup_data)(&block_import, &babe_link);
- ($with_startup_data)(&block_import, &babe_link);
+ if let sc_service::config::Role::Authority { .. } = &role {
+ let proposer = sc_basic_authorship::ProposerFactory::new(
+ client.clone(),
+ transaction_pool.clone(),
+ prometheus_registry.as_ref(),
+ );
- if let sc_service::config::Role::Authority { .. } = &role {
- let proposer = sc_basic_authorship::ProposerFactory::new(
- service.client(),
- service.transaction_pool()
- );
+ let select_chain = select_chain
+ .ok_or(sc_service::Error::SelectChainRequired)?;
- let client = service.client();
- let select_chain = service.select_chain()
- .ok_or(sc_service::Error::SelectChainRequired)?;
+ let can_author_with =
+ sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());
- let can_author_with =
- sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());
+ let babe_config = sc_consensus_babe::BabeParams {
+ keystore: keystore.clone(),
+ client: client.clone(),
+ select_chain,
+ env: proposer,
+ block_import,
+ sync_oracle: network.clone(),
+ inherent_data_providers: inherent_data_providers.clone(),
+ force_authoring,
+ babe_link,
+ can_author_with,
+ };
- let babe_config = sc_consensus_babe::BabeParams {
- keystore: service.keystore(),
- client,
- select_chain,
- env: proposer,
- block_import,
- sync_oracle: service.network(),
- inherent_data_providers: inherent_data_providers.clone(),
- force_authoring,
- babe_link,
- can_author_with,
- };
+ let babe = sc_consensus_babe::start_babe(babe_config)?;
+ task_manager.spawn_essential_handle().spawn_blocking("babe-proposer", babe);
+ }
- let babe = sc_consensus_babe::start_babe(babe_config)?;
- service.spawn_essential_task("babe-proposer", babe);
- }
-
- // Spawn authority discovery module.
- if matches!(role, sc_service::config::Role::Authority{..} | sc_service::config::Role::Sentry {..}) {
- let (sentries, authority_discovery_role) = match role {
- sc_service::config::Role::Authority { ref sentry_nodes } => (
- sentry_nodes.clone(),
- sc_authority_discovery::Role::Authority (
- service.keystore(),
- ),
- ),
- sc_service::config::Role::Sentry {..} => (
- vec![],
- sc_authority_discovery::Role::Sentry,
+ // Spawn authority discovery module.
+ if matches!(role, Role::Authority{..} | Role::Sentry {..}) {
+ let (sentries, authority_discovery_role) = match role {
+ sc_service::config::Role::Authority { ref sentry_nodes } => (
+ sentry_nodes.clone(),
+ sc_authority_discovery::Role::Authority (
+ keystore.clone(),
),
- _ => unreachable!("Due to outer matches! constraint; qed.")
- };
+ ),
+ sc_service::config::Role::Sentry {..} => (
+ vec![],
+ sc_authority_discovery::Role::Sentry,
+ ),
+ _ => unreachable!("Due to outer matches! constraint; qed.")
+ };
- let network = service.network();
- let dht_event_stream = network.event_stream("authority-discovery").filter_map(|e| async move { match e {
+ let dht_event_stream = network.event_stream("authority-discovery")
+ .filter_map(|e| async move { match e {
Event::Dht(e) => Some(e),
_ => None,
}}).boxed();
- let authority_discovery = sc_authority_discovery::AuthorityDiscovery::new(
- service.client(),
- network,
- sentries,
- dht_event_stream,
- authority_discovery_role,
- service.prometheus_registry(),
- );
+ let authority_discovery = sc_authority_discovery::AuthorityDiscovery::new(
+ client.clone(),
+ network.clone(),
+ sentries,
+ dht_event_stream,
+ authority_discovery_role,
+ prometheus_registry.clone(),
+ );
- service.spawn_task("authority-discovery", authority_discovery);
- }
+ task_manager.spawn_handle().spawn("authority-discovery", authority_discovery);
+ }
- // 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(service.keystore())
- } else {
- None
- };
+ // 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.clone() as BareCryptoStorePtr)
+ } else {
+ None
+ };
- let config = grandpa::Config {
- // FIXME #1578 make this available through chainspec
- gossip_duration: std::time::Duration::from_millis(333),
- justification_period: 512,
- name: Some(name),
- observer_enabled: false,
- keystore,
- is_authority: role.is_network_authority(),
- };
+ let config = grandpa::Config {
+ // FIXME #1578 make this available through chainspec
+ gossip_duration: std::time::Duration::from_millis(333),
+ justification_period: 512,
+ name: Some(name),
+ observer_enabled: false,
+ keystore,
+ is_authority: role.is_network_authority(),
+ };
- let enable_grandpa = !disable_grandpa;
- if enable_grandpa {
- // 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
- // and vote data availability than the observer. The observer has not
- // been tested extensively yet and having most nodes in a network run it
- // could lead to finality stalls.
- let grandpa_config = grandpa::GrandpaParams {
- config,
- link: grandpa_link,
- network: service.network(),
- inherent_data_providers: inherent_data_providers.clone(),
- telemetry_on_connect: Some(service.telemetry_on_connect_stream()),
- voting_rule: grandpa::VotingRulesBuilder::default().build(),
- prometheus_registry: service.prometheus_registry(),
- shared_voter_state,
- };
+ let enable_grandpa = !disable_grandpa;
+ if enable_grandpa {
+ // 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
+ // and vote data availability than the observer. The observer has not
+ // been tested extensively yet and having most nodes in a network run it
+ // could lead to finality stalls.
+ let grandpa_config = grandpa::GrandpaParams {
+ config,
+ link: grandpa_link,
+ network: network.clone(),
+ inherent_data_providers: inherent_data_providers.clone(),
+ telemetry_on_connect: Some(telemetry_on_connect_sinks.on_connect_stream()),
+ voting_rule: grandpa::VotingRulesBuilder::default().build(),
+ prometheus_registry: prometheus_registry.clone(),
+ shared_voter_state,
+ };
- // the GRANDPA voter task is considered infallible, i.e.
- // if it fails we take down the service with it.
- service.spawn_essential_task(
- "grandpa-voter",
- grandpa::run_grandpa_voter(grandpa_config)?
- );
- } else {
- grandpa::setup_disabled_grandpa(
- service.client(),
- &inherent_data_providers,
- service.network(),
- )?;
- }
+ // the GRANDPA voter task is considered infallible, i.e.
+ // if it fails we take down the service with it.
+ task_manager.spawn_essential_handle().spawn_blocking(
+ "grandpa-voter",
+ grandpa::run_grandpa_voter(grandpa_config)?
+ );
+ } else {
+ grandpa::setup_disabled_grandpa(
+ client.clone(),
+ &inherent_data_providers,
+ network.clone(),
+ )?;
+ }
- Ok((service, inherent_data_providers))
- }};
- ($config:expr) => {{
- new_full!($config, |_, _| {})
- }}
+ Ok((task_manager, inherent_data_providers, client, network, transaction_pool))
}
/// Builds a new service for a full client.
pub fn new_full(config: Configuration)
--> Result
-{
- new_full!(config).map(|(service, _)| service)
+-> Result {
+ new_full_base(config, |_, _| ()).map(|(task_manager, _, _, _, _)| {
+ task_manager
+ })
}
-/// Builds a new service for a light client.
-pub fn new_light(config: Configuration)
--> Result {
- type RpcExtension = jsonrpc_core::IoHandler;
+type LightClient = sc_service::TLightClient;
+type LightFetcher = sc_network::config::OnDemand;
+
+pub fn new_light_base(config: Configuration) -> Result<(
+ TaskManager, Arc, Arc,
+ Arc::Hash>>,
+ Arc, Block
+ >>
+), ServiceError> {
let inherent_data_providers = InherentDataProviders::new();
- let service = ServiceBuilder::new_light::(config)?
+ let ServiceComponents {
+ task_manager, rpc_handlers, client, network, transaction_pool, ..
+ } = ServiceBuilder::new_light::(config)?
.with_select_chain(|_config, backend| {
Ok(LongestChain::new(backend.clone()))
})?
- .with_transaction_pool(|config, client, fetcher, prometheus_registry| {
- let fetcher = fetcher
+ .with_transaction_pool(|builder| {
+ let fetcher = builder.fetcher()
.ok_or_else(|| "Trying to start light transaction pool without active fetcher")?;
- let pool_api = sc_transaction_pool::LightChainApi::new(client.clone(), fetcher.clone());
+ let pool_api = sc_transaction_pool::LightChainApi::new(
+ builder.client().clone(),
+ fetcher,
+ );
let pool = sc_transaction_pool::BasicPool::with_revalidation_type(
- config, Arc::new(pool_api), prometheus_registry, sc_transaction_pool::RevalidationType::Light,
+ builder.config().transaction_pool.clone(),
+ Arc::new(pool_api),
+ builder.prometheus_registry(),
+ sc_transaction_pool::RevalidationType::Light,
);
Ok(pool)
})?
@@ -365,9 +410,7 @@ pub fn new_light(config: Configuration)
let provider = client as Arc>;
Ok(Arc::new(GrandpaFinalityProofProvider::new(backend, provider)) as _)
})?
- .with_rpc_extensions(|builder,| ->
- Result
- {
+ .with_rpc_extensions(|builder| {
let fetcher = builder.fetcher()
.ok_or_else(|| "Trying to start node RPC without active fetcher")?;
let remote_blockchain = builder.remote_backend()
@@ -379,19 +422,25 @@ pub fn new_light(config: Configuration)
client: builder.client().clone(),
pool: builder.pool(),
};
+
Ok(node_rpc::create_light(light_deps))
})?
- .build()?;
+ .build_light()?;
+
+ Ok((task_manager, rpc_handlers, client, network, transaction_pool))
+}
- Ok(service)
+/// Builds a new service for a light client.
+pub fn new_light(config: Configuration) -> Result {
+ new_light_base(config).map(|(task_manager, _, _, _, _)| {
+ task_manager
+ })
}
#[cfg(test)]
mod tests {
use std::{sync::Arc, borrow::Cow, any::Any};
- use sc_consensus_babe::{
- CompatibleDigestItem, BabeIntermediate, INTERMEDIATE_KEY
- };
+ use sc_consensus_babe::{CompatibleDigestItem, BabeIntermediate, INTERMEDIATE_KEY};
use sc_consensus_epochs::descendent_query;
use sp_consensus::{
Environment, Proposer, BlockImportParams, BlockOrigin, ForkChoiceStrategy, BlockImport,
@@ -400,101 +449,24 @@ mod tests {
use node_primitives::{Block, DigestItem, Signature};
use node_runtime::{BalancesCall, Call, UncheckedExtrinsic, Address};
use node_runtime::constants::{currency::CENTS, time::SLOT_DURATION};
- use codec::{Encode, Decode};
+ use codec::Encode;
use sp_core::{crypto::Pair as CryptoPair, H256};
use sp_runtime::{
generic::{BlockId, Era, Digest, SignedPayload},
traits::{Block as BlockT, Header as HeaderT},
traits::Verify,
- OpaqueExtrinsic,
};
use sp_timestamp;
use sp_finality_tracker;
use sp_keyring::AccountKeyring;
- use sc_service::AbstractService;
- use crate::service::{new_full, new_light};
+ use sc_service_test::TestNetNode;
+ use crate::service::{new_full_base, new_light_base};
use sp_runtime::traits::IdentifyAccount;
use sp_transaction_pool::{MaintainedTransactionPool, ChainEvent};
+ use sc_client_api::BlockBackend;
type AccountPublic = ::Signer;
- #[cfg(feature = "rhd")]
- fn test_sync() {
- use sp_core::ed25519::Pair;
-
- use {service_test, Factory};
- use sp_consensus::{BlockImportParams, BlockOrigin};
-
- let alice: Arc = Arc::new(Keyring::Alice.into());
- let bob: Arc = Arc::new(Keyring::Bob.into());
- let validators = vec![alice.public().0.into(), bob.public().0.into()];
- let keys: Vec<&ed25519::Pair> = vec![&*alice, &*bob];
- let dummy_runtime = ::tokio::runtime::Runtime::new().unwrap();
- let block_factory = |service: &::FullService| {
- let block_id = BlockId::number(service.client().chain_info().best_number);
- let parent_header = service.client().best_header(&block_id)
- .expect("db error")
- .expect("best block should exist");
-
- futures::executor::block_on(
- service.transaction_pool().maintain(
- ChainEvent::NewBlock {
- is_new_best: true,
- id: block_id.clone(),
- retracted: vec![],
- header: parent_header,
- },
- )
- );
-
- let consensus_net = ConsensusNetwork::new(service.network(), service.client().clone());
- let proposer_factory = consensus::ProposerFactory {
- client: service.client().clone(),
- transaction_pool: service.transaction_pool().clone(),
- network: consensus_net,
- force_delay: 0,
- handle: dummy_runtime.executor(),
- };
- let (proposer, _, _) = proposer_factory.init(&parent_header, &validators, alice.clone()).unwrap();
- let block = proposer.propose().expect("Error making test block");
- BlockImportParams {
- origin: BlockOrigin::File,
- justification: Vec::new(),
- internal_justification: Vec::new(),
- finalized: false,
- body: Some(block.extrinsics),
- storage_changes: None,
- header: block.header,
- auxiliary: Vec::new(),
- }
- };
- let extrinsic_factory =
- |service: &SyncService<::FullService>|
- {
- let payload = (
- 0,
- Call::Balances(BalancesCall::transfer(RawAddress::Id(bob.public().0.into()), 69.into())),
- Era::immortal(),
- service.client().genesis_hash()
- );
- let signature = alice.sign(&payload.encode()).into();
- let id = alice.public().0.into();
- let xt = UncheckedExtrinsic {
- signature: Some((RawAddress::Id(id), signature, payload.0, Era::immortal())),
- function: payload.1,
- }.encode();
- let v: Vec = Decode::decode(&mut xt.as_slice()).unwrap();
- OpaqueExtrinsic(v)
- };
- sc_service_test::sync(
- sc_chain_spec::integration_test_config(),
- |config| new_full(config),
- |mut config| new_light(config),
- block_factory,
- extrinsic_factory,
- );
- }
-
#[test]
// It is "ignored", but the node-cli ignored tests are running on the CI.
// This can be run locally with `cargo test --release -p node-cli test_sync -- --ignored`.
@@ -520,14 +492,25 @@ mod tests {
chain_spec,
|config| {
let mut setup_handles = None;
- new_full!(config, |
- block_import: &sc_consensus_babe::BabeBlockImport,
- babe_link: &sc_consensus_babe::BabeLink,
- | {
- setup_handles = Some((block_import.clone(), babe_link.clone()));
- }).map(move |(node, x)| (node, (x, setup_handles.unwrap())))
+ let (keep_alive, inherent_data_providers, client, network, transaction_pool) =
+ new_full_base(config,
+ |
+ block_import: &sc_consensus_babe::BabeBlockImport,
+ babe_link: &sc_consensus_babe::BabeLink,
+ | {
+ setup_handles = Some((block_import.clone(), babe_link.clone()));
+ }
+ )?;
+
+ let node = sc_service_test::TestNetComponents::new(
+ keep_alive, client, network, transaction_pool
+ );
+ Ok((node, (inherent_data_providers, setup_handles.unwrap())))
+ },
+ |config| {
+ let (keep_alive, _, client, network, transaction_pool) = new_light_base(config)?;
+ Ok(sc_service_test::TestNetComponents::new(keep_alive, client, network, transaction_pool))
},
- |config| new_light(config),
|service, &mut (ref inherent_data_providers, (ref mut block_import, ref babe_link))| {
let mut inherent_data = inherent_data_providers
.create_inherent_data()
@@ -543,8 +526,8 @@ mod tests {
service.transaction_pool().maintain(
ChainEvent::NewBlock {
is_new_best: true,
- id: parent_id.clone(),
- retracted: vec![],
+ hash: parent_header.hash(),
+ tree_route: None,
header: parent_header.clone(),
},
)
@@ -552,7 +535,8 @@ mod tests {
let mut proposer_factory = sc_basic_authorship::ProposerFactory::new(
service.client(),
- service.transaction_pool()
+ service.transaction_pool(),
+ None,
);
let epoch_descriptor = babe_link.epoch_changes().lock().epoch_descriptor_for_child_of(
@@ -657,16 +641,13 @@ mod tests {
signer.sign(payload)
});
let (function, extra, _) = raw_payload.deconstruct();
- let xt = UncheckedExtrinsic::new_signed(
+ index += 1;
+ UncheckedExtrinsic::new_signed(
function,
from.into(),
signature.into(),
extra,
- ).encode();
- let v: Vec = Decode::decode(&mut xt.as_slice()).unwrap();
-
- index += 1;
- OpaqueExtrinsic(v)
+ ).into()
},
);
}
@@ -676,8 +657,14 @@ mod tests {
fn test_consensus() {
sc_service_test::consensus(
crate::chain_spec::tests::integration_test_config_with_two_authorities(),
- |config| new_full(config),
- |config| new_light(config),
+ |config| {
+ let (keep_alive, _, client, network, transaction_pool) = new_full_base(config, |_, _| ())?;
+ Ok(sc_service_test::TestNetComponents::new(keep_alive, client, network, transaction_pool))
+ },
+ |config| {
+ let (keep_alive, _, client, network, transaction_pool) = new_light_base(config)?;
+ Ok(sc_service_test::TestNetComponents::new(keep_alive, client, network, transaction_pool))
+ },
vec![
"//Alice".into(),
"//Bob".into(),
diff --git a/bin/node/cli/tests/build_spec_works.rs b/bin/node/cli/tests/build_spec_works.rs
index a6fa2ad4e297139acede01547ad0c045e90bf85e..800a4a8c51e6175e2eb8fbfb1e5ddf375d30c264 100644
--- a/bin/node/cli/tests/build_spec_works.rs
+++ b/bin/node/cli/tests/build_spec_works.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/node/cli/tests/check_block_works.rs b/bin/node/cli/tests/check_block_works.rs
index 209b1122aa06221a8990bce83a45d8e01c0224cd..34078b08cf074f218865df548ee20b3b94f19d74 100644
--- a/bin/node/cli/tests/check_block_works.rs
+++ b/bin/node/cli/tests/check_block_works.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -22,7 +22,7 @@ use assert_cmd::cargo::cargo_bin;
use std::process::Command;
use tempfile::tempdir;
-mod common;
+pub mod common;
#[test]
fn check_block_works() {
diff --git a/bin/node/cli/tests/common.rs b/bin/node/cli/tests/common.rs
index a9df32d792ecfccca0b81add2147e624db2079d2..61a07dd1ca877c8814169f2babdfccd3a506ec76 100644
--- a/bin/node/cli/tests/common.rs
+++ b/bin/node/cli/tests/common.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -17,7 +17,6 @@
// along with this program. If not, see .
#![cfg(unix)]
-#![allow(dead_code)]
use std::{process::{Child, ExitStatus}, thread, time::Duration, path::Path};
use assert_cmd::cargo::cargo_bin;
diff --git a/bin/node/cli/tests/export_import_flow.rs b/bin/node/cli/tests/export_import_flow.rs
new file mode 100644
index 0000000000000000000000000000000000000000..557e722ddb7b505a13fa8daa8361838dcfd93c45
--- /dev/null
+++ b/bin/node/cli/tests/export_import_flow.rs
@@ -0,0 +1,212 @@
+// This file is part of Substrate.
+
+// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// SPDX-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 .
+
+#![cfg(unix)]
+
+use assert_cmd::cargo::cargo_bin;
+use std::{process::Command, fs, path::PathBuf};
+use tempfile::{tempdir, TempDir};
+use regex::Regex;
+
+pub mod common;
+
+fn contains_error(logged_output: &str) -> bool {
+ logged_output.contains("Error")
+}
+
+/// Helper struct to execute the export/import/revert tests.
+/// The fields are paths to a temporary directory
+struct ExportImportRevertExecutor<'a> {
+ base_path: &'a TempDir,
+ exported_blocks_file: &'a PathBuf,
+ db_path: &'a PathBuf,
+ num_exported_blocks: Option,
+}
+
+/// Format options for export / import commands.
+enum FormatOpt {
+ Json,
+ Binary,
+}
+
+/// Command corresponding to the different commands we would like to run.
+enum SubCommand {
+ ExportBlocks,
+ ImportBlocks,
+}
+
+impl ToString for SubCommand {
+ fn to_string(&self) -> String {
+ match self {
+ SubCommand::ExportBlocks => String::from("export-blocks"),
+ SubCommand::ImportBlocks => String::from("import-blocks"),
+ }
+ }
+}
+
+impl<'a> ExportImportRevertExecutor<'a> {
+ fn new(
+ base_path: &'a TempDir,
+ exported_blocks_file: &'a PathBuf,
+ db_path: &'a PathBuf
+ ) -> Self {
+ Self {
+ base_path,
+ exported_blocks_file,
+ db_path,
+ num_exported_blocks: None,
+ }
+ }
+
+ /// Helper method to run a command. Returns a string corresponding to what has been logged.
+ fn run_block_command(&self,
+ sub_command: SubCommand,
+ format_opt: FormatOpt,
+ expected_to_fail: bool
+ ) -> String {
+ let sub_command_str = sub_command.to_string();
+ // Adding "--binary" if need be.
+ let arguments: Vec<&str> = match format_opt {
+ FormatOpt::Binary => vec![&sub_command_str, "--dev", "--pruning", "archive", "--binary", "-d"],
+ FormatOpt::Json => vec![&sub_command_str, "--dev", "--pruning", "archive", "-d"],
+ };
+
+ let tmp: TempDir;
+ // Setting base_path to be a temporary folder if we are importing blocks.
+ // This allows us to make sure we are importing from scratch.
+ let base_path = match sub_command {
+ SubCommand::ExportBlocks => &self.base_path.path(),
+ SubCommand::ImportBlocks => {
+ tmp = tempdir().unwrap();
+ tmp.path()
+ }
+ };
+
+ // Running the command and capturing the output.
+ let output = Command::new(cargo_bin("substrate"))
+ .args(&arguments)
+ .arg(&base_path)
+ .arg(&self.exported_blocks_file)
+ .output()
+ .unwrap();
+
+ let logged_output = String::from_utf8_lossy(&output.stderr).to_string();
+
+ if expected_to_fail {
+ // Checking that we did indeed find an error.
+ assert!(contains_error(&logged_output), "expected to error but did not error!");
+ assert!(!output.status.success());
+ } else {
+ // Making sure no error were logged.
+ assert!(!contains_error(&logged_output), "expected not to error but error'd!");
+ assert!(output.status.success());
+ }
+
+ logged_output
+ }
+
+ /// Runs the `export-blocks` command.
+ fn run_export(&mut self, fmt_opt: FormatOpt) {
+ let log = self.run_block_command(SubCommand::ExportBlocks, fmt_opt, false);
+
+ // Using regex to find out how many block we exported.
+ let re = Regex::new(r"Exporting blocks from #\d* to #(?P\d*)").unwrap();
+ let caps = re.captures(&log).unwrap();
+ // Saving the number of blocks we've exported for further use.
+ self.num_exported_blocks = Some(caps["exported_blocks"].parse::().unwrap());
+
+ let metadata = fs::metadata(&self.exported_blocks_file).unwrap();
+ assert!(metadata.len() > 0, "file exported_blocks should not be empty");
+
+ let _ = fs::remove_dir_all(&self.db_path);
+ }
+
+ /// Runs the `import-blocks` command, asserting that an error was found or
+ /// not depending on `expected_to_fail`.
+ fn run_import(&mut self, fmt_opt: FormatOpt, expected_to_fail: bool) {
+ let log = self.run_block_command(SubCommand::ImportBlocks, fmt_opt, expected_to_fail);
+
+ if !expected_to_fail {
+ // Using regex to find out how much block we imported,
+ // and what's the best current block.
+ let re = Regex::new(r"Imported (?P\d*) blocks. Best: #(?P\d*)").unwrap();
+ let caps = re.captures(&log).expect("capture should have succeeded");
+ let imported = caps["imported"].parse::().unwrap();
+ let best = caps["best"].parse::().unwrap();
+
+ assert_eq!(
+ imported,
+ best,
+ "numbers of blocks imported and best number differs"
+ );
+ assert_eq!(
+ best,
+ self.num_exported_blocks.expect("number of exported blocks cannot be None; qed"),
+ "best block number and number of expected blocks should not differ"
+ );
+ }
+ self.num_exported_blocks = None;
+ }
+
+ /// Runs the `revert` command.
+ fn run_revert(&self) {
+ let output = Command::new(cargo_bin("substrate"))
+ .args(&["revert", "--dev", "--pruning", "archive", "-d"])
+ .arg(&self.base_path.path())
+ .output()
+ .unwrap();
+
+ let logged_output = String::from_utf8_lossy(&output.stderr).to_string();
+
+ // Reverting should not log any error.
+ assert!(!contains_error(&logged_output));
+ // Command should never fail.
+ assert!(output.status.success());
+ }
+
+ /// Helper function that runs the whole export / import / revert flow and checks for errors.
+ fn run(&mut self, export_fmt: FormatOpt, import_fmt: FormatOpt, expected_to_fail: bool) {
+ self.run_export(export_fmt);
+ self.run_import(import_fmt, expected_to_fail);
+ self.run_revert();
+ }
+}
+
+#[test]
+fn export_import_revert() {
+ let base_path = tempdir().expect("could not create a temp dir");
+ let exported_blocks_file = base_path.path().join("exported_blocks");
+ let db_path = base_path.path().join("db");
+
+ common::run_dev_node_for_a_while(base_path.path());
+
+ let mut executor = ExportImportRevertExecutor::new(
+ &base_path,
+ &exported_blocks_file,
+ &db_path,
+ );
+
+ // Binary and binary should work.
+ executor.run(FormatOpt::Binary, FormatOpt::Binary, false);
+ // Binary and JSON should fail.
+ executor.run(FormatOpt::Binary, FormatOpt::Json, true);
+ // JSON and JSON should work.
+ executor.run(FormatOpt::Json, FormatOpt::Json, false);
+ // JSON and binary should fail.
+ executor.run(FormatOpt::Json, FormatOpt::Binary, true);
+}
diff --git a/bin/node/cli/tests/import_export_and_revert_work.rs b/bin/node/cli/tests/import_export_and_revert_work.rs
deleted file mode 100644
index 26556456171ba34aa446f37348515669ecfc10e6..0000000000000000000000000000000000000000
--- a/bin/node/cli/tests/import_export_and_revert_work.rs
+++ /dev/null
@@ -1,61 +0,0 @@
-// This file is part of Substrate.
-
-// Copyright (C) 2020 Parity Technologies (UK) Ltd.
-// SPDX-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 .
-
-#![cfg(unix)]
-
-use assert_cmd::cargo::cargo_bin;
-use std::{process::Command, fs};
-use tempfile::tempdir;
-
-mod common;
-
-#[test]
-fn import_export_and_revert_work() {
- let base_path = tempdir().expect("could not create a temp dir");
- let exported_blocks = base_path.path().join("exported_blocks");
-
- common::run_dev_node_for_a_while(base_path.path());
-
- let status = Command::new(cargo_bin("substrate"))
- .args(&["export-blocks", "--dev", "--pruning", "archive", "-d"])
- .arg(base_path.path())
- .arg(&exported_blocks)
- .status()
- .unwrap();
- assert!(status.success());
-
- let metadata = fs::metadata(&exported_blocks).unwrap();
- assert!(metadata.len() > 0, "file exported_blocks should not be empty");
-
- let _ = fs::remove_dir_all(base_path.path().join("db"));
-
- let status = Command::new(cargo_bin("substrate"))
- .args(&["import-blocks", "--dev", "--pruning", "archive", "-d"])
- .arg(base_path.path())
- .arg(&exported_blocks)
- .status()
- .unwrap();
- assert!(status.success());
-
- let status = Command::new(cargo_bin("substrate"))
- .args(&["revert", "--dev", "--pruning", "archive", "-d"])
- .arg(base_path.path())
- .status()
- .unwrap();
- assert!(status.success());
-}
diff --git a/bin/node/cli/tests/inspect_works.rs b/bin/node/cli/tests/inspect_works.rs
index 67872448762fe008dc5c57cf2c950e4c9be191c6..aa9653acadba5a1db8ccd295da9d802967604a77 100644
--- a/bin/node/cli/tests/inspect_works.rs
+++ b/bin/node/cli/tests/inspect_works.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -22,7 +22,7 @@ use assert_cmd::cargo::cargo_bin;
use std::process::Command;
use tempfile::tempdir;
-mod common;
+pub mod common;
#[test]
fn inspect_works() {
diff --git a/bin/node/cli/tests/purge_chain_works.rs b/bin/node/cli/tests/purge_chain_works.rs
index b57084092daeac23d02ed22e06ac2bcdb536f1af..001bed8b136f5d2349f83fe86c557466f0b7a7ca 100644
--- a/bin/node/cli/tests/purge_chain_works.rs
+++ b/bin/node/cli/tests/purge_chain_works.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -20,7 +20,7 @@ use assert_cmd::cargo::cargo_bin;
use std::process::Command;
use tempfile::tempdir;
-mod common;
+pub mod common;
#[test]
#[cfg(unix)]
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 fb241e177ed538123f5b06741433fc3b7b316b48..bd79dcd77a49a9e6a81b28ae360ef90b3174b565 100644
--- a/bin/node/cli/tests/running_the_node_and_interrupt.rs
+++ b/bin/node/cli/tests/running_the_node_and_interrupt.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -20,7 +20,7 @@ use assert_cmd::cargo::cargo_bin;
use std::{convert::TryInto, process::Command, thread, time::Duration};
use tempfile::tempdir;
-mod common;
+pub mod common;
#[test]
#[cfg(unix)]
diff --git a/bin/node/cli/tests/temp_base_path_works.rs b/bin/node/cli/tests/temp_base_path_works.rs
new file mode 100644
index 0000000000000000000000000000000000000000..9351568d87955b130bdde3d9f82f5ce977bc2b20
--- /dev/null
+++ b/bin/node/cli/tests/temp_base_path_works.rs
@@ -0,0 +1,72 @@
+// This file is part of Substrate.
+
+// Copyright (C) 2020 Parity Technologies (UK) Ltd.
+// SPDX-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 .
+
+#![cfg(unix)]
+
+use assert_cmd::cargo::cargo_bin;
+use nix::sys::signal::{kill, Signal::SIGINT};
+use nix::unistd::Pid;
+use regex::Regex;
+use std::convert::TryInto;
+use std::io::Read;
+use std::path::PathBuf;
+use std::process::{Command, Stdio};
+use std::thread;
+use std::time::Duration;
+
+pub mod common;
+
+#[test]
+fn temp_base_path_works() {
+ let mut cmd = Command::new(cargo_bin("substrate"));
+
+ let mut cmd = cmd
+ .args(&["--dev", "--tmp"])
+ .stdout(Stdio::piped())
+ .stderr(Stdio::piped())
+ .spawn()
+ .unwrap();
+
+ // Let it produce some blocks.
+ thread::sleep(Duration::from_secs(30));
+ assert!(
+ cmd.try_wait().unwrap().is_none(),
+ "the process should still be running"
+ );
+
+ // Stop the process
+ kill(Pid::from_raw(cmd.id().try_into().unwrap()), SIGINT).unwrap();
+ assert!(common::wait_for(&mut cmd, 40)
+ .map(|x| x.success())
+ .unwrap_or_default());
+
+ // Ensure the database has been deleted
+ let mut stderr = String::new();
+ cmd.stderr.unwrap().read_to_string(&mut stderr).unwrap();
+ let re = Regex::new(r"Database: .+ at (\S+)").unwrap();
+ let db_path = PathBuf::from(
+ re.captures(stderr.as_str())
+ .unwrap()
+ .get(1)
+ .unwrap()
+ .as_str()
+ .to_string(),
+ );
+
+ assert!(!db_path.exists());
+}
diff --git a/bin/node/cli/tests/version.rs b/bin/node/cli/tests/version.rs
index 8d8b3a5ce0374f77f275acbd55c104cb4a9f3f63..c5240257f16dea779fa78f75fafd77df75cce08e 100644
--- a/bin/node/cli/tests/version.rs
+++ b/bin/node/cli/tests/version.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/node/executor/Cargo.toml b/bin/node/executor/Cargo.toml
index 78cfb3e5b4e78569d5f61e65f47fc667848b77d8..900f0cad4327ee8cd015b581b8bcba600dfba28e 100644
--- a/bin/node/executor/Cargo.toml
+++ b/bin/node/executor/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "node-executor"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
authors = ["Parity Technologies "]
description = "Substrate node implementation in Rust."
edition = "2018"
@@ -12,35 +12,35 @@ repository = "https://github.com/paritytech/substrate/"
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.0" }
-node-primitives = { version = "2.0.0-alpha.8", path = "../primitives" }
-node-runtime = { version = "2.0.0-alpha.8", path = "../runtime" }
-sc-executor = { version = "0.8.0-alpha.8", path = "../../../client/executor" }
-sp-core = { version = "2.0.0-alpha.8", path = "../../../primitives/core" }
-sp-io = { version = "2.0.0-alpha.8", path = "../../../primitives/io" }
-sp-state-machine = { version = "0.8.0-alpha.8", path = "../../../primitives/state-machine" }
-sp-trie = { version = "2.0.0-alpha.8", path = "../../../primitives/trie" }
+codec = { package = "parity-scale-codec", version = "1.3.1" }
+node-primitives = { version = "2.0.0-rc4", path = "../primitives" }
+node-runtime = { version = "2.0.0-rc4", path = "../runtime" }
+sc-executor = { version = "0.8.0-rc4", path = "../../../client/executor" }
+sp-core = { version = "2.0.0-rc4", path = "../../../primitives/core" }
+sp-io = { version = "2.0.0-rc4", path = "../../../primitives/io" }
+sp-state-machine = { version = "0.8.0-rc4", path = "../../../primitives/state-machine" }
+sp-trie = { version = "2.0.0-rc4", path = "../../../primitives/trie" }
trie-root = "0.16.0"
-frame-benchmarking = { version = "2.0.0-alpha.8", path = "../../../frame/benchmarking" }
+frame-benchmarking = { version = "2.0.0-rc4", path = "../../../frame/benchmarking" }
[dev-dependencies]
criterion = "0.3.0"
-frame-support = { version = "2.0.0-alpha.8", path = "../../../frame/support" }
-frame-system = { version = "2.0.0-alpha.8", path = "../../../frame/system" }
-node-testing = { version = "2.0.0-alpha.8", path = "../testing" }
-pallet-balances = { version = "2.0.0-alpha.8", path = "../../../frame/balances" }
-pallet-contracts = { version = "2.0.0-alpha.8", path = "../../../frame/contracts" }
-pallet-grandpa = { version = "2.0.0-alpha.8", path = "../../../frame/grandpa" }
-pallet-im-online = { version = "2.0.0-alpha.8", path = "../../../frame/im-online" }
-pallet-indices = { version = "2.0.0-alpha.8", path = "../../../frame/indices" }
-pallet-session = { version = "2.0.0-alpha.8", path = "../../../frame/session" }
-pallet-timestamp = { version = "2.0.0-alpha.8", path = "../../../frame/timestamp" }
-pallet-transaction-payment = { version = "2.0.0-alpha.8", path = "../../../frame/transaction-payment" }
-pallet-treasury = { version = "2.0.0-alpha.8", path = "../../../frame/treasury" }
-sp-application-crypto = { version = "2.0.0-alpha.8", path = "../../../primitives/application-crypto" }
-sp-runtime = { version = "2.0.0-alpha.8", path = "../../../primitives/runtime" }
-sp-externalities = { version = "0.8.0-alpha.8", path = "../../../primitives/externalities" }
-substrate-test-client = { version = "2.0.0-alpha.8", path = "../../../test-utils/client" }
+frame-support = { version = "2.0.0-rc4", path = "../../../frame/support" }
+frame-system = { version = "2.0.0-rc4", path = "../../../frame/system" }
+node-testing = { version = "2.0.0-rc4", path = "../testing" }
+pallet-balances = { version = "2.0.0-rc4", path = "../../../frame/balances" }
+pallet-contracts = { version = "2.0.0-rc4", path = "../../../frame/contracts" }
+pallet-grandpa = { version = "2.0.0-rc4", path = "../../../frame/grandpa" }
+pallet-im-online = { version = "2.0.0-rc4", path = "../../../frame/im-online" }
+pallet-indices = { version = "2.0.0-rc4", path = "../../../frame/indices" }
+pallet-session = { version = "2.0.0-rc4", path = "../../../frame/session" }
+pallet-timestamp = { version = "2.0.0-rc4", path = "../../../frame/timestamp" }
+pallet-transaction-payment = { version = "2.0.0-rc4", path = "../../../frame/transaction-payment" }
+pallet-treasury = { version = "2.0.0-rc4", path = "../../../frame/treasury" }
+sp-application-crypto = { version = "2.0.0-rc4", path = "../../../primitives/application-crypto" }
+sp-runtime = { version = "2.0.0-rc4", path = "../../../primitives/runtime" }
+sp-externalities = { version = "0.8.0-rc4", path = "../../../primitives/externalities" }
+substrate-test-client = { version = "2.0.0-rc4", path = "../../../test-utils/client" }
wabt = "0.9.2"
[features]
diff --git a/bin/node/executor/tests/basic.rs b/bin/node/executor/tests/basic.rs
index 9350c3546ff8576d6716e9ba455455bbb6486cf1..e4de98d90e94d7bd961102cea0f868926bc2f9ba 100644
--- a/bin/node/executor/tests/basic.rs
+++ b/bin/node/executor/tests/basic.rs
@@ -19,12 +19,12 @@ use codec::{Encode, Decode, Joiner};
use frame_support::{
StorageValue, StorageMap,
traits::Currency,
- weights::{GetDispatchInfo, DispatchInfo, DispatchClass, constants::ExtrinsicBaseWeight},
+ weights::{GetDispatchInfo, DispatchInfo, DispatchClass},
};
use sp_core::{NeverNativeValue, traits::Externalities, storage::well_known_keys};
use sp_runtime::{
- ApplyExtrinsicResult, Fixed128,
- traits::{Hash as HashT, Convert},
+ ApplyExtrinsicResult,
+ traits::Hash as HashT,
transaction_validity::InvalidTransaction,
};
use pallet_contracts::ContractAddressFor;
@@ -32,7 +32,7 @@ use frame_system::{self, EventRecord, Phase};
use node_runtime::{
Header, Block, UncheckedExtrinsic, CheckedExtrinsic, Call, Runtime, Balances,
- System, TransactionPayment, Event, TransactionByteFee,
+ System, TransactionPayment, Event,
constants::currency::*,
};
use node_primitives::{Balance, Hash};
@@ -49,16 +49,17 @@ use self::common::{*, sign};
/// test code paths that differ between native and wasm versions.
pub const BLOATY_CODE: &[u8] = node_runtime::WASM_BINARY_BLOATY;
-/// Default transfer fee
-fn transfer_fee(extrinsic: &E, fee_multiplier: Fixed128) -> Balance {
- let length_fee = TransactionByteFee::get() * (extrinsic.encode().len() as Balance);
-
- let base_weight = ExtrinsicBaseWeight::get();
- let base_fee = ::WeightToFee::convert(base_weight);
- let weight = default_transfer_call().get_dispatch_info().weight;
- let weight_fee = ::WeightToFee::convert(weight);
-
- base_fee + fee_multiplier.saturated_multiply_accumulate(length_fee + weight_fee)
+/// Default transfer fee. This will use the same logic that is implemented in transaction-payment module.
+///
+/// Note that reads the multiplier from storage directly, hence to get the fee of `extrinsic`
+/// at block `n`, it must be called prior to executing block `n` to do the calculation with the
+/// correct multiplier.
+fn transfer_fee(extrinsic: &E) -> Balance {
+ TransactionPayment::compute_fee(
+ extrinsic.encode().len() as u32,
+ &default_transfer_call().get_dispatch_info(),
+ 0,
+ )
}
fn xt() -> UncheckedExtrinsic {
@@ -239,7 +240,7 @@ fn successful_execution_with_native_equivalent_code_gives_ok() {
).0;
assert!(r.is_ok());
- let fm = t.execute_with(TransactionPayment::next_fee_multiplier);
+ let fees = t.execute_with(|| transfer_fee(&xt()));
let r = executor_call:: _>(
&mut t,
@@ -251,7 +252,6 @@ fn successful_execution_with_native_equivalent_code_gives_ok() {
assert!(r.is_ok());
t.execute_with(|| {
- let fees = transfer_fee(&xt(), fm);
assert_eq!(Balances::total_balance(&alice()), 42 * DOLLARS - fees);
assert_eq!(Balances::total_balance(&bob()), 69 * DOLLARS);
});
@@ -283,7 +283,7 @@ fn successful_execution_with_foreign_code_gives_ok() {
).0;
assert!(r.is_ok());
- let fm = t.execute_with(TransactionPayment::next_fee_multiplier);
+ let fees = t.execute_with(|| transfer_fee(&xt()));
let r = executor_call:: _>(
&mut t,
@@ -295,7 +295,6 @@ fn successful_execution_with_foreign_code_gives_ok() {
assert!(r.is_ok());
t.execute_with(|| {
- let fees = transfer_fee(&xt(), fm);
assert_eq!(Balances::total_balance(&alice()), 42 * DOLLARS - fees);
assert_eq!(Balances::total_balance(&bob()), 69 * DOLLARS);
});
@@ -308,7 +307,7 @@ fn full_native_block_import_works() {
let (block1, block2) = blocks();
let mut alice_last_known_balance: Balance = Default::default();
- let mut fm = t.execute_with(TransactionPayment::next_fee_multiplier);
+ let mut fees = t.execute_with(|| transfer_fee(&xt()));
executor_call:: _>(
&mut t,
@@ -319,7 +318,6 @@ fn full_native_block_import_works() {
).0.unwrap();
t.execute_with(|| {
- let fees = transfer_fee(&xt(), fm);
assert_eq!(Balances::total_balance(&alice()), 42 * DOLLARS - fees);
assert_eq!(Balances::total_balance(&bob()), 169 * DOLLARS);
alice_last_known_balance = Balances::total_balance(&alice());
@@ -358,7 +356,7 @@ fn full_native_block_import_works() {
assert_eq!(System::events(), events);
});
- fm = t.execute_with(TransactionPayment::next_fee_multiplier);
+ fees = t.execute_with(|| transfer_fee(&xt()));
executor_call:: _>(
&mut t,
@@ -369,7 +367,6 @@ fn full_native_block_import_works() {
).0.unwrap();
t.execute_with(|| {
- let fees = transfer_fee(&xt(), fm);
assert_eq!(
Balances::total_balance(&alice()),
alice_last_known_balance - 10 * DOLLARS - fees,
@@ -447,7 +444,7 @@ fn full_wasm_block_import_works() {
let (block1, block2) = blocks();
let mut alice_last_known_balance: Balance = Default::default();
- let mut fm = t.execute_with(TransactionPayment::next_fee_multiplier);
+ let mut fees = t.execute_with(|| transfer_fee(&xt()));
executor_call:: _>(
&mut t,
@@ -458,12 +455,12 @@ fn full_wasm_block_import_works() {
).0.unwrap();
t.execute_with(|| {
- assert_eq!(Balances::total_balance(&alice()), 42 * DOLLARS - transfer_fee(&xt(), fm));
+ assert_eq!(Balances::total_balance(&alice()), 42 * DOLLARS - fees);
assert_eq!(Balances::total_balance(&bob()), 169 * DOLLARS);
alice_last_known_balance = Balances::total_balance(&alice());
});
- fm = t.execute_with(TransactionPayment::next_fee_multiplier);
+ fees = t.execute_with(|| transfer_fee(&xt()));
executor_call:: _>(
&mut t,
@@ -476,11 +473,11 @@ fn full_wasm_block_import_works() {
t.execute_with(|| {
assert_eq!(
Balances::total_balance(&alice()),
- alice_last_known_balance - 10 * DOLLARS - transfer_fee(&xt(), fm),
+ alice_last_known_balance - 10 * DOLLARS - fees,
);
assert_eq!(
Balances::total_balance(&bob()),
- 179 * DOLLARS - 1 * transfer_fee(&xt(), fm),
+ 179 * DOLLARS - 1 * fees,
);
});
}
@@ -752,7 +749,7 @@ fn successful_execution_gives_ok() {
assert_eq!(Balances::total_balance(&alice()), 111 * DOLLARS);
});
- let fm = t.execute_with(TransactionPayment::next_fee_multiplier);
+ let fees = t.execute_with(|| transfer_fee(&xt()));
let r = executor_call:: _>(
&mut t,
@@ -767,7 +764,6 @@ fn successful_execution_gives_ok() {
.expect("Extrinsic failed");
t.execute_with(|| {
- let fees = transfer_fee(&xt(), fm);
assert_eq!(Balances::total_balance(&alice()), 42 * DOLLARS - fees);
assert_eq!(Balances::total_balance(&bob()), 69 * DOLLARS);
});
diff --git a/bin/node/executor/tests/fees.rs b/bin/node/executor/tests/fees.rs
index 0e55f781e78c20423df0ca1372ed70448c9c7c17..8f828263c5bdb5b17532caca29cebd935c8a7b3e 100644
--- a/bin/node/executor/tests/fees.rs
+++ b/bin/node/executor/tests/fees.rs
@@ -19,16 +19,15 @@ use codec::{Encode, Joiner};
use frame_support::{
StorageValue, StorageMap,
traits::Currency,
- weights::{GetDispatchInfo, constants::ExtrinsicBaseWeight},
+ weights::{GetDispatchInfo, constants::ExtrinsicBaseWeight, IdentityFee, WeightToFeePolynomial},
};
use sp_core::NeverNativeValue;
-use sp_runtime::{Fixed128, Perbill, traits::Convert};
+use sp_runtime::{Perbill, FixedPointNumber};
use node_runtime::{
- CheckedExtrinsic, Call, Runtime, Balances, TransactionPayment,
- TransactionByteFee, WeightFeeCoefficient,
+ CheckedExtrinsic, Call, Runtime, Balances, TransactionPayment, Multiplier,
+ TransactionByteFee,
constants::currency::*,
};
-use node_runtime::impls::LinearWeightToFee;
use node_primitives::Balance;
use node_testing::keyring::*;
@@ -39,8 +38,8 @@ use self::common::{*, sign};
fn fee_multiplier_increases_and_decreases_on_big_weight() {
let mut t = new_test_ext(COMPACT_CODE, false);
- // initial fee multiplier must be zero
- let mut prev_multiplier = Fixed128::from_parts(0);
+ // initial fee multiplier must be one.
+ let mut prev_multiplier = Multiplier::one();
t.execute_with(|| {
assert_eq!(TransactionPayment::next_fee_multiplier(), prev_multiplier);
@@ -60,7 +59,7 @@ fn fee_multiplier_increases_and_decreases_on_big_weight() {
},
CheckedExtrinsic {
signed: Some((charlie(), signed_extra(0, 0))),
- function: Call::System(frame_system::Call::fill_block(Perbill::from_percent(90))),
+ function: Call::System(frame_system::Call::fill_block(Perbill::from_percent(60))),
}
]
);
@@ -123,7 +122,7 @@ fn fee_multiplier_increases_and_decreases_on_big_weight() {
}
#[test]
-fn transaction_fee_is_correct_ultimate() {
+fn transaction_fee_is_correct() {
// This uses the exact values of substrate-node.
//
// weight of transfer call as of now: 1_000_000
@@ -181,13 +180,13 @@ fn transaction_fee_is_correct_ultimate() {
let mut balance_alice = (100 - 69) * DOLLARS;
let base_weight = ExtrinsicBaseWeight::get();
- let base_fee = LinearWeightToFee::::convert(base_weight);
+ let base_fee = IdentityFee::::calc(&base_weight);
let length_fee = TransactionByteFee::get() * (xt.clone().encode().len() as Balance);
balance_alice -= length_fee;
let weight = default_transfer_call().get_dispatch_info().weight;
- let weight_fee = LinearWeightToFee::::convert(weight);
+ let weight_fee = IdentityFee::::calc(&weight);
// we know that weight to fee multiplier is effect-less in block 1.
// current weight of transfer = 200_000_000
diff --git a/bin/node/inspect/Cargo.toml b/bin/node/inspect/Cargo.toml
index c16bb0493ae05f29eb533b8478470e99ce1735b0..e76f215a998142516e52d2996300a073a02cdf59 100644
--- a/bin/node/inspect/Cargo.toml
+++ b/bin/node/inspect/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "node-inspect"
-version = "0.8.0-alpha.8"
+version = "0.8.0-rc4"
authors = ["Parity Technologies "]
edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -11,13 +11,13 @@ repository = "https://github.com/paritytech/substrate/"
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.0" }
+codec = { package = "parity-scale-codec", version = "1.3.1" }
derive_more = "0.99"
log = "0.4.8"
-sc-cli = { version = "0.8.0-alpha.8", path = "../../../client/cli" }
-sc-client-api = { version = "2.0.0-alpha.8", path = "../../../client/api" }
-sc-service = { version = "0.8.0-alpha.8", default-features = false, path = "../../../client/service" }
-sp-blockchain = { version = "2.0.0-alpha.8", path = "../../../primitives/blockchain" }
-sp-core = { version = "2.0.0-alpha.8", path = "../../../primitives/core" }
-sp-runtime = { version = "2.0.0-alpha.8", path = "../../../primitives/runtime" }
+sc-cli = { version = "0.8.0-rc4", path = "../../../client/cli" }
+sc-client-api = { version = "2.0.0-rc4", path = "../../../client/api" }
+sc-service = { version = "0.8.0-rc4", default-features = false, path = "../../../client/service" }
+sp-blockchain = { version = "2.0.0-rc4", path = "../../../primitives/blockchain" }
+sp-core = { version = "2.0.0-rc4", path = "../../../primitives/core" }
+sp-runtime = { version = "2.0.0-rc4", path = "../../../primitives/runtime" }
structopt = "0.3.8"
diff --git a/bin/node/inspect/src/cli.rs b/bin/node/inspect/src/cli.rs
index 3a71407ab03334e34c1297b0f18d86c73a488afd..d66644bab52fa78788098e3713ceae1576f25b6c 100644
--- a/bin/node/inspect/src/cli.rs
+++ b/bin/node/inspect/src/cli.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -23,7 +23,7 @@ use sc_cli::{ImportParams, SharedParams};
use structopt::StructOpt;
/// The `inspect` command used to print decoded chain data.
-#[derive(Debug, StructOpt, Clone)]
+#[derive(Debug, StructOpt)]
pub struct InspectCmd {
#[allow(missing_docs)]
#[structopt(flatten)]
@@ -39,7 +39,7 @@ pub struct InspectCmd {
}
/// A possible inspect sub-commands.
-#[derive(Debug, StructOpt, Clone)]
+#[derive(Debug, StructOpt)]
pub enum InspectSubCmd {
/// Decode block with native version of runtime and print out the details.
Block {
diff --git a/bin/node/inspect/src/command.rs b/bin/node/inspect/src/command.rs
index c409aee86ea45040e05b974bd00837136a595536..fae6c10c7fe7846dc63e990dcf03254655467705 100644
--- a/bin/node/inspect/src/command.rs
+++ b/bin/node/inspect/src/command.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/node/inspect/src/lib.rs b/bin/node/inspect/src/lib.rs
index 5123fc595987251a9c4061e7b0b6f9b746a04ff8..02f5614b81a78044d1418d9d23f87322da2c298c 100644
--- a/bin/node/inspect/src/lib.rs
+++ b/bin/node/inspect/src/lib.rs
@@ -1,18 +1,18 @@
// This file is part of Substrate.
-//
+//
// Copyright (C) 2020 Parity Technologies (UK) Ltd.
// SPDX-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
+// 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 .
diff --git a/bin/node/primitives/Cargo.toml b/bin/node/primitives/Cargo.toml
index 96f8428a1c4fa6a50434c9549dfa91a155f2d87b..0a66336046caafc81ef7dd9a4d9da1e122617407 100644
--- a/bin/node/primitives/Cargo.toml
+++ b/bin/node/primitives/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "node-primitives"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
authors = ["Parity Technologies "]
edition = "2018"
license = "Apache-2.0"
@@ -11,14 +11,14 @@ repository = "https://github.com/paritytech/substrate/"
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] }
-frame-system = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/system" }
-sp-application-crypto = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/application-crypto" }
-sp-core = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/core" }
-sp-runtime = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/runtime" }
+codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false, features = ["derive"] }
+frame-system = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/system" }
+sp-application-crypto = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/application-crypto" }
+sp-core = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/core" }
+sp-runtime = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/runtime" }
[dev-dependencies]
-sp-serializer = { version = "2.0.0-alpha.8", path = "../../../primitives/serializer" }
+sp-serializer = { version = "2.0.0-rc4", path = "../../../primitives/serializer" }
pretty_assertions = "0.6.1"
[features]
diff --git a/bin/node/rpc-client/Cargo.toml b/bin/node/rpc-client/Cargo.toml
index 80ca0063b2cd94a50af2b4e88d141756121d6dba..2d21746f2aeb275b7db28037e59e9aa02a3c9c14 100644
--- a/bin/node/rpc-client/Cargo.toml
+++ b/bin/node/rpc-client/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "node-rpc-client"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
authors = ["Parity Technologies "]
edition = "2018"
license = "Apache-2.0"
@@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]
env_logger = "0.7.0"
futures = "0.1.29"
hyper = "0.12.35"
-jsonrpc-core-client = { version = "14.0.5", default-features = false, features = ["http"] }
+jsonrpc-core-client = { version = "14.2.0", default-features = false, features = ["http"] }
log = "0.4.8"
-node-primitives = { version = "2.0.0-alpha.8", path = "../primitives" }
-sc-rpc = { version = "2.0.0-alpha.8", path = "../../../client/rpc" }
+node-primitives = { version = "2.0.0-rc4", path = "../primitives" }
+sc-rpc = { version = "2.0.0-rc4", path = "../../../client/rpc" }
diff --git a/bin/node/rpc/Cargo.toml b/bin/node/rpc/Cargo.toml
index bd8a8bd3127287828ddf4a173bc0f1508db5aac2..95d55fab6402c9a0dff73bbbb8c19bd6fd8823ef 100644
--- a/bin/node/rpc/Cargo.toml
+++ b/bin/node/rpc/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "node-rpc"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
authors = ["Parity Technologies "]
edition = "2018"
license = "Apache-2.0"
@@ -11,22 +11,24 @@ repository = "https://github.com/paritytech/substrate/"
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
-sc-client-api = { version = "2.0.0-alpha.8", path = "../../../client/api" }
-jsonrpc-core = "14.0.3"
-node-primitives = { version = "2.0.0-alpha.8", path = "../primitives" }
-node-runtime = { version = "2.0.0-alpha.8", path = "../runtime" }
-sp-runtime = { version = "2.0.0-alpha.8", path = "../../../primitives/runtime" }
-sp-api = { version = "2.0.0-alpha.8", path = "../../../primitives/api" }
-pallet-contracts-rpc = { version = "0.8.0-alpha.8", path = "../../../frame/contracts/rpc/" }
-pallet-transaction-payment-rpc = { version = "2.0.0-alpha.8", path = "../../../frame/transaction-payment/rpc/" }
-substrate-frame-rpc-system = { version = "2.0.0-alpha.8", path = "../../../utils/frame/rpc/system" }
-sp-transaction-pool = { version = "2.0.0-alpha.8", path = "../../../primitives/transaction-pool" }
-sc-consensus-babe = { version = "0.8.0-alpha.8", path = "../../../client/consensus/babe" }
-sc-consensus-babe-rpc = { version = "0.8.0-alpha.8", path = "../../../client/consensus/babe/rpc" }
-sp-consensus-babe = { version = "0.8.0-alpha.8", path = "../../../primitives/consensus/babe" }
-sc-keystore = { version = "2.0.0-alpha.8", path = "../../../client/keystore" }
-sc-consensus-epochs = { version = "0.8.0-alpha.8", path = "../../../client/consensus/epochs" }
-sp-consensus = { version = "0.8.0-alpha.8", path = "../../../primitives/consensus/common" }
-sp-blockchain = { version = "2.0.0-alpha.8", path = "../../../primitives/blockchain" }
-sc-finality-grandpa = { version = "0.8.0-alpha.8", path = "../../../client/finality-grandpa" }
-sc-finality-grandpa-rpc = { version = "0.8.0-alpha.8", path = "../../../client/finality-grandpa/rpc" }
+sc-client-api = { version = "2.0.0-rc4", path = "../../../client/api" }
+jsonrpc-core = "14.2.0"
+node-primitives = { version = "2.0.0-rc4", path = "../primitives" }
+node-runtime = { version = "2.0.0-rc4", path = "../runtime" }
+sp-runtime = { version = "2.0.0-rc4", path = "../../../primitives/runtime" }
+sp-api = { version = "2.0.0-rc4", path = "../../../primitives/api" }
+pallet-contracts-rpc = { version = "0.8.0-rc4", path = "../../../frame/contracts/rpc/" }
+pallet-transaction-payment-rpc = { version = "2.0.0-rc4", path = "../../../frame/transaction-payment/rpc/" }
+substrate-frame-rpc-system = { version = "2.0.0-rc4", path = "../../../utils/frame/rpc/system" }
+sp-transaction-pool = { version = "2.0.0-rc4", path = "../../../primitives/transaction-pool" }
+sc-consensus-babe = { version = "0.8.0-rc4", path = "../../../client/consensus/babe" }
+sc-consensus-babe-rpc = { version = "0.8.0-rc4", path = "../../../client/consensus/babe/rpc" }
+sp-consensus-babe = { version = "0.8.0-rc4", path = "../../../primitives/consensus/babe" }
+sc-keystore = { version = "2.0.0-rc4", path = "../../../client/keystore" }
+sc-consensus-epochs = { version = "0.8.0-rc4", path = "../../../client/consensus/epochs" }
+sp-consensus = { version = "0.8.0-rc4", path = "../../../primitives/consensus/common" }
+sp-blockchain = { version = "2.0.0-rc4", path = "../../../primitives/blockchain" }
+sc-finality-grandpa = { version = "0.8.0-rc4", path = "../../../client/finality-grandpa" }
+sc-finality-grandpa-rpc = { version = "0.8.0-rc4", path = "../../../client/finality-grandpa/rpc" }
+sc-rpc-api = { version = "0.8.0-rc4", path = "../../../client/rpc-api" }
+sp-block-builder = { version = "2.0.0-rc4", path = "../../../primitives/block-builder" }
diff --git a/bin/node/rpc/src/lib.rs b/bin/node/rpc/src/lib.rs
index 02cb44d4020f761fd8d3f2923b14ef5311c5c4c4..9b6b5991748f96e60ff0ea20d126faaa315637fb 100644
--- a/bin/node/rpc/src/lib.rs
+++ b/bin/node/rpc/src/lib.rs
@@ -30,7 +30,7 @@
#![warn(missing_docs)]
-use std::{sync::Arc, fmt};
+use std::sync::Arc;
use node_primitives::{Block, BlockNumber, AccountId, Index, Balance, Hash};
use node_runtime::UncheckedExtrinsic;
@@ -42,9 +42,11 @@ use sc_keystore::KeyStorePtr;
use sp_consensus_babe::BabeApi;
use sc_consensus_epochs::SharedEpochChanges;
use sc_consensus_babe::{Config, Epoch};
-use sc_consensus_babe_rpc::BabeRPCHandler;
+use sc_consensus_babe_rpc::BabeRpcHandler;
use sc_finality_grandpa::{SharedVoterState, SharedAuthoritySet};
use sc_finality_grandpa_rpc::GrandpaRpcHandler;
+use sc_rpc_api::DenyUnsafe;
+use sp_block_builder::BlockBuilder;
/// Light client extra dependencies.
pub struct LightDeps {
@@ -84,6 +86,8 @@ pub struct FullDeps {
pub pool: Arc,
/// The SelectChain Strategy
pub select_chain: SC,
+ /// Whether to deny unsafe calls
+ pub deny_unsafe: DenyUnsafe,
/// BABE specific dependencies.
pub babe: BabeDeps,
/// GRANDPA specific dependencies.
@@ -101,7 +105,7 @@ pub fn create_full(
C::Api: pallet_contracts_rpc::ContractsRuntimeApi,
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi,
C::Api: BabeApi,
- ::Error: fmt::Debug,
+ C::Api: BlockBuilder,
P: TransactionPool + 'static,
M: jsonrpc_core::Metadata + Default,
SC: SelectChain +'static,
@@ -115,6 +119,7 @@ pub fn create_full(
client,
pool,
select_chain,
+ deny_unsafe,
babe,
grandpa,
} = deps;
@@ -129,7 +134,7 @@ pub fn create_full(
} = grandpa;
io.extend_with(
- SystemApi::to_delegate(FullSystem::new(client.clone(), pool))
+ SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe))
);
// Making synchronous calls in light client freezes the browser currently,
// more context: https://github.com/paritytech/substrate/pull/3480
@@ -142,7 +147,14 @@ pub fn create_full(
);
io.extend_with(
sc_consensus_babe_rpc::BabeApi::to_delegate(
- BabeRPCHandler::new(client, shared_epoch_changes, keystore, babe_config, select_chain)
+ BabeRpcHandler::new(
+ client,
+ shared_epoch_changes,
+ keystore,
+ babe_config,
+ select_chain,
+ deny_unsafe,
+ ),
)
);
io.extend_with(
@@ -174,7 +186,7 @@ pub fn create_light(
} = deps;
let mut io = jsonrpc_core::IoHandler::default();
io.extend_with(
- SystemApi::::to_delegate(LightSystem::new(client, remote_blockchain, fetcher, pool))
+ SystemApi::::to_delegate(LightSystem::new(client, remote_blockchain, fetcher, pool))
);
io
diff --git a/bin/node/runtime/Cargo.toml b/bin/node/runtime/Cargo.toml
index afcc63d5d71a58b18e84f1327659b9cdb1f83548..568b1afb5eb3d1990ef88947e335e3e942a1098d 100644
--- a/bin/node/runtime/Cargo.toml
+++ b/bin/node/runtime/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "node-runtime"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
authors = ["Parity Technologies "]
edition = "2018"
build = "build.rs"
@@ -14,74 +14,77 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
# third-party dependencies
-codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] }
+codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false, features = ["derive"] }
integer-sqrt = { version = "0.1.2" }
serde = { version = "1.0.102", optional = true }
static_assertions = "1.1.0"
+hex-literal = { version = "0.2.1", optional = true }
# primitives
-sp-authority-discovery = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/authority-discovery" }
-sp-consensus-babe = { version = "0.8.0-alpha.8", default-features = false, path = "../../../primitives/consensus/babe" }
-sp-block-builder = { path = "../../../primitives/block-builder", default-features = false, version = "2.0.0-alpha.8"}
-sp-inherents = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/inherents" }
-node-primitives = { version = "2.0.0-alpha.8", default-features = false, path = "../primitives" }
-sp-offchain = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/offchain" }
-sp-core = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/core" }
-sp-std = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/std" }
-sp-api = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/api" }
-sp-runtime = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/runtime" }
-sp-staking = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/staking" }
-sp-keyring = { version = "2.0.0-alpha.8", optional = true, path = "../../../primitives/keyring" }
-sp-session = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/session" }
-sp-transaction-pool = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/transaction-pool" }
-sp-version = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/version" }
+sp-authority-discovery = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/authority-discovery" }
+sp-consensus-babe = { version = "0.8.0-rc4", default-features = false, path = "../../../primitives/consensus/babe" }
+sp-block-builder = { path = "../../../primitives/block-builder", default-features = false, version = "2.0.0-rc4"}
+sp-inherents = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/inherents" }
+node-primitives = { version = "2.0.0-rc4", default-features = false, path = "../primitives" }
+sp-offchain = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/offchain" }
+sp-core = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/core" }
+sp-std = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/std" }
+sp-api = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/api" }
+sp-runtime = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/runtime" }
+sp-staking = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/staking" }
+sp-keyring = { version = "2.0.0-rc4", optional = true, path = "../../../primitives/keyring" }
+sp-session = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/session" }
+sp-transaction-pool = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/transaction-pool" }
+sp-version = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/version" }
# frame dependencies
-frame-executive = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/executive" }
-frame-benchmarking = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/benchmarking", optional = true }
-frame-support = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/support" }
-frame-system = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/system" }
-frame-system-benchmarking = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/system/benchmarking", optional = true }
-frame-system-rpc-runtime-api = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/system/rpc/runtime-api/" }
-pallet-authority-discovery = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/authority-discovery" }
-pallet-authorship = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/authorship" }
-pallet-babe = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/babe" }
-pallet-balances = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/balances" }
-pallet-collective = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/collective" }
-pallet-contracts = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/contracts" }
-pallet-contracts-primitives = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/contracts/common/" }
-pallet-contracts-rpc-runtime-api = { version = "0.8.0-alpha.8", default-features = false, path = "../../../frame/contracts/rpc/runtime-api/" }
-pallet-democracy = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/democracy" }
-pallet-elections-phragmen = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/elections-phragmen" }
-pallet-finality-tracker = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/finality-tracker" }
-pallet-grandpa = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/grandpa" }
-pallet-im-online = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/im-online" }
-pallet-indices = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/indices" }
-pallet-identity = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/identity" }
-pallet-membership = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/membership" }
-pallet-offences = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/offences" }
-pallet-offences-benchmarking = { version = "2.0.0-alpha.8", path = "../../../frame/offences/benchmarking", default-features = false, optional = true }
-pallet-randomness-collective-flip = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/randomness-collective-flip" }
-pallet-recovery = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/recovery" }
-pallet-session = { version = "2.0.0-alpha.8", features = ["historical"], path = "../../../frame/session", default-features = false }
-pallet-session-benchmarking = { version = "2.0.0-alpha.8", path = "../../../frame/session/benchmarking", default-features = false, optional = true }
-pallet-staking = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/staking" }
-pallet-staking-reward-curve = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/staking/reward-curve" }
-pallet-scheduler = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/scheduler" }
-pallet-society = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/society" }
-pallet-sudo = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/sudo" }
-pallet-timestamp = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/timestamp" }
-pallet-treasury = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/treasury" }
-pallet-utility = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/utility" }
-pallet-transaction-payment = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/transaction-payment" }
-pallet-transaction-payment-rpc-runtime-api = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/transaction-payment/rpc/runtime-api/" }
-pallet-vesting = { version = "2.0.0-alpha.8", default-features = false, path = "../../../frame/vesting" }
+frame-executive = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/executive" }
+frame-benchmarking = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/benchmarking", optional = true }
+frame-support = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/support" }
+frame-system = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/system" }
+frame-system-benchmarking = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/system/benchmarking", optional = true }
+frame-system-rpc-runtime-api = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/system/rpc/runtime-api/" }
+pallet-authority-discovery = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/authority-discovery" }
+pallet-authorship = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/authorship" }
+pallet-babe = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/babe" }
+pallet-balances = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/balances" }
+pallet-collective = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/collective" }
+pallet-contracts = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/contracts" }
+pallet-contracts-primitives = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/contracts/common/" }
+pallet-contracts-rpc-runtime-api = { version = "0.8.0-rc4", default-features = false, path = "../../../frame/contracts/rpc/runtime-api/" }
+pallet-democracy = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/democracy" }
+pallet-elections-phragmen = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/elections-phragmen" }
+pallet-finality-tracker = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/finality-tracker" }
+pallet-grandpa = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/grandpa" }
+pallet-im-online = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/im-online" }
+pallet-indices = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/indices" }
+pallet-identity = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/identity" }
+pallet-membership = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/membership" }
+pallet-multisig = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/multisig" }
+pallet-offences = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/offences" }
+pallet-offences-benchmarking = { version = "2.0.0-rc4", path = "../../../frame/offences/benchmarking", default-features = false, optional = true }
+pallet-proxy = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/proxy" }
+pallet-randomness-collective-flip = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/randomness-collective-flip" }
+pallet-recovery = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/recovery" }
+pallet-session = { version = "2.0.0-rc4", features = ["historical"], path = "../../../frame/session", default-features = false }
+pallet-session-benchmarking = { version = "2.0.0-rc4", path = "../../../frame/session/benchmarking", default-features = false, optional = true }
+pallet-staking = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/staking" }
+pallet-staking-reward-curve = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/staking/reward-curve" }
+pallet-scheduler = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/scheduler" }
+pallet-society = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/society" }
+pallet-sudo = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/sudo" }
+pallet-timestamp = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/timestamp" }
+pallet-treasury = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/treasury" }
+pallet-utility = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/utility" }
+pallet-transaction-payment = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/transaction-payment" }
+pallet-transaction-payment-rpc-runtime-api = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/transaction-payment/rpc/runtime-api/" }
+pallet-vesting = { version = "2.0.0-rc4", default-features = false, path = "../../../frame/vesting" }
[build-dependencies]
wasm-builder-runner = { version = "1.0.5", package = "substrate-wasm-builder-runner", path = "../../../utils/wasm-builder-runner" }
[dev-dependencies]
-sp-io = { version = "2.0.0-alpha.8", path = "../../../primitives/io" }
+sp-io = { version = "2.0.0-rc4", path = "../../../primitives/io" }
[features]
default = ["std"]
@@ -107,10 +110,13 @@ std = [
"pallet-indices/std",
"sp-inherents/std",
"pallet-membership/std",
+ "pallet-multisig/std",
"pallet-identity/std",
+ "pallet-scheduler/std",
"node-primitives/std",
"sp-offchain/std",
"pallet-offences/std",
+ "pallet-proxy/std",
"sp-core/std",
"pallet-randomness-collective-flip/std",
"sp-std/std",
@@ -149,6 +155,9 @@ runtime-benchmarks = [
"pallet-elections-phragmen/runtime-benchmarks",
"pallet-identity/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
+ "pallet-indices/runtime-benchmarks",
+ "pallet-multisig/runtime-benchmarks",
+ "pallet-proxy/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
"pallet-society/runtime-benchmarks",
"pallet-staking/runtime-benchmarks",
@@ -159,4 +168,5 @@ runtime-benchmarks = [
"pallet-offences-benchmarking",
"pallet-session-benchmarking",
"frame-system-benchmarking",
+ "hex-literal",
]
diff --git a/bin/node/runtime/build.rs b/bin/node/runtime/build.rs
index cd5db582f385c8e0310a9dcbad07857df566539d..a4f323566006cf7c003cec2e413e1d23ecffead1 100644
--- a/bin/node/runtime/build.rs
+++ b/bin/node/runtime/build.rs
@@ -20,7 +20,7 @@ use wasm_builder_runner::WasmBuilder;
fn main() {
WasmBuilder::new()
.with_current_project()
- .with_wasm_builder_from_crates_or_path("1.0.9", "../../../utils/wasm-builder")
+ .with_wasm_builder_from_crates_or_path("1.0.11", "../../../utils/wasm-builder")
.export_heap_base()
.import_memory()
.build()
diff --git a/bin/node/runtime/src/constants.rs b/bin/node/runtime/src/constants.rs
index 45f1ab19a450ecc69cbe54de6ba09b32428dafab..8e87d61c1e6b597ccb0eb114351befe969264ddf 100644
--- a/bin/node/runtime/src/constants.rs
+++ b/bin/node/runtime/src/constants.rs
@@ -24,6 +24,10 @@ pub mod currency {
pub const MILLICENTS: Balance = 1_000_000_000;
pub const CENTS: Balance = 1_000 * MILLICENTS; // assume this is worth about a cent.
pub const DOLLARS: Balance = 100 * CENTS;
+
+ pub const fn deposit(items: u32, bytes: u32) -> Balance {
+ items as Balance * 15 * CENTS + (bytes as Balance) * 6 * CENTS
+ }
}
/// Time.
diff --git a/bin/node/runtime/src/impls.rs b/bin/node/runtime/src/impls.rs
index ef994392b52c0a882096d79325414964f76c189a..039093ddee69700594b70200595a39b07f7e7fa4 100644
--- a/bin/node/runtime/src/impls.rs
+++ b/bin/node/runtime/src/impls.rs
@@ -17,12 +17,10 @@
//! Some configurable implementations as associated type for the substrate runtime.
-use core::num::NonZeroI128;
use node_primitives::Balance;
-use sp_runtime::traits::{Convert, Saturating};
-use sp_runtime::{Fixed128, Perquintill};
-use frame_support::{traits::{OnUnbalanced, Currency, Get}, weights::Weight};
-use crate::{Balances, System, Authorship, MaximumBlockWeight, NegativeImbalance};
+use sp_runtime::traits::Convert;
+use frame_support::traits::{OnUnbalanced, Currency};
+use crate::{Balances, Authorship, NegativeImbalance};
pub struct Author;
impl OnUnbalanced for Author {
@@ -47,106 +45,63 @@ impl Convert for CurrencyToVoteHandler {
fn convert(x: u128) -> Balance { x * Self::factor() }
}
-/// Convert from weight to balance via a simple coefficient multiplication
-/// The associated type C encapsulates a constant in units of balance per weight
-pub struct LinearWeightToFee(sp_std::marker::PhantomData);
-
-impl> Convert for LinearWeightToFee {
- fn convert(w: Weight) -> Balance {
- // setting this to zero will disable the weight fee.
- let coefficient = C::get();
- Balance::from(w).saturating_mul(coefficient)
- }
-}
-
-/// Update the given multiplier based on the following formula
-///
-/// diff = (previous_block_weight - target_weight)/max_weight
-/// v = 0.00004
-/// next_weight = weight * (1 + (v * diff) + (v * diff)^2 / 2)
-///
-/// Where `target_weight` must be given as the `Get` implementation of the `T` generic type.
-/// https://research.web3.foundation/en/latest/polkadot/Token%20Economics/#relay-chain-transaction-fees
-pub struct TargetedFeeAdjustment(sp_std::marker::PhantomData);
-
-impl> Convert for TargetedFeeAdjustment {
- fn convert(multiplier: Fixed128) -> Fixed128 {
- let max_weight = MaximumBlockWeight::get();
- let block_weight = System::all_extrinsics_weight().total().min(max_weight);
- let target_weight = (T::get() * max_weight) as u128;
- let block_weight = block_weight as u128;
-
- // determines if the first_term is positive
- let positive = block_weight >= target_weight;
- let diff_abs = block_weight.max(target_weight) - block_weight.min(target_weight);
- // safe, diff_abs cannot exceed u64 and it can always be computed safely even with the lossy
- // `Fixed128::from_rational`.
- let diff = Fixed128::from_rational(
- diff_abs as i128,
- NonZeroI128::new(max_weight.max(1) as i128).unwrap(),
- );
- let diff_squared = diff.saturating_mul(diff);
-
- // 0.00004 = 4/100_000 = 40_000/10^9
- let v = Fixed128::from_rational(4, NonZeroI128::new(100_000).unwrap());
- // 0.00004^2 = 16/10^10 Taking the future /2 into account... 8/10^10
- let v_squared_2 = Fixed128::from_rational(8, NonZeroI128::new(10_000_000_000).unwrap());
-
- let first_term = v.saturating_mul(diff);
- let second_term = v_squared_2.saturating_mul(diff_squared);
-
- if positive {
- // Note: this is merely bounded by how big the multiplier and the inner value can go,
- // not by any economical reasoning.
- let excess = first_term.saturating_add(second_term);
- multiplier.saturating_add(excess)
- } else {
- // Defensive-only: first_term > second_term. Safe subtraction.
- let negative = first_term.saturating_sub(second_term);
- multiplier.saturating_sub(negative)
- // despite the fact that apply_to saturates weight (final fee cannot go below 0)
- // it is crucially important to stop here and don't further reduce the weight fee
- // multiplier. While at -1, it means that the network is so un-congested that all
- // transactions have no weight fee. We stop here and only increase if the network
- // became more busy.
- .max(Fixed128::from_natural(-1))
- }
- }
-}
-
#[cfg(test)]
-mod tests {
+mod multiplier_tests {
use super::*;
- use sp_runtime::assert_eq_error_rate;
- use crate::{MaximumBlockWeight, AvailableBlockRatio, Runtime};
- use crate::{constants::currency::*, TransactionPayment, TargetBlockFullness};
- use frame_support::weights::Weight;
- use core::num::NonZeroI128;
+ use sp_runtime::{assert_eq_error_rate, FixedPointNumber};
+ use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment};
+
+ use crate::{
+ constants::{currency::*, time::*},
+ TransactionPayment, MaximumBlockWeight, AvailableBlockRatio, Runtime, TargetBlockFullness,
+ AdjustmentVariable, System, MinimumMultiplier,
+ };
+ use frame_support::weights::{Weight, WeightToFeePolynomial};
fn max() -> Weight {
- MaximumBlockWeight::get()
+ AvailableBlockRatio::get() * MaximumBlockWeight::get()
+ }
+
+ fn min_multiplier() -> Multiplier {
+ MinimumMultiplier::get()
}
fn target() -> Weight {
TargetBlockFullness::get() * max()
}
- // poc reference implementation.
- fn fee_multiplier_update(block_weight: Weight, previous: Fixed128) -> Fixed128 {
+ // update based on runtime impl.
+ fn runtime_multiplier_update(fm: Multiplier) -> Multiplier {
+ TargetedFeeAdjustment::<
+ Runtime,
+ TargetBlockFullness,
+ AdjustmentVariable,
+ MinimumMultiplier,
+ >::convert(fm)
+ }
+
+ // update based on reference impl.
+ fn truth_value_update(block_weight: Weight, previous: Multiplier) -> Multiplier {
+ let accuracy = Multiplier::accuracy() as f64;
+ let previous_float = previous.into_inner() as f64 / accuracy;
+ // bump if it is zero.
+ let previous_float = previous_float.max(min_multiplier().into_inner() as f64 / accuracy);
+
// maximum tx weight
let m = max() as f64;
// block weight always truncated to max weight
let block_weight = (block_weight as f64).min(m);
- let v: f64 = 0.00004;
+ let v: f64 = AdjustmentVariable::get().to_fraction();
// Ideal saturation in terms of weight
let ss = target() as f64;
// Current saturation in terms of weight
let s = block_weight;
- let fm = v * (s/m - ss/m) + v.powi(2) * (s/m - ss/m).powi(2) / 2.0;
- let addition_fm = Fixed128::from_parts((fm * Fixed128::accuracy() as f64).round() as i128);
- previous.saturating_add(addition_fm)
+ let t1 = v * (s/m - ss/m);
+ let t2 = v.powi(2) * (s/m - ss/m).powi(2) / 2.0;
+ let next_float = previous_float * (1.0 + t1 + t2);
+ Multiplier::from_fraction(next_float)
}
fn run_with_system_weight(w: Weight, assertions: F) where F: Fn() -> () {
@@ -159,11 +114,12 @@ mod tests {
}
#[test]
- fn fee_multiplier_update_poc_works() {
- let fm = Fixed128::from_rational(0, NonZeroI128::new(1).unwrap());
+ fn truth_value_update_poc_works() {
+ let fm = Multiplier::saturating_from_rational(1, 2);
let test_set = vec![
(0, fm.clone()),
(100, fm.clone()),
+ (1000, fm.clone()),
(target(), fm.clone()),
(max() / 2, fm.clone()),
(max(), fm.clone()),
@@ -171,37 +127,71 @@ mod tests {
test_set.into_iter().for_each(|(w, fm)| {
run_with_system_weight(w, || {
assert_eq_error_rate!(
- fee_multiplier_update(w, fm),
- TargetedFeeAdjustment::::convert(fm),
- // Error is only 1 in 10^18
- Fixed128::from_parts(1),
+ truth_value_update(w, fm),
+ runtime_multiplier_update(fm),
+ // Error is only 1 in 100^18
+ Multiplier::from_inner(100),
);
})
})
}
#[test]
- fn empty_chain_simulation() {
- // just a few txs per_block.
- let block_weight = 0;
- run_with_system_weight(block_weight, || {
- let mut fm = Fixed128::default();
+ fn multiplier_can_grow_from_zero() {
+ // if the min is too small, then this will not change, and we are doomed forever.
+ // the weight is 1/100th bigger than target.
+ run_with_system_weight(target() * 101 / 100, || {
+ let next = runtime_multiplier_update(min_multiplier());
+ assert!(next > min_multiplier(), "{:?} !>= {:?}", next, min_multiplier());
+ })
+ }
+
+ #[test]
+ fn multiplier_cannot_go_below_limit() {
+ // will not go any further below even if block is empty.
+ run_with_system_weight(0, || {
+ let next = runtime_multiplier_update(min_multiplier());
+ assert_eq!(next, min_multiplier());
+ })
+ }
+
+ #[test]
+ fn time_to_reach_zero() {
+ // blocks per 24h in substrate-node: 28,800 (k)
+ // s* = 0.1875
+ // The bound from the research in an empty chain is:
+ // v <~ (p / k(0 - s*))
+ // p > v * k * -0.1875
+ // to get p == -1 we'd need
+ // -1 > 0.00001 * k * -0.1875
+ // 1 < 0.00001 * k * 0.1875
+ // 10^9 / 1875 < k
+ // k > 533_333 ~ 18,5 days.
+ run_with_system_weight(0, || {
+ // start from 1, the default.
+ let mut fm = Multiplier::one();
let mut iterations: u64 = 0;
loop {
- let next = TargetedFeeAdjustment::::convert(fm);
+ let next = runtime_multiplier_update(fm);
fm = next;
- if fm == Fixed128::from_natural(-1) { break; }
+ if fm == min_multiplier() { break; }
iterations += 1;
}
- println!("iteration {}, new fm = {:?}. Weight fee is now zero", iterations, fm);
- assert!(iterations > 50_000, "This assertion is just a warning; Don't panic. \
- Current substrate/polkadot node are configured with a _slow adjusting fee_ \
- mechanism. Hence, it is really unlikely that fees collapse to zero even on an \
- empty chain in less than at least of couple of thousands of empty blocks. But this \
- simulation indicates that fees collapsed to zero after {} almost-empty blocks. \
- Check it",
- iterations,
- );
+ assert!(iterations > 533_333);
+ })
+ }
+
+ #[test]
+ fn min_change_per_day() {
+ run_with_system_weight(max(), || {
+ let mut fm = Multiplier::one();
+ // See the example in the doc of `TargetedFeeAdjustment`. are at least 0.234, hence
+ // `fm > 1.234`.
+ for _ in 0..DAYS {
+ let next = runtime_multiplier_update(fm);
+ fm = next;
+ }
+ assert!(fm > Multiplier::saturating_from_rational(1234, 1000));
})
}
@@ -213,23 +203,24 @@ mod tests {
// almost full. The entire quota of normal transactions is taken.
let block_weight = AvailableBlockRatio::get() * max() - 100;
- // Default substrate minimum.
- let tx_weight = 10_000;
+ // Default substrate weight.
+ let tx_weight = frame_support::weights::constants::ExtrinsicBaseWeight::get();
run_with_system_weight(block_weight, || {
// initial value configured on module
- let mut fm = Fixed128::default();
+ let mut fm = Multiplier::one();
assert_eq!(fm, TransactionPayment::next_fee_multiplier());
let mut iterations: u64 = 0;
loop {
- let next = TargetedFeeAdjustment::::convert(fm);
+ let next = runtime_multiplier_update(fm);
// if no change, panic. This should never happen in this case.
if fm == next { panic!("The fee should ever increase"); }
fm = next;
iterations += 1;
- let fee = ::WeightToFee::convert(tx_weight);
- let adjusted_fee = fm.saturated_multiply_accumulate(fee);
+ let fee =
+ ::WeightToFee::calc(&tx_weight);
+ let adjusted_fee = fm.saturating_mul_acc_int(fee);
println!(
"iteration {}, new fm = {:?}. Fee at this point is: {} units / {} millicents, \
{} cents, {} dollars",
@@ -246,95 +237,86 @@ mod tests {
#[test]
fn stateless_weight_mul() {
- // This test will show that heavy blocks have a weight multiplier greater than 0
- // and light blocks will have a weight multiplier less than 0.
+ let fm = Multiplier::saturating_from_rational(1, 2);
run_with_system_weight(target() / 4, || {
- // `fee_multiplier_update` is enough as it is the absolute truth value.
- let next = TargetedFeeAdjustment::::convert(Fixed128::default());
- assert_eq!(
+ let next = runtime_multiplier_update(fm);
+ assert_eq_error_rate!(
next,
- fee_multiplier_update(target() / 4 ,Fixed128::default())
+ truth_value_update(target() / 4 , fm),
+ Multiplier::from_inner(100),
);
- // Light block. Fee is reduced a little.
- assert!(next < Fixed128::zero())
+ // Light block. Multiplier is reduced a little.
+ assert!(next < fm);
});
+
run_with_system_weight(target() / 2, || {
- let next = TargetedFeeAdjustment::::convert(Fixed128::default());
- assert_eq!(
+ let next = runtime_multiplier_update(fm);
+ assert_eq_error_rate!(
next,
- fee_multiplier_update(target() / 2 ,Fixed128::default())
+ truth_value_update(target() / 2 , fm),
+ Multiplier::from_inner(100),
);
-
- // Light block. Fee is reduced a little.
- assert!(next < Fixed128::zero())
+ // Light block. Multiplier is reduced a little.
+ assert!(next < fm);
});
run_with_system_weight(target(), || {
- // ideal. Original fee. No changes.
- let next = TargetedFeeAdjustment::::convert(Fixed128::default());
- assert_eq!(next, Fixed128::zero())
+ let next = runtime_multiplier_update(fm);
+ assert_eq_error_rate!(
+ next,
+ truth_value_update(target(), fm),
+ Multiplier::from_inner(100),
+ );
+ // ideal. No changes.
+ assert_eq!(next, fm)
});
run_with_system_weight(target() * 2, || {
// More than ideal. Fee is increased.
- let next = TargetedFeeAdjustment::::convert(Fixed128::default());
- assert_eq!(
+ let next = runtime_multiplier_update(fm);
+ assert_eq_error_rate!(
next,
- fee_multiplier_update(target() * 2 ,Fixed128::default())
+ truth_value_update(target() * 2 , fm),
+ Multiplier::from_inner(100),
);
// Heavy block. Fee is increased a little.
- assert!(next > Fixed128::zero())
+ assert!(next > fm);
});
}
#[test]
- fn stateful_weight_mul_grow_to_infinity() {
+ fn weight_mul_grow_on_big_block() {
run_with_system_weight(target() * 2, || {
- let mut original = Fixed128::default();
- let mut next = Fixed128::default();
+ let mut original = Multiplier::zero();
+ let mut next = Multiplier::default();
(0..1_000).for_each(|_| {
- next = TargetedFeeAdjustment::::convert(original);
- assert_eq!(
+ next = runtime_multiplier_update(original);
+ assert_eq_error_rate!(
next,
- fee_multiplier_update(target() * 2, original),
+ truth_value_update(target() * 2, original),
+ Multiplier::from_inner(100),
);
// must always increase
- assert!(next > original);
+ assert!(next > original, "{:?} !>= {:?}", next, original);
original = next;
});
});
}
#[test]
- fn stateful_weight_mil_collapse_to_minus_one() {
- run_with_system_weight(0, || {
- let mut original = Fixed128::default(); // 0
+ fn weight_mul_decrease_on_small_block() {
+ run_with_system_weight(target() / 2, || {
+ let mut original = Multiplier::saturating_from_rational(1, 2);
let mut next;
- // decreases
- next = TargetedFeeAdjustment::::convert(original);
- assert_eq!(
- next,
- fee_multiplier_update(0, original),
- );
- assert!(next < original);
- original = next;
-
- // keeps decreasing
- next = TargetedFeeAdjustment::::convert(original);
- assert_eq!(
- next,
- fee_multiplier_update(0, original),
- );
- assert!(next < original);
-
- // ... stops going down at -1
- assert_eq!(
- TargetedFeeAdjustment::::convert(Fixed128::from_natural(-1)),
- Fixed128::from_natural(-1)
- );
+ for _ in 0..100 {
+ // decreases
+ next = runtime_multiplier_update(original);
+ assert!(next < original, "{:?} !<= {:?}", next, original);
+ original = next;
+ }
})
}
@@ -342,7 +324,7 @@ mod tests {
fn weight_to_fee_should_not_overflow_on_large_weights() {
let kb = 1024 as Weight;
let mb = kb * kb;
- let max_fm = Fixed128::from_natural(i128::max_value());
+ let max_fm = Multiplier::saturating_from_integer(i128::max_value());
// check that for all values it can compute, correctly.
vec![
@@ -363,9 +345,9 @@ mod tests {
Weight::max_value(),
].into_iter().for_each(|i| {
run_with_system_weight(i, || {
- let next = TargetedFeeAdjustment::::convert(Fixed128::default());
- let truth = fee_multiplier_update(i, Fixed128::default());
- assert_eq_error_rate!(truth, next, Fixed128::from_parts(50_000_000));
+ let next = runtime_multiplier_update(Multiplier::one());
+ let truth = truth_value_update(i, Multiplier::one());
+ assert_eq_error_rate!(truth, next, Multiplier::from_inner(50_000_000));
});
});
@@ -375,7 +357,7 @@ mod tests {
.into_iter()
.for_each(|i| {
run_with_system_weight(i, || {
- let fm = TargetedFeeAdjustment::::convert(max_fm);
+ let fm = runtime_multiplier_update(max_fm);
// won't grow. The convert saturates everything.
assert_eq!(fm, max_fm);
})
diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs
index bae2e587542dd0c9e35308aaa000b38acadb3157..39b63f2ed2568d147c0c5fc4f91b6f1c0ba10401 100644
--- a/bin/node/runtime/src/lib.rs
+++ b/bin/node/runtime/src/lib.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -23,14 +23,18 @@
#![recursion_limit="256"]
use sp_std::prelude::*;
+
use frame_support::{
- construct_runtime, parameter_types, debug,
+ construct_runtime, parameter_types, debug, RuntimeDebug,
weights::{
- Weight,
+ Weight, IdentityFee,
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
},
traits::{Currency, Imbalance, KeyOwnerProofSystem, OnUnbalanced, Randomness, LockIdentifier},
};
+use frame_system::{EnsureRoot, EnsureOneOf};
+use frame_support::traits::InstanceFilter;
+use codec::{Encode, Decode};
use sp_core::{
crypto::KeyTypeId,
u32_trait::{_1, _2, _3, _4},
@@ -41,13 +45,13 @@ use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Index, Moment};
use sp_api::impl_runtime_apis;
use sp_runtime::{
Permill, Perbill, Perquintill, Percent, ApplyExtrinsicResult,
- impl_opaque_keys, generic, create_runtime_str, ModuleId,
+ impl_opaque_keys, generic, create_runtime_str, ModuleId, FixedPointNumber,
};
use sp_runtime::curve::PiecewiseLinear;
use sp_runtime::transaction_validity::{TransactionValidity, TransactionSource, TransactionPriority};
use sp_runtime::traits::{
self, BlakeTwo256, Block as BlockT, StaticLookup, SaturatedConversion,
- ConvertInto, OpaqueKeys, NumberFor,
+ ConvertInto, OpaqueKeys, NumberFor, Saturating,
};
use sp_version::RuntimeVersion;
#[cfg(any(feature = "std", test))]
@@ -57,24 +61,24 @@ use pallet_grandpa::fg_primitives;
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
+pub use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment};
use pallet_contracts_rpc_runtime_api::ContractExecResult;
use pallet_session::{historical as pallet_session_historical};
use sp_inherents::{InherentData, CheckInherentsResult};
-use codec::Encode;
use static_assertions::const_assert;
#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
-pub use pallet_timestamp::Call as TimestampCall;
+#[cfg(any(feature = "std", test))]
pub use pallet_balances::Call as BalancesCall;
+#[cfg(any(feature = "std", test))]
pub use frame_system::Call as SystemCall;
-pub use pallet_contracts::Gas;
-pub use frame_support::StorageValue;
+#[cfg(any(feature = "std", test))]
pub use pallet_staking::StakerStatus;
/// Implementations of some helper traits passed into runtime modules as associated types.
pub mod impls;
-use impls::{CurrencyToVoteHandler, Author, LinearWeightToFee, TargetedFeeAdjustment};
+use impls::{CurrencyToVoteHandler, Author};
/// Constant values used within the runtime.
pub mod constants;
@@ -93,8 +97,8 @@ 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: 248,
- impl_version: 1,
+ spec_version: 255,
+ impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
};
@@ -126,16 +130,24 @@ impl OnUnbalanced for DealWithFees {
}
}
+const AVERAGE_ON_INITIALIZE_WEIGHT: Perbill = Perbill::from_percent(10);
parameter_types! {
pub const BlockHashCount: BlockNumber = 2400;
/// We allow for 2 seconds of compute with a 6 second average block time.
pub const MaximumBlockWeight: Weight = 2 * WEIGHT_PER_SECOND;
+ pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
+ /// Assume 10% of weight for average on_initialize calls.
+ pub MaximumExtrinsicWeight: Weight =
+ AvailableBlockRatio::get().saturating_sub(AVERAGE_ON_INITIALIZE_WEIGHT)
+ * MaximumBlockWeight::get();
pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
pub const Version: RuntimeVersion = VERSION;
- pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
}
+const_assert!(AvailableBlockRatio::get().deconstruct() >= AVERAGE_ON_INITIALIZE_WEIGHT.deconstruct());
+
impl frame_system::Trait for Runtime {
+ type BaseCallFilter = ();
type Origin = Origin;
type Call = Call;
type Index = Index;
@@ -151,6 +163,7 @@ impl frame_system::Trait for Runtime {
type DbWeight = RocksDbWeight;
type BlockExecutionWeight = BlockExecutionWeight;
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
+ type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = Version;
@@ -160,25 +173,83 @@ impl frame_system::Trait for Runtime {
type OnKilledAccount = ();
}
+impl pallet_utility::Trait for Runtime {
+ type Event = Event;
+ type Call = Call;
+}
+
parameter_types! {
- // One storage item; value is size 4+4+16+32 bytes = 56 bytes.
- pub const MultisigDepositBase: Balance = 30 * CENTS;
+ // One storage item; key size is 32; value is size 4+4+16+32 bytes = 56 bytes.
+ pub const DepositBase: Balance = deposit(1, 88);
// Additional storage item size of 32 bytes.
- pub const MultisigDepositFactor: Balance = 5 * CENTS;
+ pub const DepositFactor: Balance = deposit(0, 32);
pub const MaxSignatories: u16 = 100;
}
-impl pallet_utility::Trait for Runtime {
+impl pallet_multisig::Trait for Runtime {
type Event = Event;
type Call = Call;
type Currency = Balances;
- type MultisigDepositBase = MultisigDepositBase;
- type MultisigDepositFactor = MultisigDepositFactor;
+ type DepositBase = DepositBase;
+ type DepositFactor = DepositFactor;
type MaxSignatories = MaxSignatories;
}
parameter_types! {
- pub const MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * MaximumBlockWeight::get();
+ // One storage item; key size 32, value size 8; .
+ pub const ProxyDepositBase: Balance = deposit(1, 8);
+ // Additional storage item size of 33 bytes.
+ pub const ProxyDepositFactor: Balance = deposit(0, 33);
+ pub const MaxProxies: u16 = 32;
+}
+
+/// The type used to represent the kinds of proxying allowed.
+#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug)]
+pub enum ProxyType {
+ Any,
+ NonTransfer,
+ Governance,
+ Staking,
+}
+impl Default for ProxyType { fn default() -> Self { Self::Any } }
+impl InstanceFilter for ProxyType {
+ fn filter(&self, c: &Call) -> bool {
+ match self {
+ ProxyType::Any => true,
+ ProxyType::NonTransfer => !matches!(c,
+ Call::Balances(..) | Call::Vesting(pallet_vesting::Call::vested_transfer(..))
+ | Call::Indices(pallet_indices::Call::transfer(..))
+ ),
+ ProxyType::Governance => matches!(c,
+ Call::Democracy(..) | Call::Council(..) | Call::Society(..)
+ | Call::TechnicalCommittee(..) | Call::Elections(..) | Call::Treasury(..)
+ ),
+ ProxyType::Staking => matches!(c, Call::Staking(..)),
+ }
+ }
+ fn is_superset(&self, o: &Self) -> bool {
+ match (self, o) {
+ (x, y) if x == y => true,
+ (ProxyType::Any, _) => true,
+ (_, ProxyType::Any) => false,
+ (ProxyType::NonTransfer, _) => true,
+ _ => false,
+ }
+ }
+}
+
+impl pallet_proxy::Trait for Runtime {
+ type Event = Event;
+ type Call = Call;
+ type Currency = Balances;
+ type ProxyType = ProxyType;
+ type ProxyDepositBase = ProxyDepositBase;
+ type ProxyDepositFactor = ProxyDepositFactor;
+ type MaxProxies = MaxProxies;
+}
+
+parameter_types! {
+ pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) * MaximumBlockWeight::get();
}
impl pallet_scheduler::Trait for Runtime {
@@ -205,9 +276,9 @@ parameter_types! {
impl pallet_indices::Trait for Runtime {
type AccountIndex = AccountIndex;
- type Event = Event;
type Currency = Balances;
type Deposit = IndexDeposit;
+ type Event = Event;
}
parameter_types! {
@@ -224,19 +295,18 @@ impl pallet_balances::Trait for Runtime {
parameter_types! {
pub const TransactionByteFee: Balance = 10 * MILLICENTS;
- // In the Substrate node, a weight of 10_000_000 (smallest non-zero weight)
- // is mapped to 10_000_000 units of fees, hence:
- pub const WeightFeeCoefficient: Balance = 1;
- // for a sane configuration, this should always be less than `AvailableBlockRatio`.
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
+ pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(1, 100_000);
+ pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000_000u128);
}
impl pallet_transaction_payment::Trait for Runtime {
type Currency = Balances;
type OnTransactionPayment = DealWithFees;
type TransactionByteFee = TransactionByteFee;
- type WeightToFee = LinearWeightToFee;
- type FeeMultiplierUpdate = TargetedFeeAdjustment;
+ type WeightToFee = IdentityFee;
+ type FeeMultiplierUpdate =
+ TargetedFeeAdjustment;
}
parameter_types! {
@@ -278,11 +348,11 @@ impl pallet_session::Trait for Runtime {
type ValidatorId = ::AccountId;
type ValidatorIdOf = pallet_staking::StashOf;
type ShouldEndSession = Babe;
+ type NextSessionRotation = Babe;
type SessionManager = pallet_session::historical::NoteHistoricalRoot;
type SessionHandler = ::KeyTypeIdProviders;
type Keys = SessionKeys;
type DisabledValidatorsThreshold = DisabledValidatorsThreshold;
- type NextSessionRotation = Babe;
}
impl pallet_session::historical::Trait for Runtime {
@@ -306,9 +376,11 @@ parameter_types! {
pub const BondingDuration: pallet_staking::EraIndex = 24 * 28;
pub const SlashDeferDuration: pallet_staking::EraIndex = 24 * 7; // 1/4 the bonding duration.
pub const RewardCurve: &'static PiecewiseLinear<'static> = &REWARD_CURVE;
- pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 4;
pub const MaxNominatorRewardedPerValidator: u32 = 64;
- pub const MaxIterations: u32 = 5;
+ pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 4;
+ pub const MaxIterations: u32 = 10;
+ // 0.05%. The higher the value, the more strict solution acceptance becomes.
+ pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000);
}
impl pallet_staking::Trait for Runtime {
@@ -323,13 +395,18 @@ impl pallet_staking::Trait for Runtime {
type BondingDuration = BondingDuration;
type SlashDeferDuration = SlashDeferDuration;
/// A super-majority of the council can cancel the slash.
- type SlashCancelOrigin = pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>;
+ type SlashCancelOrigin = EnsureOneOf<
+ AccountId,
+ EnsureRoot,
+ pallet_collective::EnsureProportionAtLeast<_3, _4, AccountId, CouncilCollective>
+ >;
type SessionInterface = Self;
type RewardCurve = RewardCurve;
type NextNewSession = Session;
type ElectionLookahead = ElectionLookahead;
type Call = Call;
type MaxIterations = MaxIterations;
+ type MinSolutionScoreBump = MinSolutionScoreBump;
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
type UnsignedPriority = StakingUnsignedPriority;
}
@@ -375,6 +452,7 @@ impl pallet_democracy::Trait for Runtime {
type VetoOrigin = pallet_collective::EnsureMember;
type CooloffPeriod = CooloffPeriod;
type PreimageByteDeposit = PreimageByteDeposit;
+ type OperationalPreimageOrigin = pallet_collective::EnsureMember;
type Slash = Treasury;
type Scheduler = Scheduler;
type MaxVotes = MaxVotes;
@@ -394,21 +472,21 @@ impl pallet_collective::Trait for Runtime {
type MaxProposals = CouncilMaxProposals;
}
-const DESIRED_MEMBERS: u32 = 13;
parameter_types! {
pub const CandidacyBond: Balance = 10 * DOLLARS;
pub const VotingBond: Balance = 1 * DOLLARS;
pub const TermDuration: BlockNumber = 7 * DAYS;
- pub const DesiredMembers: u32 = DESIRED_MEMBERS;
+ pub const DesiredMembers: u32 = 13;
pub const DesiredRunnersUp: u32 = 7;
pub const ElectionsPhragmenModuleId: LockIdentifier = *b"phrelect";
}
-// Make sure that there are no more than `MAX_MEMBERS` members elected via phragmen.
-const_assert!(DESIRED_MEMBERS <= pallet_collective::MAX_MEMBERS);
+
+// Make sure that there are no more than `MAX_MEMBERS` members elected via elections-phragmen.
+const_assert!(DesiredMembers::get() <= pallet_collective::MAX_MEMBERS);
impl pallet_elections_phragmen::Trait for Runtime {
- type ModuleId = ElectionsPhragmenModuleId;
type Event = Event;
+ type ModuleId = ElectionsPhragmenModuleId;
type Currency = Balances;
type ChangeMembers = Council;
// NOTE: this implies that council's genesis members cannot be set directly and must come from
@@ -439,13 +517,18 @@ impl pallet_collective::Trait for Runtime {
type MaxProposals = TechnicalMaxProposals;
}
+type EnsureRootOrHalfCouncil = EnsureOneOf<
+ AccountId,
+ EnsureRoot,
+ pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>
+>;
impl pallet_membership::Trait for Runtime {
type Event = Event;
- type AddOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
- type RemoveOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
- type SwapOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
- type ResetOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
- type PrimeOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
+ type AddOrigin = EnsureRootOrHalfCouncil;
+ type RemoveOrigin = EnsureRootOrHalfCouncil;
+ type SwapOrigin = EnsureRootOrHalfCouncil;
+ type ResetOrigin = EnsureRootOrHalfCouncil;
+ type PrimeOrigin = EnsureRootOrHalfCouncil;
type MembershipInitialized = TechnicalCommittee;
type MembershipChanged = TechnicalCommittee;
}
@@ -463,9 +546,18 @@ parameter_types! {
}
impl pallet_treasury::Trait for Runtime {
+ type ModuleId = TreasuryModuleId;
type Currency = Balances;
- type ApproveOrigin = pallet_collective::EnsureMembers<_4, AccountId, CouncilCollective>;
- type RejectOrigin = pallet_collective::EnsureMembers<_2, AccountId, CouncilCollective>;
+ type ApproveOrigin = EnsureOneOf<
+ AccountId,
+ EnsureRoot,
+ pallet_collective::EnsureMembers<_4, AccountId, CouncilCollective>
+ >;
+ type RejectOrigin = EnsureOneOf<
+ AccountId,
+ EnsureRoot,
+ pallet_collective::EnsureMembers<_2, AccountId, CouncilCollective>
+ >;
type Tippers = Elections;
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
@@ -477,20 +569,19 @@ impl pallet_treasury::Trait for Runtime {
type ProposalBondMinimum = ProposalBondMinimum;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
- type ModuleId = TreasuryModuleId;
}
parameter_types! {
- pub const TombstoneDeposit: Balance = 1 * DOLLARS;
- pub const RentByteFee: Balance = 1 * DOLLARS;
- pub const RentDepositOffset: Balance = 1000 * DOLLARS;
- pub const SurchargeReward: Balance = 150 * DOLLARS;
+ pub const TombstoneDeposit: Balance = 16 * MILLICENTS;
+ pub const RentByteFee: Balance = 4 * MILLICENTS;
+ pub const RentDepositOffset: Balance = 1000 * MILLICENTS;
+ pub const SurchargeReward: Balance = 150 * MILLICENTS;
}
impl pallet_contracts::Trait for Runtime {
type Time = Timestamp;
type Randomness = RandomnessCollectiveFlip;
- type Call = Call;
+ type Currency = Balances;
type Event = Event;
type DetermineContractAddress = pallet_contracts::SimpleAddressDeterminer;
type TrieIdGenerator = pallet_contracts::TrieIdFromParentCounter;
@@ -503,6 +594,7 @@ impl pallet_contracts::Trait for Runtime {
type SurchargeReward = SurchargeReward;
type MaxDepth = pallet_contracts::DefaultMaxDepth;
type MaxValueSize = pallet_contracts::DefaultMaxValueSize;
+ type WeightPrice = pallet_transaction_payment::Module;
}
impl pallet_sudo::Trait for Runtime {
@@ -513,7 +605,7 @@ impl pallet_sudo::Trait for Runtime {
parameter_types! {
pub const SessionDuration: BlockNumber = EPOCH_DURATION_IN_SLOTS as _;
pub const ImOnlineUnsignedPriority: TransactionPriority = TransactionPriority::max_value();
- /// We prioritize im-online heartbeats over phragmen solution submission.
+ /// We prioritize im-online heartbeats over election solution submission.
pub const StakingUnsignedPriority: TransactionPriority = TransactionPriority::max_value() / 2;
}
@@ -568,8 +660,8 @@ impl frame_system::offchain::SigningTypes for Runtime {
impl frame_system::offchain::SendTransactionTypes for Runtime where
Call: From,
{
- type OverarchingCall = Call;
type Extrinsic = UncheckedExtrinsic;
+ type OverarchingCall = Call;
}
impl pallet_im_online::Trait for Runtime {
@@ -580,10 +672,15 @@ impl pallet_im_online::Trait for Runtime {
type UnsignedPriority = ImOnlineUnsignedPriority;
}
+parameter_types! {
+ pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get();
+}
+
impl pallet_offences::Trait for Runtime {
type Event = Event;
type IdentificationTuple = pallet_session::historical::IdentificationTuple;
type OnOffenceHandler = Staking;
+ type WeightSoftLimit = OffencesWeightSoftLimit;
}
impl pallet_authority_discovery::Trait for Runtime {}
@@ -640,8 +737,8 @@ impl pallet_identity::Trait for Runtime {
type MaxAdditionalFields = MaxAdditionalFields;
type MaxRegistrars = MaxRegistrars;
type Slashed = Treasury;
- type ForceOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
- type RegistrarOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
+ type ForceOrigin = EnsureRootOrHalfCouncil;
+ type RegistrarOrigin = EnsureRootOrHalfCouncil;
}
parameter_types! {
@@ -674,6 +771,7 @@ parameter_types! {
impl pallet_society::Trait for Runtime {
type Event = Event;
+ type ModuleId = SocietyModuleId;
type Currency = Balances;
type Randomness = RandomnessCollectiveFlip;
type CandidateDeposit = CandidateDeposit;
@@ -686,7 +784,6 @@ impl pallet_society::Trait for Runtime {
type FounderSetOrigin = pallet_collective::EnsureProportionMoreThan<_1, _2, AccountId, CouncilCollective>;
type SuspensionJudgementOrigin = pallet_society::EnsureFounder;
type ChallengePeriod = ChallengePeriod;
- type ModuleId = SocietyModuleId;
}
parameter_types! {
@@ -707,7 +804,7 @@ construct_runtime!(
UncheckedExtrinsic = UncheckedExtrinsic
{
System: frame_system::{Module, Call, Config, Storage, Event},
- Utility: pallet_utility::{Module, Call, Storage, Event},
+ Utility: pallet_utility::{Module, Call, Event},
Babe: pallet_babe::{Module, Call, Storage, Config, Inherent},
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
Authorship: pallet_authorship::{Module, Call, Storage, Inherent},
@@ -736,6 +833,8 @@ construct_runtime!(
Recovery: pallet_recovery::{Module, Call, Storage, Event},
Vesting: pallet_vesting::{Module, Call, Storage, Event, Config},
Scheduler: pallet_scheduler::{Module, Call, Storage, Event},
+ Proxy: pallet_proxy::{Module, Call, Storage, Event},
+ Multisig: pallet_multisig::{Module, Call, Storage, Event},
}
);
@@ -976,8 +1075,26 @@ impl_runtime_apis! {
impl pallet_offences_benchmarking::Trait for Runtime {}
impl frame_system_benchmarking::Trait for Runtime {}
+ let whitelist: Vec> = vec![
+ // Block Number
+ // frame_system::Number::::hashed_key().to_vec(),
+ hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec(),
+ // Total Issuance
+ hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec(),
+ // Execution Phase
+ hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec(),
+ // Event Count
+ hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec(),
+ // System Events
+ hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec(),
+ // Caller 0 Account
+ hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da946c154ffd9992e395af90b5b13cc6f295c77033fce8a9045824a6690bbf99c6db269502f0a8d1d2a008542d5690a0749").to_vec(),
+ // Treasury Account
+ hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da95ecffd7b6c0f78751baa9d281e0bfa3a6d6f646c70792f74727372790000000000000000000000000000000000000000").to_vec(),
+ ];
+
let mut batches = Vec::::new();
- let params = (&pallet, &benchmark, &lowest_range_values, &highest_range_values, &steps, repeat);
+ let params = (&pallet, &benchmark, &lowest_range_values, &highest_range_values, &steps, repeat, &whitelist);
add_benchmark!(params, batches, b"balances", Balances);
add_benchmark!(params, batches, b"collective", Council);
@@ -985,7 +1102,10 @@ impl_runtime_apis! {
add_benchmark!(params, batches, b"elections", Elections);
add_benchmark!(params, batches, b"identity", Identity);
add_benchmark!(params, batches, b"im-online", ImOnline);
+ add_benchmark!(params, batches, b"indices", Indices);
+ add_benchmark!(params, batches, b"multisig", Multisig);
add_benchmark!(params, batches, b"offences", OffencesBench::);
+ add_benchmark!(params, batches, b"proxy", Proxy);
add_benchmark!(params, batches, b"scheduler", Scheduler);
add_benchmark!(params, batches, b"session", SessionBench::);
add_benchmark!(params, batches, b"staking", Staking);
diff --git a/bin/node/testing/Cargo.toml b/bin/node/testing/Cargo.toml
index 37518ebe804431a6994c64cf86c056d03e9a55b6..fbf369cc3b4e4cfd60303afea26a8380a25ece18 100644
--- a/bin/node/testing/Cargo.toml
+++ b/bin/node/testing/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "node-testing"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
authors = ["Parity Technologies "]
description = "Test utilities for Substrate node."
edition = "2018"
@@ -13,40 +13,40 @@ publish = true
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
-pallet-balances = { version = "2.0.0-alpha.8", path = "../../../frame/balances" }
-sc-service = { version = "0.8.0-alpha.8", features = ["test-helpers", "db"], path = "../../../client/service" }
-sc-client-db = { version = "0.8.0-alpha.8", path = "../../../client/db/", features = ["kvdb-rocksdb", "parity-db"] }
-sc-client-api = { version = "2.0.0-alpha.8", path = "../../../client/api/" }
-codec = { package = "parity-scale-codec", version = "1.3.0" }
-pallet-contracts = { version = "2.0.0-alpha.8", path = "../../../frame/contracts" }
-pallet-grandpa = { version = "2.0.0-alpha.8", path = "../../../frame/grandpa" }
-pallet-indices = { version = "2.0.0-alpha.8", path = "../../../frame/indices" }
-sp-keyring = { version = "2.0.0-alpha.8", path = "../../../primitives/keyring" }
-node-executor = { version = "2.0.0-alpha.8", path = "../executor" }
-node-primitives = { version = "2.0.0-alpha.8", path = "../primitives" }
-node-runtime = { version = "2.0.0-alpha.8", path = "../runtime" }
-sp-core = { version = "2.0.0-alpha.8", path = "../../../primitives/core" }
-sp-io = { version = "2.0.0-alpha.8", path = "../../../primitives/io" }
-frame-support = { version = "2.0.0-alpha.8", path = "../../../frame/support" }
-pallet-session = { version = "2.0.0-alpha.8", path = "../../../frame/session" }
-pallet-society = { version = "2.0.0-alpha.8", path = "../../../frame/society" }
-sp-runtime = { version = "2.0.0-alpha.8", path = "../../../primitives/runtime" }
-pallet-staking = { version = "2.0.0-alpha.8", path = "../../../frame/staking" }
-sc-executor = { version = "0.8.0-alpha.8", path = "../../../client/executor", features = ["wasmtime"] }
-sp-consensus = { version = "0.8.0-alpha.8", path = "../../../primitives/consensus/common" }
-frame-system = { version = "2.0.0-alpha.8", path = "../../../frame/system" }
-substrate-test-client = { version = "2.0.0-alpha.8", path = "../../../test-utils/client" }
-pallet-timestamp = { version = "2.0.0-alpha.8", path = "../../../frame/timestamp" }
-pallet-transaction-payment = { version = "2.0.0-alpha.8", path = "../../../frame/transaction-payment" }
-pallet-treasury = { version = "2.0.0-alpha.8", path = "../../../frame/treasury" }
+pallet-balances = { version = "2.0.0-rc4", path = "../../../frame/balances" }
+sc-service = { version = "0.8.0-rc4", features = ["test-helpers", "db"], path = "../../../client/service" }
+sc-client-db = { version = "0.8.0-rc4", path = "../../../client/db/", features = ["kvdb-rocksdb", "parity-db"] }
+sc-client-api = { version = "2.0.0-rc4", path = "../../../client/api/" }
+codec = { package = "parity-scale-codec", version = "1.3.1" }
+pallet-contracts = { version = "2.0.0-rc4", path = "../../../frame/contracts" }
+pallet-grandpa = { version = "2.0.0-rc4", path = "../../../frame/grandpa" }
+pallet-indices = { version = "2.0.0-rc4", path = "../../../frame/indices" }
+sp-keyring = { version = "2.0.0-rc4", path = "../../../primitives/keyring" }
+node-executor = { version = "2.0.0-rc4", path = "../executor" }
+node-primitives = { version = "2.0.0-rc4", path = "../primitives" }
+node-runtime = { version = "2.0.0-rc4", path = "../runtime" }
+sp-core = { version = "2.0.0-rc4", path = "../../../primitives/core" }
+sp-io = { version = "2.0.0-rc4", path = "../../../primitives/io" }
+frame-support = { version = "2.0.0-rc4", path = "../../../frame/support" }
+pallet-session = { version = "2.0.0-rc4", path = "../../../frame/session" }
+pallet-society = { version = "2.0.0-rc4", path = "../../../frame/society" }
+sp-runtime = { version = "2.0.0-rc4", path = "../../../primitives/runtime" }
+pallet-staking = { version = "2.0.0-rc4", path = "../../../frame/staking" }
+sc-executor = { version = "0.8.0-rc4", path = "../../../client/executor", features = ["wasmtime"] }
+sp-consensus = { version = "0.8.0-rc4", path = "../../../primitives/consensus/common" }
+frame-system = { version = "2.0.0-rc4", path = "../../../frame/system" }
+substrate-test-client = { version = "2.0.0-rc4", path = "../../../test-utils/client" }
+pallet-timestamp = { version = "2.0.0-rc4", path = "../../../frame/timestamp" }
+pallet-transaction-payment = { version = "2.0.0-rc4", path = "../../../frame/transaction-payment" }
+pallet-treasury = { version = "2.0.0-rc4", path = "../../../frame/treasury" }
wabt = "0.9.2"
-sp-api = { version = "2.0.0-alpha.8", path = "../../../primitives/api" }
-sp-finality-tracker = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/finality-tracker" }
-sp-timestamp = { version = "2.0.0-alpha.8", default-features = false, path = "../../../primitives/timestamp" }
-sp-block-builder = { version = "2.0.0-alpha.8", path = "../../../primitives/block-builder" }
-sc-block-builder = { version = "0.8.0-alpha.8", path = "../../../client/block-builder" }
-sp-inherents = { version = "2.0.0-alpha.8", path = "../../../primitives/inherents" }
-sp-blockchain = { version = "2.0.0-alpha.8", path = "../../../primitives/blockchain" }
+sp-api = { version = "2.0.0-rc4", path = "../../../primitives/api" }
+sp-finality-tracker = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/finality-tracker" }
+sp-timestamp = { version = "2.0.0-rc4", default-features = false, path = "../../../primitives/timestamp" }
+sp-block-builder = { version = "2.0.0-rc4", path = "../../../primitives/block-builder" }
+sc-block-builder = { version = "0.8.0-rc4", path = "../../../client/block-builder" }
+sp-inherents = { version = "2.0.0-rc4", path = "../../../primitives/inherents" }
+sp-blockchain = { version = "2.0.0-rc4", path = "../../../primitives/blockchain" }
log = "0.4.8"
tempfile = "3.1.0"
fs_extra = "1"
@@ -54,4 +54,4 @@ futures = "0.3.1"
[dev-dependencies]
criterion = "0.3.0"
-sc-cli = { version = "0.8.0-alpha.8", path = "../../../client/cli" }
+sc-cli = { version = "0.8.0-rc4", path = "../../../client/cli" }
diff --git a/bin/node/testing/src/bench.rs b/bin/node/testing/src/bench.rs
index 888ec71cdabe178e398b0e30d7cccee5c9ca397d..507d3420d835470e41fd1f1bb71fef9eaee9ad60 100644
--- a/bin/node/testing/src/bench.rs
+++ b/bin/node/testing/src/bench.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -55,7 +55,7 @@ use sp_api::ProvideRuntimeApi;
use sp_block_builder::BlockBuilder;
use sp_inherents::InherentData;
use sc_client_api::{
- ExecutionStrategy,
+ ExecutionStrategy, BlockBackend,
execution_extensions::{ExecutionExtensions, ExecutionStrategies},
};
use sp_core::{Pair, Public, sr25519, ed25519};
@@ -152,20 +152,12 @@ impl BlockType {
}
/// Content of the generated block.
+#[derive(Clone, Debug)]
pub struct BlockContent {
block_type: BlockType,
size: Option,
}
-impl BlockContent {
- fn iter_while(&self, mut f: impl FnMut(usize) -> bool) {
- match self.size {
- Some(v) => { for i in 0..v { if !f(i) { break; }}}
- None => { for i in 0.. { if !f(i) { break; }}}
- }
- }
-}
-
/// Type of backend database.
#[derive(Debug, PartialEq, Clone, Copy)]
pub enum DatabaseType {
@@ -219,10 +211,97 @@ impl CloneableSpawn for TaskExecutor {
}
}
+/// Iterator for block content.
+pub struct BlockContentIterator<'a> {
+ iteration: usize,
+ content: BlockContent,
+ runtime_version: sc_executor::RuntimeVersion,
+ genesis_hash: node_primitives::Hash,
+ keyring: &'a BenchKeyring,
+}
+
+impl<'a> BlockContentIterator<'a> {
+ fn new(content: BlockContent, keyring: &'a BenchKeyring, client: &Client) -> Self {
+ let runtime_version = client.runtime_version_at(&BlockId::number(0))
+ .expect("There should be runtime version at 0");
+
+ let genesis_hash = client.block_hash(Zero::zero())
+ .expect("Database error?")
+ .expect("Genesis block always exists; qed")
+ .into();
+
+ BlockContentIterator {
+ iteration: 0,
+ content,
+ keyring,
+ runtime_version,
+ genesis_hash,
+ }
+ }
+}
+
+impl<'a> Iterator for BlockContentIterator<'a> {
+ type Item = OpaqueExtrinsic;
+
+ fn next(&mut self) -> Option {
+ if self.content.size.map(|size| size <= self.iteration).unwrap_or(false) {
+ return None;
+ }
+
+ let sender = self.keyring.at(self.iteration);
+ let receiver = get_account_id_from_seed::(
+ &format!("random-user//{}", self.iteration)
+ );
+
+ let signed = self.keyring.sign(
+ CheckedExtrinsic {
+ signed: Some((sender, signed_extra(0, node_runtime::ExistentialDeposit::get() + 1))),
+ function: match self.content.block_type {
+ BlockType::RandomTransfersKeepAlive => {
+ Call::Balances(
+ BalancesCall::transfer_keep_alive(
+ pallet_indices::address::Address::Id(receiver),
+ node_runtime::ExistentialDeposit::get() + 1,
+ )
+ )
+ },
+ BlockType::RandomTransfersReaping => {
+ Call::Balances(
+ BalancesCall::transfer(
+ pallet_indices::address::Address::Id(receiver),
+ // Transfer so that ending balance would be 1 less than existential deposit
+ // so that we kill the sender account.
+ 100*DOLLARS - (node_runtime::ExistentialDeposit::get() - 1),
+ )
+ )
+ },
+ BlockType::Noop => {
+ Call::System(
+ SystemCall::remark(Vec::new())
+ )
+ },
+ },
+ },
+ self.runtime_version.spec_version,
+ self.runtime_version.transaction_version,
+ self.genesis_hash.into(),
+ );
+
+ let encoded = Encode::encode(&signed);
+
+ let opaque = OpaqueExtrinsic::decode(&mut &encoded[..])
+ .expect("Failed to decode opaque");
+
+ self.iteration += 1;
+
+ Some(opaque)
+ }
+}
+
impl BenchDb {
/// New immutable benchmarking database.
///
- /// See [`new`] method documentation for more information about the purpose
+ /// See [`BenchDb::new`] method documentation for more information about the purpose
/// of this structure.
pub fn with_key_types(
database_type: DatabaseType,
@@ -288,8 +367,33 @@ impl BenchDb {
(client, backend)
}
- /// Generate new block using this database.
- pub fn generate_block(&mut self, content: BlockContent) -> Block {
+ /// Generate list of required inherents.
+ ///
+ /// Uses already instantiated Client.
+ pub fn generate_inherents(&mut self, client: &Client) -> Vec {
+ let mut inherent_data = InherentData::new();
+ let timestamp = 1 * MinimumPeriod::get();
+
+ inherent_data.put_data(sp_timestamp::INHERENT_IDENTIFIER, ×tamp)
+ .expect("Put timestamp failed");
+ inherent_data.put_data(sp_finality_tracker::INHERENT_IDENTIFIER, &0)
+ .expect("Put finality tracker failed");
+
+ client.runtime_api()
+ .inherent_extrinsics_with_context(
+ &BlockId::number(0),
+ ExecutionContext::BlockConstruction,
+ inherent_data,
+ ).expect("Get inherents failed")
+ }
+
+ /// Iterate over some block content with transaction signed using this database keyring.
+ pub fn block_content(&self, content: BlockContent, client: &Client) -> BlockContentIterator {
+ BlockContentIterator::new(content, &self.keyring, client)
+ }
+
+ /// Get cliet for this database operations.
+ pub fn client(&mut self) -> Client {
let (client, _backend) = Self::bench_client(
self.database_type,
self.directory_guard.path(),
@@ -297,92 +401,33 @@ impl BenchDb {
&self.keyring,
);
- let version = client.runtime_version_at(&BlockId::number(0))
- .expect("There should be runtime version at 0")
- .spec_version;
+ client
+ }
- let genesis_hash = client.block_hash(Zero::zero())
- .expect("Database error?")
- .expect("Genesis block always exists; qed")
- .into();
+ /// Generate new block using this database.
+ pub fn generate_block(&mut self, content: BlockContent) -> Block {
+ let client = self.client();
let mut block = client
.new_block(Default::default())
.expect("Block creation failed");
- let timestamp = 1 * MinimumPeriod::get();
-
- let mut inherent_data = InherentData::new();
- inherent_data.put_data(sp_timestamp::INHERENT_IDENTIFIER, ×tamp)
- .expect("Put timestamp failed");
- inherent_data.put_data(sp_finality_tracker::INHERENT_IDENTIFIER, &0)
- .expect("Put finality tracker failed");
-
- for extrinsic in client.runtime_api()
- .inherent_extrinsics_with_context(
- &BlockId::number(0),
- ExecutionContext::BlockConstruction,
- inherent_data,
- ).expect("Get inherents failed")
- {
+ for extrinsic in self.generate_inherents(&client) {
block.push(extrinsic).expect("Push inherent failed");
}
let start = std::time::Instant::now();
- content.iter_while(|iteration| {
- let sender = self.keyring.at(iteration);
- let receiver = get_account_id_from_seed::(
- &format!("random-user//{}", iteration)
- );
-
- let signed = self.keyring.sign(
- CheckedExtrinsic {
- signed: Some((sender, signed_extra(0, node_runtime::ExistentialDeposit::get() + 1))),
- function: match content.block_type {
- BlockType::RandomTransfersKeepAlive => {
- Call::Balances(
- BalancesCall::transfer_keep_alive(
- pallet_indices::address::Address::Id(receiver),
- node_runtime::ExistentialDeposit::get() + 1,
- )
- )
- },
- BlockType::RandomTransfersReaping => {
- Call::Balances(
- BalancesCall::transfer(
- pallet_indices::address::Address::Id(receiver),
- // Transfer so that ending balance would be 1 less than existential deposit
- // so that we kill the sender account.
- 100*DOLLARS - (node_runtime::ExistentialDeposit::get() - 1),
- )
- )
- },
- BlockType::Noop => {
- Call::System(
- SystemCall::remark(Vec::new())
- )
- },
- },
- },
- version,
- genesis_hash,
- );
-
- let encoded = Encode::encode(&signed);
-
- let opaque = OpaqueExtrinsic::decode(&mut &encoded[..])
- .expect("Failed to decode opaque");
-
+ for opaque in self.block_content(content, &client) {
match block.push(opaque) {
Err(sp_blockchain::Error::ApplyExtrinsicFailed(
sp_blockchain::ApplyExtrinsicFailed::Validity(e)
)) if e.exhausted_resources() => {
- return false;
+ break;
},
Err(err) => panic!("Error pushing transaction: {:?}", err),
- Ok(_) => true,
+ Ok(_) => {},
}
- });
+ };
let block = block.build().expect("Block build failed").block;
@@ -411,7 +456,7 @@ impl BenchDb {
);
BenchContext {
- client, backend, db_guard: directory_guard,
+ client: Arc::new(client), backend, db_guard: directory_guard,
}
}
}
@@ -462,10 +507,16 @@ impl BenchKeyring {
}
/// Sign transaction with keypair from this keyring.
- pub fn sign(&self, xt: CheckedExtrinsic, version: u32, genesis_hash: [u8; 32]) -> UncheckedExtrinsic {
+ pub fn sign(
+ &self,
+ xt: CheckedExtrinsic,
+ spec_version: u32,
+ tx_version: u32,
+ genesis_hash: [u8; 32]
+ ) -> UncheckedExtrinsic {
match xt.signed {
Some((signed, extra)) => {
- let payload = (xt.function, extra.clone(), version, genesis_hash, genesis_hash);
+ let payload = (xt.function, extra.clone(), spec_version, tx_version, genesis_hash, genesis_hash);
let key = self.accounts.get(&signed).expect("Account id not found in keyring");
let signature = payload.using_encoded(|b| {
if b.len() > 256 {
@@ -537,7 +588,7 @@ impl Guard {
/// Benchmarking/test context holding instantiated client and backend references.
pub struct BenchContext {
/// Node client.
- pub client: Client,
+ pub client: Arc,
/// Node backend.
pub backend: Arc,
diff --git a/bin/node/testing/src/client.rs b/bin/node/testing/src/client.rs
index 5d2795a6f6c818b3ca2abe4d5ac1caa79f2b68a5..f44747b26b7a6eb6409e76063b23914f3fb43f66 100644
--- a/bin/node/testing/src/client.rs
+++ b/bin/node/testing/src/client.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/node/testing/src/genesis.rs b/bin/node/testing/src/genesis.rs
index f99b559a254d8b67cdbef8a9723f2020ee3101c7..2bbae96cf4332f08c24469857388d72877877653 100644
--- a/bin/node/testing/src/genesis.rs
+++ b/bin/node/testing/src/genesis.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -23,7 +23,7 @@ use sp_keyring::{Ed25519Keyring, Sr25519Keyring};
use node_runtime::{
GenesisConfig, BalancesConfig, SessionConfig, StakingConfig, SystemConfig,
GrandpaConfig, IndicesConfig, ContractsConfig, SocietyConfig, WASM_BINARY,
- AccountId,
+ AccountId, StakerStatus,
};
use node_runtime::constants::currency::*;
use sp_core::ChangesTrieConfiguration;
@@ -87,9 +87,9 @@ pub fn config_endowed(
}),
pallet_staking: Some(StakingConfig {
stakers: vec![
- (dave(), alice(), 111 * DOLLARS, pallet_staking::StakerStatus::Validator),
- (eve(), bob(), 100 * DOLLARS, pallet_staking::StakerStatus::Validator),
- (ferdie(), charlie(), 100 * DOLLARS, pallet_staking::StakerStatus::Validator)
+ (dave(), alice(), 111 * DOLLARS, StakerStatus::Validator),
+ (eve(), bob(), 100 * DOLLARS, StakerStatus::Validator),
+ (ferdie(), charlie(), 100 * DOLLARS, StakerStatus::Validator)
],
validator_count: 3,
minimum_validator_count: 0,
diff --git a/bin/node/testing/src/keyring.rs b/bin/node/testing/src/keyring.rs
index 99a44e065d2b2f69613d4c07a7398c80bb311fc5..efa47a59821945caa16a271b81bc7dcd344b5292 100644
--- a/bin/node/testing/src/keyring.rs
+++ b/bin/node/testing/src/keyring.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/node/testing/src/lib.rs b/bin/node/testing/src/lib.rs
index 07859f5fed6e85e390ccadbb4162b513a9e0f442..d682347e40019dd4a7ff74a8716929130623f31e 100644
--- a/bin/node/testing/src/lib.rs
+++ b/bin/node/testing/src/lib.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/utils/chain-spec-builder/Cargo.toml b/bin/utils/chain-spec-builder/Cargo.toml
index d4faa4f1e3b54fc69a38bbe18e0cebc9d8195d54..b633ffa96634e19aadbe082d3bafc971cf812654 100644
--- a/bin/utils/chain-spec-builder/Cargo.toml
+++ b/bin/utils/chain-spec-builder/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "chain-spec-builder"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
authors = ["Parity Technologies "]
edition = "2018"
build = "build.rs"
@@ -13,9 +13,9 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
ansi_term = "0.12.1"
-sc-keystore = { version = "2.0.0-alpha.8", path = "../../../client/keystore" }
-sc-chain-spec = { version = "2.0.0-alpha.8", path = "../../../client/chain-spec" }
-node-cli = { version = "2.0.0-alpha.8", path = "../../node/cli" }
-sp-core = { version = "2.0.0-alpha.8", path = "../../../primitives/core" }
+sc-keystore = { version = "2.0.0-rc4", path = "../../../client/keystore" }
+sc-chain-spec = { version = "2.0.0-rc4", path = "../../../client/chain-spec" }
+node-cli = { version = "2.0.0-rc4", path = "../../node/cli" }
+sp-core = { version = "2.0.0-rc4", path = "../../../primitives/core" }
rand = "0.7.2"
structopt = "0.3.8"
diff --git a/bin/utils/chain-spec-builder/build.rs b/bin/utils/chain-spec-builder/build.rs
index cf8afddb54d4ecf718e9fb25f71994baf0d99ab9..8d5aac1a08742486a9b0e5d55aaf7959941abd77 100644
--- a/bin/utils/chain-spec-builder/build.rs
+++ b/bin/utils/chain-spec-builder/build.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/utils/chain-spec-builder/src/main.rs b/bin/utils/chain-spec-builder/src/main.rs
index 1561b3a6b0624eab3a93df8ccef287c629fc7d18..4fbcc1e850723982de125067c931f27110f82ec9 100644
--- a/bin/utils/chain-spec-builder/src/main.rs
+++ b/bin/utils/chain-spec-builder/src/main.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/utils/subkey/Cargo.toml b/bin/utils/subkey/Cargo.toml
index 91643b455198b91c053bcef07ef0d14852a07298..5ade94275eb4bb5da0d75a8e3c7e96bd77eae1de 100644
--- a/bin/utils/subkey/Cargo.toml
+++ b/bin/utils/subkey/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "subkey"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
authors = ["Parity Technologies "]
edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -12,28 +12,28 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
futures = "0.1.29"
-sp-core = { version = "2.0.0-alpha.8", path = "../../../primitives/core" }
-node-runtime = { version = "2.0.0-alpha.8", path = "../../node/runtime" }
-node-primitives = { version = "2.0.0-alpha.8", path = "../../node/primitives" }
-sp-runtime = { version = "2.0.0-alpha.8", path = "../../../primitives/runtime" }
+sp-core = { version = "2.0.0-rc4", path = "../../../primitives/core" }
+node-runtime = { version = "2.0.0-rc4", path = "../../node/runtime" }
+node-primitives = { version = "2.0.0-rc4", path = "../../node/primitives" }
+sp-runtime = { version = "2.0.0-rc4", path = "../../../primitives/runtime" }
rand = "0.7.2"
clap = "2.33.0"
tiny-bip39 = "0.7"
substrate-bip39 = "0.4.1"
hex = "0.4.0"
hex-literal = "0.2.1"
-codec = { package = "parity-scale-codec", version = "1.3.0" }
-frame-system = { version = "2.0.0-alpha.8", path = "../../../frame/system" }
-pallet-balances = { version = "2.0.0-alpha.8", path = "../../../frame/balances" }
-pallet-transaction-payment = { version = "2.0.0-alpha.8", path = "../../../frame/transaction-payment" }
-pallet-grandpa = { version = "2.0.0-alpha.8", path = "../../../frame/grandpa" }
+codec = { package = "parity-scale-codec", version = "1.3.1" }
+frame-system = { version = "2.0.0-rc4", path = "../../../frame/system" }
+pallet-balances = { version = "2.0.0-rc4", path = "../../../frame/balances" }
+pallet-transaction-payment = { version = "2.0.0-rc4", path = "../../../frame/transaction-payment" }
+pallet-grandpa = { version = "2.0.0-rc4", path = "../../../frame/grandpa" }
rpassword = "4.0.1"
itertools = "0.8.2"
derive_more = { version = "0.99.2" }
-sc-rpc = { version = "2.0.0-alpha.8", path = "../../../client/rpc" }
-jsonrpc-core-client = { version = "14.0.3", features = ["http"] }
+sc-rpc = { version = "2.0.0-rc4", path = "../../../client/rpc" }
+jsonrpc-core-client = { version = "14.2.0", features = ["http"] }
hyper = "0.12.35"
-libp2p = "0.18.1"
+libp2p = { version = "0.20.1", default-features = false }
serde_json = "1.0"
[features]
diff --git a/bin/utils/subkey/src/main.rs b/bin/utils/subkey/src/main.rs
index da4f59430f9fc3fca0b22058677a4580d1ca70da..4153e769c97f57ce65e3f6eb2c36c1991c586224 100644
--- a/bin/utils/subkey/src/main.rs
+++ b/bin/utils/subkey/src/main.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -267,6 +267,9 @@ fn get_app<'a, 'b>(usage: &'a str) -> App<'a, 'b> {
If the value is a file, the file content is used as URI. \
If not given, you will be prompted for the URI.'
"),
+ SubCommand::with_name("inspect-node-key")
+ .about("Print the peer ID corresponding to the node key in the given file")
+ .args_from_usage("[file] 'Name of file to read the secret key from'"),
SubCommand::with_name("sign")
.about("Sign a message, provided on STDIN, with a given (secret) key")
.args_from_usage("
@@ -439,6 +442,17 @@ where
("inspect", Some(matches)) => {
C::print_from_uri(&get_uri("uri", &matches)?, password, maybe_network, output);
}
+ ("inspect-node-key", Some(matches)) => {
+ let file = matches.value_of("file").ok_or(Error::Static("Input file name is required"))?;
+
+ let mut file_content = fs::read(file)?;
+ let secret = libp2p_ed25519::SecretKey::from_bytes(&mut file_content)
+ .map_err(|_| Error::Static("Bad node key file"))?;
+ let keypair = libp2p_ed25519::Keypair::from(secret);
+ let peer_id = PublicKey::Ed25519(keypair.public()).into_peer_id();
+
+ println!("{}", peer_id);
+ }
("sign", Some(matches)) => {
let suri = get_uri("suri", &matches)?;
let should_decode = matches.is_present("hex");
@@ -525,7 +539,7 @@ where
let account_id: AccountId = ModuleId(id_fixed_array).into_account();
let v = maybe_network.unwrap_or(Ss58AddressFormat::SubstrateAccount);
-
+
C::print_from_uri(&account_id.to_ss58check_with_version(v), password, maybe_network, output);
}
_ => print_usage(&matches),
diff --git a/bin/utils/subkey/src/rpc.rs b/bin/utils/subkey/src/rpc.rs
index c6c63be4d1aa37015866ccba38247901a9263caf..e24cf50dc45026615891782cc2440a3eda5749a0 100644
--- a/bin/utils/subkey/src/rpc.rs
+++ b/bin/utils/subkey/src/rpc.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/bin/utils/subkey/src/vanity.rs b/bin/utils/subkey/src/vanity.rs
index 83a71659d857eb95796b2c103e3224b934c9025a..d09aeeef25a47a79ff434035a4d43a20d88c53a6 100644
--- a/bin/utils/subkey/src/vanity.rs
+++ b/bin/utils/subkey/src/vanity.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
diff --git a/client/api/Cargo.toml b/client/api/Cargo.toml
index 9d79e2ca5ab8443864d8a86ffe664a7e16cba97a..a32623ffdbd51236ea15b100d0fbe19c1f8a52f1 100644
--- a/client/api/Cargo.toml
+++ b/client/api/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sc-client-api"
-version = "2.0.0-alpha.8"
+version = "2.0.0-rc4"
authors = ["Parity Technologies "]
edition = "2018"
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -13,37 +13,37 @@ documentation = "https://docs.rs/sc-client-api"
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
-codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] }
-sp-consensus = { version = "0.8.0-alpha.8", path = "../../primitives/consensus/common" }
+codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false, features = ["derive"] }
+sp-consensus = { version = "0.8.0-rc4", path = "../../primitives/consensus/common" }
derive_more = { version = "0.99.2" }
-sc-executor = { version = "0.8.0-alpha.8", path = "../executor" }
-sp-externalities = { version = "0.8.0-alpha.8", path = "../../primitives/externalities" }
+sc-executor = { version = "0.8.0-rc4", path = "../executor" }
+sp-externalities = { version = "0.8.0-rc4", path = "../../primitives/externalities" }
fnv = { version = "1.0.6" }
futures = { version = "0.3.1" }
hash-db = { version = "0.15.2", default-features = false }
-sp-blockchain = { version = "2.0.0-alpha.8", path = "../../primitives/blockchain" }
+sp-blockchain = { version = "2.0.0-rc4", path = "../../primitives/blockchain" }
hex-literal = { version = "0.2.1" }
-sp-inherents = { version = "2.0.0-alpha.8", default-features = false, path = "../../primitives/inherents" }
-sp-keyring = { version = "2.0.0-alpha.8", path = "../../primitives/keyring" }
+sp-inherents = { version = "2.0.0-rc4", default-features = false, path = "../../primitives/inherents" }
+sp-keyring = { version = "2.0.0-rc4", path = "../../primitives/keyring" }
kvdb = "0.6.0"
log = { version = "0.4.8" }
parking_lot = "0.10.0"
lazy_static = "1.4.0"
-sp-database = { version = "2.0.0-alpha.8", path = "../../primitives/database" }
-sp-core = { version = "2.0.0-alpha.8", default-features = false, path = "../../primitives/core" }
-sp-std = { version = "2.0.0-alpha.8", default-features = false, path = "../../primitives/std" }
-sp-version = { version = "2.0.0-alpha.8", default-features = false, path = "../../primitives/version" }
-sp-api = { version = "2.0.0-alpha.8", path = "../../primitives/api" }
-sp-utils = { version = "2.0.0-alpha.8", path = "../../primitives/utils" }
-sp-runtime = { version = "2.0.0-alpha.8", default-features = false, path = "../../primitives/runtime" }
-sp-state-machine = { version = "0.8.0-alpha.8", path = "../../primitives/state-machine" }
-sc-telemetry = { version = "2.0.0-alpha.8", path = "../telemetry" }
-sp-trie = { version = "2.0.0-alpha.8", path = "../../primitives/trie" }
-sp-storage = { version = "2.0.0-alpha.8", path = "../../primitives/storage" }
-sp-transaction-pool = { version = "2.0.0-alpha.8", path = "../../primitives/transaction-pool" }
-prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.8.0-alpha.8", path = "../../utils/prometheus" }
+sp-database = { version = "2.0.0-rc4", path = "../../primitives/database" }
+sp-core = { version = "2.0.0-rc4", default-features = false, path = "../../primitives/core" }
+sp-std = { version = "2.0.0-rc4", default-features = false, path = "../../primitives/std" }
+sp-version = { version = "2.0.0-rc4", default-features = false, path = "../../primitives/version" }
+sp-api = { version = "2.0.0-rc4", path = "../../primitives/api" }
+sp-utils = { version = "2.0.0-rc4", path = "../../primitives/utils" }
+sp-runtime = { version = "2.0.0-rc4", default-features = false, path = "../../primitives/runtime" }
+sp-state-machine = { version = "0.8.0-rc4", path = "../../primitives/state-machine" }
+sc-telemetry = { version = "2.0.0-rc4", path = "../telemetry" }
+sp-trie = { version = "2.0.0-rc4", path = "../../primitives/trie" }
+sp-storage = { version = "2.0.0-rc4", path = "../../primitives/storage" }
+sp-transaction-pool = { version = "2.0.0-rc4", path = "../../primitives/transaction-pool" }
+prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.8.0-rc4", path = "../../utils/prometheus" }
[dev-dependencies]
kvdb-memorydb = "0.6.0"
-sp-test-primitives = { version = "2.0.0-alpha.8", path = "../../primitives/test-primitives" }
-substrate-test-runtime = { version = "2.0.0-alpha.8", path = "../../test-utils/runtime" }
+sp-test-primitives = { version = "2.0.0-rc4", path = "../../primitives/test-primitives" }
+substrate-test-runtime = { version = "2.0.0-rc4", path = "../../test-utils/runtime" }
diff --git a/client/api/src/backend.rs b/client/api/src/backend.rs
index fd9577695ae8704dec1ae0a2f257dadb40d14489..9482a6118d71a21415c74f7410d27ead150e06c3 100644
--- a/client/api/src/backend.rs
+++ b/client/api/src/backend.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -67,8 +67,10 @@ pub struct ImportSummary {
pub is_new_best: bool,
/// Optional storage changes.
pub storage_changes: Option<(StorageCollection, ChildStorageCollection)>,
- /// Blocks that got retracted because of this one got imported.
- pub retracted: Vec,
+ /// Tree route from old best to new best.
+ ///
+ /// If `None`, there was no re-org while importing.
+ pub tree_route: Option>,
}
/// Import operation wrapper
diff --git a/client/api/src/call_executor.rs b/client/api/src/call_executor.rs
index 8c69eb8caa85aa20033f8eab3b696b51e6831704..d9d43900dfc94f2732db7be0051401a832bf8c5b 100644
--- a/client/api/src/call_executor.rs
+++ b/client/api/src/call_executor.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
+
//! A method call executor interface.
use std::{panic::UnwindSafe, result, cell::RefCell};
diff --git a/client/api/src/cht.rs b/client/api/src/cht.rs
index 55a38a514990b9432b9a8a5bfe5b7659aa485b00..30cfd3a1b671b8f159d40bdcb499137de8fe5a69 100644
--- a/client/api/src/cht.rs
+++ b/client/api/src/cht.rs
@@ -5,7 +5,7 @@
// 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
+// 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,
@@ -15,6 +15,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
+
//! Canonical hash trie definitions and helper functions.
//!
//! Each CHT is a trie mapping block numbers to canonical hash.
diff --git a/client/api/src/client.rs b/client/api/src/client.rs
index c855cd3a0832883c3a66b5c986871909aece048a..35d40965e6425096790e6e88c37045724b2b5578 100644
--- a/client/api/src/client.rs
+++ b/client/api/src/client.rs
@@ -16,7 +16,7 @@
//! A set of APIs supported by the client along with their primitives.
-use std::{fmt, collections::HashSet};
+use std::{fmt, collections::HashSet, sync::Arc};
use sp_core::storage::StorageKey;
use sp_runtime::{
traits::{Block as BlockT, NumberFor},
@@ -90,6 +90,9 @@ pub trait BlockBackend {
/// Get block justification set by id.
fn justification(&self, id: &BlockId) -> sp_blockchain::Result