Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Feature/update to polkadot 0.8.30 substrate #156

Draft
wants to merge 133 commits into
base: feature/update-to-polkadot-0.8.29-substrate
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
beff566
Add some debug_asserts for #8171 (#8181)
tomaka Feb 24, 2021
1c34ccf
Display nicer inspect results. (#8198)
tomusdrw Feb 24, 2021
7a6d60d
Move proof generation to the type system level (#8185)
bkchr Feb 24, 2021
5d72a5a
grandpa: rewrite warp sync proof generation (#8148)
andresilva Feb 25, 2021
4b5b9bd
Add ss58 prefix for HydraDX (#8058)
jak-pan Feb 25, 2021
1febf99
allow to write pre and post runtime upgrade in pallet macro (#8194)
gui1117 Feb 25, 2021
df6a400
Add an is_finished boolean to the grandpa warp sync response (#8203)
expenses Feb 25, 2021
74d5612
Fix networking debug_asserts (#8200)
tomaka Feb 25, 2021
6fae4a1
pallet macro broke `benchmarks_instance`, fix by introducing `benchm…
gui1117 Feb 25, 2021
f6de92e
Frame Benchmarking v3.1.0 released (#8206)
gnunicorn Feb 25, 2021
debec91
contracts: Release as v3.0.0 and add reserved field to `ContractInfoO…
athei Feb 25, 2021
ec498bb
chore: fix typos for contract (#8178)
yjhmelody Feb 26, 2021
ad626b0
Fix transactions not being propagated to authorities (#8212)
tomaka Feb 26, 2021
28107d4
Better identifier and logging for runtime upgrades (#8123)
kianenigma Feb 26, 2021
a6ff3d3
Fix ignored error in benchmark tests (#8214)
gui1117 Feb 26, 2021
88ba0e6
Gilts Pallet (#8139)
gavofyork Feb 27, 2021
2dd569a
emit event on remark (#8120)
xlc Feb 28, 2021
e84d2ae
grandpa: maintain invariants when evaluating aggregated voting rules …
andresilva Feb 28, 2021
dd29596
Init `RuntimeLogger` automatically for each runtime api call (#8128)
bkchr Mar 1, 2021
7bd6b86
babe: make plan_config_change callable (#8233)
andresilva Mar 1, 2021
172c7f8
Fix state mismatch in case of bad handshake (#8230)
tomaka Mar 1, 2021
f5d2faf
contracts: Use unstable sort for topics (#8232)
athei Mar 2, 2021
44ad00d
Make Benchmark Output Analysis Function Configurable (#8228)
shawntabrizi Mar 2, 2021
308eb4c
Add benchmark to node-template pallet-template (#8239)
shawntabrizi Mar 2, 2021
0a85d36
make use of matches (#8211)
gui1117 Mar 2, 2021
73942bc
Add some migration helper to help migrating pallet changing pallet pr…
gui1117 Mar 2, 2021
b203f79
Move AuRa digest from client to primitives (#8245)
bkchr Mar 3, 2021
5f05683
Make `ExecuteBlock::execute_block` return the final block header (#8244)
bkchr Mar 3, 2021
8fc92d1
Allow pallet::call to return `DispatchResult` (#8241)
gui1117 Mar 3, 2021
e5e8197
Add migration logs to pallet v2 (#8243)
kianenigma Mar 3, 2021
dc5d587
Do not return the `Header` from `execute_block` (#8256)
bkchr Mar 3, 2021
e2d74ac
Self-sufficient account ref-counting (#8221)
gavofyork Mar 3, 2021
a8c2bc6
update nb-connect pin-project-lite rand_core (#8249)
gui1117 Mar 4, 2021
fc2d2d3
babe: introduce a request-answering mechanic (#7833)
rphmeier Mar 4, 2021
3233d29
Fix warnings related to panic and assert (#8272)
bkchr Mar 5, 2021
adca498
Fix doc build with --all-features (#8277)
gui1117 Mar 5, 2021
79ddc79
AuRa improvements (#8255)
bkchr Mar 5, 2021
af998b2
Do not use `Option` to wrap `GenesisConfig` fields (#8275)
bkchr Mar 6, 2021
a958512
refactor(remote ext): use jsonrpsee (#8105)
niklasad1 Mar 6, 2021
88014d5
pallet_macro: Generate default documentation for well known types (#8…
athei Mar 8, 2021
ac1f7ff
Clippy arithmetic new (#8282)
honeywest Mar 8, 2021
641aa72
Assets: Remove zombies, introduce approvals (#8220)
gavofyork Mar 9, 2021
e68ff13
Introduce IgnoredIssuance into Gilts (#8299)
gavofyork Mar 9, 2021
a38c948
update jsonrpsee to fix a `allow(dead_code)` (#8302)
niklasad1 Mar 9, 2021
7e5c307
Decrease the peer reputation on invalid block requests (#8260)
bkchr Mar 9, 2021
773c0b4
Simplify the code a little bit (#8295)
liuchengxu Mar 9, 2021
a94749c
Fix typo in generated docs. (#8300)
athei Mar 9, 2021
8fca15b
Introduce new concept of "slot portion for proposing" (#8280)
bkchr Mar 9, 2021
b6c2c5d
Update to latest proc-macro-crate version (#8294)
bkchr Mar 9, 2021
2461349
Return babe configuration information in the babe api epoch functions…
expenses Mar 10, 2021
ef50a44
CI: return docs jobs (#8307)
TriplEight Mar 10, 2021
3adefdc
Custom RPC for Merkle Mountain Range pallet (#8137)
tomusdrw Mar 10, 2021
b24c43a
more clear randomness API for BABE (#8180)
rphmeier Mar 10, 2021
fcab5a3
Implement PJR checker (#8160)
coriolinus Mar 11, 2021
6f12d79
Fix doc build (#8322)
adoerr Mar 11, 2021
6ac86d5
Rework telemetry to replace the use of tracing with an object we pass…
cecton Mar 11, 2021
dedbdc4
Bump tracing from 0.1.22 to 0.1.25 (#8263)
dependabot[bot] Mar 11, 2021
0a61b0a
Remove legacy network protocol (#8296)
tomaka Mar 11, 2021
aae1861
pallet-staking: add RewardDestination::None for explictly not receivi…
sorpaas Mar 11, 2021
6b50787
Add on_idle hook (#8209)
JesseAbram Mar 11, 2021
8b3e5bc
Fix #8306 (#8330)
tomaka Mar 11, 2021
1e045f2
Convert timestamp to unit type wrapper (#8333)
bkchr Mar 11, 2021
97ecd62
Do not ban peers for sending multiple valid requests (#8325)
bkchr Mar 12, 2021
101b347
contracts: Expose rent parameter to contracts (#8231)
athei Mar 12, 2021
da7ca4d
im-online: use EstimateNextSessionRotation to get better estimates of…
andresilva Mar 12, 2021
3ba5808
remove whitespaces. (#8341)
kianenigma Mar 12, 2021
18ab090
Derive common classes for `IfDisconnected`. (#8346)
eskimor Mar 12, 2021
52c2189
Remove useless sr-api (#8335)
koushiro Mar 15, 2021
a107e1f
Don't log to debug for every failed extrinsic. (#8355)
kianenigma Mar 15, 2021
fdac8be
Add more relaxed pallet-name parsing (#8353)
hirschenberger Mar 15, 2021
3541769
Don't log so many stkaing events on genesis block (#8339)
kianenigma Mar 15, 2021
9618c5f
Support pallet::storage conditional compilation (#8324)
shaunxw Mar 16, 2021
c939ceb
NPoS Challenge Mode (#8236)
coriolinus Mar 16, 2021
8a4aeba
Audit fixes for election/staking decoupling part 2 (#8167)
kianenigma Mar 16, 2021
39b3131
staking: Flexible generation of reward curve and associated tweaks (#…
gavofyork Mar 16, 2021
c532e0b
alerting-rules: ContinuousTaskEnded alert should not drop all unspeci…
gabreal Mar 16, 2021
ea50800
Document a pub item (#8374)
gavofyork Mar 16, 2021
b8ee107
Update diener to enable polkadot companions that use new crates (#8371)
bkchr Mar 16, 2021
24df4c5
Release missing 3.0 crates: pallet-node-authorization sc-finality-gra…
gnunicorn Mar 16, 2021
056d63f
Update ss58-registry.json (#8351)
akru Mar 16, 2021
7eafd1f
[CI] Require D*-audit labels for any runtime changes (#8345)
s3krit Mar 16, 2021
66098c2
Fix CI benchmark check (#8380)
bkchr Mar 16, 2021
3f434df
CI: run cargo deny nightly (#8376)
TriplEight Mar 16, 2021
319d244
Improve complexity of CompactAssignments::unique_targets (#8314)
coriolinus Mar 17, 2021
cb033a4
Migrate pallet-proxy to pallet attribute macro (#8365)
emostov Mar 17, 2021
abd39a8
Migrate node authorization pallet to FRAME v2 (#8337)
kaichaosun Mar 17, 2021
3a12b0e
fix check-labels.yml (#8387)
s3krit Mar 17, 2021
de96cf8
add D1-trivial label (#8388)
s3krit Mar 17, 2021
ce0b69a
Migrate pallet-babe to pallet attribute macro. (#8310)
shaunxw Mar 17, 2021
211be1d
Storing multiple Justifications per block (#7640)
octol Mar 17, 2021
a0161f3
Aura and Slots refactoring (#8386)
bkchr Mar 17, 2021
46ea7e7
Fast CompactAssignment search (#8385)
coriolinus Mar 18, 2021
cc24950
Replace 'Module' with 'Pallet' in construct_runtime macro (#8372)
shaunxw Mar 18, 2021
c2cffa1
Improve logging in network gossip (#8389)
bkchr Mar 18, 2021
462384b
Storage chains: indexing, renewals and reference counting (#8265)
arkpar Mar 18, 2021
f8a58bd
doc(frame): [nitpicks] (#8396)
sacha-l Mar 18, 2021
4365fa6
Better description for assert in frame-session genesis (#8399)
bkchr Mar 18, 2021
b066782
Compute yearly inflation on-chain allowing to change x_ideal accordin…
gui1117 Mar 19, 2021
bb8ab89
Make work for no_std (#8402)
gavofyork Mar 19, 2021
283bb60
Decouple Staking and Election - Part 2.1: Unleash Multi Phase (#8113)
kianenigma Mar 20, 2021
c731027
Implement PartialEq for DispatchError. (#8407)
shaunxw Mar 21, 2021
f6e265d
Use the log crate to output contract generated messages. (#8403)
athei Mar 21, 2021
6e42b4b
Rename GenericProto to Notifications (#8415)
tomaka Mar 22, 2021
97da79e
CI: address the bug with .env (#8404)
TriplEight Mar 22, 2021
3472a65
CI: fix env file location (#8417)
TriplEight Mar 22, 2021
83942f5
Optimize the peerset a bit (#8416)
tomaka Mar 22, 2021
067f185
Refactor NotifsHandler::poll (#8422)
tomaka Mar 23, 2021
7821936
contracts: Update deduct block when a contract is excempted (#8418)
athei Mar 23, 2021
fcf950c
Fix CI for new labels (#8432)
gavofyork Mar 23, 2021
307a3b6
Fungibles trait and impl for Assets pallet (#8425)
gavofyork Mar 23, 2021
f2e8da0
Improve remote-externalities (#8397)
hardliner66 Mar 23, 2021
36d77bc
Expose block number in seal_random (#8329)
athei Mar 23, 2021
87cdfd3
Add tracing logic in pallet macro for hooks and dispatchables (#8305)
gui1117 Mar 23, 2021
4df3c9a
improve doc (#8437)
gui1117 Mar 23, 2021
30ad918
contracts: Reduce the API surface (#8359)
athei Mar 24, 2021
4d4e1a2
grandpa: speed up tests (#8439)
andresilva Mar 24, 2021
069917b
remove outdated comment (#8442)
gui1117 Mar 24, 2021
189d079
test runner (#7665)
Mar 24, 2021
91f4559
Migrate pallet-utility to pallet attribute macro. (#8326)
shaunxw Mar 24, 2021
3a3e9ea
update README.adoc (#8412)
Mar 24, 2021
f02dcaa
Make candidate intake in society configurable (#8445)
kianenigma Mar 24, 2021
b6e8438
Migrate pallet-vesting to pallet attribute macro. (#8440)
shaunxw Mar 24, 2021
6792846
Check `unreserve` and `transfer` returnvalues in debug code (#8398)
hirschenberger Mar 24, 2021
67695c8
Update to libp2p-0.36 (#8420)
romanb Mar 24, 2021
3efe87d
Use Debug for genesis mismatch message (#8449)
tomaka Mar 24, 2021
2f69b2d
Make the number of nominations configurable (#8368)
kianenigma Mar 25, 2021
3655f9b
client: fix justifications migration (#8489)
andresilva Mar 30, 2021
b49b66a
Merge commit '3655f9bb44d75ff205737023760198733a237685' of https://gi…
Sep 28, 2022
b68e3ac
set spec_version
Sep 28, 2022
b6abf92
set rust to 2021-03-14
Sep 28, 2022
ea39158
rename bin to cere
Sep 28, 2022
eb49a21
updated MaxCodeSize
Sep 28, 2022
c8361f9
compressed should be used
Oct 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/build-and-push-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
- name: Copy wasm artifact from the image
run: |
container_id=$(docker create ${{ env.IMAGE_ID }})
artifact_name=node_runtime.compact.${GITHUB_SHA:0:7}.wasm
artifact_name=node_runtime.compact.compressed.${GITHUB_SHA:0:7}.wasm
echo ARTIFACT_NAME=$artifact_name >> $GITHUB_ENV
docker cp $container_id:/home/cere/node-runtime-artifacts/node_runtime.compact.wasm ./$artifact_name
docker cp $container_id:/home/cere/node-runtime-artifacts/node_runtime.compact.compressed.wasm ./$artifact_name
- name: Upload wasm artifact
uses: actions/upload-artifact@v3
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/check-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Check labels
run: bash ${{ github.workspace }}/.maintain/github/check_labels.sh
env:
GITHUB_PR: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ rls*.log
.cargo/
.cargo-remote.toml
*.bin
*.iml
78 changes: 62 additions & 16 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ default:
- if: $CI_COMMIT_REF_NAME == "tags"
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1

.nightly-pipeline: &nightly-pipeline
rules:
# this job runs only on nightly pipeline with the mentioned variable, against `master` branch
- if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule" && $PIPELINE == "nightly"

#### stage: .pre

skip-if-draft:
Expand Down Expand Up @@ -199,17 +204,7 @@ test-prometheus-alerting-rules:
cargo-deny:
stage: test
<<: *docker-env
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- changes:
- "Cargo.lock"
- "**/Cargo.toml"
- 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
<<: *nightly-pipeline
script:
- cargo deny check --hide-inclusion-graph -c .maintain/deny.toml
after_script:
Expand Down Expand Up @@ -277,6 +272,7 @@ test-linux-stable: &test-linux
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
- time cargo test -p frame-support-test --features=conditional-storage --manifest-path frame/support/test/Cargo.toml
- SUBSTRATE_TEST_TIMEOUT=1 time cargo test -p substrate-test-utils --release --verbose --locked -- --ignored timeout
- sccache -s

Expand Down Expand Up @@ -468,6 +464,30 @@ build-macos-subkey:
tags:
- osx

build-rust-doc:
stage: build
<<: *docker-env
<<: *test-refs
needs:
- job: test-linux-stable
artifacts: false
variables:
<<: *default-vars
SKIP_WASM_BUILD: 1
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
when: on_success
expire_in: 7 days
paths:
- ./crate-docs/
script:
- RUSTDOCFLAGS="--html-in-header $(pwd)/.maintain/rustdoc-header.html"
time cargo +nightly doc --no-deps --workspace --all-features --verbose
- mv ./target/doc ./crate-docs
- echo "<meta http-equiv=refresh content=0;url=sc_service/index.html>" > ./crate-docs/index.html
- sccache -s
allow_failure: true

#### stage: publish

.build-push-docker-image: &build-push-docker-image
Expand Down Expand Up @@ -499,6 +519,10 @@ build-macos-subkey:
- buildah info
- buildah push --format=v2s2 "$IMAGE_NAME:$VERSION"
- buildah push --format=v2s2 "$IMAGE_NAME:latest"
# pass artifacts to the trigget-simnet job
- echo "VERSION=${VERSION}" > build.env
- echo "TRIGGERER=${CI_PROJECT_NAME}" >> build.env
after_script:
- buildah logout "$IMAGE_NAME"

publish-docker-substrate:
Expand All @@ -510,8 +534,6 @@ publish-docker-substrate:
variables:
<<: *docker-build-vars
PRODUCT: substrate
after_script:
- echo "VERSION=${VERSION}" >> build.env
artifacts:
reports:
# this artifact is used in trigger-simnet job
Expand Down Expand Up @@ -550,6 +572,32 @@ publish-s3-release:
- 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
<<: *publish-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
Expand Down Expand Up @@ -603,9 +651,7 @@ deploy-prometheus-alerting-rules:

trigger-simnet:
stage: deploy
rules:
# this job runs only on nightly pipeline with the mentioned variable, against `master` branch
- if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule" && $PIPELINE == "nightly"
<<: *nightly-pipeline
needs:
- job: publish-docker-substrate
trigger:
Expand Down
16 changes: 15 additions & 1 deletion .maintain/common/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ has_label(){

# Formats a message into a JSON string for posting to Matrix
# message: 'any plaintext message'
# formatted_message: '<strong>optional message formatted in <em>html</em></strong>'
# formatted_message: '<strong>optional message formatted in <em>html</em></strong>'
# Usage: structure_message $content $formatted_content (optional)
structure_message() {
if [ -z "$2" ]; then
Expand All @@ -101,3 +101,17 @@ structure_message() {
send_message() {
curl -XPOST -d "$1" "https://matrix.parity.io/_matrix/client/r0/rooms/$2/send/m.room.message?access_token=$3"
}

# Check for runtime changes between two commits. This is defined as any changes
# to bin/node/src/runtime, frame/ and primitives/sr_* trees.
has_runtime_changes() {
from=$1
to=$2
if git diff --name-only "${from}...${to}" \
| grep -q -e '^frame/' -e '^primitives/'
then
return 0
else
return 1
fi
}
2 changes: 1 addition & 1 deletion .maintain/frame-weight-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! Autogenerated weights for {{pallet}}
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}}
//! DATE: {{date}}, STEPS: {{cmd.steps}}, REPEAT: {{cmd.repeat}}, LOW RANGE: {{cmd.lowest_range_values}}, HIGH RANGE: {{cmd.highest_range_values}}
//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}`
//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}}

// Executed Command:
Expand Down
27 changes: 23 additions & 4 deletions .maintain/github/check_labels.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -e

#shellcheck source=../common/lib.sh
source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh"
Expand All @@ -24,10 +25,18 @@ releasenotes_labels=(
)

criticality_labels=(
'C1-low'
'C3-medium'
'C7-high'
'C9-critical'
'C1-low 📌'
'C3-medium 📣'
'C7-high ❗️'
'C9-critical ‼️'
)

audit_labels=(
'D1-audited 👍'
'D2-notlive 💤'
'D3-trivial 🧸'
'D5-nicetohaveaudit ⚠️'
'D9-needsaudit 👮'
)

echo "[+] Checking release notes (B) labels"
Expand All @@ -46,4 +55,14 @@ else
exit 1
fi

if has_runtime_changes origin/master "${HEAD_SHA}"; then
echo "[+] Runtime changes detected. Checking audit (D) labels"
if ensure_labels "${audit_labels[@]}"; then
echo "[+] Release audit label detected. All is well."
else
echo "[!] Release audit label not detected. Please add one of: ${audit_labels[*]}"
exit 1
fi
fi

exit 0
3 changes: 1 addition & 2 deletions .maintain/gitlab/check_polkadot_companion_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,9 @@ else
fi

# Patch all Substrate crates in Polkadot
diener patch --crates-to-patch ../ --substrate
diener patch --crates-to-patch ../ --substrate --path Cargo.toml

# Test Polkadot pr or master branch with this Substrate commit.
cargo update -p sp-io
time cargo test --all --release --verbose --features=real-overseer

cd parachain/test-parachains/adder/collator/
Expand Down
27 changes: 12 additions & 15 deletions .maintain/gitlab/check_runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@

set -e # fail on any error


#shellcheck source=../common/lib.sh
. "$(dirname "${0}")/../common/lib.sh"

VERSIONS_FILE="bin/node/runtime/src/lib.rs"

boldprint () { printf "|\n| \033[1m${@}\033[0m\n|\n" ; }
boldcat () { printf "|\n"; while read l; do printf "| \033[1m${l}\033[0m\n"; done; printf "|\n" ; }
boldprint () { printf "|\n| \033[1m%s\033[0m\n|\n" "${@}"; }
boldcat () { printf "|\n"; while read -r l; do printf "| \033[1m%s\033[0m\n" "${l}"; done; printf "|\n" ; }

github_label () {
echo
Expand All @@ -23,24 +24,22 @@ github_label () {
-F "ref=master" \
-F "variables[LABEL]=${1}" \
-F "variables[PRNO]=${CI_COMMIT_REF_NAME}" \
${GITLAB_API}/projects/${GITHUB_API_PROJECT}/trigger/pipeline
"${GITLAB_API}/projects/${GITHUB_API_PROJECT}/trigger/pipeline"
}


boldprint "latest 10 commits of ${CI_COMMIT_REF_NAME}"
git log --graph --oneline --decorate=short -n 10

boldprint "make sure the master branch and release tag are available in shallow clones"
git fetch --depth=${GIT_DEPTH:-100} origin master
git fetch --depth=${GIT_DEPTH:-100} origin release
git fetch --depth="${GIT_DEPTH:-100}" origin master
git fetch --depth="${GIT_DEPTH:-100}" origin release
git tag -f release FETCH_HEAD
git log -n1 release


boldprint "check if the wasm sources changed"
if ! git diff --name-only origin/master...${CI_COMMIT_SHA} \
| grep -v -e '^primitives/sr-arithmetic/fuzzer' \
| grep -q -e '^bin/node/src/runtime' -e '^frame/' -e '^primitives/sr-'
if ! has_runtime_changes origin/master "${CI_COMMIT_SHA}"
then
boldcat <<-EOT

Expand All @@ -57,18 +56,16 @@ fi
# consensus-critical logic that has changed. the runtime wasm blobs must be
# rebuilt.

add_spec_version="$(git diff tags/release...${CI_COMMIT_SHA} ${VERSIONS_FILE} \
add_spec_version="$(git diff "tags/release...${CI_COMMIT_SHA}" "${VERSIONS_FILE}" \
| sed -n -r "s/^\+[[:space:]]+spec_version: +([0-9]+),$/\1/p")"
sub_spec_version="$(git diff tags/release...${CI_COMMIT_SHA} ${VERSIONS_FILE} \
sub_spec_version="$(git diff "tags/release...${CI_COMMIT_SHA}" "${VERSIONS_FILE}" \
| sed -n -r "s/^\-[[:space:]]+spec_version: +([0-9]+),$/\1/p")"



if [ "${add_spec_version}" != "${sub_spec_version}" ]
then

github_label "D2-breaksapi"

boldcat <<-EOT

changes to the runtime sources and changes in the spec version.
Expand All @@ -82,9 +79,9 @@ else
# check for impl_version updates: if only the impl versions changed, we assume
# there is no consensus-critical logic that has changed.

add_impl_version="$(git diff tags/release...${CI_COMMIT_SHA} ${VERSIONS_FILE} \
add_impl_version="$(git diff "tags/release...${CI_COMMIT_SHA}" "${VERSIONS_FILE}" \
| sed -n -r 's/^\+[[:space:]]+impl_version: +([0-9]+),$/\1/p')"
sub_impl_version="$(git diff tags/release...${CI_COMMIT_SHA} ${VERSIONS_FILE} \
sub_impl_version="$(git diff "tags/release...${CI_COMMIT_SHA}" "${VERSIONS_FILE}" \
| sed -n -r 's/^\-[[:space:]]+impl_version: +([0-9]+),$/\1/p')"


Expand Down
2 changes: 1 addition & 1 deletion .maintain/monitoring/alerting-rules/alerting-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ groups:

- alert: ContinuousTaskEnded
expr: '(polkadot_tasks_spawned_total{task_name != "basic-authorship-proposer"} == 1)
- on(instance, task_name) (polkadot_tasks_ended_total == 1)'
- on(instance, task_name) group_left() (polkadot_tasks_ended_total == 1)'
for: 5m
labels:
severity: warning
Expand Down
Loading