From 260b739d3f0f584f181701fe428e44a275bec6b8 Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 4 Dec 2020 11:24:40 +0100 Subject: [PATCH 1/9] CI: debug [skip ci] --- .gitlab-ci.yml | 663 +------------------------------------------------ 1 file changed, 3 insertions(+), 660 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 215157061bb0b..d514cd942f8b3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -112,368 +112,13 @@ skip-if-draft: #### stage: check -check-runtime: - stage: check - image: paritytech/tools:latest - <<: *kubernetes-build - rules: - - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs - variables: - <<: *default-vars - GITLAB_API: "https://gitlab.parity.io/api/v4" - GITHUB_API_PROJECT: "parity%2Finfrastructure%2Fgithub-api" - script: - - ./.maintain/gitlab/check_runtime.sh - allow_failure: true - -check-signed-tag: - stage: check - image: paritytech/tools:latest - <<: *kubernetes-build - rules: - - if: $CI_COMMIT_REF_NAME =~ /^ci-release-.*$/ - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+\.[0-9]+.*$/ - script: - - ./.maintain/gitlab/check_signed.sh - -check-line-width: - stage: check - image: paritytech/tools:latest - <<: *kubernetes-build - rules: - - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs - script: - - ./.maintain/gitlab/check_line_width.sh - allow_failure: true - -test-dependency-rules: - stage: check - image: paritytech/tools:latest - <<: *kubernetes-build - script: - - .maintain/ensure-deps.sh - -#### stage: test - -cargo-audit: - stage: test - <<: *docker-env - rules: - - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs - when: never - - if: $CI_PIPELINE_SOURCE == "web" - - if: $CI_PIPELINE_SOURCE == "schedule" - - if: $CI_COMMIT_REF_NAME == "master" - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - script: - - cargo audit - allow_failure: true - -cargo-deny: - stage: test - <<: *docker-env - rules: - - if: $CI_COMMIT_MESSAGE =~ /skip-checks/ - when: never - - if: $CI_PIPELINE_SOURCE == "web" - - if: $CI_PIPELINE_SOURCE == "schedule" - - if: $CI_COMMIT_REF_NAME == "master" - - if: $CI_COMMIT_REF_NAME == "tags" - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - script: - - cargo deny check --hide-inclusion-graph -c .maintain/deny.toml - after_script: - - echo "___The complete log is in the artifacts___" - - cargo deny check -c .maintain/deny.toml 2> deny.log - artifacts: - name: $CI_COMMIT_SHORT_SHA - expire_in: 3 days - when: always - paths: - - deny.log - -cargo-check-benches: - stage: test - <<: *docker-env - <<: *test-refs - script: - - SKIP_WASM_BUILD=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: - stage: test - <<: *docker-env - <<: *test-refs - script: - - cd ./bin/utils/subkey - - SKIP_WASM_BUILD=1 time cargo check --release - - sccache -s - -test-deterministic-wasm: - stage: test - <<: *docker-env - <<: *test-refs - variables: - <<: *default-vars - WASM_BUILD_NO_COLOR: 1 - script: - # build runtime - - cargo build --verbose --release -p node-runtime - # make checksum - - sha256sum target/release/wbuild/node-runtime/target/wasm32-unknown-unknown/release/node_runtime.wasm > checksum.sha256 - # clean up – FIXME: can we reuse some of the artifacts? - - cargo clean - # build again - - cargo build --verbose --release -p node-runtime - # confirm checksum - - sha256sum -c checksum.sha256 - - sccache -s - -test-linux-stable: &test-linux - stage: test - <<: *docker-env - <<: *test-refs - 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 -Dwarnings" - RUST_BACKTRACE: 1 - WASM_BUILD_NO_COLOR: 1 - script: - # this job runs all tests in former runtime-benchmarks, frame-staking and wasmtime tests - - time cargo test --workspace --locked --release --verbose --features runtime-benchmarks --manifest-path bin/node/cli/Cargo.toml - - SUBSTRATE_TEST_TIMEOUT=1 time cargo test -p substrate-test-utils --release --verbose --locked -- --ignored timeout - - sccache -s - -unleash-check: - stage: test - <<: *docker-env - rules: - - if: $CI_COMMIT_MESSAGE =~ /skip-checks/ - when: never - # .test-refs - - if: $CI_COMMIT_REF_NAME == "master" - - if: $CI_COMMIT_REF_NAME == "tags" - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - script: - - cargo install cargo-unleash ${CARGO_UNLEASH_INSTALL_PARAMS} - - cargo unleash check ${CARGO_UNLEASH_PKG_DEF} - -test-frame-examples-compile-to-wasm: - # into one job - stage: test - <<: *docker-env - <<: *test-refs - 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 - RUST_BACKTRACE: 1 - script: - - cd frame/example-offchain-worker/ - - cargo +nightly build --target=wasm32-unknown-unknown --no-default-features - - cd ../example - - cargo +nightly build --target=wasm32-unknown-unknown --no-default-features - - sccache -s - -test-linux-stable-int: - <<: *test-linux - 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 - time cargo test -p node-cli --release --verbose --locked -- --ignored - &> ${CI_COMMIT_SHORT_SHA}_int_failure.log - - sccache -s - after_script: - - awk '/FAILED|^error\[/,0' ${CI_COMMIT_SHORT_SHA}_int_failure.log - artifacts: - name: $CI_COMMIT_SHORT_SHA - when: on_failure - expire_in: 3 days - paths: - - ${CI_COMMIT_SHORT_SHA}_int_failure.log - -check-web-wasm: - stage: test - <<: *docker-env - <<: *test-refs - script: - # WASM support is in progress. As more and more crates support WASM, we - # should add entries here. See https://github.com/paritytech/substrate/issues/2416 - - time cargo build --target=wasm32-unknown-unknown -p sp-io - - time cargo build --target=wasm32-unknown-unknown -p sp-runtime - - time cargo build --target=wasm32-unknown-unknown -p sp-std - - time cargo build --target=wasm32-unknown-unknown -p sc-consensus-aura - - time cargo build --target=wasm32-unknown-unknown -p sc-consensus-babe - - time cargo build --target=wasm32-unknown-unknown -p sp-consensus - - time cargo build --target=wasm32-unknown-unknown -p sc-telemetry - # Note: the command below is a bit weird because several Cargo issues prevent us from compiling the node in a more straight-forward way. - - time cargo +nightly build --manifest-path=bin/node/cli/Cargo.toml --no-default-features --features browser --target=wasm32-unknown-unknown -Z features=itarget - # with-tracing must be explicitly activated, we run a test to ensure this works as expected in both cases - - time cargo +nightly test --manifest-path primitives/tracing/Cargo.toml --no-default-features - - time cargo +nightly test --manifest-path primitives/tracing/Cargo.toml --no-default-features --features=with-tracing - - sccache -s - -test-full-crypto-feature: - stage: test - <<: *docker-env - <<: *test-refs - 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 - RUST_BACKTRACE: 1 - script: - - cd primitives/core/ - - time cargo +nightly build --verbose --no-default-features --features full_crypto - - cd ../application-crypto - - time cargo +nightly build --verbose --no-default-features --features full_crypto - - sccache -s - -cargo-check-macos: - stage: test - # shell runner on mac ignores the image set in *docker-env - <<: *docker-env - <<: *test-refs - script: - - SKIP_WASM_BUILD=1 time cargo check --release - - sccache -s - 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 - rules: - - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs - script: - - ./.maintain/gitlab/check_polkadot_companion_status.sh - -check-polkadot-companion-build: - stage: build - <<: *docker-env - <<: *test-refs - needs: - - job: test-linux-stable-int - artifacts: false - script: - - ./.maintain/gitlab/check_polkadot_companion_build.sh - after_script: - - cd polkadot && git rev-parse --abbrev-ref HEAD - allow_failure: true - -test-browser-node: - stage: build - <<: *docker-env - <<: *test-refs - 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 - -build-linux-substrate: &build-binary - stage: build - <<: *collect-artifacts - <<: *docker-env - rules: - # .build-refs with manual on PRs and chaos - - if: $CI_PIPELINE_SOURCE == "web" - - if: $CI_COMMIT_REF_NAME == "master" - - if: $CI_COMMIT_REF_NAME == "tags" - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - - if: $CI_COMMIT_MESSAGE =~ /\[chaos:(basic|medium|large)\]/ && $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # i.e add [chaos:basic] in commit message to trigger - - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs - when: manual - allow_failure: true - needs: - - job: test-linux-stable - artifacts: false - before_script: - - mkdir -p ./artifacts/substrate/ - script: - - WASM_BUILD_NO_COLOR=1 time cargo build --release --verbose - - mv ./target/release/substrate ./artifacts/substrate/. - - echo -n "Substrate version = " - - if [ "${CI_COMMIT_TAG}" ]; then - echo "${CI_COMMIT_TAG}" | tee ./artifacts/substrate/VERSION; - else - ./artifacts/substrate/substrate --version | - sed -n -E 's/^substrate ([0-9.]+.*-[0-9a-f]{7,13})-.*$/\1/p' | - tee ./artifacts/substrate/VERSION; - fi - - sha256sum ./artifacts/substrate/substrate | tee ./artifacts/substrate/substrate.sha256 - - printf '\n# building node-template\n\n' - - ./.maintain/node-template-release.sh ./artifacts/substrate/substrate-node-template.tar.gz - - cp -r .maintain/docker/substrate.Dockerfile ./artifacts/substrate/ - - sccache -s - -build-linux-subkey: &build-subkey - stage: build - <<: *collect-artifacts - <<: *docker-env - rules: - # .build-refs with manual on PRs - - if: $CI_PIPELINE_SOURCE == "web" - - if: $CI_COMMIT_REF_NAME == "master" - - if: $CI_COMMIT_REF_NAME == "tags" - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs - when: manual - allow_failure: true - needs: - - job: cargo-check-subkey - artifacts: false - before_script: - - mkdir -p ./artifacts/subkey - script: - - cd ./bin/utils/subkey - - SKIP_WASM_BUILD=1 time cargo build --release --verbose - - cd - - - mv ./target/release/subkey ./artifacts/subkey/. - - echo -n "Subkey version = " - - ./artifacts/subkey/subkey --version | - sed -n -E 's/^subkey ([0-9.]+.*)/\1/p' | - tee ./artifacts/subkey/VERSION; - - sha256sum ./artifacts/subkey/subkey | tee ./artifacts/subkey/subkey.sha256 - - cp -r .maintain/docker/subkey.Dockerfile ./artifacts/subkey/ - - sccache -s - -build-macos-subkey: - <<: *build-subkey - tags: - - osx - build-rust-doc: stage: build <<: *docker-env <<: *test-refs - needs: - - job: test-linux-stable - artifacts: false + # needs: + # - job: test-linux-stable + # artifacts: false variables: <<: *default-vars RUSTFLAGS: -Dwarnings @@ -490,305 +135,3 @@ build-rust-doc: - mv ./target/doc ./crate-docs - echo "" > ./crate-docs/index.html - sccache -s - -#### stage: post-build-test - -trigger-contracts-ci: - stage: post-build-test - needs: - - job: build-linux-substrate - artifacts: false - - job: test-linux-stable - artifacts: false - trigger: - project: parity/srml-contracts-waterfall - branch: master - strategy: depend - rules: - - if: $CI_PIPELINE_SOURCE == "web" - - if: $CI_PIPELINE_SOURCE == "schedule" - - if: $CI_COMMIT_REF_NAME == "master" - -#### stage: chaos-env - -build-chaos-docker: - stage: chaos-env - rules: - # .build-refs with chaos - - if: $CI_PIPELINE_SOURCE == "web" - - if: $CI_COMMIT_REF_NAME == "master" - - if: $CI_COMMIT_REF_NAME == "tags" - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - - if: $CI_COMMIT_MESSAGE =~ /\[chaos:(basic|medium|large)\]/ && $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # i.e add [chaos:basic] in commit message to trigger - needs: - - job: build-linux-substrate - image: docker:stable - tags: - - kubernetes-parity-build - variables: - <<: *default-vars - DOCKER_HOST: tcp://localhost:2375 - DOCKER_DRIVER: overlay2 - PRODUCT: substrate - DOCKERFILE: $PRODUCT.Dockerfile - CONTAINER_IMAGE: paritypr/$PRODUCT - environment: - name: parity-simnet - services: - - docker:dind - before_script: - - test "$DOCKER_CHAOS_USER" -a "$DOCKER_CHAOS_TOKEN" - || ( echo "no docker credentials provided"; exit 1 ) - - docker login -u "$DOCKER_CHAOS_USER" -p "$DOCKER_CHAOS_TOKEN" - - docker info - script: - - cd ./artifacts/$PRODUCT/ - - VERSION="ci-${CI_COMMIT_SHORT_SHA}" - - echo "${PRODUCT} version = ${VERSION}" - - test -z "${VERSION}" && exit 1 - - docker build - --build-arg VCS_REF="${CI_COMMIT_SHA}" - --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" - --tag $CONTAINER_IMAGE:$VERSION - --file $DOCKERFILE . - - docker push $CONTAINER_IMAGE:$VERSION - after_script: - - docker logout - -#### stage: chaos - -chaos-test-singlenodeheight: - stage: chaos - rules: - # .build-refs with chaos - - if: $CI_PIPELINE_SOURCE == "web" - - if: $CI_COMMIT_REF_NAME == "master" - - if: $CI_COMMIT_REF_NAME == "tags" - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - - if: $CI_COMMIT_MESSAGE =~ /\[chaos:(basic|medium|large)\]/ && $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # i.e add [chaos:basic] in commit message to trigger - image: paritypr/simnet:latest - needs: - - job: build-chaos-docker - tags: - - parity-simnet - variables: - <<: *default-vars - PRODUCT: substrate - DOCKERFILE: $PRODUCT.Dockerfile - CONTAINER_IMAGE: paritypr/$PRODUCT - KEEP_NAMESPACE: 0 - NAMESPACE: "substrate-ci-${CI_COMMIT_SHORT_SHA}-${CI_PIPELINE_ID}" - VERSION: "ci-${CI_COMMIT_SHORT_SHA}" - interruptible: true - environment: - name: parity-simnet - script: - - simnet spawn dev -i $CONTAINER_IMAGE:$VERSION - - simnet singlenodeheight -h 30 - after_script: - - simnet clean - -#### stage: publish - -.build-push-docker-image: &build-push-docker-image - <<: *build-refs - <<: *kubernetes-build - image: docker:stable - services: - - docker:dind - 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 ) - - docker login -u "$Docker_Hub_User_Parity" -p "$Docker_Hub_Pass_Parity" - - docker info - script: - - cd ./artifacts/$PRODUCT/ - - VERSION="$(cat ./VERSION)" - - echo "${PRODUCT} version = ${VERSION}" - - test -z "${VERSION}" && exit 1 - - docker build - --build-arg VCS_REF="${CI_COMMIT_SHA}" - --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" - --tag $CONTAINER_IMAGE:$VERSION - --tag $CONTAINER_IMAGE:latest - --file $DOCKERFILE . - - docker push $CONTAINER_IMAGE:$VERSION - - docker push $CONTAINER_IMAGE:latest - -publish-docker-substrate: - stage: publish - <<: *build-push-docker-image - # collect VERSION artifact here to pass it on to kubernetes - <<: *collect-artifacts - needs: - - job: build-linux-substrate - artifacts: true - variables: - <<: *docker-build-vars - PRODUCT: substrate - after_script: - - docker logout - # only VERSION information is needed for the deployment - - find ./artifacts/ -depth -not -name VERSION -type f -delete - -publish-docker-subkey: - stage: publish - <<: *build-push-docker-image - needs: - - job: build-linux-subkey - artifacts: true - variables: - <<: *docker-build-vars - PRODUCT: subkey - after_script: - - docker logout - -publish-s3-release: - stage: publish - <<: *build-refs - <<: *kubernetes-build - 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" - PREFIX: "substrate/${ARCH}-${DOCKER_OS}" - script: - - aws s3 sync ./artifacts/ s3://${BUCKET}/${PREFIX}/$(cat ./artifacts/substrate/VERSION)/ - - echo "update objects in latest path" - - aws s3 sync s3://${BUCKET}/${PREFIX}/$(cat ./artifacts/substrate/VERSION)/ s3://${BUCKET}/${PREFIX}/latest/ - after_script: - - aws s3 ls s3://${BUCKET}/${PREFIX}/latest/ - --recursive --human-readable --summarize - -publish-s3-doc: - stage: publish - image: paritytech/awscli:latest - allow_failure: true - needs: - - job: build-rust-doc - artifacts: true - - job: build-linux-substrate - artifacts: false - <<: *build-refs - <<: *kubernetes-build - variables: - GIT_STRATEGY: none - BUCKET: "releases.parity.io" - PREFIX: "substrate-rustdoc" - script: - - test -r ./crate-docs/index.html || ( - echo "./crate-docs/index.html not present, build:rust:doc:release job not complete"; - exit 1 - ) - - aws s3 sync --delete --size-only --only-show-errors - ./crate-docs/ s3://${BUCKET}/${PREFIX}/ - after_script: - - aws s3 ls s3://${BUCKET}/${PREFIX}/ - --human-readable --summarize - -publish-draft-release: - stage: publish - image: paritytech/tools:latest - rules: - - if: $CI_COMMIT_REF_NAME =~ /^ci-release-.*$/ - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+\.[0-9]+.*$/ - script: - - ./.maintain/gitlab/publish_draft_release.sh - allow_failure: true - -publish-to-crates-io: - stage: publish - <<: *docker-env - rules: - - if: $CI_COMMIT_REF_NAME =~ /^ci-release-.*$/ - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+\.[0-9]+.*$/ - script: - - cargo install cargo-unleash ${CARGO_UNLEASH_INSTALL_PARAMS} - - cargo unleash em-dragons --no-check --owner github:paritytech:core-devs ${CARGO_UNLEASH_PKG_DEF} - allow_failure: true - -deploy-kubernetes-alerting-rules: - stage: deploy - interruptible: true - retry: 1 - tags: - - kubernetes-parity-build - image: paritytech/kubetools:latest - environment: - name: parity-mgmt-polkadot-alerting - variables: - NAMESPACE: monitoring - PROMETHEUSRULE: prometheus-k8s-rules-polkadot-alerting - RULES: .maintain/monitoring/alerting-rules/alerting-rules.yaml - script: - - echo "deploying prometheus alerting rules" - - kubectl -n ${NAMESPACE} patch prometheusrule ${PROMETHEUSRULE} - --type=merge --patch "$(sed 's/^/ /;1s/^/spec:\n/' ${RULES})" - rules: - - if: $CI_COMMIT_REF_NAME == "master" - changes: - - .gitlab-ci.yml - - .maintain/monitoring/**/* - -.validator-deploy: &validator-deploy - stage: flaming-fir - rules: - # .build-refs, but manual - - if: $CI_COMMIT_REF_NAME == "master" - when: manual - - if: $CI_PIPELINE_SOURCE == "web" - when: manual - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - when: manual - 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 - interruptible: true - tags: - - linux-docker - -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 - rules: - - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs - script: - - ./.maintain/gitlab/check_labels.sh From 6e846f95d5fed32697bba6a0a76171ab273a546d Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 4 Dec 2020 11:25:53 +0100 Subject: [PATCH 2/9] CI: fail docs on warns, now for real --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d514cd942f8b3..ed7c518e92002 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -121,7 +121,8 @@ build-rust-doc: # artifacts: false variables: <<: *default-vars - RUSTFLAGS: -Dwarnings + RUSTDOCFLAGS: "--html-in-header $(pwd)/.maintain/rustdoc-header.html -Dwarnings" + SKIP_WASM_BUILD: 1 artifacts: name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc" when: on_success @@ -130,8 +131,7 @@ build-rust-doc: - ./crate-docs/ script: - rm -f ./crate-docs/index.html # use it as an indicator if the job succeeds - - SKIP_WASM_BUILD=1 RUSTDOCFLAGS="--html-in-header $(pwd)/.maintain/rustdoc-header.html" - time cargo +nightly doc --no-deps --workspace --all-features --verbose + - time cargo +nightly doc --no-deps --workspace --all-features --verbose - mv ./target/doc ./crate-docs - echo "" > ./crate-docs/index.html - sccache -s From 64e6a8c3dc841a610190fcdc42b07b9c29e42eb2 Mon Sep 17 00:00:00 2001 From: Denis P Date: Fri, 4 Dec 2020 11:35:50 +0100 Subject: [PATCH 3/9] CI: fix flag --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ed7c518e92002..c07d55d0d198a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -121,7 +121,6 @@ build-rust-doc: # artifacts: false variables: <<: *default-vars - RUSTDOCFLAGS: "--html-in-header $(pwd)/.maintain/rustdoc-header.html -Dwarnings" SKIP_WASM_BUILD: 1 artifacts: name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc" @@ -131,7 +130,8 @@ build-rust-doc: - ./crate-docs/ script: - rm -f ./crate-docs/index.html # use it as an indicator if the job succeeds - - time cargo +nightly doc --no-deps --workspace --all-features --verbose + - RUSTDOCFLAGS="--html-in-header $(pwd)/.maintain/rustdoc-header.html -Dwarnings" + time cargo +nightly doc --no-deps --workspace --all-features --verbose - mv ./target/doc ./crate-docs - echo "" > ./crate-docs/index.html - sccache -s From 5ac2675fe87cc76758b29a9e761dede54ef7f071 Mon Sep 17 00:00:00 2001 From: Dan Forbes Date: Thu, 10 Dec 2020 15:17:15 -0800 Subject: [PATCH 4/9] Fix docs (#7710) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix docs * Update frame/merkle-mountain-range/src/lib.rs Co-authored-by: Alexander Theißen Co-authored-by: Alexander Theißen --- bin/node/browser-testing/src/lib.rs | 2 +- bin/node/runtime/src/lib.rs | 2 +- client/authority-discovery/src/service.rs | 8 ++++---- client/authority-discovery/src/worker.rs | 6 +++--- client/basic-authorship/src/basic_authorship.rs | 2 +- client/basic-authorship/src/lib.rs | 2 +- client/cli/src/commands/run_cmd.rs | 7 ++++--- client/cli/src/commands/utils.rs | 2 +- client/cli/src/config.rs | 2 +- client/finality-grandpa/src/lib.rs | 2 +- client/network/src/gossip.rs | 2 +- client/service/src/client/mod.rs | 11 ++++++----- client/telemetry/src/async_record.rs | 2 +- frame/contracts/src/schedule.rs | 2 +- frame/example/src/lib.rs | 6 +++--- frame/proxy/src/lib.rs | 2 +- frame/session/src/historical/onchain.rs | 2 +- frame/staking/src/lib.rs | 4 ++-- frame/staking/src/slashing.rs | 2 +- frame/support/src/traits.rs | 2 +- frame/transaction-payment/src/lib.rs | 2 +- frame/treasury/src/lib.rs | 8 ++++---- primitives/npos-elections/compact/src/lib.rs | 4 ++-- primitives/npos-elections/src/balancing.rs | 2 +- primitives/npos-elections/src/lib.rs | 8 ++++---- primitives/npos-elections/src/phragmen.rs | 3 +-- primitives/npos-elections/src/reduce.rs | 2 +- test-utils/runtime/src/lib.rs | 2 +- utils/prometheus/src/lib.rs | 2 +- 29 files changed, 52 insertions(+), 51 deletions(-) diff --git a/bin/node/browser-testing/src/lib.rs b/bin/node/browser-testing/src/lib.rs index 777e5ea9f132e..f4dc090856782 100644 --- a/bin/node/browser-testing/src/lib.rs +++ b/bin/node/browser-testing/src/lib.rs @@ -26,7 +26,7 @@ //! ``` //! For debug infomation, such as the informant, run without the `--headless` //! flag and open a browser to the url that `wasm-pack test` outputs. -//! For more infomation see https://rustwasm.github.io/docs/wasm-pack/. +//! For more infomation see . use wasm_bindgen_test::{wasm_bindgen_test, wasm_bindgen_test_configure}; use wasm_bindgen_futures::JsFuture; diff --git a/bin/node/runtime/src/lib.rs b/bin/node/runtime/src/lib.rs index be3783cd7ca5c..f9ff491a67fc8 100644 --- a/bin/node/runtime/src/lib.rs +++ b/bin/node/runtime/src/lib.rs @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -//! The Substrate runtime. This can be compiled with ``#[no_std]`, ready for Wasm. +//! The Substrate runtime. This can be compiled with `#[no_std]`, ready for Wasm. #![cfg_attr(not(feature = "std"), no_std)] // `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256. diff --git a/client/authority-discovery/src/service.rs b/client/authority-discovery/src/service.rs index 7eabeb3daf52e..d23d2f3a480f7 100644 --- a/client/authority-discovery/src/service.rs +++ b/client/authority-discovery/src/service.rs @@ -22,14 +22,14 @@ use futures::SinkExt; use sc_network::{Multiaddr, PeerId}; use sp_authority_discovery::AuthorityId; -/// Service to interact with the [`Worker`]. +/// Service to interact with the [`crate::Worker`]. #[derive(Clone)] pub struct Service { to_worker: mpsc::Sender, } -/// A [`Service`] allows to interact with a [`Worker`], e.g. by querying the -/// [`Worker`]'s local address cache for a given [`AuthorityId`]. +/// A [`Service`] allows to interact with a [`crate::Worker`], e.g. by querying the +/// [`crate::Worker`]'s local address cache for a given [`AuthorityId`]. impl Service { pub(crate) fn new(to_worker: mpsc::Sender) -> Self { Self { @@ -44,7 +44,7 @@ impl Service { /// [`crate::Worker`] failed. /// /// Note: [`Multiaddr`]s returned always include a [`PeerId`] via a - /// [`libp2p::core::multiaddr:Protocol::P2p`] component. Equality of + /// [`libp2p::core::multiaddr::Protocol::P2p`] component. Equality of /// [`PeerId`]s across [`Multiaddr`]s returned by a single call is not /// enforced today, given that there are still authorities out there /// publishing the addresses of their sentry nodes on the DHT. In the future diff --git a/client/authority-discovery/src/worker.rs b/client/authority-discovery/src/worker.rs index 45b55f76673c2..d886f24542d76 100644 --- a/client/authority-discovery/src/worker.rs +++ b/client/authority-discovery/src/worker.rs @@ -100,7 +100,7 @@ pub enum Role { /// /// 5. Allow querying of the collected addresses via the [`crate::Service`]. pub struct Worker { - /// Channel receiver for messages send by a [`Service`]. + /// Channel receiver for messages send by a [`crate::Service`]. from_service: Fuse>, client: Arc, @@ -615,8 +615,8 @@ where } /// NetworkProvider provides [`Worker`] with all necessary hooks into the -/// underlying Substrate networking. Using this trait abstraction instead of [`NetworkService`] -/// directly is necessary to unit test [`Worker`]. +/// underlying Substrate networking. Using this trait abstraction instead of +/// [`sc_network::NetworkService`] directly is necessary to unit test [`Worker`]. #[async_trait] pub trait NetworkProvider: NetworkStateInfo { /// Modify a peerset priority group. diff --git a/client/basic-authorship/src/basic_authorship.rs b/client/basic-authorship/src/basic_authorship.rs index 8c022ef3a9741..065acbde2cc95 100644 --- a/client/basic-authorship/src/basic_authorship.rs +++ b/client/basic-authorship/src/basic_authorship.rs @@ -44,7 +44,7 @@ use sc_proposer_metrics::MetricsLink as PrometheusMetrics; /// Default maximum block size in bytes used by [`Proposer`]. /// -/// Can be overwritten by [`ProposerFactory::set_maxium_block_size`]. +/// Can be overwritten by [`ProposerFactory::set_maximum_block_size`]. /// /// Be aware that there is also an upper packet size on what the networking code /// will accept. If the block doesn't fit in such a package, it can not be diff --git a/client/basic-authorship/src/lib.rs b/client/basic-authorship/src/lib.rs index 9b0c491508231..2cb66d4ccc40b 100644 --- a/client/basic-authorship/src/lib.rs +++ b/client/basic-authorship/src/lib.rs @@ -71,4 +71,4 @@ mod basic_authorship; -pub use crate::basic_authorship::{ProposerFactory, Proposer}; +pub use crate::basic_authorship::{ProposerFactory, Proposer, DEFAULT_MAX_BLOCK_SIZE}; diff --git a/client/cli/src/commands/run_cmd.rs b/client/cli/src/commands/run_cmd.rs index 019b760e5b4ae..48bad16afb677 100644 --- a/client/cli/src/commands/run_cmd.rs +++ b/client/cli/src/commands/run_cmd.rs @@ -75,7 +75,8 @@ pub struct RunCmd { /// Listen to all RPC interfaces. /// /// Default is local. Note: not all RPC methods are safe to be exposed publicly. Use an RPC proxy - /// server to filter out dangerous methods. More details: https://github.com/paritytech/substrate/wiki/Public-RPC. + /// server to filter out dangerous methods. More details: + /// . /// Use `--unsafe-rpc-external` to suppress the warning if you understand the risks. #[structopt(long = "rpc-external")] pub rpc_external: bool, @@ -105,7 +106,7 @@ pub struct RunCmd { /// Listen to all Websocket interfaces. /// /// Default is local. Note: not all RPC methods are safe to be exposed publicly. Use an RPC proxy - /// server to filter out dangerous methods. More details: https://github.com/paritytech/substrate/wiki/Public-RPC. + /// server to filter out dangerous methods. More details: . /// Use `--unsafe-ws-external` to suppress the warning if you understand the risks. #[structopt(long = "ws-external")] pub ws_external: bool, @@ -142,7 +143,7 @@ pub struct RunCmd { /// /// A comma-separated list of origins (protocol://domain or special `null` /// value). Value of `all` will disable origin validation. Default is to - /// allow localhost and https://polkadot.js.org origins. When running in + /// allow localhost and origins. When running in /// --dev mode the default is to allow all origins. #[structopt(long = "rpc-cors", value_name = "ORIGINS", parse(try_from_str = parse_cors))] pub rpc_cors: Option, diff --git a/client/cli/src/commands/utils.rs b/client/cli/src/commands/utils.rs index 6e48d04e1328b..25c7294fd1e0a 100644 --- a/client/cli/src/commands/utils.rs +++ b/client/cli/src/commands/utils.rs @@ -57,7 +57,7 @@ pub fn read_uri(uri: Option<&String>) -> error::Result { /// 2. Try to construct the `Pair` while using `uri` as input for [`sp_core::Pair::from_string_with_seed`]. /// /// 3. Try to construct the `Pair::Public` while using `uri` as input for -/// [`sp_core::Pair::Public::from_string_with_version`]. +/// [`sp_core::crypto::Ss58Codec::from_string_with_version`]. pub fn print_from_uri( uri: &str, password: Option, diff --git a/client/cli/src/config.rs b/client/cli/src/config.rs index e4411e49408e5..38f0ac2e956f6 100644 --- a/client/cli/src/config.rs +++ b/client/cli/src/config.rs @@ -47,7 +47,7 @@ const RECOMMENDED_OPEN_FILE_DESCRIPTOR_LIMIT: u64 = 10_000; /// Default configuration values used by Substrate /// -/// These values will be used by [`CliConfiguritation`] to set +/// These values will be used by [`CliConfiguration`] to set /// default values for e.g. the listen port or the RPC port. pub trait DefaultConfigurationValues { /// The port Substrate should listen on for p2p connections. diff --git a/client/finality-grandpa/src/lib.rs b/client/finality-grandpa/src/lib.rs index ced101b8c8562..0757a484afb4a 100644 --- a/client/finality-grandpa/src/lib.rs +++ b/client/finality-grandpa/src/lib.rs @@ -329,7 +329,7 @@ impl BlockStatus for Arc where /// A trait that includes all the client functionalities grandpa requires. /// Ideally this would be a trait alias, we're not there yet. -/// tracking issue https://github.com/rust-lang/rust/issues/41517 +/// tracking issue pub trait ClientForGrandpa: LockImportRun + Finalizer + AuxStore + HeaderMetadata + HeaderBackend diff --git a/client/network/src/gossip.rs b/client/network/src/gossip.rs index ac3f92e9d37aa..8a46d0701e932 100644 --- a/client/network/src/gossip.rs +++ b/client/network/src/gossip.rs @@ -41,7 +41,7 @@ //! In normal situations, messages sent through a [`QueuedSender`] will arrive in the same //! order as they have been sent. //! It is possible, in the situation of disconnects and reconnects, that messages arrive in a -//! different order. See also https://github.com/paritytech/substrate/issues/6756. +//! different order. See also . //! However, if multiple instances of [`QueuedSender`] exist for the same peer and protocol, or //! if some other code uses the [`NetworkService`] to send notifications to this combination or //! peer and protocol, then the notifications will be interleaved in an unpredictable way. diff --git a/client/service/src/client/mod.rs b/client/service/src/client/mod.rs index b3aa2fa076af5..e4d1dc8bd8509 100644 --- a/client/service/src/client/mod.rs +++ b/client/service/src/client/mod.rs @@ -23,22 +23,23 @@ //! //! - A database containing the blocks and chain state, generally referred to as //! the [`Backend`](sc_client_api::backend::Backend). -//! - A runtime environment, generally referred to as the [`Executor`](CallExecutor). +//! - A runtime environment, generally referred to as the +//! [`Executor`](sc_client_api::call_executor::CallExecutor). //! //! # Initialization //! //! Creating a [`Client`] is done by calling the `new` method and passing to it a -//! [`Backend`](sc_client_api::backend::Backend) and an [`Executor`](CallExecutor). +//! [`Backend`](sc_client_api::backend::Backend) and an +//! [`Executor`](sc_client_api::call_executor::CallExecutor). //! //! The former is typically provided by the `sc-client-db` crate. //! //! The latter typically requires passing one of: //! //! - A [`LocalCallExecutor`] running the runtime locally. -//! - A [`RemoteCallExecutor`](light::call_executor::RemoteCallRequest) that will ask a +//! - A [`RemoteCallExecutor`](sc_client_api::light::RemoteCallRequest) that will ask a //! third-party to perform the executions. -//! - A [`RemoteOrLocalCallExecutor`](light::call_executor::RemoteOrLocalCallExecutor), combination -//! of the two. +//! - A [`RemoteOrLocalCallExecutor`](sc_client_api::light::LocalOrRemote), combination of the two. //! //! Additionally, the fourth generic parameter of the `Client` is a marker type representing //! the ways in which the runtime can interface with the outside. Any code that builds a `Client` diff --git a/client/telemetry/src/async_record.rs b/client/telemetry/src/async_record.rs index 34b7c1435afa1..06650a54defd4 100644 --- a/client/telemetry/src/async_record.rs +++ b/client/telemetry/src/async_record.rs @@ -1,6 +1,6 @@ //! # Internal types to ssync drain slog //! FIXME: REMOVE THIS ONCE THE PR WAS MERGE -//! https://github.com/slog-rs/async/pull/14 +//! use slog::{Record, RecordStatic, Level, SingleKV, KV, BorrowedKV}; use slog::{Serializer, OwnedKVList, Key}; diff --git a/frame/contracts/src/schedule.rs b/frame/contracts/src/schedule.rs index b80aceb361fe9..df1ea240630cd 100644 --- a/frame/contracts/src/schedule.rs +++ b/frame/contracts/src/schedule.rs @@ -69,7 +69,7 @@ pub struct Limits { /// Maximum allowed stack height in number of elements. /// - /// See https://wiki.parity.io/WebAssembly-StackHeight to find out + /// See to find out /// how the stack frame cost is calculated. Each element can be of one of the /// wasm value types. This means the maximum size per element is 64bit. pub stack_height: u32, diff --git a/frame/example/src/lib.rs b/frame/example/src/lib.rs index fb84a48a8d2d3..fbf708a9c78a1 100644 --- a/frame/example/src/lib.rs +++ b/frame/example/src/lib.rs @@ -131,7 +131,7 @@ //! //! //! // Reference documentation of aspects such as `storageItems` and `dispatchable` functions should only be -//! // included in the https://docs.rs Rustdocs for Substrate and not repeated in the README file. +//! // included in the Rustdocs for Substrate and not repeated in the README file. //! //! \### Dispatchable Functions //! @@ -224,8 +224,8 @@ //! // Show a usage example in an actual runtime //! //! // See: -//! // - Substrate TCR https://github.com/parity-samples/substrate-tcr -//! // - Substrate Kitties https://shawntabrizi.github.io/substrate-collectables-workshop/#/ +//! // - Substrate TCR +//! // - Substrate Kitties //! //! \## Genesis Config //! diff --git a/frame/proxy/src/lib.rs b/frame/proxy/src/lib.rs index 3d707d2383672..765251744c27b 100644 --- a/frame/proxy/src/lib.rs +++ b/frame/proxy/src/lib.rs @@ -706,7 +706,7 @@ impl Module { pub mod migration { use super::*; - /// Migration code for https://github.com/paritytech/substrate/pull/6770 + /// Migration code for /// /// Details: This migration was introduced between Substrate 2.0-RC6 and Substrate 2.0 releases. /// Before this migration, the `Proxies` storage item used a tuple of `AccountId` and diff --git a/frame/session/src/historical/onchain.rs b/frame/session/src/historical/onchain.rs index f4576675c1183..1ee7ce4419df9 100644 --- a/frame/session/src/historical/onchain.rs +++ b/frame/session/src/historical/onchain.rs @@ -55,7 +55,7 @@ pub fn store_session_validator_set_to_offchain() { store_session_validator_set_to_offchain::(>::current_index()); diff --git a/frame/staking/src/lib.rs b/frame/staking/src/lib.rs index 5f5f5ff2bb6e0..3fda8306503f6 100644 --- a/frame/staking/src/lib.rs +++ b/frame/staking/src/lib.rs @@ -2166,7 +2166,7 @@ impl Module { Self::bonded(stash).and_then(Self::ledger).map(|l| l.active).unwrap_or_default() } - /// Internal impl of [`slashable_balance_of`] that returns [`VoteWeight`]. + /// Internal impl of [`Self::slashable_balance_of`] that returns [`VoteWeight`]. pub fn slashable_balance_of_vote_weight(stash: &T::AccountId, issuance: BalanceOf) -> VoteWeight { T::CurrencyToVote::to_vote(Self::slashable_balance_of(stash), issuance) } @@ -2833,7 +2833,7 @@ impl Module { /// Execute election and return the new results. The edge weights are processed into support /// values. /// - /// This is basically a wrapper around [`do_phragmen`] which translates + /// This is basically a wrapper around [`Self::do_phragmen`] which translates /// `PrimitiveElectionResult` into `ElectionResult`. /// /// No storage item is updated. diff --git a/frame/staking/src/slashing.rs b/frame/staking/src/slashing.rs index b1f0c9d9a4427..e59f2e84e4323 100644 --- a/frame/staking/src/slashing.rs +++ b/frame/staking/src/slashing.rs @@ -47,7 +47,7 @@ //! has multiple misbehaviors. However, accounting for such cases is necessary //! to deter a class of "rage-quit" attacks. //! -//! Based on research at https://research.web3.foundation/en/latest/polkadot/slashing/npos/ +//! Based on research at use super::{ EraIndex, Config, Module, Store, BalanceOf, Exposure, Perbill, SessionInterface, diff --git a/frame/support/src/traits.rs b/frame/support/src/traits.rs index 1bbcd87cc2e39..718f1d6354a3a 100644 --- a/frame/support/src/traits.rs +++ b/frame/support/src/traits.rs @@ -1901,7 +1901,7 @@ impl PalletVersion { /// Returns the storage key for a pallet version. /// - /// See [`PALLET_VERSION_STORAGE_KEY_POSTIFX`] on how this key is built. + /// See [`PALLET_VERSION_STORAGE_KEY_POSTFIX`] on how this key is built. /// /// Returns `None` if the given `PI` returned a `None` as name for the given /// `Pallet`. diff --git a/frame/transaction-payment/src/lib.rs b/frame/transaction-payment/src/lib.rs index 554b2e801afe0..26e6222f1b4c2 100644 --- a/frame/transaction-payment/src/lib.rs +++ b/frame/transaction-payment/src/lib.rs @@ -109,7 +109,7 @@ type BalanceOf = /// Meaning that fees can change by around ~23% per day, given extreme congestion. /// /// More info can be found at: -/// https://w3f-research.readthedocs.io/en/latest/polkadot/Token%20Economics.html +/// pub struct TargetedFeeAdjustment(sp_std::marker::PhantomData<(T, S, V, M)>); /// Something that can convert the current multiplier to the next one. diff --git a/frame/treasury/src/lib.rs b/frame/treasury/src/lib.rs index e180f64d1cbdf..6ccd8f03a159c 100644 --- a/frame/treasury/src/lib.rs +++ b/frame/treasury/src/lib.rs @@ -414,19 +414,19 @@ decl_event!( TipClosed(Hash, AccountId, Balance), /// A tip suggestion has been retracted. \[tip_hash\] TipRetracted(Hash), - /// New bounty proposal. [index] + /// New bounty proposal. \[index\] BountyProposed(BountyIndex), /// A bounty proposal was rejected; funds were slashed. [index, bond] BountyRejected(BountyIndex, Balance), - /// A bounty proposal is funded and became active. [index] + /// A bounty proposal is funded and became active. \[index\] BountyBecameActive(BountyIndex), /// A bounty is awarded to a beneficiary. [index, beneficiary] BountyAwarded(BountyIndex, AccountId), /// A bounty is claimed by beneficiary. [index, payout, beneficiary] BountyClaimed(BountyIndex, Balance, AccountId), - /// A bounty is cancelled. [index] + /// A bounty is cancelled. \[index\] BountyCanceled(BountyIndex), - /// A bounty expiry is extended. [index] + /// A bounty expiry is extended. \[index\] BountyExtended(BountyIndex), } ); diff --git a/primitives/npos-elections/compact/src/lib.rs b/primitives/npos-elections/compact/src/lib.rs index b35c407c40cd5..22997e4f616c7 100644 --- a/primitives/npos-elections/compact/src/lib.rs +++ b/primitives/npos-elections/compact/src/lib.rs @@ -58,8 +58,8 @@ pub(crate) fn syn_err(message: &'static str) -> syn::Error { /// /// The given struct provides function to convert from/to Assignment: /// -/// - [`from_assignment()`]. -/// - [`fn into_assignment()`]. +/// - `fn from_assignment<..>(..)` +/// - `fn into_assignment<..>(..)` /// /// The generated struct is by default deriving both `Encode` and `Decode`. This is okay but could /// lead to many 0s in the solution. If prefixed with `#[compact]`, then a custom compact encoding diff --git a/primitives/npos-elections/src/balancing.rs b/primitives/npos-elections/src/balancing.rs index 04083cc9b0d43..517ac5c03f12e 100644 --- a/primitives/npos-elections/src/balancing.rs +++ b/primitives/npos-elections/src/balancing.rs @@ -36,7 +36,7 @@ use sp_std::prelude::*; /// change has been made (`difference = 0`). /// /// In almost all cases, a balanced solution will have a better score than an unbalanced solution, -/// yet this is not 100% guaranteed because the first element of a [`ElectionScore`] does not +/// yet this is not 100% guaranteed because the first element of a [`crate::ElectionScore`] does not /// directly related to balancing. /// /// Note that some reference implementation adopt an approach in which voters are balanced randomly diff --git a/primitives/npos-elections/src/lib.rs b/primitives/npos-elections/src/lib.rs index d82839f02086d..2c7d133529c9d 100644 --- a/primitives/npos-elections/src/lib.rs +++ b/primitives/npos-elections/src/lib.rs @@ -18,10 +18,10 @@ //! - [`seq_phragmen`]: Implements the Phragmén Sequential Method. An un-ranked, relatively fast //! election method that ensures PJR, but does not provide a constant factor approximation of the //! maximin problem. -//! - [`phragmms`]: Implements a hybrid approach inspired by Phragmén which is executed faster but +//! - [`phragmms()`]: Implements a hybrid approach inspired by Phragmén which is executed faster but //! it can achieve a constant factor approximation of the maximin problem, similar to that of the //! MMS algorithm. -//! - [`balance_solution`]: Implements the star balancing algorithm. This iterative process can push +//! - [`balance`]: Implements the star balancing algorithm. This iterative process can push //! a solution toward being more `balances`, which in turn can increase its score. //! //! ### Terminology @@ -70,7 +70,7 @@ //! `StakedAssignment`. //! //! -//! More information can be found at: https://arxiv.org/abs/2004.12990 +//! More information can be found at: #![cfg_attr(not(feature = "std"), no_std)] @@ -283,7 +283,7 @@ impl Voter { }) } - /// Same as [`try_normalize`] but the normalization is only limited between elected edges. + /// Same as [`Self::try_normalize`] but the normalization is only limited between elected edges. pub fn try_normalize_elected(&mut self) -> Result<(), &'static str> { let elected_edge_weights = self .edges diff --git a/primitives/npos-elections/src/phragmen.rs b/primitives/npos-elections/src/phragmen.rs index cfbeed1cdd3fb..135f992aba783 100644 --- a/primitives/npos-elections/src/phragmen.rs +++ b/primitives/npos-elections/src/phragmen.rs @@ -108,9 +108,8 @@ pub fn seq_phragmen( /// `seq_phragmen` for more information. This function is left public in case a crate needs to use /// the implementation in a custom way. /// -/// To create th inputs needed for this function, see [`crate::setup_inputs`]. -/// /// This can only fail if the normalization fails. +// To create the inputs needed for this function, see [`crate::setup_inputs`]. pub fn seq_phragmen_core( rounds: usize, candidates: Vec>, diff --git a/primitives/npos-elections/src/reduce.rs b/primitives/npos-elections/src/reduce.rs index 17d7dd1290f7d..a96a2ed8457dd 100644 --- a/primitives/npos-elections/src/reduce.rs +++ b/primitives/npos-elections/src/reduce.rs @@ -45,7 +45,7 @@ //! //! ### Resources: //! -//! 1. https://hackmd.io/JOn9x98iS0e0DPWQ87zGWg?view +//! 1. use crate::node::{Node, NodeId, NodeRef, NodeRole}; use crate::{ExtendedBalance, IdentifierT, StakedAssignment}; diff --git a/test-utils/runtime/src/lib.rs b/test-utils/runtime/src/lib.rs index b4a69a491d588..459af7d1ece68 100644 --- a/test-utils/runtime/src/lib.rs +++ b/test-utils/runtime/src/lib.rs @@ -15,7 +15,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//! The Substrate runtime. This can be compiled with #[no_std], ready for Wasm. +//! The Substrate runtime. This can be compiled with `#[no_std]`, ready for Wasm. #![cfg_attr(not(feature = "std"), no_std)] diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index be7050a8a0736..097073239c411 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -33,7 +33,7 @@ use std::net::SocketAddr; mod networking; mod sourced; -pub use sourced::{SourcedCounter, SourcedGauge, MetricSource}; +pub use sourced::{SourcedCounter, SourcedGauge, MetricSource, SourcedMetric}; #[cfg(target_os = "unknown")] pub use unknown_os::init_prometheus; From f618f8ddf40817b0bc34a718d7fd61f5dbe0c13e Mon Sep 17 00:00:00 2001 From: Max Inden Date: Fri, 11 Dec 2020 10:27:06 +0100 Subject: [PATCH 5/9] client/authority-discovery: Fix link in doc comment --- client/authority-discovery/src/worker.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/authority-discovery/src/worker.rs b/client/authority-discovery/src/worker.rs index d886f24542d76..f970f58228da2 100644 --- a/client/authority-discovery/src/worker.rs +++ b/client/authority-discovery/src/worker.rs @@ -77,7 +77,7 @@ pub enum Role { /// An authority discovery [`Worker`] can publish the local node's addresses as well as discover /// those of other nodes via a Kademlia DHT. /// -/// When constructed with [`Role::PublishAndDiscover`] a [`Worker`] will +/// When constructed with [`Role::PublishAndDiscover`] a [`Worker`] will: /// /// 1. Retrieve its external addresses (including peer id). /// @@ -87,7 +87,8 @@ pub enum Role { /// /// 4. Put addresses and signature as a record with the authority id as a key on a Kademlia DHT. /// -/// When constructed with either [`Role::PublishAndDiscover`] or [`Role::Publish`] a [`Worker`] will +/// When constructed with either [`Role::PublishAndDiscover`] or [`Role::Discover`] a [`Worker`] +/// will: /// /// 1. Retrieve the current and next set of authorities. /// From 636ca451b006ef521b839ce8ef9ce1d4c898f220 Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 9 Aug 2021 18:12:08 +0200 Subject: [PATCH 6/9] CI: no fail fast on CI --- .gitlab-ci.yml | 2 +- client/telemetry/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aff0a65835b41..82780915e89f0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -180,7 +180,7 @@ build-rust-doc: script: - rm -f ./crate-docs/index.html # use it as an indicator if the job succeeds - RUSTDOCFLAGS="--html-in-header $(pwd)/.maintain/rustdoc-header.html -Dwarnings" - time cargo +nightly doc --no-deps --workspace --all-features --verbose + time cargo +nightly doc --no-deps --workspace --all-features --verbose --no-fail-fast - mv ./target/doc ./crate-docs - echo "" > ./crate-docs/index.html - sccache -s diff --git a/client/telemetry/src/lib.rs b/client/telemetry/src/lib.rs index 5bd839e074952..107861900ab50 100644 --- a/client/telemetry/src/lib.rs +++ b/client/telemetry/src/lib.rs @@ -449,7 +449,7 @@ enum Register { /// Report a telemetry. /// -/// Translates to [`tracing::info`], but contains an additional verbosity parameter which the log +/// Translates to `tracing::info`, but contains an additional verbosity parameter which the log /// record is tagged with. Additionally the verbosity parameter is added to the record as a /// key-value pair. /// From eb004808324b6368786a865787bc4e25863f3bf3 Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 9 Aug 2021 18:25:47 +0200 Subject: [PATCH 7/9] CI: should fail fast on cargo doc --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82780915e89f0..aff0a65835b41 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -180,7 +180,7 @@ build-rust-doc: script: - rm -f ./crate-docs/index.html # use it as an indicator if the job succeeds - RUSTDOCFLAGS="--html-in-header $(pwd)/.maintain/rustdoc-header.html -Dwarnings" - time cargo +nightly doc --no-deps --workspace --all-features --verbose --no-fail-fast + time cargo +nightly doc --no-deps --workspace --all-features --verbose - mv ./target/doc ./crate-docs - echo "" > ./crate-docs/index.html - sccache -s From 515ed27387840519a3d52285f309d088ff009b9a Mon Sep 17 00:00:00 2001 From: Denis P Date: Mon, 9 Aug 2021 20:35:24 +0200 Subject: [PATCH 8/9] docs: fix local link --- client/executor/wasmtime/src/runtime.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/executor/wasmtime/src/runtime.rs b/client/executor/wasmtime/src/runtime.rs index d4a2a28394b52..9960bde2e92bb 100644 --- a/client/executor/wasmtime/src/runtime.rs +++ b/client/executor/wasmtime/src/runtime.rs @@ -369,9 +369,9 @@ pub struct Config { /// The total number of wasm pages an instance can request. /// /// If specified, the runtime will be able to allocate only that much of wasm memory pages. This - /// is the total number and therefore the [`heap_pages`] is accounted for. + /// is the total number and therefore the [`Config::heap_pages`] is accounted for. /// - /// That means that the initial number of pages of a linear memory plus the [`heap_pages`] should + /// That means that the initial number of pages of a linear memory plus the [`Config::heap_pages`] should /// be less or equal to `max_memory_pages`, otherwise the instance won't be created. /// /// Moreover, `memory.grow` will fail (return -1) if the sum of the number of currently mounted From 88ea6b6ebc97f3cc77c07292369a801dd9eb0a5e Mon Sep 17 00:00:00 2001 From: Denis P Date: Tue, 10 Aug 2021 15:01:17 +0200 Subject: [PATCH 9/9] CI: private docs --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aff0a65835b41..7771884c2f96e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -180,7 +180,7 @@ build-rust-doc: script: - rm -f ./crate-docs/index.html # use it as an indicator if the job succeeds - RUSTDOCFLAGS="--html-in-header $(pwd)/.maintain/rustdoc-header.html -Dwarnings" - time cargo +nightly doc --no-deps --workspace --all-features --verbose + time cargo +nightly doc --no-deps --workspace --all-features --verbose --document-private-items - mv ./target/doc ./crate-docs - echo "" > ./crate-docs/index.html - sccache -s