From 71b0e94d11739bde59e2001671e206716893818c Mon Sep 17 00:00:00 2001 From: Albrecht Date: Wed, 2 Mar 2022 10:02:02 +0100 Subject: [PATCH 1/3] Version 1.5.0 (#333) * Version 1.5.0 * Runtime Version 10500 --- Cargo.lock | 32 ++++++++++++++-------------- nodes/parachain/Cargo.toml | 2 +- nodes/standalone/Cargo.toml | 2 +- pallets/attestation/Cargo.toml | 2 +- pallets/ctype/Cargo.toml | 2 +- pallets/delegation/Cargo.toml | 2 +- pallets/did/Cargo.toml | 2 +- pallets/kilt-launch/Cargo.toml | 2 +- pallets/pallet-did-lookup/Cargo.toml | 2 +- pallets/pallet-inflation/Cargo.toml | 2 +- pallets/pallet-web3-names/Cargo.toml | 2 +- pallets/parachain-staking/Cargo.toml | 2 +- runtimes/common/Cargo.toml | 2 +- runtimes/peregrine/Cargo.toml | 2 +- runtimes/peregrine/src/lib.rs | 2 +- runtimes/spiritnet/Cargo.toml | 2 +- runtimes/spiritnet/src/lib.rs | 2 +- runtimes/standalone/Cargo.toml | 2 +- runtimes/standalone/src/lib.rs | 2 +- support/Cargo.toml | 2 +- 20 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 90c1aab48..5609faeca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -359,7 +359,7 @@ checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" [[package]] name = "attestation" -version = "1.4.1" +version = "1.5.0" dependencies = [ "ctype", "delegation", @@ -1366,7 +1366,7 @@ dependencies = [ [[package]] name = "ctype" -version = "1.4.1" +version = "1.5.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -1840,7 +1840,7 @@ dependencies = [ [[package]] name = "delegation" -version = "1.4.1" +version = "1.5.0" dependencies = [ "bitflags", "ctype", @@ -1889,7 +1889,7 @@ dependencies = [ [[package]] name = "did" -version = "1.4.1" +version = "1.5.0" dependencies = [ "ctype", "env_logger 0.8.4", @@ -3504,7 +3504,7 @@ dependencies = [ [[package]] name = "kilt-launch" -version = "1.4.1" +version = "1.5.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -3524,7 +3524,7 @@ dependencies = [ [[package]] name = "kilt-parachain" -version = "1.4.1" +version = "1.5.0" dependencies = [ "clap", "cumulus-client-cli", @@ -3599,7 +3599,7 @@ dependencies = [ [[package]] name = "kilt-support" -version = "1.4.1" +version = "1.5.0" dependencies = [ "frame-support", "frame-system", @@ -4469,7 +4469,7 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "mashnet-node" -version = "1.4.1" +version = "1.5.0" dependencies = [ "clap", "frame-benchmarking", @@ -4520,7 +4520,7 @@ dependencies = [ [[package]] name = "mashnet-node-runtime" -version = "1.4.1" +version = "1.5.0" dependencies = [ "attestation", "bitflags", @@ -5622,7 +5622,7 @@ dependencies = [ [[package]] name = "pallet-did-lookup" -version = "1.4.1" +version = "1.5.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -5772,7 +5772,7 @@ dependencies = [ [[package]] name = "pallet-inflation" -version = "1.4.1" +version = "1.5.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -6303,7 +6303,7 @@ dependencies = [ [[package]] name = "pallet-web3-names" -version = "1.4.0" +version = "1.5.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -6369,7 +6369,7 @@ dependencies = [ [[package]] name = "parachain-staking" -version = "1.4.1" +version = "1.5.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -6641,7 +6641,7 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "peregrine-runtime" -version = "1.4.1" +version = "1.5.0" dependencies = [ "attestation", "ctype", @@ -8554,7 +8554,7 @@ dependencies = [ [[package]] name = "runtime-common" -version = "0.1.0" +version = "1.5.0" dependencies = [ "frame-support", "frame-system", @@ -10814,7 +10814,7 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spiritnet-runtime" -version = "1.4.1" +version = "1.5.0" dependencies = [ "attestation", "ctype", diff --git a/nodes/parachain/Cargo.toml b/nodes/parachain/Cargo.toml index 65794270c..b278ec8bb 100644 --- a/nodes/parachain/Cargo.toml +++ b/nodes/parachain/Cargo.toml @@ -4,7 +4,7 @@ build = "build.rs" description = "KILT parachain" edition = "2021" name = "kilt-parachain" -version = "1.4.1" +version = "1.5.0" [[bin]] name = "kilt-parachain" diff --git a/nodes/standalone/Cargo.toml b/nodes/standalone/Cargo.toml index 9567e2f03..83fc72e4e 100644 --- a/nodes/standalone/Cargo.toml +++ b/nodes/standalone/Cargo.toml @@ -3,7 +3,7 @@ authors = ["KILT "] build = "build.rs" edition = "2021" name = "mashnet-node" -version = "1.4.1" +version = "1.5.0" [[bin]] name = "mashnet-node" diff --git a/pallets/attestation/Cargo.toml b/pallets/attestation/Cargo.toml index fbdcfd948..f282aeb1b 100644 --- a/pallets/attestation/Cargo.toml +++ b/pallets/attestation/Cargo.toml @@ -4,7 +4,7 @@ description = "Enables adding and revoking attestations." edition = "2021" name = "attestation" repository = "https://github.com/KILTprotocol/mashnet-node" -version = "1.4.1" +version = "1.5.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/pallets/ctype/Cargo.toml b/pallets/ctype/Cargo.toml index 0f98672bd..f0d426ad2 100644 --- a/pallets/ctype/Cargo.toml +++ b/pallets/ctype/Cargo.toml @@ -4,7 +4,7 @@ description = "Enables adding CTypes." edition = "2021" name = "ctype" repository = "https://github.com/KILTprotocol/mashnet-node" -version = "1.4.1" +version = "1.5.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/pallets/delegation/Cargo.toml b/pallets/delegation/Cargo.toml index 7228b1eae..538714d8d 100644 --- a/pallets/delegation/Cargo.toml +++ b/pallets/delegation/Cargo.toml @@ -4,7 +4,7 @@ description = "Enables creating and revoking root nodes of delegation hierarchie edition = "2021" name = "delegation" repository = "https://github.com/KILTprotocol/mashnet-node" -version = "1.4.1" +version = "1.5.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/pallets/did/Cargo.toml b/pallets/did/Cargo.toml index 99dbbc607..badd1e2e6 100644 --- a/pallets/did/Cargo.toml +++ b/pallets/did/Cargo.toml @@ -4,7 +4,7 @@ description = "Enables adding and removing decentralized identifiers (DIDs)." edition = "2021" name = "did" repository = "https://github.com/KILTprotocol/mashnet-node" -version = "1.4.1" +version = "1.5.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/pallets/kilt-launch/Cargo.toml b/pallets/kilt-launch/Cargo.toml index 50f7119ae..48e0e7093 100644 --- a/pallets/kilt-launch/Cargo.toml +++ b/pallets/kilt-launch/Cargo.toml @@ -4,7 +4,7 @@ description = "Enables automatic unlocking of balance from genesis block" edition = "2021" name = "kilt-launch" repository = "https://github.com/KILTprotocol/mashnet-node" -version = "1.4.1" +version = "1.5.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/pallets/pallet-did-lookup/Cargo.toml b/pallets/pallet-did-lookup/Cargo.toml index f99cee027..e3185565c 100644 --- a/pallets/pallet-did-lookup/Cargo.toml +++ b/pallets/pallet-did-lookup/Cargo.toml @@ -4,7 +4,7 @@ description = "Lookup the DID for a blockchain account." edition = "2021" name = "pallet-did-lookup" repository = "https://github.com/KILTprotocol/mashnet-node" -version = "1.4.1" +version = "1.5.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/pallets/pallet-inflation/Cargo.toml b/pallets/pallet-inflation/Cargo.toml index 6ab467dad..70904425e 100644 --- a/pallets/pallet-inflation/Cargo.toml +++ b/pallets/pallet-inflation/Cargo.toml @@ -4,7 +4,7 @@ description = "Substrate pallet issueing a pre-configured amount of tokens to th edition = "2021" name = "pallet-inflation" repository = "https://github.com/KILTprotocol/mashnet-node" -version = "1.4.1" +version = "1.5.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/pallets/pallet-web3-names/Cargo.toml b/pallets/pallet-web3-names/Cargo.toml index 7b7f26624..736ee470e 100644 --- a/pallets/pallet-web3-names/Cargo.toml +++ b/pallets/pallet-web3-names/Cargo.toml @@ -4,7 +4,7 @@ description = "Unique Web3 nicknames for KILT DIDs." edition = "2021" name = "pallet-web3-names" repository = "https://github.com/KILTprotocol/mashnet-node" -version = "1.4.0" +version = "1.5.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/pallets/parachain-staking/Cargo.toml b/pallets/parachain-staking/Cargo.toml index 200465020..3763a1ac8 100644 --- a/pallets/parachain-staking/Cargo.toml +++ b/pallets/parachain-staking/Cargo.toml @@ -3,7 +3,7 @@ authors = ["KILT "] description = "Parachain parachain-staking pallet for collator delegation and selection as well as reward distribution" edition = "2021" name = "parachain-staking" -version = "1.4.1" +version = "1.5.0" [dev-dependencies] pallet-aura = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.17", default-features = false} diff --git a/runtimes/common/Cargo.toml b/runtimes/common/Cargo.toml index d00725a37..00616cb90 100644 --- a/runtimes/common/Cargo.toml +++ b/runtimes/common/Cargo.toml @@ -2,7 +2,7 @@ authors = ["KILT "] edition = "2021" name = "runtime-common" -version = "0.1.0" +version = "1.5.0" [dev-dependencies] sp-io = {git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.17"} diff --git a/runtimes/peregrine/Cargo.toml b/runtimes/peregrine/Cargo.toml index 9b9e70f17..36fce1182 100644 --- a/runtimes/peregrine/Cargo.toml +++ b/runtimes/peregrine/Cargo.toml @@ -2,7 +2,7 @@ authors = ["KILT "] edition = "2021" name = "peregrine-runtime" -version = "1.4.1" +version = "1.5.0" [build-dependencies] substrate-wasm-builder = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.17"} diff --git a/runtimes/peregrine/src/lib.rs b/runtimes/peregrine/src/lib.rs index 3e8912f38..fd3e0e989 100644 --- a/runtimes/peregrine/src/lib.rs +++ b/runtimes/peregrine/src/lib.rs @@ -79,7 +79,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("mashnet-node"), impl_name: create_runtime_str!("mashnet-node"), authoring_version: 4, - spec_version: 10410, + spec_version: 10500, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/runtimes/spiritnet/Cargo.toml b/runtimes/spiritnet/Cargo.toml index bf61fb3b6..bcd9c3a12 100644 --- a/runtimes/spiritnet/Cargo.toml +++ b/runtimes/spiritnet/Cargo.toml @@ -2,7 +2,7 @@ authors = ["KILT "] edition = "2021" name = "spiritnet-runtime" -version = "1.4.1" +version = "1.5.0" [build-dependencies] substrate-wasm-builder = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.17"} diff --git a/runtimes/spiritnet/src/lib.rs b/runtimes/spiritnet/src/lib.rs index 6fbf1bf22..803a237c2 100644 --- a/runtimes/spiritnet/src/lib.rs +++ b/runtimes/spiritnet/src/lib.rs @@ -79,7 +79,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("kilt-spiritnet"), impl_name: create_runtime_str!("kilt-spiritnet"), authoring_version: 1, - spec_version: 10410, + spec_version: 10500, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/runtimes/standalone/Cargo.toml b/runtimes/standalone/Cargo.toml index 46903f713..9e3895ce7 100644 --- a/runtimes/standalone/Cargo.toml +++ b/runtimes/standalone/Cargo.toml @@ -2,7 +2,7 @@ authors = ["KILT "] edition = "2021" name = "mashnet-node-runtime" -version = "1.4.1" +version = "1.5.0" [build-dependencies] substrate-wasm-builder = {git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.17"} diff --git a/runtimes/standalone/src/lib.rs b/runtimes/standalone/src/lib.rs index b719ca6af..270a32782 100644 --- a/runtimes/standalone/src/lib.rs +++ b/runtimes/standalone/src/lib.rs @@ -114,7 +114,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("mashnet-node"), impl_name: create_runtime_str!("mashnet-node"), authoring_version: 4, - spec_version: 10410, + spec_version: 10500, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 2, diff --git a/support/Cargo.toml b/support/Cargo.toml index 26a922a27..286fc65e0 100644 --- a/support/Cargo.toml +++ b/support/Cargo.toml @@ -4,7 +4,7 @@ description = "Shared traits and structs used across the KILT pallets" edition = "2021" name = "kilt-support" repository = "https://github.com/KILTprotocol/mashnet-node" -version = "1.4.1" +version = "1.5.0" [dependencies] codec = {default-features = false, features = ["derive"], package = "parity-scale-codec", version = "2.3.1"} From 1139e5517448bb444d2bc771f9c2c1f61983ab16 Mon Sep 17 00:00:00 2001 From: William Freudenberger Date: Wed, 2 Mar 2022 14:35:52 +0100 Subject: [PATCH 2/3] fix: StorageVersion migration for DID, Delegation --- pallets/delegation/src/migrations.rs | 17 +++++++++-------- pallets/did/src/migrations.rs | 17 +++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/pallets/delegation/src/migrations.rs b/pallets/delegation/src/migrations.rs index 94d7c9a69..01fe55e0a 100644 --- a/pallets/delegation/src/migrations.rs +++ b/pallets/delegation/src/migrations.rs @@ -51,7 +51,7 @@ pub mod v3 { use frame_support::{ generate_storage_alias, pallet_prelude::Weight, - traits::{Get, OnRuntimeUpgrade, PalletInfoAccess}, + traits::{Get, OnRuntimeUpgrade, PalletInfoAccess, StorageVersion as NewStorageVersion}, }; use log::info; use sp_std::marker::PhantomData; @@ -66,12 +66,6 @@ pub mod v3 { fn pre_upgrade() -> Result<(), &'static str> { assert!(StorageVersion::get() == Some(DelegationStorageVersion::V2)); - // no migration needed - assert!( - Pallet::::current_storage_version() == 3, - "New StorageVersion should be set via pallet macro already" - ); - info!("👥 Delegation pallet to v3 passes PRE migrate checks ✅",); Ok(()) } @@ -80,8 +74,10 @@ pub mod v3 { // remove deprecated storage versioning entry frame_support::migration::remove_storage_prefix(Pallet::::name().as_bytes(), b"StorageVersion", &[]); + NewStorageVersion::new(3).put::>(); + info!("👥 completed Delegation pallet migration to v3 ✅",); - T::DbWeight::get().reads_writes(0, 1) + T::DbWeight::get().reads_writes(0, 2) } #[cfg(feature = "try-runtime")] @@ -91,6 +87,11 @@ pub mod v3 { !frame_support::migration::have_storage_value(Pallet::::name().as_bytes(), b"StorageVersion", &[]), "Old StorageVersion should not exist anymore" ); + assert_eq!( + Pallet::::current_storage_version(), + 3, + "StorageVersion should have migrated to new paradigm" + ); info!( "👥 Delegation pallet migration to {:?} passes POST migrate checks ✅", diff --git a/pallets/did/src/migrations.rs b/pallets/did/src/migrations.rs index bacc50cf6..71a616a93 100644 --- a/pallets/did/src/migrations.rs +++ b/pallets/did/src/migrations.rs @@ -52,7 +52,7 @@ pub mod v4 { use frame_support::{ generate_storage_alias, pallet_prelude::Weight, - traits::{Get, OnRuntimeUpgrade, PalletInfoAccess}, + traits::{Get, OnRuntimeUpgrade, PalletInfoAccess, StorageVersion as NewStorageVersion}, }; use log::info; use sp_std::marker::PhantomData; @@ -67,12 +67,6 @@ pub mod v4 { fn pre_upgrade() -> Result<(), &'static str> { assert!(StorageVersion::get() == Some(DidStorageVersion::V3)); - // no migration needed - assert!( - Pallet::::current_storage_version() == 4, - "New StorageVersion should be set via pallet macro already" - ); - info!("👁 DID storage migration to v4 passes PRE migrate checks ✅",); Ok(()) } @@ -81,8 +75,10 @@ pub mod v4 { // remove deprecated storage versioning entry frame_support::migration::remove_storage_prefix(Pallet::::name().as_bytes(), b"StorageVersion", &[]); + NewStorageVersion::new(4).put::>(); + info!("👁 completed DID storage migration to v4 ✅",); - T::DbWeight::get().reads_writes(0, 1) + T::DbWeight::get().reads_writes(0, 2) } #[cfg(feature = "try-runtime")] @@ -92,6 +88,11 @@ pub mod v4 { !frame_support::migration::have_storage_value(Pallet::::name().as_bytes(), b"StorageVersion", &[]), "Old StorageVersion should not exist anymore" ); + assert_eq!( + Pallet::::current_storage_version(), + 4, + "StorageVersion should have migrated to new paradigm" + ); info!( "👁 DID storage migration to {:?} passes POST migrate checks ✅", From e7f07c203c41ac66a74f187dcbfb5ca52f10a723 Mon Sep 17 00:00:00 2001 From: weichweich Date: Wed, 9 Mar 2022 14:18:14 +0100 Subject: [PATCH 3/3] chore: increase DID ep size --- runtimes/common/src/constants.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtimes/common/src/constants.rs b/runtimes/common/src/constants.rs index 179668291..12b8aec40 100644 --- a/runtimes/common/src/constants.rs +++ b/runtimes/common/src/constants.rs @@ -84,7 +84,7 @@ pub const MAX_VESTING_SCHEDULES: u32 = 28; /// Calculate the storage deposit based on the number of storage items and the /// combined byte size of those items. pub const fn deposit(items: u32, bytes: u32) -> Balance { - items as Balance * 63 * MILLI_KILT + (bytes as Balance) * 50 * MICRO_KILT + items as Balance * 56 * MILLI_KILT + (bytes as Balance) * 50 * MICRO_KILT } /// The size of an index in the index pallet. @@ -210,7 +210,7 @@ pub mod did { use super::*; /// The size is checked in the runtime by a test. - pub const MAX_DID_BYTE_LENGTH: u32 = 7418; + pub const MAX_DID_BYTE_LENGTH: u32 = 9918; pub const DID_DEPOSIT: Balance = deposit(2 + MAX_NUMBER_OF_SERVICES_PER_DID, MAX_DID_BYTE_LENGTH); pub const DID_FEE: Balance = 50 * MILLI_KILT; @@ -228,7 +228,7 @@ pub mod did { pub const MAX_SERVICE_ID_LENGTH: u32 = 50; pub const MAX_SERVICE_TYPE_LENGTH: u32 = 50; pub const MAX_NUMBER_OF_TYPES_PER_SERVICE: u32 = 1; - pub const MAX_SERVICE_URL_LENGTH: u32 = 100; + pub const MAX_SERVICE_URL_LENGTH: u32 = 200; pub const MAX_NUMBER_OF_URLS_PER_SERVICE: u32 = 1; }