difftreelog
ci use upstream polkadot image (#1073)
in: master
* 1. delete own polkadot image and use native image from parity. 2. delete wasm-name variable 3. add rust-toolchain.toml and delete RUST_TOOLCHAIN variable 4. deleted unused docker files 5. miltiple fix workflows * test without shiden * fix chains for asset-hub * fix polkadex for xcm * fix polkadex for xcm * update versions for gh-actions * fix datapath for relay * fix datapath for assethub * fix assethub * fix chains for assethub * fix codestyle workflow * fix conditions for workflows * delete flag insecure-validator-i-know-what-i-do ---------
54 files changed
.baedeker/collator-selection.jsonnetdiffbeforeafterboth--- a/.baedeker/collator-selection.jsonnet
+++ b/.baedeker/collator-selection.jsonnet
@@ -2,18 +2,21 @@
m = import 'baedeker-library/mixin/spec.libsonnet',
;
+function(relay_spec)
+
local relay = {
name: 'relay',
bin: 'bin/polkadot',
validatorIdAssignment: 'staking',
spec: {Genesis:{
- chain: 'rococo-local',
+ chain: relay_spec,
modify:: m.genericRelay($),
}},
nodes: {
[name]: {
bin: $.bin,
wantedKeys: 'relay',
+ expectedDataPath: '/parity',
},
for name in ['alice', 'bob', 'charlie', 'dave', 'eve']
},
.baedeker/forkless-data.jsonnetdiffbeforeafterboth--- a/.baedeker/forkless-data.jsonnet
+++ b/.baedeker/forkless-data.jsonnet
@@ -17,6 +17,7 @@
[name]: {
bin: $.bin,
wantedKeys: 'relay',
+ expectedDataPath: '/parity',
},
for name in ['alice', 'bob', 'charlie', 'dave', 'eve']
},
.baedeker/node-only.jsonnetdiffbeforeafterboth--- a/.baedeker/node-only.jsonnet
+++ b/.baedeker/node-only.jsonnet
@@ -2,18 +2,21 @@
m = import 'baedeker-library/mixin/spec.libsonnet',
;
+function(relay_spec)
+
local relay = {
name: 'relay',
bin: 'bin/polkadot',
validatorIdAssignment: 'staking',
spec: {Genesis:{
- chain: 'rococo-local',
+ chain: relay_spec,
modify:: m.genericRelay($),
}},
nodes: {
[name]: {
bin: $.bin,
wantedKeys: 'relay',
+ expectedDataPath: '/parity',
},
for name in ['alice', 'bob', 'charlie', 'dave', 'eve']
},
.baedeker/xcm-opal-async-backing.jsonnetdiffbeforeafterboth--- a/.baedeker/xcm-opal-async-backing.jsonnet
+++ b/.baedeker/xcm-opal-async-backing.jsonnet
@@ -39,13 +39,14 @@
[name]: {
bin: $.bin,
wantedKeys: 'relay',
+ expectedDataPath: '/parity',
},
for name in ['alice', 'bob', 'charlie', 'dave', 'eve']
},
};
-local opal = {
- name: 'opal',
+local unique = {
+ name: 'unique',
bin: 'bin/unique',
paraId: 1001,
spec: {Genesis:{
@@ -66,6 +67,6 @@
relay + {
parachains: {
[para.name]: para,
- for para in [opal]
+ for para in [unique]
},
}
.baedeker/xcm-opal.jsonnetdiffbeforeafterboth1local2m = import 'baedeker-library/mixin/spec.libsonnet',3;45function(relay_spec)67local relay = {8 name: 'relay',9 bin: 'bin/polkadot',10 validatorIdAssignment: 'staking',11 spec: {Genesis:{12 chain: relay_spec,13 modify:: m.genericRelay($, hrmp = [14 // [$.parachains.opal.paraId, $.parachains.westmint.paraId, 8, 512],15 // [$.parachains.westmint.paraId, $.parachains.opal.paraId, 8, 512],16 ]),17 }},18 nodes: {19 [name]: {20 bin: $.bin,21 wantedKeys: 'relay',22 expectedDataPath: '/parity',23 },24 for name in ['alice', 'bob', 'charlie', 'dave', 'eve']25 },26};2728local unique = {29 name: 'unique',30 bin: 'bin/unique',31 paraId: 1001,32 spec: {Genesis:{33 modify:: m.genericPara($),34 }},35 nodes: {36 [name]: {37 bin: $.bin,38 wantedKeys: 'para',39 extraArgs: [40 '--increase-future-pool',41 ],42 },43 for name in ['alice', 'bob']44 },45};4647local westmint = {48 name: 'westmint',49 bin: 'bin/assethub',50 paraId: 1002,51 spec: {Genesis:{52 chain: 'westmint-local',53 modify:: m.genericPara($),54 }},55 nodes: {56 [name]: {57 bin: $.bin,58 wantedKeys: 'para',59 expectedDataPath: '/parity', 60 },61 for name in ['alice', 'bob']62 },63};6465relay + {66 parachains: {67 [para.name]: para,68 for para in [unique, westmint]69 },70}.baedeker/xcm-quartz.jsonnetdiffbeforeafterboth--- a/.baedeker/xcm-quartz.jsonnet
+++ b/.baedeker/xcm-quartz.jsonnet
@@ -24,13 +24,14 @@
[name]: {
bin: $.bin,
wantedKeys: 'relay',
+ expectedDataPath: '/parity',
},
for name in ['alice', 'bob', 'charlie', 'dave', 'eve', 'ferdie']
},
};
-local quartz = {
- name: 'quartz',
+local unique = {
+ name: 'unique',
bin: 'bin/unique',
paraId: 1001,
spec: {Genesis:{
@@ -89,7 +90,7 @@
local statemine = {
name: 'statemine',
- bin: 'bin/cumulus',
+ bin: 'bin/assethub',
paraId: 1004,
spec: {Genesis:{
chain: 'statemine-local',
@@ -99,6 +100,7 @@
[name]: {
bin: $.bin,
wantedKeys: 'para',
+ expectedDataPath: '/parity',
},
for name in ['alice', 'bob']
},
@@ -124,6 +126,6 @@
relay + {
parachains: {
[para.name]: para,
- for para in [quartz, karura, moonriver, statemine, shiden]
+ for para in [unique, karura, moonriver, statemine, shiden]
},
}
.baedeker/xcm-unique.jsonnetdiffbeforeafterboth--- a/.baedeker/xcm-unique.jsonnet
+++ b/.baedeker/xcm-unique.jsonnet
@@ -25,6 +25,7 @@
[name]: {
bin: $.bin,
wantedKeys: 'relay',
+ expectedDataPath: '/parity',
},
for name in ['alice', 'bob', 'charlie', 'dave', 'eve', 'ferdie', 'gregory', 'holly']
},
@@ -90,7 +91,7 @@
local statemint = {
name: 'statemint',
- bin: 'bin/cumulus',
+ bin: 'bin/assethub',
paraId: 1004,
spec: {Genesis:{
chain: 'statemint-local',
@@ -100,6 +101,7 @@
[name]: {
bin: $.bin,
wantedKeys: 'para-ed',
+ expectedDataPath: '/parity',
},
for name in ['alice', 'bob']
},
.docker/Dockerfile-chain-devdiffbeforeafterboth--- a/.docker/Dockerfile-chain-dev
+++ b/.docker/Dockerfile-chain-dev
@@ -1,6 +1,5 @@
FROM uniquenetwork/services:latest
-ARG RUST_TOOLCHAIN
ARG NETWORK
ENV DEBIAN_FRONTEND=noninteractive
@@ -8,14 +7,6 @@
ENV NETWORK=$NETWORK
ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"
-
-RUN echo "$NETWORK\n" && echo "$RUST_TOOLCHAIN\n"
-
-RUN rustup toolchain uninstall $(rustup toolchain list) && \
- rustup toolchain install $RUST_TOOLCHAIN && \
- rustup default $RUST_TOOLCHAIN && \
- rustup component add --toolchain $RUST_TOOLCHAIN rust-src && \
- rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN
RUN mkdir /dev_chain
COPY . /dev_chain
.docker/Dockerfile-chain-dev-unitdiffbeforeafterboth--- a/.docker/Dockerfile-chain-dev-unit
+++ b/.docker/Dockerfile-chain-dev-unit
@@ -4,14 +4,7 @@
ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"
-ARG RUST_TOOLCHAIN
ARG NETWORK
-
-RUN rustup toolchain uninstall $(rustup toolchain list) && \
- rustup toolchain install $RUST_TOOLCHAIN && \
- rustup default $RUST_TOOLCHAIN && \
- rustup component add --toolchain $RUST_TOOLCHAIN rust-src && \
- rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN
RUN mkdir /dev_chain
COPY . /dev_chain
.docker/Dockerfile-collators.j2diffbeforeafterboth--- a/.docker/Dockerfile-collators.j2
+++ /dev/null
@@ -1,64 +0,0 @@
-FROM uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} as polkadot
-
-# ===== Rust builder =====
-FROM uniquenetwork/services:latest as rust-builder
-
-ENV CARGO_HOME="/cargo-home"
-ENV PATH="/cargo-home/bin:$PATH"
-ENV TZ=UTC
-RUN rustup toolchain uninstall $(rustup toolchain list) && \
- rustup toolchain install {{ RUST_TOOLCHAIN }} && \
- rustup default {{ RUST_TOOLCHAIN }} && \
- rustup component add --toolchain {{ RUST_TOOLCHAIN }} rust-src && \
- rustup target list --installed && \
- rustup show
-RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }}
-
-RUN mkdir /unique_parachain
-WORKDIR /unique_parachain
-
-# ===== BUILD ======
-FROM rust-builder as builder-unique
-
-WORKDIR /unique_parachain
-
-ARG PROFILE=release
-
-RUN git clone https://github.com/UniqueNetwork/unique-chain.git -b {{ BRANCH }} . && \
- cargo build --features={{ NETWORK }}-runtime --$PROFILE
-
-# ===== RUN ======
-
-FROM ubuntu:22.04
-
-RUN apt-get -y update && \
- apt-get -y install curl git && \
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \
- export NVM_DIR="$HOME/.nvm" && \
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
- nvm install v16.16.0 && \
- nvm use v16.16.0
-
-RUN git clone https://github.com/uniquenetwork/polkadot-launch -b {{ POLKADOT_LAUNCH_BRANCH }}
-
-RUN export NVM_DIR="$HOME/.nvm" && \
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
- cd /polkadot-launch && \
- npm install --global yarn && \
- yarn install
-
-COPY --from=builder-unique /unique_parachain/target/release/unique-collator /unique-chain/target/release/
-COPY --from=builder-unique /unique_parachain/launch-config.json /polkadot-launch/launch-config.json
-
-COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/
-
-EXPOSE 9844
-EXPOSE 9944
-EXPOSE 9833
-EXPOSE 40333
-EXPOSE 30333
-
-CMD export NVM_DIR="$HOME/.nvm" && \
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
- cd /polkadot-launch && \
- yarn start launch-config.json
.docker/Dockerfile-hydradxdiffbeforeafterboth--- /dev/null
+++ b/.docker/Dockerfile-hydradx
@@ -0,0 +1,50 @@
+# ===== Rust builder =====
+FROM ubuntu:22.04 as rust-builder
+LABEL maintainer="Unique.Network"
+
+ARG RUST_TOOLCHAIN
+ENV CARGO_HOME="/cargo-home"
+ENV PATH="/cargo-home/bin:$PATH"
+ENV TZ=UTC
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+RUN apt-get update && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
+
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
+
+RUN rustup toolchain install "${RUST_TOOLCHAIN}" && \
+ rustup target add wasm32-unknown-unknown --toolchain "${RUST_TOOLCHAIN}" && \
+ rustup default "${RUST_TOOLCHAIN}" && \
+ rustup component add --toolchain "${RUST_TOOLCHAIN}" rust-src && \
+ rustup target list --installed && \
+ rustup show
+
+RUN mkdir /unique_parachain
+WORKDIR /unique_parachain
+
+# ===== BUILD BIN =====
+FROM rust-builder as builder-hydradx-bin
+
+ARG HYDRADX_BUILD_BRANCH
+
+WORKDIR /unique_parachain
+
+RUN git clone --depth 1 -b "${HYDRADX_BUILD_BRANCH}" https://github.com/galacticcouncil/HydraDX-node.git
+
+RUN --mount=type=cache,target=/cargo-home/registry \
+ --mount=type=cache,target=/cargo-home/git \
+ --mount=type=cache,target=/unique_parachain/parachain/target \
+ cd HydraDX-node && \
+ CARGO_INCREMENTAL=0 cargo build --release --locked && \
+ mkdir /unique_parachain/Hydradx && \
+ mv ./target/release/hydradx /unique_parachain/Hydradx/hydradx
+
+# ===== BIN ======
+
+FROM ubuntu:22.04 as builder-hydradx
+
+COPY --from=builder-hydradx-bin /unique_parachain/Hydradx/hydradx /bin/hydradx
+ENTRYPOINT ["/bin/hydradx"]
.docker/Dockerfile-polkadot.j2diffbeforeafterboth--- a/.docker/Dockerfile-polkadot.j2
+++ /dev/null
@@ -1,46 +0,0 @@
-# ===== Rust builder =====
-FROM ubuntu:22.04 as rust-builder
-LABEL maintainer="Unique.Network"
-
-ENV CARGO_HOME="/cargo-home"
-ENV PATH="/cargo-home/bin:$PATH"
-ENV TZ=UTC
-RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-
-RUN apt-get update && \
- apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
- apt-get clean && \
- rm -r /var/lib/apt/lists/*
-
-RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
-
-RUN rustup toolchain install {{ RUST_TOOLCHAIN }} && \
- rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} && \
- rustup default {{ RUST_TOOLCHAIN }} && \
- rustup component add --toolchain {{ RUST_TOOLCHAIN }} rust-src && \
- rustup target list --installed && \
- rustup show
-
-RUN mkdir /unique_parachain
-WORKDIR /unique_parachain
-
-# ===== BUILD POLKADOT =====
-FROM rust-builder as builder-polkadot-bin
-
-WORKDIR /unique_parachain
-
-RUN git clone -b {{ POLKADOT_BUILD_BRANCH }} --depth 1 https://github.com/paritytech/polkadot.git
-
-RUN --mount=type=cache,target=/cargo-home/registry \
- --mount=type=cache,target=/cargo-home/git \
- --mount=type=cache,target=/unique_parachain/polkadot/target \
- cd polkadot && \
- CARGO_INCREMENTAL=0 cargo build --release --locked && \
- mv ./target/release/polkadot /unique_parachain/polkadot/
-
-# ===== BIN ======
-
-FROM ubuntu:22.04 as builder-polkadot
-
-COPY --from=builder-polkadot-bin /unique_parachain/polkadot/polkadot /bin/polkadot
-ENTRYPOINT ["/bin/polkadot"]
.docker/Dockerfile-testnet.j2diffbeforeafterboth--- a/.docker/Dockerfile-testnet.j2
+++ /dev/null
@@ -1,66 +0,0 @@
-# ===== Rust builder =====
-FROM uniquenetwork/services:latest as rust-builder
-ARG RUST_TOOLCHAIN=
-
-ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN
-ENV CARGO_HOME="/cargo-home"
-ENV PATH="/cargo-home/bin:$PATH"
-ENV TZ=UTC
-
-RUN rustup toolchain uninstall $(rustup toolchain list) && \
- rustup toolchain install {{ RUST_TOOLCHAIN }} && \
- rustup default {{ RUST_TOOLCHAIN }} && \
- rustup component add --toolchain {{ RUST_TOOLCHAIN }} rust-src && \
- rustup target list --installed && \
- rustup show
-RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }}
-
-RUN mkdir /unique_parachain
-WORKDIR /unique_parachain
-
-# ===== BUILD ======
-FROM rust-builder as builder-unique
-
-ARG PROFILE=release
-
-WORKDIR /unique_parachain
-
-RUN git clone -b {{ BRANCH }} https://github.com/UniqueNetwork/unique-chain.git && \
- cd unique-chain && \
- cargo build --features={{ NETWORK }}-runtime --$PROFILE
-
-# ===== RUN ======
-
-FROM ubuntu:22.04
-
-RUN apt-get -y update && \
- apt-get -y install curl git && \
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \
- export NVM_DIR="$HOME/.nvm" && \
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
- nvm install v16.16.0 && \
- nvm use v16.16.0
-
-RUN git clone https://github.com/uniquenetwork/polkadot-launch -b {{ POLKADOT_LAUNCH_BRANCH }}
-
-RUN export NVM_DIR="$HOME/.nvm" && \
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
- cd /polkadot-launch && \
- npm install --global yarn && \
- yarn install
-
-COPY --from=builder-unique /unique_parachain/unique-chain/.docker/testnet-config/launch-config.json /polkadot-launch/launch-config.json
-COPY --from=builder-unique /unique_parachain/unique-chain/target/release/unique-collator /unique-chain/target/release/
-
-COPY --from=uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/
-
-EXPOSE 9844
-EXPOSE 9944
-EXPOSE 9833
-EXPOSE 40333
-EXPOSE 30333
-
-CMD export NVM_DIR="$HOME/.nvm" && \
- [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
- cd /polkadot-launch && \
- yarn start launch-config.json
.docker/Dockerfile-try-runtime.j2diffbeforeafterboth--- a/.docker/Dockerfile-try-runtime.j2
+++ b/.docker/Dockerfile-try-runtime.j2
@@ -1,18 +1,18 @@
# ===== Rust builder =====
-FROM uniquenetwork/services:latest as rust-builder
+FROM ubuntu:22.04 as rust-builder
+LABEL maintainer="Unique.Network"
-ENV RUST_TOOLCHAIN $RUST_TOOLCHAIN
ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"
ENV TZ=UTC
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+RUN apt-get update && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
+ apt-get clean && \
+ rm -r /var/lib/apt/lists/*
-RUN rustup toolchain uninstall $(rustup toolchain list) && \
- rustup toolchain install {{ RUST_TOOLCHAIN }} && \
- rustup default {{ RUST_TOOLCHAIN }} && \
- rustup target list --installed && \
- rustup component add --toolchain {{ RUST_TOOLCHAIN }} rust-src && \
- rustup show
-RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }}
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
RUN mkdir /unique_parachain
WORKDIR /unique_parachain
@@ -30,4 +30,4 @@
echo "Fork from: {{ REPLICA_FROM }}\n" && \
cargo build --features=try-runtime,{{ NETWORK }}-runtime --release
-CMD cargo run --release --features {{ NETWORK }}-runtime,try-runtime -- try-runtime --runtime target/release/wbuild/{{ WASM_NAME }}-runtime/{{ WASM_NAME }}_runtime.compact.compressed.wasm -lruntime=debug -ltry-runtime::cli=debug on-runtime-upgrade --checks live --uri {{ REPLICA_FROM }}
+CMD cargo run --release --features {{ NETWORK }}-runtime,try-runtime -- try-runtime --runtime target/release/wbuild/{{ NETWORK }}-runtime/{{ NETWORK }}_runtime.compact.compressed.wasm -lruntime=debug -ltry-runtime::cli=debug on-runtime-upgrade --checks live --uri {{ REPLICA_FROM }}
.docker/Dockerfile-uniquediffbeforeafterboth--- a/.docker/Dockerfile-unique
+++ b/.docker/Dockerfile-unique
@@ -14,15 +14,6 @@
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
-ARG RUST_TOOLCHAIN
-RUN echo "Using Rust '$RUST_TOOLCHAIN'" && \
- rustup toolchain install $RUST_TOOLCHAIN && \
- rustup target add wasm32-unknown-unknown --toolchain ${RUST_TOOLCHAIN} && \
- rustup default $RUST_TOOLCHAIN && \
- rustup component add --toolchain $RUST_TOOLCHAIN rust-src && \
- rustup target list --installed && \
- rustup show
-
RUN mkdir /unique_parachain
WORKDIR /unique_parachain
@@ -33,7 +24,7 @@
COPY . unique-chain/
-ARG RUNTIME_FEATURES
+ARG FEATURES
# registry for Updating registry. It is safe to cache it, because it only contains references to the dependency files,
# and the caches for the files themselves are set in Cargo.lock, which won't be updated because of --locked flag
# git for Updating git repository. It is safe to cache it, because git dependencies are cached by revision,
@@ -47,8 +38,8 @@
--mount=type=cache,target=/cargo-home/git \
--mount=type=cache,target=/unique_parachain/unique-chain/target \
cd unique-chain && \
- echo "Using runtime features '$RUNTIME_FEATURES'" && \
- CARGO_INCREMENTAL=0 cargo build --profile integration-tests --features=fast-inflation,"$RUNTIME_FEATURES" --locked && \
+ echo "Using runtime features ${FEATURES}" && \
+ CARGO_INCREMENTAL=0 cargo build --profile integration-tests --features=fast-inflation,"${FEATURES}" --locked && \
mv ./target/integration-tests/unique-collator /unique_parachain/unique-chain/ && \
cd target/integration-tests/wbuild && find . -name "*.wasm" -exec sh -c 'mkdir -p "../../../wasm/$(dirname {})"; cp {} "../../../wasm/{}"' \;
.docker/Dockerfile-unique-releasediffbeforeafterboth--- a/.docker/Dockerfile-unique-release
+++ b/.docker/Dockerfile-unique-release
@@ -14,15 +14,6 @@
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
-ARG RUST_TOOLCHAIN
-RUN echo "Using Rust '$RUST_TOOLCHAIN'" && \
- rustup toolchain install $RUST_TOOLCHAIN && \
- rustup target add wasm32-unknown-unknown --toolchain ${RUST_TOOLCHAIN} && \
- rustup default $RUST_TOOLCHAIN && \
- rustup component add --toolchain $RUST_TOOLCHAIN rust-src && \
- rustup target list --installed && \
- rustup show
-
RUN mkdir /unique_parachain
WORKDIR /unique_parachain
@@ -34,12 +25,12 @@
ARG UNIQUE_VERSION
RUN git clone -b "$UNIQUE_VERSION" --depth 1 https://github.com/uniquenetwork/unique-chain.git
-ARG RUNTIME_FEATURES
+ARG FEATURES
RUN --mount=type=cache,target=/cargo-home/registry \
--mount=type=cache,target=/cargo-home/git \
--mount=type=cache,target=/unique_parachain/polkadot/target \
cd unique-chain && \
- CARGO_INCREMENTAL=0 cargo build --release --features="$RUNTIME_FEATURES" --locked && \
+ CARGO_INCREMENTAL=0 cargo build --release --features="${FEATURES}" --locked && \
mv ./target/release/unique-collator /unique_parachain/unique-chain/
# ===== BIN ======
.docker/docker-compose.collators.j2diffbeforeafterboth--- a/.docker/docker-compose.collators.j2
+++ /dev/null
@@ -1,10 +0,0 @@
-version: "3.5"
-
-services:
- forkless-data:
- image: uniquenetwork/ci-collator-selection-local:{{ NETWORK }}-{{ BUILD_TAG }}
- container_name: collator-selection-{{ NETWORK }}
- expose:
- - 9944
- ports:
- - 127.0.0.1:9944:9944
.docker/docker-compose.forkless-data.j2diffbeforeafterboth--- a/.docker/docker-compose.forkless-data.j2
+++ /dev/null
@@ -1,24 +0,0 @@
-version: "3.5"
-
-services:
- forkless-data:
- image: uniquenetwork/ci-forkless-data-local:{{ NETWORK }}-{{ BUILD_TAG }}
- container_name: forkless-data-{{ NETWORK }}
- expose:
- - 9944
- - 33044
- - 33055
- - 33066
- - 33077
- - 33088
- - 33144
- - 33155
- ports:
- - 127.0.0.1:9944:9944
- - 127.0.0.1:33044:33044
- - 127.0.0.1:33055:33055
- - 127.0.0.1:33066:33066
- - 127.0.0.1:33077:33077
- - 127.0.0.1:33088:33088
- - 127.0.0.1:33144:33144
- - 127.0.0.1:33155:33155
.docker/docker-compose.forkless-nodata.j2diffbeforeafterboth--- a/.docker/docker-compose.forkless-nodata.j2
+++ /dev/null
@@ -1,10 +0,0 @@
-version: "3.5"
-
-services:
- forkless-nodata:
- image: uniquenetwork/ci-forkless-nodata-local:{{ NETWORK }}-{{ BUILD_TAG }}
- container_name: forkless-nodata
- expose:
- - 9944
- ports:
- - 127.0.0.1:9944:9944
.docker/docker-compose.gov.j2diffbeforeafterboth--- a/.docker/docker-compose.gov.j2
+++ b/.docker/docker-compose.gov.j2
@@ -4,9 +4,7 @@
node-dev:
build:
args:
- - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}"
- "NETWORK={{ NETWORK }}"
- - "WASM_NAME={{ WASM_NAME }}"
context: ../
dockerfile: .docker/Dockerfile-chain-dev
image: node-dev
.docker/docker-compose.tmp-dev.j2diffbeforeafterboth--- a/.docker/docker-compose.tmp-dev.j2
+++ b/.docker/docker-compose.tmp-dev.j2
@@ -4,7 +4,6 @@
node-dev:
build:
args:
- - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}"
- "NETWORK={{ NETWORK }}"
context: ../
dockerfile: .docker/Dockerfile-chain-dev
.docker/docker-compose.tmp-node.j2diffbeforeafterboth--- a/.docker/docker-compose.tmp-node.j2
+++ /dev/null
@@ -1,36 +0,0 @@
-version: "3.5"
-
-services:
- node-parachain:
- build:
- args:
- - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}"
- - "BRANCH={{ BRANCH }}"
- - "REPO_URL={{ REPO_URL }}"
- - "NETWORK={{ NETWORK }}"
- - "POLKADOT_BUILD_BRANCH={{ POLKADOT_BUILD_BRANCH }}"
- - "POLKADOT_LAUNCH_BRANCH={{ POLKADOT_LAUNCH_BRANCH }}"
- - "MAINNET_TAG={{ MAINNET_TAG }}"
- - "MAINNET_BRANCH={{ MAINNET_BRANCH }}"
- - "WASM_NAME={{ WASM_NAME }}"
- context: ../
- dockerfile: .docker/Dockerfile-parachain-node-only
- image: node-parachain
- container_name: node-parachain
- volumes:
- - type: bind
- source: ./launch-config-forkless-nodata.json
- target: /polkadot-launch/launch-config.json
- read_only: true
- expose:
- - 9944
- - 9945
- - 9844
- ports:
- - 127.0.0.1:9944:9944
- - 127.0.0.1:9945:9945
- - 127.0.0.1:9844:9844
- logging:
- options:
- max-size: "1m"
- max-file: "3"
.docker/docker-compose.tmp-unit.j2diffbeforeafterboth--- a/.docker/docker-compose.tmp-unit.j2
+++ b/.docker/docker-compose.tmp-unit.j2
@@ -6,7 +6,6 @@
context: ../
dockerfile: .docker/Dockerfile-chain-dev-unit
args:
- - "RUST_TOOLCHAIN={{ RUST_TOOLCHAIN }}"
- "NETWORK={{ NETWORK }}"
image: node-dev
container_name: node-dev
.docker/forkless-config/launch-config-forkless-nodata.j2diffbeforeafterboth--- a/.docker/forkless-config/launch-config-forkless-nodata.j2
+++ /dev/null
@@ -1,128 +0,0 @@
-{
- "relaychain": {
- "bin": "/polkadot/target/release/polkadot",
- "upgradeBin": "/polkadot/target/release/polkadot",
- "upgradeWasm": "/polkadot/target/release/wbuild/{{ RELAY_CHAIN_TYPE }}-runtime/{{ RELAY_CHAIN_TYPE }}_runtime.compact.compressed.wasm",
- "chain": "{{ RELAY_CHAIN_TYPE }}-local",
- "nodes": [
- {
- "name": "alice",
- "rpcPort": 9844,
- "port": 30444,
- "flags": [
- "-lparachain::candidate_validation=debug",
- "-lxcm=trace",
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external"
- ]
- },
- {
- "name": "bob",
- "rpcPort": 9855,
- "port": 30555,
- "flags": [
- "-lparachain::candidate_validation=debug",
- "-lxcm=trace",
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external"
- ]
- },
- {
- "name": "charlie",
- "rpcPort": 9866,
- "port": 30666,
- "flags": [
- "-lparachain::candidate_validation=debug",
- "-lxcm=trace",
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external"
- ]
- },
- {
- "name": "dave",
- "rpcPort": 9877,
- "port": 30777,
- "flags": [
- "-lparachain::candidate_validation=debug",
- "-lxcm=trace",
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external"
- ]
- },
- {
- "name": "eve",
- "rpcPort": 9888,
- "port": 30888,
- "flags": [
- "-lparachain::candidate_validation=debug",
- "-lxcm=trace",
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external"
- ]
- }
- ],
- "genesis": {
- "runtime": {
- "runtime_genesis_config": {
- "parachainsConfiguration": {
- "config": {
- "validation_upgrade_frequency": 1,
- "validation_upgrade_delay": 1
- }
- }
- }
- }
- }
- },
- "parachains": [
- {
- "bin": "/unique-chain/current/release/unique-collator",
- "upgradeBin": "/unique-chain/target/release/unique-collator",
- "upgradeWasm": "/unique-chain/target/release/wbuild/{{ WASM_NAME }}-runtime/{{ WASM_NAME }}_runtime.compact.compressed.wasm",
- "id": "1000",
- "balance": "1000000000000000000000000",
- "nodes": [
- {
- "port": 31200,
- "rpcPort": 9944,
- "name": "alice",
- "flags": [
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external",
- "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug",
- "--ws-max-connections=1000",
- "--",
- "--port=31335",
- "--ws-port=9745",
- "--rpc-port=9734"
- ]
- },
- {
- "port": 31201,
- "rpcPort": 9945,
- "name": "bob",
- "flags": [
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external",
- "-lxcm=trace,parity_ws::handler=debug,jsonrpsee_core=trace,jsonrpsee-core=trace,jsonrpsee_ws_server=debug",
- "--ws-max-connections=1000",
- "--",
- "--port=31337",
- "--ws-port=9747",
- "--rpc-port=9737"
- ]
- }
- ]
- }
- ],
- "simpleParachains": [],
- "hrmpChannels": [],
- "finalization": false
-}
.docker/testnet-config/launch-config.jsondiffbeforeafterboth--- a/.docker/testnet-config/launch-config.json
+++ /dev/null
@@ -1,147 +0,0 @@
-{
- "relaychain": {
- "bin": "/polkadot/target/release/polkadot",
- "chain": "rococo-local",
- "nodes": [
- {
- "name": "alice",
- "rpcPort": 9844,
- "port": 30444,
- "flags": [
- "-lparachain::candidate_validation=debug",
- "-lxcm=trace",
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external"
- ]
- },
- {
- "name": "bob",
- "rpcPort": 9855,
- "port": 30555,
- "flags": [
- "-lparachain::candidate_validation=debug",
- "-lxcm=trace",
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external"
- ]
- },
- {
- "name": "charlie",
- "rpcPort": 9866,
- "port": 30666,
- "flags": [
- "-lparachain::candidate_validation=debug",
- "-lxcm=trace",
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external"
- ]
- },
- {
- "name": "dave",
- "rpcPort": 9877,
- "port": 30777,
- "flags": [
- "-lparachain::candidate_validation=debug",
- "-lxcm=trace",
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external"
- ]
- },
- {
- "name": "eve",
- "rpcPort": 9888,
- "port": 30888,
- "flags": [
- "-lparachain::candidate_validation=debug",
- "-lxcm=trace",
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external"
- ]
- }
- ],
- "genesis": {
- "runtime": {
- "runtime_genesis_config": {
- "parachainsConfiguration": {
- "config": {
- "validation_upgrade_frequency": 1,
- "validation_upgrade_delay": 1
- }
- }
- }
- }
- }
- },
- "parachains": [
- {
- "bin": "/unique-chain/target/release/unique-collator",
- "id": "1000",
- "balance": "1000000000000000000000000",
- "nodes": [
- {
- "port": 31200,
- "rpcPort": 9944,
- "name": "alice",
- "flags": [
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external",
- "-lxcm=trace"
- ]
- },
- {
- "port": 31201,
- "rpcPort": 9945,
- "name": "bob",
- "flags": [
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external",
- "-lxcm=trace"
- ]
- },
- {
- "port": 31202,
- "rpcPort": 9946,
- "name": "charlie",
- "flags": [
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external",
- "-lxcm=trace"
- ]
- },
- {
- "port": 31203,
- "rpcPort": 9947,
- "name": "dave",
- "flags": [
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external",
- "-lxcm=trace"
- ]
- },
- {
- "port": 31204,
- "rpcPort": 9948,
- "name": "eve",
- "flags": [
- "--rpc-cors=all",
- "--unsafe-rpc-external",
- "--unsafe-ws-external",
- "-lxcm=trace"
- ]
- }
- ]
- }
- ],
- "simpleParachains": [],
- "hrmpChannels": [],
- "finalization": false
-}
.envdiffbeforeafterboth--- a/.env
+++ b/.env
@@ -1,25 +1,26 @@
RUST_TOOLCHAIN=nightly-2024-04-10
-POLKADOT_LAUNCH_BRANCH=unique-network
-RELAY_CHAIN_TYPE=westend
+RELAY_CHAIN_TYPE=rococo
-POLKADOT_MAINNET_BRANCH=v1.2.4
+POLKADOT_MAINNET_BRANCH=v1.9.0
+STATEMINT_BUILD_BRANCH=1.9.0
ACALA_BUILD_BRANCH=2.25.0
MOONBEAM_BUILD_BRANCH=runtime-2901
ASTAR_BUILD_BRANCH=v5.39.1
-UNIQUE_MAINNET_BRANCH=release-v10030071
+HYDRADX_BUILD_BRANCH=v27.0.0
+POLKADEX_BUILD_BRANCH=v6.0.0
+UNIQUE_MAINNET_BRANCH=release-v10030070
UNIQUE_REPLICA_FROM=wss://ws.unique.network:443
-POLKADEX_BUILD_BRANCH=v1.1.0
-HYDRADX_BUILD_BRANCH=v20.1.1
-KUSAMA_MAINNET_BRANCH=v1.2.5
-KARURA_BUILD_BRANCH=release-karura-2.25.0
+KUSAMA_MAINNET_BRANCH=v1.9.0
+STATEMINE_BUILD_BRANCH=1.9.0
+KARURA_BUILD_BRANCH=2.25.0
MOONRIVER_BUILD_BRANCH=runtime-2901
SHIDEN_BUILD_BRANCH=v5.39.1
-QUARTZ_MAINNET_BRANCH=release-v10030071
+QUARTZ_MAINNET_BRANCH=release-v10030070
QUARTZ_REPLICA_FROM=wss://ws-quartz.unique.network:443
-UNIQUEWEST_MAINNET_BRANCH=release-v0.9.43
-WESTMINT_BUILD_BRANCH=bad-branch-v1011001
-OPAL_MAINNET_BRANCH=release-v10030071
+UNIQUEWEST_MAINNET_BRANCH=v1.9.0
+WESTMINT_BUILD_BRANCH=1.9.0
+OPAL_MAINNET_BRANCH=release-v10030070
OPAL_REPLICA_FROM=wss://ws-opal.unique.network:443
.github/actions/prepare/action.ymldiffbeforeafterboth--- a/.github/actions/prepare/action.yml
+++ b/.github/actions/prepare/action.yml
@@ -15,7 +15,7 @@
run: |
echo "LAST_COMMIT_SHA=${GITHUB_SHA}" >> ${GITHUB_ENV}
- name: Run find-and-replace to remove slashes from branch name
- uses: mad9000/actions-find-and-replace-string@4
+ uses: mad9000/actions-find-and-replace-string@5
id: ref_slug
with:
source: ${{ github.head_ref }}
.github/workflows/canary.ymldiffbeforeafterboth--- a/.github/workflows/canary.yml
+++ /dev/null
@@ -1,12 +0,0 @@
-on:
- workflow_call:
-
-jobs:
-
- market-e2e-test:
- name: market e2e tests
- uses: ./.github/workflows/market-test.yml
- secrets: inherit
-
-
-
.github/workflows/ci-develop.ymldiffbeforeafterboth--- a/.github/workflows/ci-develop.yml
+++ b/.github/workflows/ci-develop.yml
@@ -26,11 +26,6 @@
uses: ./.github/workflows/unit-test.yml
secrets: inherit
- canary:
- if: github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'CI-canary')
- uses: ./.github/workflows/canary.yml
- secrets: inherit
-
xcm:
if: github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'CI-xcm')
uses: ./.github/workflows/xcm.yml
@@ -67,7 +62,7 @@
secrets: inherit
governance:
- if: github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'CI-gov')
+ if: github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'CI-governance')
uses: ./.github/workflows/governance.yml
secrets: inherit
.github/workflows/ci-master.ymldiffbeforeafterboth--- a/.github/workflows/ci-master.yml
+++ b/.github/workflows/ci-master.yml
@@ -24,10 +24,6 @@
uses: ./.github/workflows/unit-test.yml
secrets: inherit
- # canary:
- # uses: ./.github/workflows/canary.yml
- # secrets: inherit # pass all secrets from initial workflow to nested
-
xcm:
uses: ./.github/workflows/xcm.yml
secrets: inherit # pass all secrets from initial workflow to nested
.github/workflows/codestyle.ymldiffbeforeafterboth--- a/.github/workflows/codestyle.yml
+++ b/.github/workflows/codestyle.yml
@@ -13,17 +13,17 @@
steps:
- name: Clean Workspace
uses: AutoModality/action-clean@v1.1.0
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }}
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Install toolchain version from .env
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
targets: wasm32-unknown-unknown
- components: rustfmt, clippy
+ components: rustfmt, clippy
- name: Run cargo fmt
run: cargo fmt -- --check # In that mode it returns only exit code.
- name: Cargo fmt state
@@ -35,10 +35,10 @@
steps:
- name: Clean Workspace
uses: AutoModality/action-clean@v1.1.0
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }}
- - uses: actions/setup-node@v3.5.1
+ - uses: actions/setup-node@v4.0.2
with:
node-version: 20
- name: Install modules
@@ -50,17 +50,21 @@
clippy:
runs-on: [ self-hosted-ci ]
steps:
- - uses: actions/checkout@v3.1.0
+ - name: Clean Workspace
+ uses: AutoModality/action-clean@v1.1.0
+ - uses: actions/checkout@v4.1.7
+ with:
+ ref: ${{ github.head_ref }}
- name: Install substrate dependencies
run: sudo apt install -y libssl-dev pkg-config libclang-dev clang protobuf-compiler
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Install toolchain version from .env
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
targets: wasm32-unknown-unknown
- components: rustfmt, clippy
+ components: rustfmt, clippy
- name: Run cargo check
run: cargo clippy --features=quartz-runtime,unique-runtime,try-runtime,runtime-benchmarks --tests -- -Dwarnings
env:
.github/workflows/collator-selection.ymldiffbeforeafterboth--- a/.github/workflows/collator-selection.yml
+++ b/.github/workflows/collator-selection.yml
@@ -1,4 +1,4 @@
-name: collator-selection-test-run
+name: collator-selection
# Controls when the action will run.
on:
@@ -15,25 +15,22 @@
jobs:
prepare-execution-marix:
-
name: Prepare execution matrix
-
- runs-on: [self-hosted-ci]
+ runs-on: [ self-hosted-ci ]
outputs:
matrix: ${{ steps.create_matrix.outputs.matrix }}
steps:
-
- name: Clean Workspace
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Create Execution matrix
uses: CertainLach/create-matrix-action@v4
@@ -44,10 +41,9 @@
network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}
collator-selection:
-
needs: prepare-execution-marix
# The type of runner that the job will run on
- runs-on: [self-hosted-ci,large]
+ runs-on: [ self-hosted-ci ]
timeout-minutes: 1380
@@ -68,7 +64,7 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
@@ -77,58 +73,25 @@
uses: ./.github/actions/prepare
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Log in to Docker Hub
- uses: docker/login-action@v2.1.0
+ uses: docker/login-action@v3.2.0
with:
username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- - name: Run find-and-replace to remove slashes from branch name
- uses: mad9000/actions-find-and-replace-string@4
- id: branchname
- with:
- source: ${{ github.head_ref }}
- find: '/'
- replace: '-'
-
- - name: Generate ENV related extend Dockerfile file for POLKADOT
- uses: cuchi/jinja2-action@v1.2.0
- with:
- template: .docker/Dockerfile-polkadot.j2
- output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
-
- - name: Prepare polkadot
- uses: ./.github/actions/buildContainer
+ - name: Check and pull polkadot image
id: polkadot
+ uses: cloudposse/github-action-docker-image-exists@main
with:
- container: uniquenetwork/builder-polkadot
+ registry: registry.hub.docker.com
+ organization: parity
+ repository: polkadot
+ login: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
tag: ${{ matrix.relay_branch }}
- context: .docker
- dockerfile: Dockerfile-polkadot.${{ matrix.relay_branch }}.yml
- dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
- dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- # - name: pull needed images
- # run: |
- # docker pull uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}
-
- # - name: Build unique-chain
- # run: |
- # docker build --file .docker/Dockerfile-unique \
- # --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }} \
- # --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} \
- # --tag uniquenetwork/ci-collator-selection-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-${{ env.BUILD_SHA }} \
- # .
-
- # - name: Push docker image version
- # run: docker push uniquenetwork/ci-collator-selection-local:${{ matrix.network }}-${{ steps.branchname.outputs.value }}-${{ env.BUILD_SHA }}
-
-
- name: Prepare latest
uses: ./.github/actions/buildContainer
id: latest
@@ -138,23 +101,25 @@
context: .
dockerfile: .docker/Dockerfile-unique
args: |
- --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }},session-test-timings
- --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ --build-arg FEATURES=${{ matrix.network }}-runtime,session-test-timings
dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- - uses: actions/setup-node@v3.5.1
+ - uses: actions/setup-node@v4.0.2
with:
node-version: 20
- name: Install baedeker
- uses: UniqueNetwork/baedeker-action/setup@built
+ uses: UniqueNetwork/baedeker-action/setup@v1-no-debug-output
+ with:
+ useCache: false
- name: Setup library
run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library
- name: Start network
- uses: UniqueNetwork/baedeker-action@built
+ uses: UniqueNetwork/baedeker-action@v1-no-debug-output
+ if: success()
id: bdk
with:
jpath: |
@@ -163,7 +128,7 @@
relay_spec=${{ env.RELAY_CHAIN_TYPE }}-local
inputs: |
.baedeker/collator-selection.jsonnet
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.name }}'}})
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}})
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}})
- name: Upload network config
@@ -173,21 +138,28 @@
path: ${{ steps.bdk.outputs.composeProject }}
retention-days: 2
- - name: Run tests
+ - name: Ensure network is alive
working-directory: js-packages/tests
+ id: alive1
+ if: ${{ !cancelled() && steps.bdk.outcome == 'success' }}
run: |
- yarn install
+ yarn
yarn add mochawesome
- # Wanted by both wait_for_first_block
- # export RPC_URL="${RELAY_SAPPHIRE_HTTP_URL:-${RELAY_OPAL_HTTP_URL:-${RELAY_QUARTZ_HTTP_URL:-${RELAY_UNIQUE_HTTP_URL:-}}}}"
../scripts/wait_for_first_block.sh
+ env:
+ RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
+
+ - name: Run tests
+ working-directory: js-packages/tests
+ if: ${{ !cancelled() && steps.alive1.outcome == 'success' }}
+ run: |
echo "Ready to start tests"
NOW=$(date +%s) && yarn testCollators --reporter mochawesome --reporter-options reportFilename=test-collators-${NOW}
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
- name: Test Report
- uses: phoenix-actions/test-reporting@v10
+ uses: phoenix-actions/test-reporting@v15
id: test-report
if: success() || failure()
with:
.github/workflows/execution-matrix.ymldiffbeforeafterboth--- a/.github/workflows/execution-matrix.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-name: Reusable workflow
-
-on:
- workflow_call:
- # Map the workflow outputs to job outputs
- outputs:
- matrix:
- description: "The first output string"
- value: ${{ jobs.create-matrix.outputs.matrix_output }}
-
-jobs:
-
- create-marix:
-
- name: Prepare execution matrix
-
- runs-on: self-hosted-ci
- outputs:
- matrix_output: ${{ steps.create_matrix.outputs.matrix }}
-
- steps:
-
- - name: Clean Workspace
- uses: AutoModality/action-clean@v1.1.0
-
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
- with:
- ref: ${{ github.head_ref }} #Checking out head commit
-
- - name: Read .env file
- uses: xom9ikk/dotenv@v2
-
- - name: Create Execution matrix
- uses: CertainLach/create-matrix-action@v4
- id: create_matrix
- with:
- matrix: |
- network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}}
- network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}
- network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}}
-
.github/workflows/forkless-update-data.ymldiffbeforeafterboth--- a/.github/workflows/forkless-update-data.yml
+++ b/.github/workflows/forkless-update-data.yml
@@ -2,8 +2,11 @@
# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586869792/Forkless+update+with+data
# Triger: only call from main workflow(re-usable workflows)
+name: forkless-update-data
+
on:
workflow_call:
+ workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
@@ -13,7 +16,7 @@
name: execution matrix
- runs-on: self-hosted-ci
+ runs-on: [ self-hosted-ci ]
outputs:
matrix: ${{ steps.create_matrix.outputs.matrix }}
@@ -23,27 +26,27 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Create Execution matrix
uses: CertainLach/create-matrix-action@v4
id: create_matrix
with:
matrix: |
- network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, runtime_features {opal-runtime}, wasm_name {opal}, fork_source {${{ env.OPAL_REPLICA_FROM }}}
- network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, runtime_features {quartz-runtime}, wasm_name {quartz}, fork_source {${{ env.QUARTZ_REPLICA_FROM }}}
- network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, runtime_features {unique-runtime}, wasm_name {unique}, fork_source {${{ env.UNIQUE_REPLICA_FROM }}}
+ network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, fork_source {${{ env.OPAL_REPLICA_FROM }}}
+ network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, fork_source {${{ env.QUARTZ_REPLICA_FROM }}}
+ network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, fork_source {${{ env.UNIQUE_REPLICA_FROM }}}
forkless-data:
needs: prepare-execution-matrix
# The type of runner that the job will run on
- runs-on: [self-hosted-ci,large]
+ runs-on: [ self-hosted-ci,large ]
timeout-minutes: 1380
@@ -61,7 +64,7 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
@@ -70,33 +73,24 @@
uses: ./.github/actions/prepare
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Log in to Docker Hub
- uses: docker/login-action@v2.1.0
+ uses: docker/login-action@v3.2.0
with:
username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- - name: Generate ENV related extend Dockerfile file for POLKADOT
- uses: cuchi/jinja2-action@v1.2.0
- with:
- template: .docker/Dockerfile-polkadot.j2
- output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
-
- - name: Prepare polkadot
- uses: ./.github/actions/buildContainer
+ - name: Check and pull polkadot image
id: polkadot
+ uses: cloudposse/github-action-docker-image-exists@main
with:
- container: uniquenetwork/builder-polkadot
+ registry: registry.hub.docker.com
+ organization: parity
+ repository: polkadot
+ login: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
tag: ${{ matrix.relay_branch }}
- context: .docker
- dockerfile: Dockerfile-polkadot.${{ matrix.relay_branch }}.yml
- dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
- dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- name: Prepare latest
uses: ./.github/actions/buildContainer
@@ -107,8 +101,7 @@
context: .
dockerfile: .docker/Dockerfile-unique
args: |
- --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }}
- --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ --build-arg FEATURES=${{ matrix.network }}-runtime
dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
@@ -119,18 +112,21 @@
image: ${{ steps.latest.outputs.name }}
directory: /wasm
- - uses: actions/setup-node@v3.5.1
+ - uses: actions/setup-node@v4.0.2
with:
node-version: 20
- name: Install baedeker
- uses: UniqueNetwork/baedeker-action/setup@built
+ uses: UniqueNetwork/baedeker-action/setup@v1-no-debug-output
+ with:
+ useCache: false
- name: Setup library
run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library
- name: Start network
- uses: UniqueNetwork/baedeker-action@built
+ uses: UniqueNetwork/baedeker-action@v1-no-debug-output
+ if: success()
id: bdk
with:
jpath: |
@@ -141,36 +137,52 @@
fork_source=${{ matrix.fork_source }}
inputs: |
.baedeker/forkless-data.jsonnet
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.name }}'}})
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}})
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}})
- - name: "Reconcile: runtime is upgraded"
+ - name: Ensure network is alive
working-directory: js-packages/tests
+ id: alive1
+ if: ${{ !cancelled() && steps.bdk.outcome == 'success' }}
run: |
- yarn
+ yarn
../scripts/wait_for_first_block.sh
+ env:
+ RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
+
+ - name: "Reconcile: runtime is upgraded"
+ working-directory: js-packages/tests
+ id: reconcile1
+ if: ${{ !cancelled() && steps.alive1.outcome == 'success' }}
+ run: |
echo "Executing upgrade"
- yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ../scripts/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm
+ yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ../scripts/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.network }}-runtime/${{ matrix.network }}_runtime.compact.compressed.wasm
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
- - name: Run Parallel tests after forkless upgrade
+ - name: Ensure network is alive
working-directory: js-packages/tests
+ id: alive2
+ if: ${{ !cancelled() && steps.reconcile1.outcome == 'success' }}
run: |
- yarn
- yarn add mochawesome
+ yarn
../scripts/wait_for_first_block.sh
+ env:
+ RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
+
+ - name: Run Parallel tests after forkless upgrade
+ working-directory: js-packages/tests
+ if: ${{ !cancelled() && steps.alive2.outcome == 'success' }}
+ run: |
echo "Ready to start tests"
NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
- name: Run Sequential tests after forkless upgrade
- if: success() || failure()
working-directory: js-packages/tests
+ if: ${{ !cancelled() && steps.alive2.outcome == 'success' }}
run: |
- yarn
- yarn add mochawesome
NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW}
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
.github/workflows/forkless-update-nodata.ymldiffbeforeafterboth--- a/.github/workflows/forkless-update-nodata.yml
+++ b/.github/workflows/forkless-update-nodata.yml
@@ -2,8 +2,11 @@
# Forkless update without data replication
# Triger: only call from main workflow(re-usable workflows)
+name: forkless-update-nodata
+
on:
workflow_call:
+ workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
@@ -13,7 +16,7 @@
name: execution matrix
- runs-on: self-hosted-ci
+ runs-on: [ self-hosted-ci ]
outputs:
matrix: ${{ steps.create_matrix.outputs.matrix }}
@@ -23,27 +26,27 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Create Execution matrix
uses: CertainLach/create-matrix-action@v4
id: create_matrix
with:
matrix: |
- network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, runtime_features {opal-runtime}, wasm_name {opal}
- network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, runtime_features {quartz-runtime}, wasm_name {quartz}
- network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, runtime_features {unique-runtime}, wasm_name {unique}
+ network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}
+ network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}
+ network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}
forkless-nodata:
needs: prepare-execution-matrix
# The type of runner that the job will run on
- runs-on: [self-hosted-ci,large]
+ runs-on: [ self-hosted-ci,large ]
timeout-minutes: 1380
@@ -61,7 +64,7 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
@@ -70,33 +73,24 @@
uses: ./.github/actions/prepare
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Log in to Docker Hub
- uses: docker/login-action@v2.1.0
+ uses: docker/login-action@v3.2.0
with:
username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- - name: Generate ENV related extend Dockerfile file for POLKADOT
- uses: cuchi/jinja2-action@v1.2.0
- with:
- template: .docker/Dockerfile-polkadot.j2
- output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
-
- - name: Prepare polkadot
- uses: ./.github/actions/buildContainer
+ - name: Check and pull polkadot image
id: polkadot
+ uses: cloudposse/github-action-docker-image-exists@main
with:
- container: uniquenetwork/builder-polkadot
+ registry: registry.hub.docker.com
+ organization: parity
+ repository: polkadot
+ login: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
tag: ${{ matrix.relay_branch }}
- context: .docker
- dockerfile: Dockerfile-polkadot.${{ matrix.relay_branch }}.yml
- dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
- dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- name: Prepare mainnet
uses: ./.github/actions/buildContainer
@@ -107,8 +101,7 @@
context: .docker
dockerfile: Dockerfile-unique-release
args: |
- --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }}
- --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ --build-arg NETWORK=${{ matrix.network }}
--build-arg UNIQUE_VERSION=${{ matrix.mainnet_branch }}
dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
@@ -122,8 +115,7 @@
context: .
dockerfile: .docker/Dockerfile-unique
args: |
- --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }}
- --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ --build-arg FEATURES=${{ matrix.network }}-runtime
dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
@@ -134,54 +126,76 @@
image: ${{ steps.latest.outputs.name }}
directory: /wasm
- - uses: actions/setup-node@v3.5.1
+ - uses: actions/setup-node@v4.0.2
with:
node-version: 20
- name: Install baedeker
- uses: UniqueNetwork/baedeker-action/setup@built
+ uses: UniqueNetwork/baedeker-action/setup@v1-no-debug-output
+ with:
+ useCache: false
- name: Setup library
run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library
- name: Start network
- uses: UniqueNetwork/baedeker-action@built
+ uses: UniqueNetwork/baedeker-action@v1-no-debug-output
id: bdk
+ if: success()
with:
jpath: |
.baedeker/vendor
tla-str: |
- relay_spec=rococo-local
+ relay_spec=${{ env.RELAY_CHAIN_TYPE }}-local
inputs: |
.baedeker/node-only.jsonnet
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.name }}'}})
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}})
# nodata build uses old runtime, but new chain, thus we use mainnet image for spec generation, and then latest image for nodes.
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}}, for_chain = false)
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}})
- - name: "Reconcile: runtime is upgraded"
+ - name: Ensure network is alive
working-directory: js-packages/tests
+ id: alive1
+ if: ${{ !cancelled() && steps.bdk.outcome == 'success' }}
run: |
yarn
+ yarn add mochawesome
../scripts/wait_for_first_block.sh
+ env:
+ RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
+
+ - name: "Reconcile: runtime is upgraded"
+ working-directory: js-packages/tests
+ id: reconcile1
+ if: ${{ !cancelled() && steps.alive1.outcome == 'success' }}
+ run: |
echo "Executing upgrade"
- yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ../scripts/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.wasm_name }}-runtime/${{ matrix.wasm_name }}_runtime.compact.compressed.wasm
+ yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm ../scripts/authorizeEnactUpgrade.ts ${{ steps.wasms.outputs.dir }}/${{ matrix.network }}-runtime/${{ matrix.network }}_runtime.compact.compressed.wasm
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
- - name: Run Parallel tests after forkless upgrade
+ - name: Ensure network is alive
working-directory: js-packages/tests
+ id: alive2
+ if: ${{ !cancelled() && steps.reconcile1.outcome == 'success' }}
run: |
- yarn add mochawesome
../scripts/wait_for_first_block.sh
+ env:
+ RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
+
+ - name: Run Parallel tests after forkless upgrade
+ working-directory: js-packages/tests
+ if: ${{ !cancelled() && steps.alive2.outcome == 'success' }}
+ run: |
echo "Ready to start tests"
NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
- name: Run Sequential tests after forkless upgrade
- if: success() || failure()
working-directory: js-packages/tests
+ if: ${{ !cancelled() && steps.alive2.outcome == 'success' }}
run: NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW}
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
.github/workflows/generate-execution-matrix.ymldiffbeforeafterboth--- a/.github/workflows/generate-execution-matrix.yml
+++ /dev/null
@@ -1,45 +0,0 @@
-name: Prepare execution matrix
-
-on:
- workflow_call:
- # Map the workflow outputs to job outputs
- outputs:
- matrix_values:
- description: "Matix output"
- matrix: ${{ jobs.prepare-execution-matrix.outputs.matrix }}
-
-
-#concurrency:
-# group: ${{ github.workflow }}-${{ github.head_ref }}
-# cancel-in-progress: true
-
-
-jobs:
- prepare-execution-matrix:
- name: Generate output
- runs-on: self-hosted-ci
- # Map the job outputs to step outputs
- outputs:
- matrix: ${{ steps.create_matrix.outputs.matrix }}
-
- steps:
-
- - name: Clean Workspace
- uses: AutoModality/action-clean@v1.1.0
-
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
- with:
- ref: ${{ github.head_ref }} #Checking out head commit
-
- - name: Read .env file
- uses: xom9ikk/dotenv@v2
-
- - name: Create Execution matrix
- uses: CertainLach/create-matrix-action@v4
- id: create_matrix
- with:
- matrix: |
- network {opal}, runtime {opal}, features {opal-runtime}, mainnet_branch {${{ env.OPAL_MAINNET_TAG }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}}
- network {quartz}, runtime {quartz}, features {quartz-runtime}, mainnet_branch {${{ env.QUARTZ_MAINNET_TAG }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}
- network {unique}, runtime {unique}, features {unique-runtime}, mainnet_branch {${{ env.UNIQUE_MAINNET_TAG }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}}
.github/workflows/governance.ymldiffbeforeafterboth--- a/.github/workflows/governance.yml
+++ b/.github/workflows/governance.yml
@@ -1,16 +1,17 @@
# Governance tests in --dev mode with gov-test-timings feature enabled to reduce gov timings
-name: governance tests
+name: governance
# Triger: only call from main workflow(re-usable workflows)
on:
workflow_call:
+ workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
prepare-execution-marix:
name: Prepare execution matrix
- runs-on: self-hosted-ci
+ runs-on: [ self-hosted ]
outputs:
matrix: ${{ steps.create_matrix.outputs.matrix }}
@@ -19,26 +20,26 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Create Execution matrix
uses: CertainLach/create-matrix-action@v4
id: create_matrix
with:
matrix: |
- network {unique}, wasm_name {unique}
- network {quartz}, wasm_name {quartz}
- network {opal}, wasm_name {opal}
+ network {unique}
+ network {quartz}
+ network {opal}
dev_build_int_tests:
needs: prepare-execution-marix
# The type of runner that the job will run on
- runs-on: [self-hosted-ci, medium]
+ runs-on: [ self-hosted-ci, medium ]
timeout-minutes: 1380
name: ${{ matrix.network }}
@@ -53,12 +54,12 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Generate ENV related extend file for docker-compose
uses: cuchi/jinja2-action@v1.2.0
@@ -66,17 +67,15 @@
template: .docker/docker-compose.gov.j2
output_file: .docker/docker-compose.${{ matrix.network }}.yml
variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
NETWORK=${{ matrix.network }}
- WASM_NAME=${{ matrix.wasm_name }}
- name: Show build configuration
run: cat .docker/docker-compose.${{ matrix.network }}.yml
- name: Build the stack
- run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans
+ run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans
- - uses: actions/setup-node@v3.5.1
+ - uses: actions/setup-node@v4.0.2
with:
node-version: 20
@@ -92,7 +91,7 @@
RPC_URL: http://127.0.0.1:9944/
- name: Test Report
- uses: phoenix-actions/test-reporting@v10
+ uses: phoenix-actions/test-reporting@v15
id: test-report
if: success() || failure() # run this step even if previous step failed
with:
@@ -107,7 +106,7 @@
- name: Stop running containers
if: always() # run this step always
- run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down
+ run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down
- name: Remove builder cache
if: always() # run this step always
.github/workflows/make-bench.ymldiffbeforeafterboth--- a/.github/workflows/make-bench.yml
+++ b/.github/workflows/make-bench.yml
@@ -17,22 +17,15 @@
- name: Clean Workspace
uses: AutoModality/action-clean@v1.1.0
- - uses: actions/checkout@v3.3.0
+ - uses: actions/checkout@v4.1.7
with:
ref: develop
- name: Read .env file
- uses: xom9ikk/dotenv@v2.1.1
+ uses: xom9ikk/dotenv@v2.3.0.3.0
- name: Install substrate dependencies
run: sudo apt install -y curl cmake make libssl-dev pkg-config libclang-dev clang protobuf-compiler
-
- - name: Install actual toolchain
- uses: actions-rs/toolchain@v1.0.7
- with:
- toolchain: ${{ env.RUST_TOOLCHAIN }}
- default: true
- target: wasm32-unknown-unknown
- uses: actions/setup-node@v3
with:
.github/workflows/market-test.ymldiffbeforeafterboth--- a/.github/workflows/market-test.yml
+++ /dev/null
@@ -1,216 +0,0 @@
-# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586509375/Market+e2e+test
-# Nested workflow for lunching Market e2e tests from external repository https://github.com/UniqueNetwork/market-e2e-tests
-
-name: market api tests
-
-# Controls when the action will run.
-on:
- workflow_call:
-
-
-# A workflow run is made up of one or more jobs that can run sequentially or in parallel
-jobs:
-
- prepare-execution-marix:
-
- name: Prepare execution matrix
-
- runs-on: [self-hosted-ci]
- outputs:
- matrix: ${{ steps.create_matrix.outputs.matrix }}
-
- steps:
-
- - name: Clean Workspace
- uses: AutoModality/action-clean@v1.1.0
-
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
- with:
- ref: ${{ github.head_ref }} #Checking out head commit
-
- - name: Read .env file
- uses: xom9ikk/dotenv@v2
-
- - name: Create Execution matrix
- uses: CertainLach/create-matrix-action@v4
- id: create_matrix
- with:
- matrix: |
- network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}
-
-
- market_test:
- needs: prepare-execution-marix
- # The type of runner that the job will run on
- runs-on: [self-hosted-ci,large]
- timeout-minutes: 360
-
- name: ${{ matrix.network }}
-
- continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
-
- strategy:
- matrix:
- include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
-
- steps:
- - name: Clean Workspace
- uses: AutoModality/action-clean@v1.1.0
-
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - name: Checkout master repo
- uses: actions/checkout@master
- with:
- ref: ${{ github.head_ref }} #Checking out head commit
-
- - name: Checkout Market e2e tests
- uses: actions/checkout@v3.1.0
- with:
- repository: 'UniqueNetwork/market-e2e-tests'
- ssh-key: ${{ secrets.GH_PAT }}
- path: 'qa-tests'
- ref: 'master'
-
- - name: Read .env file
- uses: xom9ikk/dotenv@v2
-
- - name: Copy qa-tests/.env.example to qa-tests/.env
- working-directory: qa-tests
- run: cp .env.docker .env
-
- - name: Generate ENV related extend file for docker-compose
- uses: cuchi/jinja2-action@v1.2.0
- with:
- template: qa-tests/.docker/docker-compose.tmp-market.j2
- output_file: qa-tests/.docker/docker-compose.${{ matrix.network }}.yml
- variables: |
- REPO_URL=${{ github.server_url }}/${{ github.repository }}.git
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
- POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
- NETWORK=${{ matrix.network }}
- BRANCH=${{ github.head_ref }}
-
-
- - name: Show build configuration
- working-directory: qa-tests
- run: cat .docker/docker-compose.${{ matrix.network }}.yml
-
- - name: Start node-parachain
- working-directory: qa-tests
- run: docker-compose -f ".docker/docker-compose.market.yml" -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans --force-recreate node-parachain
-
- - uses: actions/setup-node@v3.5.1
- with:
- node-version: 20
-
- - name: Setup TypeScript
- working-directory: qa-tests
- run: |
- npm install -g ts-node
- npm install
-
- - name: Copy qa-tests/.env.docker to qa-tests/.env
- working-directory: qa-tests
- run: |
- rm -rf .env
- cp .env.docker .env
-
-# Temporary disable node readyness check. Have to dig into the script logic.
-# - name: Wait for chain up and running
-# working-directory: js-packages/tests
-# run: |
-# yarn install
-# ../scripts/wait_for_first_block.sh
-# echo "Ready to start tests"
-# env:
-# RPC_URL: http://127.0.0.1:9944/
-
- - name: Wait for chain up and running
- run: |
- sleep 1200s
- echo "Ready to start Market e2e tests"
-
- - name: Show content of .env file and Generate accounts
- working-directory: qa-tests
- run: |
- cat .env
- ts-node ./src/scripts/create-market-accounts.ts
-
- - name: Copy qa-tests/.env to qa-tests/.env.docker
- working-directory: qa-tests
- run: |
- rm -rf .env.docker
- cp .env .env.docker
-
- - name: Get chain logs
- if: always() # run this step always
- run: |
- docker exec node-parachain cat /polkadot-launch/9944.log
- docker exec node-parachain cat /polkadot-launch/9945.log
- docker exec node-parachain cat /polkadot-launch/alice.log
- docker exec node-parachain cat /polkadot-launch/eve.log
- docker exec node-parachain cat /polkadot-launch/dave.log
- docker exec node-parachain cat /polkadot-launch/charlie.log
-
- - name: Deploy contracts
- run: |
- cd qa-tests
- ts-node ./src/scripts/deploy-contract.ts
-
- - name: Timeout for debug
- if: failure()
- run: sleep 300s
-
- - name: Import test data
- working-directory: qa-tests
- run: ts-node ./src/scripts/create-test-collections.ts
-
- - name: Show content of qa-test .env
- working-directory: qa-tests
- run: cat .env
-
- - name: Read qa -test .env file Before market start
- uses: xom9ikk/dotenv@v2
- with:
- path: qa-tests/
-
- - name: local-market:start
- run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" up -d --build
-
- - name: Wait for market readyness
- working-directory: qa-tests
- run: src/scripts/wait-market-ready.sh
- shell: bash
-
- - name: Install dependecies
- working-directory: qa-tests
- run: |
- npm ci
- npm install -D @playwright/test
- npx playwright install-deps
- npx playwright install
-
- - name: Show content of qa-test .env
- working-directory: qa-tests
- run: cat .env
-
- - name: Test API interface
- working-directory: qa-tests
- run: |
- npx playwright test --workers=3 --quiet .*.api.test.ts --reporter=github --config playwright.config.ts
-
- - name: Timeout for debug
- if: failure()
- run: sleep 300s
-
- - name: Stop running containers
- if: always() # run this step always
- run: docker-compose -f "qa-tests/.docker/docker-compose.market.yml" -f "qa-tests/.docker/docker-compose.${{ matrix.network }}.yml" down --volumes
-
- - name: Remove builder cache
- if: always() # run this step always
- run: |
- docker builder prune -f
- docker system prune -f
.github/workflows/node-only-update.ymldiffbeforeafterboth--- a/.github/workflows/node-only-update.yml
+++ b/.github/workflows/node-only-update.yml
@@ -1,11 +1,12 @@
# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586837028/Nodes+only+update
# Node only update with restart polkadot-launch process.
-name: nodes-only update
+name: node-only-update
# Triger: only call from main workflow(re-usable workflows)
on:
workflow_call:
+ workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
@@ -15,7 +16,7 @@
name: execution matrix
- runs-on: self-hosted-ci
+ runs-on: [ self-hosted-ci ]
outputs:
matrix: ${{ steps.create_matrix.outputs.matrix }}
@@ -25,27 +26,27 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Create Execution matrix
uses: CertainLach/create-matrix-action@v4
id: create_matrix
with:
matrix: |
- network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, runtime_features {opal-runtime}
- network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, runtime_features {quartz-runtime}
- network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, runtime_features {unique-runtime}
+ network {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}
+ network {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}
+ network {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}
node-only-update:
needs: prepare-execution-matrix
# The type of runner that the job will run on
- runs-on: [self-hosted-ci]
+ runs-on: [ self-hosted-ci ]
timeout-minutes: 2880 # 48 hours for execution jobs.
@@ -67,7 +68,7 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
@@ -76,33 +77,24 @@
uses: ./.github/actions/prepare
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Log in to Docker Hub
- uses: docker/login-action@v2.1.0
+ uses: docker/login-action@v3.2.0
with:
username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- - name: Generate ENV related extend Dockerfile file for POLKADOT
- uses: cuchi/jinja2-action@v1.2.0
- with:
- template: .docker/Dockerfile-polkadot.j2
- output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
-
- - name: Prepare polkadot
- uses: ./.github/actions/buildContainer
+ - name: Check and pull polkadot image
id: polkadot
+ uses: cloudposse/github-action-docker-image-exists@main
with:
- container: uniquenetwork/builder-polkadot
+ registry: registry.hub.docker.com
+ organization: parity
+ repository: polkadot
+ login: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
tag: ${{ matrix.relay_branch }}
- context: .docker
- dockerfile: Dockerfile-polkadot.${{ matrix.relay_branch }}.yml
- dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
- dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- name: Prepare mainnet
uses: ./.github/actions/buildContainer
@@ -113,8 +105,7 @@
context: .docker
dockerfile: Dockerfile-unique-release
args: |
- --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }}
- --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ --build-arg FEATURES=${{ matrix.network }}-runtime
--build-arg UNIQUE_VERSION=${{ matrix.mainnet_branch }}
dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
@@ -128,30 +119,32 @@
context: .
dockerfile: .docker/Dockerfile-unique
args: |
- --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }}
- --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ --build-arg FEATURES=${{ matrix.network }}-runtime
dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- name: Checkout at '${{ matrix.mainnet_branch }}' branch
- uses: actions/checkout@master
+ uses: actions/checkout@v4.1.7
with:
#ref: ${{ github.head_ref }}
ref: ${{ matrix.mainnet_branch }} #Checking out head commit
path: ${{ matrix.mainnet_branch }}
- - uses: actions/setup-node@v3.5.1
+ - uses: actions/setup-node@v4.0.2
with:
- node-version: 18.17.1 # Update node version to 20 after mainnet will have changes for it
+ node-version: 20
- name: Install baedeker
- uses: UniqueNetwork/baedeker-action/setup@built
+ uses: UniqueNetwork/baedeker-action/setup@v1-no-debug-output
+ with:
+ useCache: false
- name: Setup library
run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library
- name: Start network
- uses: UniqueNetwork/baedeker-action@built
+ uses: UniqueNetwork/baedeker-action@v1-no-debug-output
+ if: success()
id: bdk
with:
jpath: |
@@ -160,33 +153,40 @@
relay_spec=${{ env.RELAY_CHAIN_TYPE }}-local
inputs: |
.baedeker/node-only.jsonnet
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.name }}'}})
- # extra_node_mixin due to mainnet unique node not supporting --increase-future-pool
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}})
ephemeral:snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}}, extra_node_mixin={extraArgs: []})
- - name: Run Parallel tests before Node Parachain upgrade
- working-directory: ${{ matrix.mainnet_branch }}/tests
- if: success()
+ - name: Ensure network is alive
+ working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests
+ id: alive1
+ if: ${{ !cancelled() && steps.bdk.outcome == 'success' }}
run: |
yarn
yarn add mochawesome
- # TODO: Update to new script structure after mainnet will have it
- ./scripts/wait_for_first_block.sh
+ ../scripts/wait_for_first_block.sh
+ env:
+ RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
+
+ - name: Run Parallel tests before Node Parachain upgrade
+ working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests
+ if: ${{ !cancelled() && steps.alive1.outcome == 'success' }}
+ run: |
echo "Ready to start tests"
NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
- name: Run Sequential tests before Node Parachain upgrade
- if: success() || failure()
- working-directory: ${{ matrix.mainnet_branch }}/tests
+ if: ${{ !cancelled() && steps.alive1.outcome == 'success' }}
+ working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests
run: NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW}
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
- name: "Reconcile: only one old node"
- if: success() || failure()
- uses: UniqueNetwork/baedeker-action/reconcile@built
+ if: ${{ !cancelled() && steps.alive1.outcome == 'success' }}
+ id: reconcile1
+ uses: UniqueNetwork/baedeker-action/reconcile@v1-no-debug-output
with:
baedeker: ${{ steps.bdk.outputs.baedeker }}
# Chain should always be built with the mainnet spec, this we first set binary for all nodes expect one, then set mainnet binary for the last node, and then force chainspec to be still generated from mainnet
@@ -196,15 +196,18 @@
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}})
- name: Ensure network is alive
- if: success()
+ working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests
+ id: alive2
+ if: ${{ !cancelled() && steps.reconcile1.outcome == 'success' }}
run: |
- ./js-packages/scripts/wait_for_first_block.sh
+ ../scripts/wait_for_first_block.sh
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
- name: "Reconcile: all nodes are updated"
- if: success() || failure()
- uses: UniqueNetwork/baedeker-action/reconcile@built
+ if: ${{ !cancelled() && steps.alive2.outcome == 'success' }}
+ id: reconcile2
+ uses: UniqueNetwork/baedeker-action/reconcile@v1-no-debug-output
with:
baedeker: ${{ steps.bdk.outputs.baedeker }}
# Chain should always be built with the mainnet spec, this we first set binary for all nodes, and then force chainspec to be still generated from mainnet
@@ -212,22 +215,27 @@
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}}, for_chain = false)
snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.mainnet.outputs.name }}'}})
+ - name: Ensure network is alive
+ working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests
+ id: alive3
+ if: ${{ !cancelled() && steps.reconcile2.outcome == 'success' }}
+ run: |
+ ../scripts/wait_for_first_block.sh
+ env:
+ RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
+
- name: Run Parallel tests after Node Parachain upgrade
- working-directory: ${{ matrix.mainnet_branch }}/tests
- if: success() || failure() # run this step even if previous step failed
+ working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests
+ if: ${{ !cancelled() && steps.alive3.outcome == 'success' }}
run: |
- yarn install
- yarn add mochawesome
- # TODO: Update to new script structure after mainnet will have it
- ./scripts/wait_for_first_block.sh
echo "Ready to start tests"
NOW=$(date +%s) && yarn testParallel --reporter mochawesome --reporter-options reportFilename=test-parallel-${NOW}
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
- name: Run Sequential tests after Node Parachain upgrade
- if: success() || failure()
- working-directory: ${{ matrix.mainnet_branch }}/tests
+ if: ${{ !cancelled() && steps.alive3.outcome == 'success' }}
+ working-directory: ${{ matrix.mainnet_branch }}/js-packages/tests
run: NOW=$(date +%s) && yarn testSequential --reporter mochawesome --reporter-options reportFilename=test-sequential-${NOW}
env:
RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
.github/workflows/polkadot-types.ymldiffbeforeafterboth--- a/.github/workflows/polkadot-types.yml
+++ b/.github/workflows/polkadot-types.yml
@@ -1,6 +1,6 @@
# Integration test in --dev mode
# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586411104/Integration+tests
-name: Polkadot types
+name: polkadot-types
# Triger: only call from main workflow(re-usable workflows)
on:
@@ -19,7 +19,7 @@
polkadot_generate_types:
# The type of runner that the job will run on
- runs-on: [self-hosted-ci,medium]
+ runs-on: [ self-hosted-ci,medium ]
timeout-minutes: 1380
name: ${{ matrix.network }}
@@ -42,12 +42,12 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Generate ENV related extend file for docker-compose
uses: cuchi/jinja2-action@v1.2.0
@@ -55,16 +55,15 @@
template: .docker/docker-compose.tmp-dev.j2
output_file: .docker/docker-compose.${{ matrix.network }}.yml
variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
NETWORK=${{ matrix.network }}
- name: Show build configuration
run: cat .docker/docker-compose.${{ matrix.network }}.yml
- name: Build the stack
- run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans
+ run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans
- - uses: actions/setup-node@v3.5.1
+ - uses: actions/setup-node@v4.0.2
with:
node-version: 20
@@ -84,7 +83,7 @@
- name: Stop running containers
if: always() # run this step always
- run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down
+ run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down
- name: Remove builder cache
if: always() # run this step always
.github/workflows/schedule-trigger-for-develop-build.ymldiffbeforeafterboth--- a/.github/workflows/schedule-trigger-for-develop-build.yml
+++ b/.github/workflows/schedule-trigger-for-develop-build.yml
@@ -16,7 +16,7 @@
- name: Clean Workspace
uses: AutoModality/action-clean@v1.1.0
- name: Checkout 🛎
- uses: actions/checkout@v3.1.0
+ uses: actions/checkout@v4.1.7
with:
# check out all branches
fetch-depth: 0
.github/workflows/testnet-build.ymldiffbeforeafterboth--- a/.github/workflows/testnet-build.yml
+++ /dev/null
@@ -1,128 +0,0 @@
-name: testnet-image-build
-
-# Controls when the action will run.
-on:
- workflow_call:
-
- # Allows you to run this workflow manually from the Actions tab
- workflow_dispatch:
-
-#Define Workflow variables
-env:
- REPO_URL: ${{ github.server_url }}/${{ github.repository }}
-
-# A workflow run is made up of one or more jobs that can run sequentially or in parallel
-jobs:
-
- prepare-execution-marix:
-
- name: Prepare execution matrix
-
- runs-on: [self-hosted-ci,medium]
- outputs:
- matrix: ${{ steps.create_matrix.outputs.matrix }}
-
- steps:
-
- - name: Clean Workspace
- uses: AutoModality/action-clean@v1.1.0
-
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
- with:
- ref: ${{ github.head_ref }} #Checking out head commit
-
- - name: Read .env file
- uses: xom9ikk/dotenv@v2
-
- - name: Create Execution matrix
- uses: CertainLach/create-matrix-action@v4
- id: create_matrix
- with:
- matrix: |
- network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}
- network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}
- network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}
-
- testnet-build:
- needs: prepare-execution-marix
- # The type of runner that the job will run on
- runs-on: [self-hosted-ci,medium]
-
- timeout-minutes: 600
-
- name: ${{ matrix.network }}
-
- continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
-
- strategy:
- matrix:
- include: ${{fromJson(needs.prepare-execution-marix.outputs.matrix)}}
-
- steps:
- - name: Skip if pull request is in Draft
- if: github.event.pull_request.draft == true
- run: exit 1
-
- - name: Clean Workspace
- uses: AutoModality/action-clean@v1.1.0
-
- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
- with:
- ref: ${{ github.head_ref }} #Checking out head commit
-
- - name: Read .env file
- uses: xom9ikk/dotenv@v2
-
- - name: Generate ENV related extend file for docker-compose
- uses: cuchi/jinja2-action@v1.2.0
- with:
- template: .docker/Dockerfile-testnet.j2
- output_file: .docker/Dockerfile-testnet.${{ matrix.network }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- NETWORK=${{ matrix.network }}
- POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
- POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
- NETWORK=${{ matrix.network }}
- BRANCH=${{ github.head_ref }}
-
- - name: Show build configuration
- run: cat .docker/Dockerfile-testnet.${{ matrix.network }}.yml
-
- - name: Show launch-config configuration
- run: cat launch-config.json
-
- - name: Run find-and-replace to remove slashes from branch name
- uses: mad9000/actions-find-and-replace-string@4
- id: branchname
- with:
- source: ${{ github.head_ref }}
- find: '/'
- replace: '-'
-
- - name: Log in to Docker Hub
- uses: docker/login-action@v2.1.0
- with:
- username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
- password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
-
- - name: Pull polkadot docker image
- run: docker pull uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}
-
- - name: Build the stack
- run: cd .docker/ && docker build --file ./Dockerfile-testnet.${{ matrix.network }}.yml --tag uniquenetwork/${{ matrix.network }}-testnet-local-nightly:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }} .
-
- - name: Push docker version image
- run: docker push uniquenetwork/${{ matrix.network }}-testnet-local-nightly:nightly-${{ steps.branchname.outputs.value }}-${{ github.sha }}
-
- - name: Clean Workspace
- if: always()
- uses: AutoModality/action-clean@v1.1.0
-
- - name: Remove builder cache
- if: always() # run this step always
- run: |
- docker builder prune -f
- docker system prune -f
.github/workflows/try-runtime.ymldiffbeforeafterboth--- a/.github/workflows/try-runtime.yml
+++ b/.github/workflows/try-runtime.yml
@@ -2,8 +2,11 @@
# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2587656213/Try+runtime
# Triger: only call from main workflow(re-usable workflows)
+name: try-runtime
+
on:
workflow_call:
+ workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
@@ -11,7 +14,7 @@
name: Prepare execution matrix
- runs-on: self-hosted-ci
+ runs-on: [ self-hosted-ci ]
outputs:
matrix: ${{ steps.create_matrix.outputs.matrix }}
@@ -21,27 +24,27 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Create Execution matrix
uses: CertainLach/create-matrix-action@v4
id: create_matrix
with:
matrix: |
- network {opal}, wasm_name {opal}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}}
- network {quartz}, wasm_name {quartz}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}
- network {unique}, wasm_name {unique}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}}
+ network {opal}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}}
+ network {quartz}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}
+ network {unique}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}}
try-runtime-build:
needs: prepare-execution-marix
# The type of runner that the job will run on
- runs-on: [self-hosted-ci]
+ runs-on: [ self-hosted-ci ]
continue-on-error: true #Do not stop testing of matrix runs failed. As it decided during PR review - it required 50/50& Let's check it with false.
name: ${{ matrix.network }}-try-runtime-build
@@ -55,7 +58,7 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
@@ -64,10 +67,10 @@
uses: ./.github/actions/prepare
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Log in to Docker Hub
- uses: docker/login-action@v2.1.0
+ uses: docker/login-action@v3.2.0
with:
username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
@@ -79,16 +82,14 @@
template: .docker/Dockerfile-try-runtime.j2
output_file: .docker/Dockerfile-try-runtime.${{ matrix.network }}.yml
variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
NETWORK=${{ matrix.network }}
- WASM_NAME=${{ matrix.wasm_name }}
REPLICA_FROM=${{ matrix.replica_from_address }}
- name: Show build Dockerfile
run: cat .docker/Dockerfile-try-runtime.${{ matrix.network }}.yml
- name: Run find-and-replace to remove slashes from branch name
- uses: mad9000/actions-find-and-replace-string@4
+ uses: mad9000/actions-find-and-replace-string@5
id: branchname
with:
source: ${{ github.head_ref }}
@@ -137,7 +138,7 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
@@ -150,7 +151,7 @@
echo "BUILD_SHA=${LAST_COMMIT_SHA:0:8}" >> $GITHUB_ENV
- name: Run find-and-replace to remove slashes from branch name
- uses: mad9000/actions-find-and-replace-string@4
+ uses: mad9000/actions-find-and-replace-string@5
id: branchname
with:
source: ${{ github.head_ref }}
@@ -158,7 +159,7 @@
replace: '-'
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Generate ENV related extend file for docker-compose
uses: cuchi/jinja2-action@v1.2.0
@@ -172,18 +173,18 @@
- name: Show build configuration
run: cat .docker/docker-compose.try-runtime.${{ matrix.network }}.yml
- - uses: actions/setup-node@v3.5.1
+ - uses: actions/setup-node@v4.0.2
with:
node-version: 20
- name: Log in to Docker Hub
- uses: docker/login-action@v2.1.0
+ uses: docker/login-action@v3.2.0
with:
username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- name: Build the stack
- run: docker-compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300
+ run: docker compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" up -d --remove-orphans --force-recreate --timeout 300
- name: Check if docker logs consist logs related to Runtime Upgrade testing.
if: success()
@@ -243,7 +244,7 @@
- name: Stop running containers
if: always() # run this step always
- run: docker-compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" down
+ run: docker compose -f ".docker/docker-compose.try-runtime.${{ matrix.network }}.yml" down
- name: Remove builder cache
if: always() # run this step always
.github/workflows/unit-test.ymldiffbeforeafterboth--- a/.github/workflows/unit-test.yml
+++ b/.github/workflows/unit-test.yml
@@ -1,18 +1,19 @@
# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586738699/Unit+Tests
# Re-Usable Workflow for lanching Unit tests
-name: unit tests
+name: unit-tests
# Controls when the action will run.
# Triger: only call from main workflow(re-usable workflows)
on:
workflow_call:
+ workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
unit_tests:
# The type of runner that the job will run on
- runs-on: [self-hosted-ci,medium]
+ runs-on: [ self-hosted-ci,medium ]
timeout-minutes: 1380
name: ${{ github.base_ref }}
@@ -25,31 +26,28 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Generate ENV related extend file for docker-compose
uses: cuchi/jinja2-action@v1.2.0
with:
template: .docker/docker-compose.tmp-unit.j2
output_file: .docker/docker-compose.unit.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
-
- name: Show build configuration
run: cat .docker/docker-compose.unit.yml
- name: Build the stack
- run: docker-compose -f ".docker/docker-compose.unit.yml" up --build --force-recreate --timeout 300 --remove-orphans --exit-code-from node-dev
+ run: docker compose -f ".docker/docker-compose.unit.yml" up --build --force-recreate --timeout 300 --remove-orphans --exit-code-from node-dev
- name: Stop running containers
if: always() # run this step always
- run: docker-compose -f ".docker/docker-compose.unit.yml" down
+ run: docker compose -f ".docker/docker-compose.unit.yml" down
- name: Remove builder cache
if: always() # run this step always
.github/workflows/xcm.ymldiffbeforeafterboth--- a/.github/workflows/xcm.yml
+++ b/.github/workflows/xcm.yml
@@ -16,7 +16,7 @@
prepare-execution-marix:
name: Prepare execution matrix
- runs-on: [self-hosted-ci]
+ runs-on: [ self-hosted-ci ]
outputs:
matrix: ${{ steps.create_matrix.outputs.matrix }}
@@ -25,21 +25,21 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Create Execution matrix
uses: CertainLach/create-matrix-action@v4
id: create_matrix
with:
matrix: |
- network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.WESTMINT_BUILD_BRANCH }}}, astar_version {${{ env.ASTAR_BUILD_BRANCH }}}, polkadex_version {${{ env.POLKADEX_BUILD_BRANCH }}}, hydradx_version {${{ env.HYDRADX_BUILD_BRANCH }}}, runtest {testXcmOpal}, runtime_features {opal-runtime}
- network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINE_BUILD_BRANCH }}}, astar_version {${{ env.SHIDEN_BUILD_BRANCH }}}, polkadex_version {${{ env.POLKADEX_BUILD_BRANCH }}}, hydradx_version {${{ env.HYDRADX_BUILD_BRANCH }}}, runtest {testFullXcmQuartz}, runtime_features {quartz-runtime}
- network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINT_BUILD_BRANCH }}}, astar_version {${{ env.ASTAR_BUILD_BRANCH }}}, polkadex_version {${{ env.POLKADEX_BUILD_BRANCH }}}, hydradx_version {${{ env.HYDRADX_BUILD_BRANCH }}}, runtest {testFullXcmUnique}, runtime_features {unique-runtime}
+ network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, assethub_version {${{ env.WESTMINT_BUILD_BRANCH }}}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, acala_repository {acala-node}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, astar_version {${{ env.ASTAR_BUILD_BRANCH }}}, runtest {testXcmOpal}
+ network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, assethub_version {${{ env.STATEMINE_BUILD_BRANCH }}}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, acala_repository {karura-node}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, astar_version {${{ env.SHIDEN_BUILD_BRANCH }}}, runtest {testFullXcmQuartz}
+ network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, assethub_version {${{ env.STATEMINT_BUILD_BRANCH }}}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, acala_repository {acala-node}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, astar_version {${{ env.ASTAR_BUILD_BRANCH }}}, runtest {testFullXcmUnique}
xcm:
needs: prepare-execution-marix
@@ -65,7 +65,7 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
@@ -74,269 +74,121 @@
uses: ./.github/actions/prepare
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Log in to Docker Hub
- uses: docker/login-action@v2.1.0
+ uses: docker/login-action@v3.2.0
with:
username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- # Check POLKADOT version and build it if it doesn't exist in repository
- - name: Generate ENV related extend Dockerfile file for POLKADOT
- uses: cuchi/jinja2-action@v1.2.0
+ - name: Check and pull polkadot image
+ id: polkadot
+ uses: cloudposse/github-action-docker-image-exists@main
with:
- template: .docker/Dockerfile-polkadot.j2
- output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
+ registry: registry.hub.docker.com
+ organization: parity
+ repository: polkadot
+ login: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
+ tag: ${{ matrix.relay_branch }}
- - name: Check if the dockerhub repository contains the needed version POLKADOT
- run: |
- # aquire token
- TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
- export TOKEN=$TOKEN
+ - name: Check and pull acala image
+ id: acala
+ uses: cloudposse/github-action-docker-image-exists@main
+ with:
+ registry: registry.hub.docker.com
+ organization: acala
+ repository: ${{ matrix.acala_repository }}
+ login: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
+ tag: ${{ matrix.acala_version }}
- # Get TAGS from DOCKERHUB POLKADOT repository
- POLKADOT_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadot/tags/?page_size=100 | jq -r '."results"[]["name"]')
- # Show TAGS
- echo "POLKADOT TAGS:"
- echo $POLKADOT_TAGS
- # Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS
- if [[ ${POLKADOT_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.relay_branch }}"($|[[:space:]]) ]]; then
- echo "Repository has needed POLKADOT version";
- docker pull uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}
- else
- echo "Repository has not needed POLKADOT version, so build it";
- cd .docker/ && docker build --file ./Dockerfile-polkadot.${{ matrix.relay_branch }}.yml --tag uniquenetwork/builder-polkadot:${{ matrix.relay_branch }} .
- echo "Push needed POLKADOT version to the repository";
- docker push uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}
- fi
- shell: bash
-
- # Check ACALA version and build it if it doesn't exist in repository
- - name: Generate ENV related extend Dockerfile file for ACALA
- uses: cuchi/jinja2-action@v1.2.0
+ - name: Check and pull MOONBEAM image
+ id: moonbeam
+ uses: cloudposse/github-action-docker-image-exists@main
with:
- template: .docker/Dockerfile-acala.j2
- output_file: .docker/Dockerfile-acala.${{ matrix.acala_version }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- ACALA_BUILD_BRANCH=${{ matrix.acala_version }}
+ registry: registry.hub.docker.com
+ organization: moonbeamfoundation
+ repository: moonbeam
+ login: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
+ tag: ${{ matrix.moonbeam_version }}
- - name: Check if the dockerhub repository contains the needed ACALA version
- run: |
- # aquire token
- TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
- export TOKEN=$TOKEN
-
- # Get TAGS from DOCKERHUB repository
- ACALA_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-acala/tags/?page_size=100 | jq -r '."results"[]["name"]')
- # Show TAGS
- echo "ACALA TAGS:"
- echo $ACALA_TAGS
- # Check correct version ACALA and build it if it doesn't exist in ACALA TAGS
- if [[ ${ACALA_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.acala_version }}"($|[[:space:]]) ]]; then
- echo "Repository has needed ACALA version";
- docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }}
- else
- echo "Repository has not needed ACALA version, so build it";
- cd .docker/ && docker build --file ./Dockerfile-acala.${{ matrix.acala_version }}.yml --tag uniquenetwork/builder-acala:${{ matrix.acala_version }} .
- echo "Push needed ACALA version to the repository";
- docker push uniquenetwork/builder-acala:${{ matrix.acala_version }}
- fi
- shell: bash
-
- # Check MOONBEAM version and build it if it doesn't exist in repository
- - name: Generate ENV related extend Dockerfile file for MOONBEAM
- uses: cuchi/jinja2-action@v1.2.0
+ - name: Check and pull ASSETHUB image
+ id: assethub
+ uses: cloudposse/github-action-docker-image-exists@main
with:
- template: .docker/Dockerfile-moonbeam.j2
- output_file: .docker/Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- MOONBEAM_BUILD_BRANCH=${{ matrix.moonbeam_version }}
-
- - name: Check if the dockerhub repository contains the needed MOONBEAM version
- run: |
- # aquire token
- TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
- export TOKEN=$TOKEN
+ registry: registry.hub.docker.com
+ organization: parity
+ repository: polkadot-parachain
+ login: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
+ tag: ${{ matrix.assethub_version }}
- # Get TAGS from DOCKERHUB repository
- MOONBEAM_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-moonbeam/tags/?page_size=100 | jq -r '."results"[]["name"]')
- # Show TAGS
- echo "MOONBEAM TAGS:"
- echo $MOONBEAM_TAGS
- # Check correct version MOONBEAM and build it if it doesn't exist in MOONBEAM TAGS
- if [[ ${MOONBEAM_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.moonbeam_version }}"($|[[:space:]]) ]]; then
- echo "Repository has needed MOONBEAM version";
- docker pull uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}
- else
- echo "Repository has not needed MOONBEAM version, so build it";
- cd .docker/ && docker build --file ./Dockerfile-moonbeam.${{ matrix.moonbeam_version }}.yml --tag uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }} .
- echo "Push needed MOONBEAM version to the repository";
- docker push uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}
- fi
- shell: bash
-
- # Check CUMULUS version and build it if it doesn't exist in repository
- - name: Generate ENV related extend Dockerfile file for CUMULUS
- uses: cuchi/jinja2-action@v1.2.0
+ - name: Check and pull ASTAR image
+ id: astar
+ uses: cloudposse/github-action-docker-image-exists@main
with:
- template: .docker/Dockerfile-cumulus.j2
- output_file: .docker/Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- CUMULUS_BUILD_BRANCH=${{ matrix.cumulus_version }}
-
- - name: Check if the dockerhub repository contains the needed CUMULUS version
- run: |
- # aquire token
- TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
- export TOKEN=$TOKEN
+ registry: registry.hub.docker.com
+ organization: staketechnologies
+ repository: astar-collator
+ login: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
+ tag: ${{ matrix.astar_version }}
- # Get TAGS from DOCKERHUB repository
- CUMULUS_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-cumulus/tags/?page_size=100 | jq -r '."results"[]["name"]')
- # Show TAGS
- echo "CUMULUS TAGS:"
- echo $CUMULUS_TAGS
- # Check correct version CUMULUS and build it if it doesn't exist in CUMULUS TAGS
- if [[ ${CUMULUS_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.cumulus_version }}"($|[[:space:]]) ]]; then
- echo "Repository has needed CUMULUS version";
- docker pull uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}
- else
- echo "Repository has not needed CUMULUS version, so build it";
- cd .docker/ && docker build --file ./Dockerfile-cumulus.${{ matrix.cumulus_version }}.yml --tag uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }} .
- echo "Push needed CUMULUS version to the repository";
- docker push uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}
- fi
- shell: bash
-
- # Check ASTAR version and build it if it doesn't exist in repository
- - name: Generate ENV related extend Dockerfile file for ASTAR
- uses: cuchi/jinja2-action@v1.2.0
+ - name: Check and pull POLKADEX image
+ id: polkadex
+ uses: cloudposse/github-action-docker-image-exists@main
with:
- template: .docker/Dockerfile-astar.j2
- output_file: .docker/Dockerfile-astar.${{ matrix.astar_version }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- ASTAR_BUILD_BRANCH=${{ matrix.astar_version }}
+ registry: registry.hub.docker.com
+ organization: polkadex
+ repository: mainnet
+ login: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
+ tag: ${{ env.POLKADEX_BUILD_BRANCH }}
- - name: Check if the dockerhub repository contains the needed ASTAR version
- run: |
- # aquire token
- TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
- export TOKEN=$TOKEN
-
- # Get TAGS from DOCKERHUB repository
- ASTAR_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-astar/tags/?page_size=100 | jq -r '."results"[]["name"]')
- # Show TAGS
- echo "ASTAR TAGS:"
- echo $ASTAR_TAGS
- # Check correct version ASTAR and build it if it doesn't exist in ASTAR TAGS
- if [[ ${ASTAR_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.astar_version }}"($|[[:space:]]) ]]; then
- echo "Repository has needed ASTAR version";
- docker pull uniquenetwork/builder-astar:${{ matrix.astar_version }}
- else
- echo "Repository has not needed ASTAR version, so build it";
- cd .docker/ && docker build --file ./Dockerfile-astar.${{ matrix.astar_version }}.yml --tag uniquenetwork/builder-astar:${{ matrix.astar_version }} .
- echo "Push needed ASTAR version to the repository";
- docker push uniquenetwork/builder-astar:${{ matrix.astar_version }}
- fi
- shell: bash
-
- # Check POLKADEX version and build it if it doesn't exist in repository
- - name: Generate ENV related extend Dockerfile file for POLKADEX
- uses: cuchi/jinja2-action@v1.2.0
+ - name: Prepare Hydradx
+ uses: ./.github/actions/buildContainer
+ id: hydradx
with:
- template: .docker/Dockerfile-polkadex.j2
- output_file: .docker/Dockerfile-polkadex.${{ matrix.polkadex_version }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- POLKADEX_BUILD_BRANCH=${{ matrix.polkadex_version }}
+ container: uniquenetwork/builder-hydradx
+ tag: ${{ env.HYDRADX_BUILD_BRANCH }}
+ context: .
+ dockerfile: .docker/Dockerfile-hydradx
+ args: |
+ --build-arg HYDRADX_BUILD_BRANCH=${{ env.HYDRADX_BUILD_BRANCH }}
+ --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
+ dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- - name: Check if the dockerhub repository contains the needed POLKADEX version
- run: |
- # aquire token
- TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
- export TOKEN=$TOKEN
-
- # Get TAGS from DOCKERHUB repository
- POLKADEX_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadex/tags/?page_size=100 | jq -r '."results"[]["name"]')
- # Show TAGS
- echo "POLKADEX TAGS:"
- echo $POLKADEX_TAGS
- # Check correct version POLKADEX and build it if it doesn't exist in POLKADEX TAGS
- if [[ ${POLKADEX_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.polkadex_version }}"($|[[:space:]]) ]]; then
- echo "Repository has needed POLKADEX version";
- docker pull uniquenetwork/builder-polkadex:${{ matrix.polkadex_version }}
- else
- echo "Repository has not needed POLKADEX version, so build it";
- cd .docker/ && docker build --file ./Dockerfile-polkadex.${{ matrix.polkadex_version }}.yml --tag uniquenetwork/builder-polkadex:${{ matrix.polkadex_version }} .
- echo "Push needed POLKADEX version to the repository";
- docker push uniquenetwork/builder-polkadex:${{ matrix.polkadex_version }}
- fi
- shell: bash
-
- # Check Hydradx version and build it if it doesn't exist in repository
- - name: Generate ENV related extend Dockerfile file for Hydradx
- uses: cuchi/jinja2-action@v1.2.0
+ - name: Prepare latest
+ uses: ./.github/actions/buildContainer
+ id: latest
with:
- template: .docker/Dockerfile-hydradx.j2
- output_file: .docker/Dockerfile-hydradx.${{ matrix.hydradx_version }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- HYDRADX_BUILD_BRANCH=${{ matrix.hydradx_version }}
-
- - name: Check if the dockerhub repository contains the needed HYDRADX version
- run: |
- # aquire token
- TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
- export TOKEN=$TOKEN
+ container: uniquenetwork/ci-xcm-local
+ tag: ${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }}
+ context: .
+ dockerfile: .docker/Dockerfile-unique
+ args: |
+ --build-arg FEATURES=${{ matrix.network }}-runtime
+ dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- # Get TAGS from DOCKERHUB repository
- HYDRADX_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-hydradx/tags/?page_size=100 | jq -r '."results"[]["name"]')
- # Show TAGS
- echo "HYDRADX TAGS:"
- echo $HYDRADX_TAGS
- # Check correct version HYDRADX and build it if it doesn't exist in HYDRADX TAGS
- if [[ ${HYDRADX_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.hydradx_version }}"($|[[:space:]]) ]]; then
- echo "Repository has needed HYDRADX version";
- docker pull uniquenetwork/builder-hydradx:${{ matrix.hydradx_version }}
- else
- echo "Repository has not needed HYDRADX version, so build it";
- cd .docker/ && docker build --file ./Dockerfile-hydradx.${{ matrix.hydradx_version }}.yml --tag uniquenetwork/builder-hydradx:${{ matrix.hydradx_version }} .
- echo "Push needed HYDRADX version to the repository";
- docker push uniquenetwork/builder-hydradx:${{ matrix.hydradx_version }}
- fi
- shell: bash
-
-
- - name: Build unique-chain
- run: |
- docker build --file .docker/Dockerfile-unique \
- --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }} \
- --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} \
- --tag uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} \
- .
-
- - name: Push docker image version
- run: docker push uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }}
-
- - uses: actions/setup-node@v3.5.1
+ - uses: actions/setup-node@v4.0.2
with:
node-version: 20
- name: Install baedeker
- uses: UniqueNetwork/baedeker-action/setup@built
+ uses: UniqueNetwork/baedeker-action/setup@v1-no-debug-output
+ with:
+ useCache: false
- name: Setup library
run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library
- name: Start network
- uses: UniqueNetwork/baedeker-action@built
+ uses: UniqueNetwork/baedeker-action@v1-no-debug-output
id: bdk
with:
jpath: |
@@ -345,14 +197,14 @@
relay_spec=${{ env.RELAY_CHAIN_TYPE }}-local
inputs: |
.baedeker/xcm-${{ matrix.network }}.jsonnet
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}'}})
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'uniquenetwork/ci-xcm-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }}'}})
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/acala':{dockerImage:'uniquenetwork/builder-acala:${{ matrix.acala_version }}'}})
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/moonbeam':{dockerImage:'uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}'}})
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/cumulus':{dockerImage:'uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}'}})
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/astar':{dockerImage:'uniquenetwork/builder-astar:${{ matrix.astar_version }}'}})
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadex':{dockerImage:'uniquenetwork/builder-polkadex:${{ matrix.polkadex_version }}'}})
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/hydradx':{dockerImage:'uniquenetwork/builder-hydradx:${{ matrix.hydradx_version }}'}})
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}})
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/unique':{dockerImage:'${{ steps.latest.outputs.name }}'}})
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/acala':{dockerImage:'${{ steps.acala.outputs.image }}:${{ steps.acala.outputs.tag }}'}})
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/moonbeam':{dockerImage:'${{ steps.moonbeam.outputs.image }}:${{ steps.moonbeam.outputs.tag }}'}})
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/assethub':{dockerImage:'${{ steps.assethub.outputs.image }}:${{ steps.assethub.outputs.tag }}'}})
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/astar':{dockerImage:'${{ steps.astar.outputs.image }}:${{ steps.astar.outputs.tag }}', docker:'/usr/local/bin/astar-collator'}})
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadex':{dockerImage:'${{ steps.polkadex.outputs.image }}:${{ steps.polkadex.outputs.tag }}'}})
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/hydradx':{dockerImage:'${{ steps.latest.outputs.name }}'}})
- name: Upload network config
uses: actions/upload-artifact@v3
@@ -361,28 +213,36 @@
path: ${{ steps.bdk.outputs.composeProject }}
retention-days: 2
- - name: Yarn install
+ - name: Ensure network is alive
working-directory: js-packages/tests
+ id: alive1
+ if: ${{ !cancelled() && steps.bdk.outcome == 'success' }}
run: |
- yarn install
+ yarn
yarn add mochawesome
+ ../scripts/wait_for_first_block.sh
+ env:
+ RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
- name: Call HRMP initialization
working-directory: js-packages/scripts
+ id: hrmp
+ if: ${{ !cancelled() && steps.alive1.outcome == 'success' }}
run: |
yarn node --no-warnings=ExperimentalWarning --loader ts-node/esm createHrmp.ts ${{matrix.network}}
- name: Run XCM tests
working-directory: js-packages/tests
+ id: tests
+ if: ${{ !cancelled() && steps.hrmp.outcome == 'success' }}
run: |
- # Wanted by both wait_for_first_block
- export RPC_URL="${RELAY_OPAL_HTTP_URL:-${RELAY_QUARTZ_HTTP_URL:-${RELAY_UNIQUE_HTTP_URL:-}}}"
- ../scripts/wait_for_first_block.sh
echo "Ready to start tests"
NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}
+ env:
+ RPC_URL: ${{ env.RELAY_UNIQUE_HTTP_URL }}
- name: XCM Test Report
- uses: phoenix-actions/test-reporting@v10
+ uses: phoenix-actions/test-reporting@v15
id: test-report
if: success() || failure()
with:
.github/workflows/xnft.ymldiffbeforeafterboth--- a/.github/workflows/xnft.yml
+++ b/.github/workflows/xnft.yml
@@ -16,7 +16,7 @@
prepare-execution-marix:
name: Prepare execution matrix
- runs-on: [self-hosted-ci]
+ runs-on: [ self-hosted-ci ]
outputs:
matrix: ${{ steps.create_matrix.outputs.matrix }}
@@ -25,19 +25,19 @@
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Create Execution matrix
uses: CertainLach/create-matrix-action@v4
id: create_matrix
with:
matrix: |
- network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, runtest {all-quartz}, runtime_features {quartz-runtime}
+ network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, acala_repository {karura-node}, runtest {all-quartz}
xnft:
needs: prepare-execution-marix
@@ -60,10 +60,11 @@
run: exit 1
- name: Clean Workspace
+ if: always()
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
@@ -72,118 +73,90 @@
uses: ./.github/actions/prepare
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Log in to Docker Hub
- uses: docker/login-action@v2.1.0
+ uses: docker/login-action@v3.2.0
with:
username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- # Check POLKADOT version and build it if it doesn't exist in repository
- - name: Generate ENV related extend Dockerfile file for POLKADOT
- uses: cuchi/jinja2-action@v1.2.0
+ - name: Check and pull polkadot image
+ id: polkadot
+ uses: cloudposse/github-action-docker-image-exists@main
with:
- template: .docker/Dockerfile-polkadot.j2
- output_file: .docker/Dockerfile-polkadot.${{ matrix.relay_branch }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- POLKADOT_BUILD_BRANCH=${{ matrix.relay_branch }}
+ registry: registry.hub.docker.com
+ organization: parity
+ repository: polkadot
+ login: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
+ tag: ${{ matrix.relay_branch }}
- - name: Check if the dockerhub repository contains the needed version POLKADOT
- run: |
- # aquire token
- TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
- export TOKEN=$TOKEN
-
- # Get TAGS from DOCKERHUB POLKADOT repository
- POLKADOT_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadot/tags/?page_size=100 | jq -r '."results"[]["name"]')
- # Show TAGS
- echo "POLKADOT TAGS:"
- echo $POLKADOT_TAGS
- # Check correct version POLKADOT and build it if it doesn't exist in POLKADOT TAGS
- if [[ ${POLKADOT_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.relay_branch }}"($|[[:space:]]) ]]; then
- echo "Repository has needed POLKADOT version";
- docker pull uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}
- else
- echo "Repository has not needed POLKADOT version, so build it";
- cd .docker/ && docker build --file ./Dockerfile-polkadot.${{ matrix.relay_branch }}.yml --tag uniquenetwork/builder-polkadot:${{ matrix.relay_branch }} .
- echo "Push needed POLKADOT version to the repository";
- docker push uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}
- fi
- shell: bash
+ - name: Check and pull acala image
+ id: acala
+ uses: cloudposse/github-action-docker-image-exists@main
+ with:
+ registry: registry.hub.docker.com
+ organization: acala
+ repository: ${{ matrix.acala_repository }}
+ login: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ password: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
+ tag: ${{ matrix.acala_version }}
- # Check ACALA version and build it if it doesn't exist in repository
- - name: Generate ENV related extend Dockerfile file for ACALA
- uses: cuchi/jinja2-action@v1.2.0
+ - name: Prepare latest
+ uses: ./.github/actions/buildContainer
+ id: latest
with:
- template: .docker/Dockerfile-acala.j2
- output_file: .docker/Dockerfile-acala.${{ matrix.acala_version }}.yml
- variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
- ACALA_BUILD_BRANCH=${{ matrix.acala_version }}
-
- - name: Check if the dockerhub repository contains the needed ACALA version
- run: |
- # aquire token
- TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)
- export TOKEN=$TOKEN
+ container: uniquenetwork/ci-xnft-local
+ tag: ${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }}
+ context: .
+ dockerfile: .docker/Dockerfile-unique
+ args: |
+ --build-arg FEATURES=${{ matrix.network }}-runtime
+ dockerhub_username: ${{ secrets.CORE_DOCKERHUB_USERNAME }}
+ dockerhub_token: ${{ secrets.CORE_DOCKERHUB_TOKEN }}
- # Get TAGS from DOCKERHUB repository
- ACALA_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-acala/tags/?page_size=100 | jq -r '."results"[]["name"]')
- # Show TAGS
- echo "ACALA TAGS:"
- echo $ACALA_TAGS
- # Check correct version ACALA and build it if it doesn't exist in ACALA TAGS
- if [[ ${ACALA_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.acala_version }}"($|[[:space:]]) ]]; then
- echo "Repository has needed ACALA version";
- docker pull uniquenetwork/builder-acala:${{ matrix.acala_version }}
- else
- echo "Repository has not needed ACALA version, so build it";
- cd .docker/ && docker build --file ./Dockerfile-acala.${{ matrix.acala_version }}.yml --tag uniquenetwork/builder-acala:${{ matrix.acala_version }} .
- echo "Push needed ACALA version to the repository";
- docker push uniquenetwork/builder-acala:${{ matrix.acala_version }}
- fi
- shell: bash
-
- - name: Build unique-chain
- run: |
- docker build --file .docker/Dockerfile-unique \
- --build-arg RUNTIME_FEATURES=${{ matrix.runtime_features }} \
- --build-arg RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} \
- --tag uniquenetwork/ci-xnft-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }} \
- .
-
- - name: Push docker image version
- run: docker push uniquenetwork/ci-xnft-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }}
-
- - uses: actions/setup-node@v3.5.1
+ - uses: actions/setup-node@v4.0.2
with:
node-version: 20
- name: Clone xnft-tests
- run: git clone https://github.com/UniqueNetwork/xnft-tests.git
+ run: git clone -b ci https://github.com/UniqueNetwork/xnft-tests.git
- name: Install baedeker
- uses: UniqueNetwork/baedeker-action/setup@built
+ uses: UniqueNetwork/baedeker-action/setup@v1-no-debug-output
+ with:
+ useCache: false
- name: Setup library
run: mkdir -p .baedeker/vendor/ && git clone https://github.com/UniqueNetwork/baedeker-library .baedeker/vendor/baedeker-library
- name: Start network
- uses: UniqueNetwork/baedeker-action@built
+ uses: UniqueNetwork/baedeker-action@v1-no-debug-output
+ if: success()
id: bdk
with:
jpath: |
.baedeker/vendor
tla-str: |
- relay_spec=rococo-local
+ relay_spec=${{ env.RELAY_CHAIN_TYPE }}-local
inputs: |
xnft-tests/.baedeker/testnets.jsonnet
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'uniquenetwork/builder-polkadot:${{ matrix.relay_branch }}'}})
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/quartz':{dockerImage:'uniquenetwork/ci-xnft-local:${{ matrix.network }}-${{ env.REF_SLUG }}-${{ env.BUILD_SHA }}'}})
- snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/karura':{dockerImage:'uniquenetwork/builder-acala:${{ matrix.acala_version }}'}})
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadot':{dockerImage:'${{ steps.polkadot.outputs.image }}:${{ steps.polkadot.outputs.tag }}'}})
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/quartz':{dockerImage:'${{ steps.latest.outputs.name }}'}})
+ snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/karura':{dockerImage:'${{ steps.acala.outputs.image }}:${{ steps.acala.outputs.tag }}'}})
+ - name: Ensure network is alive
+ working-directory: js-packages/tests
+ id: alive1
+ if: ${{ !cancelled() && steps.bdk.outcome == 'success' }}
+ run: |
+ yarn
+ yarn add mochawesome
+ ../scripts/wait_for_first_block.sh
+ env:
+ RPC_URL: ${{ env.RELAY_QUARTZ_HTTP_URL }}
+
- name: Yarn install
working-directory: xnft-tests
run: |
@@ -192,11 +165,14 @@
- name: Run XNFT Tests
working-directory: xnft-tests
+ if: ${{ !cancelled() && steps.alive1.outcome == 'success' }}
run: |
NOW=$(date +%s) && yarn ${{ matrix.runtest }} --reporter mochawesome --reporter-options reportFilename=test-${NOW}
+ env:
+ RPC_URL: ${{ env.RELAY_QUARTZ_HTTP_URL }}
- name: XNFT Tests Report
- uses: phoenix-actions/test-reporting@v10
+ uses: phoenix-actions/test-reporting@v15
id: test-report
if: success() || failure()
with:
@@ -204,10 +180,6 @@
path: xnft-tests/mochawesome-report/test-*.json
reporter: mochawesome-json
fail-on-error: 'false'
-
- - name: Clean Workspace
- if: always()
- uses: AutoModality/action-clean@v1.1.0
- name: Remove builder cache
if: always()
.github/workflows/yarn-dev.ymldiffbeforeafterboth--- a/.github/workflows/yarn-dev.yml
+++ b/.github/workflows/yarn-dev.yml
@@ -1,19 +1,18 @@
# Integration test in --dev mode
# https://cryptousetech.atlassian.net/wiki/spaces/CI/pages/2586411104/Integration+tests
-name: yarn dev
+name: yarn-dev
# Triger: only call from main workflow(re-usable workflows)
on:
workflow_call:
+ workflow_dispatch:
-
-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
dev_build_int_tests:
# The type of runner that the job will run on
- runs-on: [self-hosted-ci,medium]
+ runs-on: [ self-hosted-ci,medium ]
timeout-minutes: 1380
name: ${{ matrix.network }}
@@ -28,17 +27,16 @@
- network: "unique"
steps:
-
- name: Clean Workspace
uses: AutoModality/action-clean@v1.1.0
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- - uses: actions/checkout@v3.1.0
+ - uses: actions/checkout@v4.1.7
with:
ref: ${{ github.head_ref }} #Checking out head commit
- name: Read .env file
- uses: xom9ikk/dotenv@v2
+ uses: xom9ikk/dotenv@v2.3.0
- name: Generate ENV related extend file for docker-compose
uses: cuchi/jinja2-action@v1.2.0
@@ -46,17 +44,15 @@
template: .docker/docker-compose.tmp-dev.j2
output_file: .docker/docker-compose.${{ matrix.network }}.yml
variables: |
- RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }}
NETWORK=${{ matrix.network }}
-
- name: Show build configuration
run: cat .docker/docker-compose.${{ matrix.network }}.yml
- name: Build the stack
- run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans
+ run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" up -d --build --remove-orphans
- - uses: actions/setup-node@v3.5.1
+ - uses: actions/setup-node@v4.0.2
with:
node-version: 20
@@ -72,7 +68,7 @@
RPC_URL: http://127.0.0.1:9944/
- name: Test Report
- uses: phoenix-actions/test-reporting@v10
+ uses: phoenix-actions/test-reporting@v15
id: test-report
if: success() || failure() # run this step even if previous step failed
with:
@@ -99,7 +95,7 @@
- name: Stop running containers
if: always() # run this step always
- run: docker-compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down
+ run: docker compose -f ".docker/docker-compose.${{ matrix.network }}.yml" down
- name: Remove builder cache
if: always() # run this step always
doc/demo_milestone1-2.mddiffbeforeafterboth--- a/doc/demo_milestone1-2.md
+++ b/doc/demo_milestone1-2.md
@@ -17,7 +17,7 @@
The node can be run using docker container:
```
-docker-compose up -d
+docker compose up -d
```
#### NFT Tracking Module
doc/how-not-to-break-rpc.mddiffbeforeafterboth--- /dev/null
+++ b/doc/how-not-to-break-rpc.md
@@ -0,0 +1,169 @@
+# How not to break RPC
+
+Let's discuss how to avoid the breaking of RPC with an example of how the `colection_by_id` RPC method was broken.
+
+The `collection_by_id` was broken due to the change of the result type `RpcCollection`.
+The new version of the `RpcCollection` was incompatible with the old one due to addition of the `flags` field:
+
+```rust
+// The new version of the `RpcCollection`
+pub struct RpcCollection<AccountId> {
+ /// Collection owner account.
+ pub owner: AccountId,
+ /// Collection mode.
+ pub mode: CollectionMode,
+ /// Collection name.
+ pub name: Vec<u16>,
+ /// Collection description.
+ pub description: Vec<u16>,
+ /// Token prefix.
+ pub token_prefix: Vec<u8>,
+ /// The state of sponsorship of the collection.
+ pub sponsorship: SponsorshipState<AccountId>,
+ /// Collection limits.
+ pub limits: CollectionLimits,
+ /// Collection permissions.
+ pub permissions: CollectionPermissions,
+ /// Token property permissions.
+ pub token_property_permissions: Vec<PropertyKeyPermission>,
+ /// Collection properties.
+ pub properties: Vec<Property>,
+ /// Is collection read only.
+ pub read_only: bool,
+
+ /// Extra collection flags
+ pub flags: RpcCollectionFlags, // <-- THIS IS A NEW FIELD!
+}
+```
+
+### Where exactly was RPC broken?
+
+To answer this question, we need to describe the process of handling an RPC call.
+
+1. A user calls an RPC method.
+2. The node sees what method with what arguments should be executed.
+3. Since the code of each RPC method is located inside the runtime, the node does the following:
+ - The node encodes the RPC arguments into the [SCALE format](https://docs.substrate.io/reference/scale-codec/), and then it will call the corresponding method of the runtime API with the encoded arguments.
+ - The runtime executes the RPC logic and then returns the SCALE-encoded result.
+ - The node receives the result from the runtime and then decodes it. **It is the place where RPC could break!**
+
+Point #3 describes a process implemented inside the [`pass_method`](https://github.com/UniqueNetwork/unique-chain/blob/1c7179877b5fb1eacf86c5ecf607317d11999675/client/rpc/src/lib.rs#L435-L472) macro.
+
+Using the `pass_method` macro the node maps each RPC method onto the corresponding runtime API method.
+
+See how [the node's RPC is implemented](https://github.com/UniqueNetwork/unique-chain/blob/1c7179877b5fb1eacf86c5ecf607317d11999675/client/rpc/src/lib.rs#L493-L569) and how [the runtime API is declared](https://github.com/UniqueNetwork/unique-chain/blob/1c7179877b5fb1eacf86c5ecf607317d11999675/primitives/rpc/src/lib.rs#L32-L129).
+
+### How can the node use the old runtime API?
+
+As you can see from the previous section -- RPC breaks if the runtime API data format is incompatible with the node's RPC data format.
+
+When the node is working with an old runtime and exposes the new version of RPC that contains some methods with a changed signature, the node should call only the old versions of these methods to avoid RPC failure.
+
+The node should do the following to get an old runtime API method to run correctly:
+* The node should convert all the RPC arguments into the old runtime API format.
+* It should convert the result from the runtime to the new data format (it is the only action needed in the case of `collection_by_id`).
+
+The `pass_method` macro can call the old runtime API methods.
+For instance, the correct implementation of the `collection_by_id` RPC method looks like this:
+```rust
+pass_method!(
+ /* line 1 */ collection_by_id(collection: CollectionId) -> Option<RpcCollection<AccountId>>, unique_api;
+ /* line 2 */ changed_in 3, collection_by_id_before_version_3(collection) => |value| value.map(|coll| coll.into())
+);
+```
+
+The first line describes the newest RPC signature.
+
+The second line tells us what should be called in the case if we're dealing with an old runtime API.
+* `collection_by_id_before_version_3` -- the name of the corresponding runtime API method with an old signature.
+* `(collection)` -- what arguments should the node pass to the old method. In the case of `collection_by_id`, we pass the arguments as is since there were no changes to the arguments' types.
+* `=> |value| value.map(|coll| coll.into())` -- describes how to transform the return value from the old runtime API data format into the new RPC data format.
+
+### Runtime API backward compatibility support
+
+Methods like `collection_by_id_before_version_3` doesn't appear automatically.
+
+When changing the runtime API methods' signatures, we need to:
+* Specify the number of the new version of the runtime API.
+* Specify the old versions of the changed methods.
+
+See the documentation of the `decl_runtime_apis` macro: [runtime api trait versioning](https://docs.rs/sp-api/latest/sp_api/macro.decl_runtime_apis.html#runtime-api-trait-versioning).
+
+### How to easily implement the converting from the old structure into the new ones
+
+To describe structures that can have some fields changing over different versions, we use the `#[struct_versioning::versioned]` attribute.
+
+Let's take a look at the `RpcCollection` declaration.
+
+```rust
+/// Collection parameters, used in RPC calls (see [`Collection`] for the storage version).
+#[struct_versioning::versioned(version = 2, upper)]
+#[derive(Encode, Decode, Clone, PartialEq, TypeInfo)]
+#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
+pub struct RpcCollection<AccountId> {
+ /// Collection owner account.
+ pub owner: AccountId,
+
+ /// Collection mode.
+ pub mode: CollectionMode,
+
+ /// Collection name.
+ pub name: Vec<u16>,
+
+ /// Collection description.
+ pub description: Vec<u16>,
+
+ /// Token prefix.
+ pub token_prefix: Vec<u8>,
+
+ /// The state of sponsorship of the collection.
+ pub sponsorship: SponsorshipState<AccountId>,
+
+ /// Collection limits.
+ pub limits: CollectionLimits,
+
+ /// Collection permissions.
+ pub permissions: CollectionPermissions,
+
+ /// Token property permissions.
+ pub token_property_permissions: Vec<PropertyKeyPermission>,
+
+ /// Collection properties.
+ pub properties: Vec<Property>,
+
+ /// Is collection read only.
+ pub read_only: bool,
+
+ /// Extra collection flags
+ #[version(2.., upper(RpcCollectionFlags {foreign: false, erc721metadata: false}))]
+ pub flags: RpcCollectionFlags,
+}
+```
+
+The `#[struct_versioning::versioned]` will create 2 types for us: the `RpcCollectionVersion1` (the old version) and the `RpcCollection` (the new version).
+
+This attribute automatically implements the `impl From<RpcCollectionVersion1> for RpcCollection`.
+
+The attribute understands how to map the old fields to new ones with the help of the `#[version(...)]` field attribute, which should be placed right before the field in question.
+
+There were no field `flags` in the `RpcCollectionVersion1` structure. The `#[version(2.., upper(<expr>))]` tells the attribute to assign the `flags` field to `<expr>` in the new version of the `RpcCollection` structure.
+
+Given that we have the `From` trait implemented for the new version of the `RpcCollection`, we can use `.into()` to convert the old version to the new one as we did in the `pass_method` macro above.
+
+Here is the description of the `struct_versioning` attribute:
+```
+Generate versioned variants of a struct
+
+ `#[versioned(version = 1[, first_version = 1][, upper][, versions])]`
+ - *version* - current version of a struct
+ - *first_version* - allows to skip generation of structs, which predates first supported version
+ - *upper* - generate From impls, which converts old version of structs to new
+ - *versions* - generate enum, which contains all possible versions of struct
+
+ Each field may have version attribute
+ `#[version([1]..[2][, upper(old)])]`
+ - *1* - version, on which this field is appeared
+ - *2* - version, in which this field was removed
+ (i.e if set to 2, this field was exist on version 1, and no longer exist on version 2)
+ - *upper* - code, which should be executed to transform old value to new/create new value
+```
js-packages/scripts/generateEnv.tsdiffbeforeafterboth--- a/js-packages/scripts/generateEnv.ts
+++ b/js-packages/scripts/generateEnv.ts
@@ -41,19 +41,21 @@
let env = (await readFile(join(dirname, '../../.env'))).toString();
await Promise.all([
// Version from polkadot-fellows
- ff('wss://rpc.polkadot.io/', /^(.)(...)(...)$/, 'v$1.$2.$3').then(v => env = setVar(env, 'POLKADOT_MAINNET_BRANCH', v)),
+ //ff('wss://rpc.polkadot.io/', /^(.)(...)(...)$/, 'v$1.$2.$3').then(v => env = setVar(env, 'POLKADOT_MAINNET_BRANCH', v)),
+ ff('wss://rococo-rpc.polkadot.io/', /^(.)(...)(...)$/, 'v$1.$2.$3').then(v => env = setVar(env, 'POLKADOT_MAINNET_BRANCH', v)),
// ff('wss://statemint-rpc.polkadot.io/', /^(....)$/, 'release-parachains-v$1').then(v => env = setVar(env, 'STATEMINT_BUILD_BRANCH', v)),
ff('wss://acala-rpc-0.aca-api.network/', /^(.)(..)(.)$/, '$1.$2.$3').then(v => env = setVar(env, 'ACALA_BUILD_BRANCH', v)),
ff('wss://wss.api.moonbeam.network/', /^(....)$/, 'runtime-$1').then(v => env = setVar(env, 'MOONBEAM_BUILD_BRANCH', v)),
ff('wss://ws.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'UNIQUE_MAINNET_BRANCH', fixupUnique(v))),
- ff('wss://kusama-rpc.polkadot.io/', /^(.)(...)(...)$/, 'v$1.$2.$3').then(v => env = setVar(env, 'KUSAMA_MAINNET_BRANCH', v)),
+ //ff('wss://kusama-rpc.polkadot.io/', /^(.)(...)(...)$/, 'v$1.$2.$3').then(v => env = setVar(env, 'KUSAMA_MAINNET_BRANCH', v)),
+ ff('wss://rococo-rpc.polkadot.io/', /^(.)(...)(...)$/, 'v$1.$2.$3').then(v => env = setVar(env, 'KUSAMA_MAINNET_BRANCH', v)),
// ff('wss://statemine-rpc.polkadot.io/', /^(....)$/, 'release-parachains-v$1').then(v => env = setVar(env, 'STATEMINE_BUILD_BRANCH', v)),
ff('wss://karura-rpc-0.aca-api.network/', /^(.)(..)(.)$/, 'release-karura-$1.$2.$3').then(v => env = setVar(env, 'KARURA_BUILD_BRANCH', v)),
ff('wss://wss.api.moonriver.moonbeam.network/', /^(....)$/, 'runtime-$1').then(v => env = setVar(env, 'MOONRIVER_BUILD_BRANCH', v)),
ff('wss://ws-quartz.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'QUARTZ_MAINNET_BRANCH', fixupUnique(v))),
- ff('wss://ws-westend.unique.network/', /^(.)(..)(.)$/, 'release-v0.$1.$2').then(v => env = setVar(env, 'UNIQUEWEST_MAINNET_BRANCH', v)),
+ ff('wss://eu-ws-westend.unique.network/', /^(.)(..)(.)$/, 'release-v$1.$2.$3').then(v => env = setVar(env, 'UNIQUEWEST_MAINNET_BRANCH', v)),
ff('wss://westmint-rpc.polkadot.io/', /^(.......)$/, 'bad-branch-v$1').then(v => env = setVar(env, 'WESTMINT_BUILD_BRANCH', v)),
ff('wss://ws-opal.unique.network/', /^(........)$/, 'release-v$1').then(v => env = setVar(env, 'OPAL_MAINNET_BRANCH', fixupUnique(v))),
js-packages/scripts/wait_for_first_block.shdiffbeforeafterboth--- a/js-packages/scripts/wait_for_first_block.sh
+++ b/js-packages/scripts/wait_for_first_block.sh
@@ -6,38 +6,52 @@
last_block_id=0
block_id=0
+counter=0
function get_block {
- block_id_hex=$(do_rpc chain_getHeader | jq -r .result.number)
- block_id=$((block_id_hex))
- echo Id = $block_id
+ block_id_hex=$(do_rpc chain_getHeader | jq -r .result.number)
+ block_id=$((block_id_hex))
+ echo Id = $block_id
}
function had_new_block {
- last_block_id=$block_id
- get_block
- if (( last_block_id != 0 && block_id > last_block_id )); then
- return 0
- fi
- return 1
+ last_block_id=$block_id
+ get_block
+ if (( last_block_id != 0 && block_id > last_block_id )); then
+ return 0
+ fi
+ return 1
}
function reset_check {
- last_block_id=0
- block_id=0
+ last_block_id=0
+ block_id=0
+ counter=0
}
-while ! had_new_block; do
- echo "Waiting for next block..."
- sleep 12
+while ! had_new_block ; do
+ echo "Waiting for another block..."
+ counter=$((counter+1))
+ echo "counter="$counter
+ sleep 12
+ if [ $counter -gt 400 ]; then
+ exit 1;
+ fi
done
+
reset_check
echo "Chain is running, but lets wait for another block after a minute, to avoid startup flakiness."
sleep 60
-while ! had_new_block; do
- echo "Waiting for another block..."
- sleep 12
+while ! had_new_block ; do
+ echo "Waiting for another block..."
+ counter=$((counter+1))
+ echo "counter="$counter
+ sleep 12
+ if [ $counter -gt 400 ]; then
+ exit 1;
+ fi
done
+
echo "Chain is running!"
kb/how-not-to-break-rpc.mddiffbeforeafterboth--- a/kb/how-not-to-break-rpc.md
+++ /dev/null
@@ -1,169 +0,0 @@
-# How not to break RPC
-
-Let's discuss how to avoid the breaking of RPC with an example of how the `colection_by_id` RPC method was broken.
-
-The `collection_by_id` was broken due to the change of the result type `RpcCollection`.
-The new version of the `RpcCollection` was incompatible with the old one due to addition of the `flags` field:
-
-```rust
-// The new version of the `RpcCollection`
-pub struct RpcCollection<AccountId> {
- /// Collection owner account.
- pub owner: AccountId,
- /// Collection mode.
- pub mode: CollectionMode,
- /// Collection name.
- pub name: Vec<u16>,
- /// Collection description.
- pub description: Vec<u16>,
- /// Token prefix.
- pub token_prefix: Vec<u8>,
- /// The state of sponsorship of the collection.
- pub sponsorship: SponsorshipState<AccountId>,
- /// Collection limits.
- pub limits: CollectionLimits,
- /// Collection permissions.
- pub permissions: CollectionPermissions,
- /// Token property permissions.
- pub token_property_permissions: Vec<PropertyKeyPermission>,
- /// Collection properties.
- pub properties: Vec<Property>,
- /// Is collection read only.
- pub read_only: bool,
-
- /// Extra collection flags
- pub flags: RpcCollectionFlags, // <-- THIS IS A NEW FIELD!
-}
-```
-
-### Where exactly was RPC broken?
-
-To answer this question, we need to describe the process of handling an RPC call.
-
-1. A user calls an RPC method.
-2. The node sees what method with what arguments should be executed.
-3. Since the code of each RPC method is located inside the runtime, the node does the following:
- - The node encodes the RPC arguments into the [SCALE format](https://docs.substrate.io/reference/scale-codec/), and then it will call the corresponding method of the runtime API with the encoded arguments.
- - The runtime executes the RPC logic and then returns the SCALE-encoded result.
- - The node receives the result from the runtime and then decodes it. **It is the place where RPC could break!**
-
-Point #3 describes a process implemented inside the [`pass_method`](https://github.com/UniqueNetwork/unique-chain/blob/1c7179877b5fb1eacf86c5ecf607317d11999675/client/rpc/src/lib.rs#L435-L472) macro.
-
-Using the `pass_method` macro the node maps each RPC method onto the corresponding runtime API method.
-
-See how [the node's RPC is implemented](https://github.com/UniqueNetwork/unique-chain/blob/1c7179877b5fb1eacf86c5ecf607317d11999675/client/rpc/src/lib.rs#L493-L569) and how [the runtime API is declared](https://github.com/UniqueNetwork/unique-chain/blob/1c7179877b5fb1eacf86c5ecf607317d11999675/primitives/rpc/src/lib.rs#L32-L129).
-
-### How can the node use the old runtime API?
-
-As you can see from the previous section -- RPC breaks if the runtime API data format is incompatible with the node's RPC data format.
-
-When the node is working with an old runtime and exposes the new version of RPC that contains some methods with a changed signature, the node should call only the old versions of these methods to avoid RPC failure.
-
-The node should do the following to get an old runtime API method to run correctly:
-* The node should convert all the RPC arguments into the old runtime API format.
-* It should convert the result from the runtime to the new data format (it is the only action needed in the case of `collection_by_id`).
-
-The `pass_method` macro can call the old runtime API methods.
-For instance, the correct implementation of the `collection_by_id` RPC method looks like this:
-```rust
-pass_method!(
- /* line 1 */ collection_by_id(collection: CollectionId) -> Option<RpcCollection<AccountId>>, unique_api;
- /* line 2 */ changed_in 3, collection_by_id_before_version_3(collection) => |value| value.map(|coll| coll.into())
-);
-```
-
-The first line describes the newest RPC signature.
-
-The second line tells us what should be called in the case if we're dealing with an old runtime API.
-* `collection_by_id_before_version_3` -- the name of the corresponding runtime API method with an old signature.
-* `(collection)` -- what arguments should the node pass to the old method. In the case of `collection_by_id`, we pass the arguments as is since there were no changes to the arguments' types.
-* `=> |value| value.map(|coll| coll.into())` -- describes how to transform the return value from the old runtime API data format into the new RPC data format.
-
-### Runtime API backward compatibility support
-
-Methods like `collection_by_id_before_version_3` doesn't appear automatically.
-
-When changing the runtime API methods' signatures, we need to:
-* Specify the number of the new version of the runtime API.
-* Specify the old versions of the changed methods.
-
-See the documentation of the `decl_runtime_apis` macro: [runtime api trait versioning](https://docs.rs/sp-api/latest/sp_api/macro.decl_runtime_apis.html#runtime-api-trait-versioning).
-
-### How to easily implement the converting from the old structure into the new ones
-
-To describe structures that can have some fields changing over different versions, we use the `#[struct_versioning::versioned]` attribute.
-
-Let's take a look at the `RpcCollection` declaration.
-
-```rust
-/// Collection parameters, used in RPC calls (see [`Collection`] for the storage version).
-#[struct_versioning::versioned(version = 2, upper)]
-#[derive(Encode, Decode, Clone, PartialEq, TypeInfo)]
-#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
-pub struct RpcCollection<AccountId> {
- /// Collection owner account.
- pub owner: AccountId,
-
- /// Collection mode.
- pub mode: CollectionMode,
-
- /// Collection name.
- pub name: Vec<u16>,
-
- /// Collection description.
- pub description: Vec<u16>,
-
- /// Token prefix.
- pub token_prefix: Vec<u8>,
-
- /// The state of sponsorship of the collection.
- pub sponsorship: SponsorshipState<AccountId>,
-
- /// Collection limits.
- pub limits: CollectionLimits,
-
- /// Collection permissions.
- pub permissions: CollectionPermissions,
-
- /// Token property permissions.
- pub token_property_permissions: Vec<PropertyKeyPermission>,
-
- /// Collection properties.
- pub properties: Vec<Property>,
-
- /// Is collection read only.
- pub read_only: bool,
-
- /// Extra collection flags
- #[version(2.., upper(RpcCollectionFlags {foreign: false, erc721metadata: false}))]
- pub flags: RpcCollectionFlags,
-}
-```
-
-The `#[struct_versioning::versioned]` will create 2 types for us: the `RpcCollectionVersion1` (the old version) and the `RpcCollection` (the new version).
-
-This attribute automatically implements the `impl From<RpcCollectionVersion1> for RpcCollection`.
-
-The attribute understands how to map the old fields to new ones with the help of the `#[version(...)]` field attribute, which should be placed right before the field in question.
-
-There were no field `flags` in the `RpcCollectionVersion1` structure. The `#[version(2.., upper(<expr>))]` tells the attribute to assign the `flags` field to `<expr>` in the new version of the `RpcCollection` structure.
-
-Given that we have the `From` trait implemented for the new version of the `RpcCollection`, we can use `.into()` to convert the old version to the new one as we did in the `pass_method` macro above.
-
-Here is the description of the `struct_versioning` attribute:
-```
-Generate versioned variants of a struct
-
- `#[versioned(version = 1[, first_version = 1][, upper][, versions])]`
- - *version* - current version of a struct
- - *first_version* - allows to skip generation of structs, which predates first supported version
- - *upper* - generate From impls, which converts old version of structs to new
- - *versions* - generate enum, which contains all possible versions of struct
-
- Each field may have version attribute
- `#[version([1]..[2][, upper(old)])]`
- - *1* - version, on which this field is appeared
- - *2* - version, in which this field was removed
- (i.e if set to 2, this field was exist on version 1, and no longer exist on version 2)
- - *upper* - code, which should be executed to transform old value to new/create new value
-```
rust-toolchain.tomldiffbeforeafterboth--- /dev/null
+++ b/rust-toolchain.toml
@@ -0,0 +1,4 @@
+[toolchain]
+channel = "nightly-2024-04-10"
+components = ["clippy", "rust-analyzer", "rust-src", "rustfmt"]
+targets = ["wasm32-unknown-unknown"]