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
--- a/.docker/Dockerfile-parachain-upgrade-data.j2
+++ b/.docker/Dockerfile-parachain-upgrade-data.j2
@@ -35,7 +35,7 @@
 COPY . /unique_parachain
 WORKDIR /unique_parachain
 
-RUN cargo build --features={{ NETWORK }}-runtime --$PROFILE
+RUN cargo build --features={{ NETWORK }}-runtime{{ EXTRA_FEATURES }} --$PROFILE
 
 # ===== RUN ======
 FROM ubuntu:22.04
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
before · runtime/quartz/src/lib.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.1819#![cfg_attr(not(feature = "std"), no_std)]20// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.21#![recursion_limit = "1024"]22#![allow(clippy::from_over_into, clippy::identity_op)]23#![allow(clippy::fn_to_numeric_cast_with_truncation)]24// Make the WASM binary available.25#[cfg(feature = "std")]26include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));2728extern crate alloc;2930use frame_support::parameter_types;3132use sp_version::RuntimeVersion;33use sp_runtime::create_runtime_str;3435use up_common::types::*;3637use ::xcm::latest::NetworkId;3839#[path = "../../common/mod.rs"]40mod runtime_common;4142pub mod xcm_barrier;4344pub use runtime_common::*;4546#[cfg(feature = "become-sapphire")]47pub const RUNTIME_NAME: &str = "sapphire";48#[cfg(not(feature = "become-sapphire"))]49pub const RUNTIME_NAME: &str = "quartz";50pub const TOKEN_SYMBOL: &str = "QTZ";51pub const DECIMALS: u8 = 18;5253/// This runtime version.54pub const VERSION: RuntimeVersion = RuntimeVersion {55	spec_name: create_runtime_str!(RUNTIME_NAME),56	impl_name: create_runtime_str!(RUNTIME_NAME),57	authoring_version: 1,58	spec_version: 942057,59	impl_version: 0,60	apis: RUNTIME_API_VERSIONS,61	transaction_version: 3,62	state_version: 1,63};6465parameter_types! {66	pub const Version: RuntimeVersion = VERSION;67	pub const RelayNetwork: NetworkId = NetworkId::Kusama;68}69#[cfg(feature = "become-sapphire")]70parameter_types! {71	pub const SS58Prefix: u16 = 8883;72	pub const ChainId: u64 = 8883;73}7475#[cfg(not(feature = "become-sapphire"))]76parameter_types! {77	pub const SS58Prefix: u8 = 255;78	pub const ChainId: u64 = 8881;79}8081construct_runtime!();8283impl_common_runtime_apis!();8485cumulus_pallet_parachain_system::register_validate_block!(86	Runtime = Runtime,87	BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,88	CheckInherents = CheckInherents,89);
after · runtime/quartz/src/lib.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.1819#![cfg_attr(not(feature = "std"), no_std)]20// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.21#![recursion_limit = "1024"]22#![allow(clippy::from_over_into, clippy::identity_op)]23#![allow(clippy::fn_to_numeric_cast_with_truncation)]24// Make the WASM binary available.25#[cfg(feature = "std")]26include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));2728extern crate alloc;2930use frame_support::parameter_types;3132use sp_version::RuntimeVersion;33use sp_runtime::create_runtime_str;3435use up_common::types::*;3637use ::xcm::latest::NetworkId;3839#[path = "../../common/mod.rs"]40mod runtime_common;4142pub mod xcm_barrier;4344pub use runtime_common::*;4546#[cfg(feature = "become-sapphire")]47pub const RUNTIME_NAME: &str = "sapphire";48#[cfg(not(feature = "become-sapphire"))]49pub const RUNTIME_NAME: &str = "quartz";50pub const TOKEN_SYMBOL: &str = "QTZ";51pub const DECIMALS: u8 = 18;5253/// This runtime version.54pub const VERSION: RuntimeVersion = RuntimeVersion {55	spec_name: create_runtime_str!(RUNTIME_NAME),56	impl_name: create_runtime_str!(RUNTIME_NAME),57	authoring_version: 1,58	spec_version: 942057,59	impl_version: 0,60	apis: RUNTIME_API_VERSIONS,61	transaction_version: 3,62	#[cfg(feature="state-version-0")]63	state_version: 0,64	#[cfg(not(feature="state-version-0"))]65	state_version: 1,66};6768parameter_types! {69	pub const Version: RuntimeVersion = VERSION;70	pub const RelayNetwork: NetworkId = NetworkId::Kusama;71}72#[cfg(feature = "become-sapphire")]73parameter_types! {74	pub const SS58Prefix: u16 = 8883;75	pub const ChainId: u64 = 8883;76}7778#[cfg(not(feature = "become-sapphire"))]79parameter_types! {80	pub const SS58Prefix: u8 = 255;81	pub const ChainId: u64 = 8881;82}8384construct_runtime!();8586impl_common_runtime_apis!();8788cumulus_pallet_parachain_system::register_validate_block!(89	Runtime = Runtime,90	BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor::<Runtime, Executive>,91	CheckInherents = CheckInherents,92);
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,
 };