Skip to content

Commit

Permalink
Merge branch 'master' into lexnv/metadata-v16-associated-types
Browse files Browse the repository at this point in the history
  • Loading branch information
lexnv authored Oct 16, 2024
2 parents e91da23 + 2c41656 commit f3e3e1e
Show file tree
Hide file tree
Showing 14 changed files with 206 additions and 175 deletions.
68 changes: 45 additions & 23 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,8 @@ concurrency:

jobs:
preflight:
if: contains(github.event.label.name, 'GHA-migration')
uses: ./.github/workflows/reusable-preflight.yml

test-rustdoc:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- uses: actions/checkout@v4
- run: forklift cargo doc --workspace --all-features --no-deps
env:
SKIP_WASM_BUILD: 1
test-doc:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
needs: [preflight]
Expand All @@ -42,7 +30,7 @@ jobs:
build-rustdoc:
runs-on: ${{ needs.preflight.outputs.RUNNER }}
if: ${{ needs.preflight.outputs.changes_rust }}
needs: [preflight, test-rustdoc]
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
Expand Down Expand Up @@ -88,6 +76,23 @@ jobs:
retention-days: 1
if-no-files-found: error

confirm-required-jobs-passed:
runs-on: ubuntu-latest
name: All docs jobs passed
# If any new job gets added, be sure to add it to this array
needs: [test-doc, build-rustdoc, build-implementers-guide]
if: always() && !cancelled()
steps:
- run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep '"result": "failure"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi
publish-rustdoc:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
Expand Down Expand Up @@ -121,13 +126,30 @@ jobs:
- run: mkdir -p book
- name: Move book files
run: mv /tmp/book/html/* book/
- name: Push to GH-Pages branch
uses: github-actions-x/[email protected]
with:
github-token: ${{ steps.app-token.outputs.token }}
push-branch: "gh-pages"
commit-message: "___Updated docs for ${{ github.head_ref || github.ref_name }}___"
force-add: "true"
files: ${{ github.head_ref || github.ref_name }}/ book/
name: devops-parity
email: [email protected]
- name: Push changes to gh-pages
env:
TOKEN: ${{ steps.app-token.outputs.token }}
APP_NAME: "paritytech-upd-ghpages-polkadotsdk"
REF_NAME: ${{ github.head_ref || github.ref_name }}
Green: "\e[32m"
NC: "\e[0m"
run: |
echo "${Green}Git add${NC}"
git add book/
git add ${REF_NAME}/
echo "${Green}git status | wc -l${NC}"
git status | wc -l
echo "${Green}Add new remote with gh app token${NC}"
git remote set-url origin $(git config remote.origin.url | sed "s/github.com/${APP_NAME}:${TOKEN}@github.com/g")
echo "${Green}Remove http section that causes issues with gh app auth token${NC}"
sed -i.bak '/\[http/d' ./.git/config
sed -i.bak '/extraheader/d' ./.git/config
echo "${Green}Git push${NC}"
git config user.email "[email protected]"
git config user.name "${APP_NAME}"
git commit --amend -m "___Updated docs" || echo "___Nothing to commit___"
git push origin gh-pages --force
43 changes: 0 additions & 43 deletions .gitlab/pipeline/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,49 +100,6 @@ build-templates-node:
- mv ./target/release/minimal-template-node ./artifacts/.
- mv ./target/release/solochain-template-node ./artifacts/.

build-rustdoc:
stage: build
extends:
- .docker-env
- .common-refs
- .run-immediately
variables:
SKIP_WASM_BUILD: 1
RUSTDOCFLAGS: "-Dwarnings --default-theme=ayu --html-in-header ./docs/sdk/assets/header.html --extend-css ./docs/sdk/assets/theme.css --html-after-content ./docs/sdk/assets/after-content.html"
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
when: on_success
expire_in: 1 days
paths:
- ./crate-docs/
script:
- time cargo doc --all-features --workspace --no-deps
- rm -f ./target/doc/.lock
- mv ./target/doc ./crate-docs
# Inject Simple Analytics (https://www.simpleanalytics.com/) privacy preserving tracker into
# all .html files
- >
inject_simple_analytics() {
local path="$1";
local script_content="<script async defer src=\"https://apisa.parity.io/latest.js\"></script><noscript><img src=\"https://apisa.parity.io/latest.js\" alt=\"\" referrerpolicy=\"no-referrer-when-downgrade\" /></noscript>";
# Function that inject script into the head of an html file using sed.
process_file() {
local file="$1";
echo "Adding Simple Analytics script to $file";
sed -i "s|</head>|$script_content</head>|" "$file";
};
export -f process_file;
# xargs runs process_file in separate shells without access to outer variables.
# make script_content available inside process_file, export it as an env var here.
export script_content;
# Modify .html files in parallel using xargs, otherwise it can take a long time.
find "$path" -name '*.html' | xargs -I {} -P "$(nproc)" bash -c 'process_file "$@"' _ {};
};
inject_simple_analytics "./crate-docs";
- echo "<meta http-equiv=refresh content=0;url=polkadot_sdk_docs/index.html>" > ./crate-docs/index.html

build-implementers-guide:
stage: build
extends:
Expand Down
61 changes: 0 additions & 61 deletions .gitlab/pipeline/publish.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,6 @@
# This file is part of .gitlab-ci.yml
# Here are all jobs that are executed during "publish" stage

publish-rustdoc:
stage: publish
extends:
- .kubernetes-env
- .publish-gh-pages-refs
variables:
CI_IMAGE: node:18
GIT_DEPTH: 100
RUSTDOCS_DEPLOY_REFS: "master"
needs:
- job: build-rustdoc
artifacts: true
- job: build-implementers-guide
artifacts: true
script:
# If $CI_COMMIT_REF_NAME doesn't match one of $RUSTDOCS_DEPLOY_REFS space-separated values, we
# exit immediately.
# Putting spaces at the front and back to ensure we are not matching just any substring, but the
# whole space-separated value.
# setup ssh
- eval $(ssh-agent)
- ssh-add - <<< ${GITHUB_SSH_PRIV_KEY}
- mkdir ~/.ssh && touch ~/.ssh/known_hosts
- ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
# Set git config
- git config user.email "[email protected]"
- git config user.name "${GITHUB_USER}"
- git config remote.origin.url "[email protected]:/paritytech/${CI_PROJECT_NAME}.git"
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
- git fetch origin gh-pages
# Save README and docs
- cp -r ./crate-docs/ /tmp/doc/
- cp -r ./artifacts/book/ /tmp/
- cp README.md /tmp/doc/
# we don't need to commit changes because we copy docs to /tmp
- git checkout gh-pages --force
# Enable if docs needed for other refs
# Install `index-tpl-crud` and generate index.html based on RUSTDOCS_DEPLOY_REFS
# - which index-tpl-crud &> /dev/null || yarn global add @substrate/index-tpl-crud
# - index-tpl-crud upsert ./index.html ${CI_COMMIT_REF_NAME}
# Ensure the destination dir doesn't exist.
- rm -rf ${CI_COMMIT_REF_NAME}
- rm -rf book/
- mv -f /tmp/doc ${CI_COMMIT_REF_NAME}
# dir for implementors guide
- mkdir -p book
- mv /tmp/book/html/* book/
# Upload files
- git add --all
# `git commit` has an exit code of > 0 if there is nothing to commit.
# This causes GitLab to exit immediately and marks this job failed.
# We don't want to mark the entire job failed if there's nothing to
# publish though, hence the `|| true`.
- git commit --amend -m "___Updated docs" ||
echo "___Nothing to commit___"
- git push origin gh-pages --force
# artificial sleep to publish gh-pages
- sleep 300
after_script:
- rm -rf .git/ ./*

# note: images are used not only in zombienet but also in rococo, wococo and versi
.build-push-image:
image: $BUILDAH_IMAGE
Expand Down
27 changes: 0 additions & 27 deletions .gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,30 +109,3 @@ test-linux-stable-codecov:
else
codecovcli -v do-upload -f target/coverage/result/report-${CI_NODE_INDEX}.lcov --disable-search -t ${CODECOV_TOKEN} -r paritytech/polkadot-sdk --commit-sha ${CI_COMMIT_SHA} --fail-on-error --git-service github;
fi
test-doc:
stage: test
extends:
- .docker-env
- .common-refs
# DAG
needs:
- job: test-rustdoc
artifacts: false
variables:
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
script:
- time cargo test --doc --workspace

test-rustdoc:
stage: test
extends:
- .docker-env
- .common-refs
- .run-immediately
variables:
SKIP_WASM_BUILD: 1
script:
- time cargo doc --workspace --all-features --no-deps
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ tiny-keccak = { version = "2.0.2" }
tokio = { version = "1.40.0", default-features = false }
tokio-retry = { version = "0.3.0" }
tokio-stream = { version = "0.1.14" }
tokio-test = { version = "0.4.2" }
tokio-test = { version = "0.4.4" }
tokio-tungstenite = { version = "0.20.1" }
tokio-util = { version = "0.7.8" }
toml = { version = "0.8.12" }
Expand Down
40 changes: 32 additions & 8 deletions cumulus/zombienet/tests/0009-elastic_pov_recovery.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
[settings]
timeout = 1000

[relaychain.default_resources]
limits = { memory = "4G", cpu = "2" }
requests = { memory = "2G", cpu = "1" }

[parachain.default_resources]
limits = { memory = "4G", cpu = "2" }
requests = { memory = "2G", cpu = "1" }

[relaychain.genesis.runtimeGenesis.patch.configuration.config.async_backing_params]
max_candidate_depth = 6
allowed_ancestry_len = 3
Expand All @@ -23,7 +31,11 @@ command = "polkadot"

[[relaychain.node_groups]]
name = "validator"
args = ["-lruntime=debug,parachain=trace", "--reserved-only", "--reserved-nodes {{'alice'|zombie('multiAddress')}}"]
args = [
"-lruntime=debug,parachain=trace",
"--reserved-only",
"--reserved-nodes {{'alice'|zombie('multiAddress')}}"
]
count = 8

# Slot based authoring with 3 cores and 2s slot duration
Expand All @@ -32,17 +44,29 @@ id = 2100
chain = "elastic-scaling"
add_to_genesis = false

# Slot based authoring with 3 cores and 2s slot duration
# run 'recovery-target' as a parachain full node
[[parachains.collators]]
name = "collator-elastic"
name = "recovery-target"
validator = false # full node
image = "{{COL_IMAGE}}"
command = "test-parachain"
args = ["--disable-block-announcements", "-laura=trace,runtime=info,cumulus-consensus=trace,consensus::common=trace,parachain::collation-generation=trace,parachain::collator-protocol=trace,parachain=debug", "--force-authoring", "--experimental-use-slot-based"]
args = [
"-lparachain::availability=trace,sync=debug,parachain=debug,cumulus-pov-recovery=debug,cumulus-consensus=debug",
"--disable-block-announcements",
"--in-peers 0",
"--out-peers 0",
"--",
"--reserved-only",
"--reserved-nodes {{'alice'|zombie('multiAddress')}}"]

# run 'recovery-target' as a parachain full node
# Slot based authoring with 3 cores and 2s slot duration
[[parachains.collators]]
name = "recovery-target"
validator = false # full node
name = "collator-elastic"
image = "{{COL_IMAGE}}"
command = "test-parachain"
args = ["-lparachain::availability=trace,sync=debug,parachain=debug,cumulus-pov-recovery=debug,cumulus-consensus=debug", "--disable-block-announcements", "--bootnodes {{'collator-elastic'|zombie('multiAddress')}}", "--in-peers 0", "--out-peers 0", "--", "--reserved-only", "--reserved-nodes {{'alice'|zombie('multiAddress')}}"]
args = [
"-laura=trace,runtime=info,cumulus-consensus=trace,consensus::common=trace,parachain::collation-generation=trace,parachain::collator-protocol=trace,parachain=debug",
"--disable-block-announcements",
"--force-authoring",
"--experimental-use-slot-based"
]
15 changes: 15 additions & 0 deletions prdoc/pr_5998.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json

title: Fix memory leak in litep2p public addresses

doc:
- audience: [ Node Dev, Node Operator ]
description: |
This PR bounds the number of public addresses of litep2p to 32 entries.
This ensures we do not increase the number of addresses over time, and that the DHT
authority records will not exceed the upper size limit.

crates:
- name: sc-network
bump: patch
9 changes: 9 additions & 0 deletions prdoc/pr_6027.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title: Remove pallet::getter from pallet-offences
doc:
- audience: Runtime Dev
description: |
This PR removes pallet::getter from pallet-offences from type Reports. It also adds a test to verify that retrieval of Reports still works with storage::getter.

crates:
- name: pallet-offences
bump: patch
Loading

0 comments on commit f3e3e1e

Please sign in to comment.