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

Feature/update to polkadot v0 9 5 #152

Merged
merged 64 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
a57bc44
Storage chain: Runtime module (#8624)
arkpar Jun 4, 2021
7d8a9b6
more useful error message (#9014)
ordian Jun 4, 2021
0495ead
Named reserve (#7778)
xlc Jun 4, 2021
e98aca3
update ss58 type to u16 (#8955)
jak-pan Jun 4, 2021
d27dea9
Fixed build (#9021)
arkpar Jun 4, 2021
2cff60c
Bump parity-db (#9024)
adoerr Jun 4, 2021
37bb3ae
consensus: handle justification sync for blocks authored locally (#8698)
andresilva Jun 4, 2021
24a92c3
arithmetic: fix PerThing pow (#9030)
andresilva Jun 6, 2021
1085a90
Compact proof utilities in sp_trie. (#8574)
cheme Jun 7, 2021
1fa8cf7
Don't inlucde nominaotrs that back no one in the snapshot. (#9017)
kianenigma Jun 7, 2021
5d89967
Periodically call `Peerset::alloc_slots` on all sets (#9025)
tomaka Jun 7, 2021
fa26ce6
contracts: Add new `seal_call` that offers new features (#8909)
athei Jun 7, 2021
d089179
fix unreserve_all_named (#9042)
xlc Jun 8, 2021
0af6df5
Delete legacy runtime metadata macros (#9043)
ascjones Jun 8, 2021
0a2472d
`rpc-http-threads` cli arg (#8890)
tgmichel Jun 8, 2021
07a1af3
Emit `Bonded` event when rebonding (#9040)
shawntabrizi Jun 8, 2021
5f5fbea
deps(jsonrpsee): update to 0.2.0 to avoid alpha (#9036)
niklasad1 Jun 8, 2021
b493dd3
Small doc updates to `election-provider-multi-phase` (#9041)
emostov Jun 8, 2021
f775d0d
Misc telemetry polish (#8484)
dvdplm Jun 8, 2021
6749c70
put the validate_unsigned implementation inside the pallet definition…
gui1117 Jun 8, 2021
d6ac9f5
Use pallet names to name enum variants (#8990)
KiChjang Jun 9, 2021
a2f48bf
Stop sending network_state to telemetry (#9026)
gilescope Jun 9, 2021
4d64381
READY Update simnet tests to v5 (#8946)
radupopa2010 Jun 9, 2021
3e5b4a2
remove explicit unit return type (#9053)
JoshOrndorff Jun 9, 2021
eb9033b
[try-runtime-cli] Offchain worker support (#8966)
emostov Jun 9, 2021
2c84b31
Migrate ProfilingLayer to tracing registry API (#8943)
Folyd Jun 10, 2021
8f99b4b
grandpa: ignore justifications from other consensus engines (#9075)
andresilva Jun 11, 2021
218bd4f
Don't connect to reserved nodes if they're banned (#9020)
tomaka Jun 11, 2021
155ac5b
Try fix ui tests (#9082)
bkchr Jun 11, 2021
41ab01a
Implement `transfer_all` in Balances Pallet (#9018)
shawntabrizi Jun 11, 2021
b9f7b58
Transaction pool: Remove futures-diagnose and thread pool (#9074)
bkchr Jun 11, 2021
561dbcf
Migrate pallet-staking to pallet attribute macro (#9083)
shaunxw Jun 12, 2021
3325b10
pallet-offences: Switch to partition_point (#9049)
bkchr Jun 12, 2021
6d82c02
disable unused schnorrkel feature (#9084)
ordian Jun 12, 2021
2c21039
make all extrinsics public so they are available from outside (#9078)
apopiak Jun 12, 2021
350ba12
Fixes in Assets Pallet (#9059)
shawntabrizi Jun 12, 2021
1f16a6a
im-online: send heartbeats at a random period (#8819)
andresilva Jun 12, 2021
9e42949
Enforce pub calls in pallets (#9085)
gui1117 Jun 12, 2021
ab84c8c
Adds moonbeam, moonriver to ss58 registry (#9028)
Jun 13, 2021
3a41701
Allow additional trait bounds for `#[pallet::constant]` (#9050)
ascjones Jun 13, 2021
c8d5796
remove Default from AssetId trait bound (#9062)
xlc Jun 13, 2021
11d5eff
Add function to test whether function is exported in wasm blob (#9093)
Lldenaurois Jun 13, 2021
125c4b3
Make find_proxy public. (#9094)
IAliceBobI Jun 13, 2021
6b3c76a
pallet-authorship: Fixing some nitpicks (#9095)
bkchr Jun 13, 2021
f4cccc0
fix ordering of staking weight arguments (#9063)
coriolinus Jun 14, 2021
a7b641f
Allow renaming storage item prefixes (#9016)
KiChjang Jun 14, 2021
a4b0fd8
Migrate pallet-randomness-collective-flip to pallet attribute macro (…
koushiro Jun 14, 2021
ea960d6
Improve construct_runtime doc (#9096)
h4x3rotab Jun 14, 2021
c666a25
staking/election: prolonged era and emergency mode for governance sub…
gui1117 Jun 14, 2021
3bb42b9
Aura: Skip initialize block & remove cache (#9132)
bkchr Jun 17, 2021
159a5aa
double the allocator limit (#9102)
kianenigma Jun 17, 2021
8fb89f4
Merge 8920
shawntabrizi Jun 16, 2021
811cbb8
Make backwards compatible with CountedMap (#9126)
shawntabrizi Jun 16, 2021
87e38e4
Make it possible to override maximum payload of RPC (#9019)
kianenigma Jun 17, 2021
9c57262
fix build
shawntabrizi Jun 18, 2021
d5fb0f6
Merge remote-tracking branch 'upstream/polkadot-v0.9.5' into feature/…
MRamanenkau Sep 26, 2022
182ad61
Make tests compile
MRamanenkau Sep 26, 2022
5f5ee1c
Add release notes and increment spec version
MRamanenkau Sep 26, 2022
48d90a8
Post merge fixes
MRamanenkau Sep 26, 2022
5b692a4
Fix diffs with substrate
MRamanenkau Sep 27, 2022
ff6cd7f
Merge branch 'feature/update-to-polkadot-v0-9-5' of github.com:Cerebe…
MRamanenkau Sep 27, 2022
25c88f9
Remove pallet-transaction-storage
MRamanenkau Sep 27, 2022
23161c7
Add storage migrations
MRamanenkau Nov 22, 2022
9fe4366
Merge branch 'dev-cere' into feature/update-to-polkadot-v0-9-5
MRamanenkau Dec 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ test-frame-examples-compile-to-wasm:

test-linux-stable-int:
<<: *test-linux
stage: test
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.___"
Expand Down Expand Up @@ -567,9 +568,11 @@ build-rust-doc:
- buildah push --format=v2s2 "$IMAGE_NAME:latest"
after_script:
- buildah logout "$IMAGE_NAME"
# pass artifacts to the trigger-simnet job
- echo "IMAGE_NAME=${IMAGE_NAME}" > ./artifacts/$PRODUCT/build.env
- echo "IMAGE_TAG=${VERSION}" >> ./artifacts/$PRODUCT/build.env
# pass artifacts to the trigger-simnet job
- echo "IMAGE_NAME=${IMAGE_NAME}" | tee -a ./artifacts/$PRODUCT/build.env
- IMAGE_TAG="$(cat ./artifacts/$PRODUCT/VERSION)"
- echo "IMAGE_TAG=${IMAGE_TAG}" | tee -a ./artifacts/$PRODUCT/build.env
- cat ./artifacts/$PRODUCT/build.env

publish-docker-substrate:
stage: publish
Expand Down Expand Up @@ -708,4 +711,4 @@ trigger-simnet:
DWNSTRM_ID: 332
script:
# API trigger for a simnet job
- .maintain/gitlab/trigger_pipeline.sh
- .maintain/gitlab/trigger_pipeline.sh --simnet-version=${SIMNET_REF}
230 changes: 190 additions & 40 deletions .maintain/gitlab/trigger_pipeline.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,181 @@
#!/bin/bash

set -eu

# API trigger another project's pipeline
echo "Triggering Simnet pipeline."

curl --silent \
-X POST \
-F "token=${CI_JOB_TOKEN}" \
-F "ref=v3" `# trigger the pinned version of simnet CI config` \
-F "variables[TRGR_PROJECT]=${TRGR_PROJECT}" \
-F "variables[TRGR_REF]=${TRGR_REF}" \
-F "variables[IMAGE_NAME]=${IMAGE_NAME}" \
-F "variables[IMAGE_TAG]=${IMAGE_TAG}" \
"https://${CI_SERVER_HOST}/api/v4/projects/${DWNSTRM_ID}/trigger/pipeline" | \
tee pipeline

PIPELINE_ID=$(cat pipeline | jq ".id")
PIPELINE_URL=$(cat pipeline | jq ".web_url")
echo
echo "Simnet pipeline ${PIPELINE_URL} was successfully triggered."
echo "Now we're polling it to obtain the distinguished status."

# This is a workaround for a Gitlab bug, waits here until
# https://gitlab.com/gitlab-org/gitlab/-/issues/326137 gets fixed.
# The timeout is 360 curls with 8 sec interval, roughly an hour.
set -eou pipefail

# This script is to trigger Simnet pipeline.
# See help article for more details.

SCRIPT_NAME="$0"
SCRIPT_PATH=$(dirname "$0") # relative
SCRIPT_PATH=$(cd "${SCRIPT_PATH}" && pwd) # absolutized and normalized
SIMNET_VERSION=""

function usage {
cat << EOF
This script is to trigger Simnet pipeline.
It's designed to be launched locally and from CI.
The required argumants for both cases are listed below.

Usage: ${SCRIPT_NAME} OPTION

OPTIONS

-h, --help Print this help message.

Mandatory in both cases:

-s, --simnet-version Simnet version to trigger.
E.g.: v4

-u, --upstream-project Triggering project.
E.g.: substrate

-r, --upstream-ref The branch or tag name for which project is built.
E.g.: master

-d, --downstream-id Downstream project's ID to trigger.
E.g.: 332 (simnet project id)

-n, --image-name Name of image to test.
E.g.: docker.io/paritypr/synth-wave

-i, --image-tag Tag of the image to test.
E.g.: master

-c, --collator-image-tag Tag of collator image. Image name is hardcoded.
E.g.: master

Required for local launch:

-g, --ci-server-fqdn FQDN of your gitlab server.
E.g.: gitlab.parity.io

-t, --trigger-token Gitlab trigger token. This must be defined in
project -> settings -> CI/CD -> Pipeline triggers
Defaults to CI_JOB_TOKEN
https://stackoverflow.com/questions/42746634/gitlab-trigger-api-returns-404

-a, --access-token Gitlab peronal access token or it defaults to
PIPELINE_TOKEN (gitlab variable)
https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html

EXAMPLES
${SCRIPT_NAME} -s v4
${SCRIPT_NAME} --simnet-version=v4

Local test example. You need to set the 2 vars before running: TR_TOKEN and PERS_TOKEN
${SCRIPT_NAME} --simnet-version=v4 \\
--upstream-project=substrate \\
--upstream-ref=master \\
--image-name=docker.io/paritypr/synth-wave \\
--image-tag=master \\
--collator-image-tag=master \\
--ci-server-fqdn=gitlab.parity.io \\
--downstream-id=332 \\
--trigger-token="\${TR_TOKEN}" \\
--access-token="\${PERS_TOKEN}"
EOF
}

function main {
# Main entry point for the script.
parse_args "$@"
check_args
trigger_pipeline
check_pipeline
poll_pipeline
}

function parse_args {
# shellcheck disable=SC2214
while getopts c:u:r:i:n:g:t:r:a:s:h-: OPT; do
# support long options: https://stackoverflow.com/a/28466267/519360
if [ "${OPT}" = "-" ]; then # long option: reformulate OPT and OPTARG
OPT="${OPTARG%%=*}" # extract long option name
OPTARG="${OPTARG#$OPT}" # extract long option argument (may be empty)
OPTARG="${OPTARG#=}" # if long option argument, remove assigning `=`
fi
case "${OPT}" in
h | help ) usage ; exit 0 ;;
s | simnet-version ) needs_arg ; SIMNET_VERSION="${OPTARG}" ;;
u | upstream-project ) needs_arg ; TRGR_PROJECT="${OPTARG}" ;;
r | upstream-ref ) needs_arg ; TRGR_REF="${OPTARG}" ;;
n | image-name ) needs_arg ; IMAGE_NAME="${OPTARG}" ;;
i | image-tag ) needs_arg ; IMAGE_TAG="${OPTARG}" ;;
c | collator-image-tag ) needs_arg ; COLLATOR_IMAGE_TAG="${OPTARG}" ;;
g | ci-server-fqdn ) needs_arg ; CI_SERVER_HOST="${OPTARG}" ;;
d | downstream-id ) needs_arg ; DWNSTRM_ID="${OPTARG}" ;;
t | trigger-token ) needs_arg ; CI_JOB_TOKEN="${OPTARG}" ;;
a | access-token ) needs_arg ; PIPELINE_TOKEN="${OPTARG}" ;;
??* ) log DIE "Illegal option --${OPT}" ;; # bad long option
? ) exit 2 ;; # bad short option (error reported via getopts)
esac
done
shift $((OPTIND-1)) # remove parsed options and args from $@ list

}

function check_args {
if [[ -z "${SIMNET_VERSION}" ]] ; then
log DIE "Must specify value for mandatory argument -s,--simnet-version

$(usage)"
fi
}

function needs_arg {
if [ -z "${OPTARG}" ]; then
log DIE "No arg for --${OPT} option"
fi
}

function trigger_pipeline {
# API trigger another project's pipeline.
log INFO "Triggering Simnet pipeline."

curl --silent \
-X POST \
-F "token=${CI_JOB_TOKEN}" \
-F "ref=${SIMNET_VERSION}" \
-F "variables[TRGR_PROJECT]=${TRGR_PROJECT}" \
-F "variables[TRGR_REF]=${TRGR_REF}" \
-F "variables[IMAGE_NAME]=${IMAGE_NAME}" \
-F "variables[IMAGE_TAG]=${IMAGE_TAG}" \
"https://${CI_SERVER_HOST}/api/v4/projects/${DWNSTRM_ID}/trigger/pipeline" | \
tee pipeline;
}

function check_pipeline {
PIPELINE_ID=$(jq ".id" pipeline)
PIPELINE_URL=$(jq ".web_url" pipeline)
echo
log INFO "Simnet pipeline ${PIPELINE_URL} was successfully triggered."
log INFO "Now we're polling it to obtain the distinguished status."
}

function poll_pipeline {
# This is a workaround for a Gitlab bug, waits here until
# https://gitlab.com/gitlab-org/gitlab/-/issues/326137 gets fixed.
# The timeout is 360 curls with 8 sec interval, roughly an hour.
log INFO "Waiting on ${PIPELINE_ID} status..."

# shellcheck disable=SC2034
for i in {1..360}; do
STATUS=$(get_status);
log INFO "Triggered pipeline status is ${STATUS}";
if [[ ${STATUS} =~ ^(pending|running|created)$ ]]; then
echo;
elif [[ ${STATUS} =~ ^(failed|canceled|skipped|manual)$ ]]; then
log DIE "Something's broken in: ${PIPELINE_URL}";
elif [[ ${STATUS} =~ ^(success)$ ]]; then
log INFO "Look how green it is: ${PIPELINE_URL}"
exit 0
else
log DIE "Something else has happened in ${PIPELINE_URL}"
fi
sleep 8;
done
}

function get_status() {
curl --silent \
Expand All @@ -33,19 +184,18 @@ function get_status() {
jq --raw-output ".status";
}

echo "Waiting on ${PIPELINE_ID} status..."
function log {
local lvl msg fmt
lvl=$1 msg=$2
fmt='+%Y-%m-%d %H:%M:%S'
lg_date=$(date "${fmt}")
if [[ "${lvl}" = "DIE" ]] ; then
lvl="ERROR"
echo "${lg_date} - ${lvl} - ${msg}"
exit 1
else
echo "${lg_date} - ${lvl} - ${msg}"
fi
}

for i in $(seq 1 360); do
STATUS=$(get_status);
echo "Triggered pipeline status is ${STATUS}";
if [[ ${STATUS} =~ ^(pending|running|created)$ ]]; then
echo;
elif [[ ${STATUS} =~ ^(failed|canceled|skipped|manual)$ ]]; then
echo "Something's broken in: ${PIPELINE_URL}"; exit 1;
elif [[ ${STATUS} =~ ^(success)$ ]]; then
echo "Look how green it is: ${PIPELINE_URL}"; exit 0;
else
echo "Something else has happened in ${PIPELINE_URL}"; exit 1;
fi
sleep 8;
done
main "$@"
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.21.0]
### Changed
- Updated Substrate to polkadot-v0.9.5

## [2.20.0]
### Changed
- Updated Substrate to polkadot-v0.9.4
Expand Down
Loading