git.delta.rocks / unique-network / refs/commits / c72090e3f649

difftreelog

ci use state-version: 0 on forkless-with-data workflow

Yaroslav Bolyukin2023-06-05parent: #98307af.patch.diff
in: master

9 files changed

modified.docker/Dockerfile-parachain-upgrade-data.j2diffbeforeafterboth
before · .docker/Dockerfile-parachain-upgrade-data.j2
1FROM uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} as polkadot23# ===== Rust builder =====4FROM uniquenetwork/services:latest as rust-builder56ENV CARGO_HOME="/cargo-home"7ENV PATH="/cargo-home/bin:$PATH"8ENV TZ=UTC910RUN rustup toolchain uninstall $(rustup toolchain list) && \11    rustup toolchain install {{ RUST_TOOLCHAIN }} && \12    rustup default {{ RUST_TOOLCHAIN }} && \13    rustup target list --installed && \14    rustup show15RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }}1617RUN mkdir /unique_parachain18WORKDIR /unique_parachain1920# ===== BUILD current version ======21FROM rust-builder as builder-unique-current2223ARG PROFILE=release2425WORKDIR /unique_parachain2627RUN git clone https://github.com/UniqueNetwork/unique-chain.git -b {{ MAINNET_BRANCH }} . && \28    cargo build --features={{ NETWORK }}-runtime --$PROFILE2930# ===== BUILD target version ======31FROM rust-builder as builder-unique-target3233ARG PROFILE=release3435COPY . /unique_parachain36WORKDIR /unique_parachain3738RUN cargo build --features={{ NETWORK }}-runtime --$PROFILE3940# ===== RUN ======41FROM ubuntu:22.044243ENV REPLICA_FROM={{ REPLICA_FROM }}4445RUN apt-get -y update && \46    apt-get -y install curl git && \47    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \48    export NVM_DIR="$HOME/.nvm" && \49    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \50    nvm install v16.16.0 && \51    nvm use v16.16.05253RUN git clone https://github.com/uniquenetwork/polkadot-launch.git -b {{ POLKADOT_LAUNCH_BRANCH }}5455RUN export NVM_DIR="$HOME/.nvm" && \56    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \57    cd /polkadot-launch && \58    npm install --global yarn && \59    yarn install6061COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/62COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/63COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/{{ WASM_NAME }}-runtime/{{ WASM_NAME }}_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/{{ WASM_NAME }}-runtime/{{ WASM_NAME }}_runtime.compact.compressed.wasm6465COPY --from=builder-unique-target /unique_parachain/.docker/forkless-config/launch-config-forkless-data.json /polkadot-launch/launch-config.json66COPY --from=builder-unique-target /unique_parachain/.docker/forkless-config/fork.jsonnet /polkadot-launch/fork.jsonnet67COPY --from=builder-unique-target /unique_parachain/.docker/forkless-config/typeNames.jsonnet /polkadot-launch/typeNames.jsonnet6869COPY --from=uniquenetwork/builder-chainql:{{ CHAINQL }} /chainql/target/release/chainql /chainql/target/release/7071COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/72COPY --from=polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm7374CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" REPLICA_FROM && \75    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \76    cd /polkadot-launch && \77    yarn start launch-config.json --test-upgrade-parachains
after · .docker/Dockerfile-parachain-upgrade-data.j2
1FROM uniquenetwork/builder-polkadot:{{ POLKADOT_BUILD_BRANCH }} as polkadot23# ===== Rust builder =====4FROM uniquenetwork/services:latest as rust-builder56ENV CARGO_HOME="/cargo-home"7ENV PATH="/cargo-home/bin:$PATH"8ENV TZ=UTC910RUN rustup toolchain uninstall $(rustup toolchain list) && \11    rustup toolchain install {{ RUST_TOOLCHAIN }} && \12    rustup default {{ RUST_TOOLCHAIN }} && \13    rustup target list --installed && \14    rustup show15RUN rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }}1617RUN mkdir /unique_parachain18WORKDIR /unique_parachain1920# ===== BUILD current version ======21FROM rust-builder as builder-unique-current2223ARG PROFILE=release2425WORKDIR /unique_parachain2627RUN git clone https://github.com/UniqueNetwork/unique-chain.git -b {{ MAINNET_BRANCH }} . && \28    cargo build --features={{ NETWORK }}-runtime --$PROFILE2930# ===== BUILD target version ======31FROM rust-builder as builder-unique-target3233ARG PROFILE=release3435COPY . /unique_parachain36WORKDIR /unique_parachain3738RUN cargo build --features={{ NETWORK }}-runtime{{ EXTRA_FEATURES }} --$PROFILE3940# ===== RUN ======41FROM ubuntu:22.044243ENV REPLICA_FROM={{ REPLICA_FROM }}4445RUN apt-get -y update && \46    apt-get -y install curl git && \47    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash && \48    export NVM_DIR="$HOME/.nvm" && \49    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \50    nvm install v16.16.0 && \51    nvm use v16.16.05253RUN git clone https://github.com/uniquenetwork/polkadot-launch.git -b {{ POLKADOT_LAUNCH_BRANCH }}5455RUN export NVM_DIR="$HOME/.nvm" && \56    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \57    cd /polkadot-launch && \58    npm install --global yarn && \59    yarn install6061COPY --from=builder-unique-current /unique_parachain/target/release/unique-collator /unique-chain/current/release/62COPY --from=builder-unique-target /unique_parachain/target/release/unique-collator /unique-chain/target/release/63COPY --from=builder-unique-target /unique_parachain/target/release/wbuild/{{ WASM_NAME }}-runtime/{{ WASM_NAME }}_runtime.compact.compressed.wasm /unique-chain/target/release/wbuild/{{ WASM_NAME }}-runtime/{{ WASM_NAME }}_runtime.compact.compressed.wasm6465COPY --from=builder-unique-target /unique_parachain/.docker/forkless-config/launch-config-forkless-data.json /polkadot-launch/launch-config.json66COPY --from=builder-unique-target /unique_parachain/.docker/forkless-config/fork.jsonnet /polkadot-launch/fork.jsonnet67COPY --from=builder-unique-target /unique_parachain/.docker/forkless-config/typeNames.jsonnet /polkadot-launch/typeNames.jsonnet6869COPY --from=uniquenetwork/builder-chainql:{{ CHAINQL }} /chainql/target/release/chainql /chainql/target/release/7071COPY --from=polkadot /unique_parachain/polkadot/target/release/polkadot /polkadot/target/release/72COPY --from=polkadot /unique_parachain/polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm /polkadot/target/release/wbuild/westend-runtime/westend_runtime.compact.compressed.wasm7374CMD export NVM_DIR="$HOME/.nvm" PATH="$PATH:/chainql/target/release" REPLICA_FROM && \75    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \76    cd /polkadot-launch && \77    yarn start launch-config.json --test-upgrade-parachains
modified.github/workflows/forkless-update-data.ymldiffbeforeafterboth
--- a/.github/workflows/forkless-update-data.yml
+++ b/.github/workflows/forkless-update-data.yml
@@ -34,11 +34,12 @@
         uses: CertainLach/create-matrix-action@v4
         id: create_matrix
         with:
+          # TODO: Remove state-version-0 after mainnet upgrade
           matrix: |
-            network {quartz}, wasm_name {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}
-            network {unique}, wasm_name {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}
-            network {opal}, wasm_name {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}
-            network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}}
+            network {quartz}, wasm_name {quartz}, mainnet_branch {${{ env.QUARTZ_MAINNET_BRANCH }}}, replica_from_address {${{ env.QUARTZ_REPLICA_FROM }}}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, extra_features {,state-version-0}
+            network {unique}, wasm_name {unique}, mainnet_branch {${{ env.UNIQUE_MAINNET_BRANCH }}}, replica_from_address {${{ env.UNIQUE_REPLICA_FROM }}}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, extra_features {,state-version-0}
+            network {opal}, wasm_name {opal}, mainnet_branch {${{ env.OPAL_MAINNET_BRANCH }}}, replica_from_address {${{ env.OPAL_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, extra_features {,state-version-0}
+            network {sapphire}, wasm_name {quartz}, mainnet_branch {${{ env.SAPPHIRE_MAINNET_BRANCH }}}, replica_from_address {${{ env.SAPPHIRE_REPLICA_FROM }}}, relay_branch {${{ env.UNIQUEEAST_MAINNET_BRANCH }}} extra_features {,state-version-0}
 
   forkless-data-build:
     needs: prepare-execution-marix
@@ -84,6 +85,7 @@
             POLKADOT_LAUNCH_BRANCH=${{ env.POLKADOT_LAUNCH_BRANCH }}
             REPLICA_FROM=${{ matrix.replica_from_address }}
             CHAINQL=${{ env.CHAINQL }}
+            EXTRA_FEATURES=${{ env.extra_features }}
 
       - name: Show build configuration
         run: cat .docker/Dockerfile-parachain-upgrade-data.${{ matrix.network }}.yml
modifiednode/cli/Cargo.tomldiffbeforeafterboth
--- a/node/cli/Cargo.toml
+++ b/node/cli/Cargo.toml
@@ -105,3 +105,4 @@
 runtime-benchmarks = ['opal-runtime/runtime-benchmarks', 'polkadot-cli/runtime-benchmarks', 'polkadot-service/runtime-benchmarks', 'quartz-runtime?/runtime-benchmarks', 'sc-service/runtime-benchmarks', 'unique-runtime?/runtime-benchmarks']
 sapphire-runtime = ['quartz-runtime', 'quartz-runtime/become-sapphire']
 try-runtime = ['opal-runtime?/try-runtime', 'quartz-runtime?/try-runtime', 'try-runtime-cli/try-runtime', 'unique-runtime?/try-runtime']
+state-version-0 = ['opal-runtime?/state-version-0', 'quartz-runtime?/state-version-0', 'unique-runtime?/state-version-0']
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -17,6 +17,7 @@
 
 [features]
 default = ['opal-runtime', 'std']
+state-version-0 = []
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
 opal-runtime = ['app-promotion', 'collator-selection', 'foreign-assets', 'pallet-test-utils', 'preimage', 'refungible']
 pov-estimate = []
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -56,6 +56,9 @@
 	impl_version: 0,
 	apis: RUNTIME_API_VERSIONS,
 	transaction_version: 3,
+	#[cfg(feature="state-version-0")]
+	state_version: 0,
+	#[cfg(not(feature="state-version-0"))]
 	state_version: 1,
 };
 
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -18,6 +18,7 @@
 [features]
 become-sapphire = []
 default = ['quartz-runtime', 'std']
+state-version-0 = []
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
 pov-estimate = []
 quartz-runtime = ['app-promotion', 'collator-selection', 'foreign-assets', 'preimage', 'refungible']
modifiedruntime/quartz/src/lib.rsdiffbeforeafterboth
--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -59,6 +59,9 @@
 	impl_version: 0,
 	apis: RUNTIME_API_VERSIONS,
 	transaction_version: 3,
+	#[cfg(feature="state-version-0")]
+	state_version: 0,
+	#[cfg(not(feature="state-version-0"))]
 	state_version: 1,
 };
 
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -17,6 +17,7 @@
 
 [features]
 default = ['std', 'unique-runtime']
+state-version-0 = []
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
 pov-estimate = []
 runtime-benchmarks = [
modifiedruntime/unique/src/lib.rsdiffbeforeafterboth
--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -56,6 +56,9 @@
 	impl_version: 0,
 	apis: RUNTIME_API_VERSIONS,
 	transaction_version: 3,
+	#[cfg(feature="state-version-0")]
+	state_version: 0,
+	#[cfg(not(feature="state-version-0"))]
 	state_version: 1,
 };