From 9ecdc7454f9b91d35926a6c16b13492ef3346537 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 21 Jun 2021 16:48:05 -0600 Subject: [PATCH 01/79] Add initial migrations pallet sketch --- pallets/migrations/Cargo.toml | 22 +++++++ pallets/migrations/src/lib.rs | 104 ++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 pallets/migrations/Cargo.toml create mode 100644 pallets/migrations/src/lib.rs diff --git a/pallets/migrations/Cargo.toml b/pallets/migrations/Cargo.toml new file mode 100644 index 0000000000..7838d72bf4 --- /dev/null +++ b/pallets/migrations/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "migrations" +version = "0.1.0" +authors = ["PureStake"] +edition = "2018" +description = "migrations management pallet" + +[dependencies] +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } +log = "0.4" +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } + +[features] +default = ["std"] +std = [ + "frame-support/std", + "frame-system/std", + "sp-std/std", + "sp-runtime/std", +] diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs new file mode 100644 index 0000000000..5da677ac4c --- /dev/null +++ b/pallets/migrations/src/lib.rs @@ -0,0 +1,104 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! # Migrations + +#![cfg_attr(not(feature = "std"), no_std)] + +use frame_support::pallet; + +#[pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use sp_std::prelude::*; + + #[pallet::pallet] + pub struct Pallet(PhantomData); + + #[derive(Copy, Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug)] + /// A Migration that must happen on-chain upon a runtime-upgrade + pub struct Migration { + // TODO: this would involve some metadata about the migration as well as a means of calling + // the actual migration function + } + + /// Our list of migrations. Any ordering considerations can be specified here (?). + // const MIGRATIONS: // TODO: this would be a constant vec (or similar) of individual migrations + + /// Configuration trait of this pallet. + #[pallet::config] + pub trait Config: frame_system::Config { + /// Overarching event type + type Event: From> + IsType<::Event>; + /// Weight information for extrinsics in this pallet. + type WeightInfo: WeightInfo; + } + + #[pallet::error] + pub enum Error { + // errors in this pallet would be quite bad... + } + + #[pallet::event] + #[pallet::generate_deposit(pub(crate) fn deposit_event)] + pub enum Event { + // e.g. runtime upgrade started, completed, etc. + } + + #[pallet::hooks] + impl Hooks> for Pallet { + + /// on_runtime_upgrade is expected to be called exactly once after a runtime upgrade. + /// We use this as a chance to flag that we are now in upgrade-mode and begin our + /// migrations. + /// + /// In the event that a migration is expected to take more than one block, ongoing migration + /// work could continue from block-to-block in this pallet's on_initialize function. + fn on_runtime_upgrade() -> Weight { + // start by flagging that we are not fully upgraded + >::put(false); + + let weight: u32 = 0; + + let info = process_runtime_upgrades(); + weight += info.actual_weight.expect("Weight not provided"); + + // now flag that we are done with our runtime upgrade + >::put(true); + + weight + } + } + + #[pallet::storage] + #[pallet::getter(fn is_fully_upgraded)] + /// True if all required migrations have completed + type FullyUpgraded = StorageValue<_, bool, ValueQuery>; + + #[pallet::call] + impl Pallet { + + // TODO: this isn't a call, but it should forward weight info + #[pallet::weight(0)] + pub fn process_runtime_upgrades(origin: OriginFor) -> DispatchResultWithPostInfo { + frame_system::ensure_root(origin)?; + // TODO: iterate over MIGRATIONS here and ensure that each one has been fully applied. + // additionally, write to storage about our progress if multi-block-update functionality + // is required. + } + } +} From e4f15ce2a29512d63353f423d8d46d3e63e3fccf Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Fri, 25 Jun 2021 10:23:43 -0600 Subject: [PATCH 02/79] Sketch out Migration impls --- pallets/migrations/src/lib.rs | 13 +++++++-- pallets/migrations/src/migrations.rs | 43 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 pallets/migrations/src/migrations.rs diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 5da677ac4c..356b8715df 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -14,11 +14,12 @@ // You should have received a copy of the GNU General Public License // along with Moonbeam. If not, see . -//! # Migrations +//! # Migration Pallet #![cfg_attr(not(feature = "std"), no_std)] use frame_support::pallet; +pub mod migrations; #[pallet] pub mod pallet { @@ -31,13 +32,19 @@ pub mod pallet { #[derive(Copy, Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug)] /// A Migration that must happen on-chain upon a runtime-upgrade - pub struct Migration { + pub trait Migration { // TODO: this would involve some metadata about the migration as well as a means of calling // the actual migration function + + fn friendly_name() -> str; } /// Our list of migrations. Any ordering considerations can be specified here (?). - // const MIGRATIONS: // TODO: this would be a constant vec (or similar) of individual migrations + static MIGRATIONS: [Migration] = [ + MM_001_AuthorMappingAddDeposit, + MM_002_StakingFixTotalBalance, + MM_003_StakingTransitionBoundedSet, + ]; /// Configuration trait of this pallet. #[pallet::config] diff --git a/pallets/migrations/src/migrations.rs b/pallets/migrations/src/migrations.rs new file mode 100644 index 0000000000..c552c44a0a --- /dev/null +++ b/pallets/migrations/src/migrations.rs @@ -0,0 +1,43 @@ +// Copyright 2019-2020 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! # Migrations + +use crate::*; + +/// This module acts as a registry where each migration is defined. Each migration should implement +/// the "Migration" trait declared in this crate. + +struct MM_001_AuthorMappingAddDeposit; +impl Migration for MM_001_AuthorMappingAddDeposit { + fn friendly_name() -> str { + "AuthorMappingAddDeposit" + } +} + +struct MM_002_StakingFixTotalBalance; +impl Migration for StakingFixTotalBalance { + fn friendly_name() -> str { + "StakingFixTotalBalance" + } +} + +struct MM_003_StakingTransitionBoundedSet; // TODO: better name +impl Migration for MM_003_StakingTransitionBoundedSet { + fn friendly_name() -> str { + "StakingTransitionBoundedSet" + } +} From ca3620eba41286737738f7e563a53645f25a9b68 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Fri, 25 Jun 2021 11:22:06 -0600 Subject: [PATCH 03/79] Make it build --- Cargo.lock | 14 ++++++-- Cargo.toml | 1 + pallets/migrations/Cargo.toml | 1 + pallets/migrations/src/lib.rs | 51 ++++++++++++---------------- pallets/migrations/src/migrations.rs | 20 +++++++---- 5 files changed, 48 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 98f7981244..d4d55e568e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,7 +1,5 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - [[package]] name = "Inflector" version = "0.11.4" @@ -4664,6 +4662,18 @@ dependencies = [ "thrift", ] +[[package]] +name = "migrations" +version = "0.1.0" +dependencies = [ + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "sp-runtime", + "sp-std", +] + [[package]] name = "minicbor" version = "0.8.1" diff --git a/Cargo.toml b/Cargo.toml index e20d54cb15..6896074f96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ members = [ 'node', 'node/cli', 'node/service', + 'pallets/migrations', 'bin/utils/moonkey' ] exclude = [ diff --git a/pallets/migrations/Cargo.toml b/pallets/migrations/Cargo.toml index 7838d72bf4..4a6cf5ba3f 100644 --- a/pallets/migrations/Cargo.toml +++ b/pallets/migrations/Cargo.toml @@ -11,6 +11,7 @@ frame-system = { git = "https://github.com/paritytech/substrate", branch = "polk log = "0.4" sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } +parity-scale-codec = { version = "2.0.0", default-features = false } [features] default = ["std"] diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 356b8715df..ef265655a0 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -21,29 +21,29 @@ use frame_support::pallet; pub mod migrations; +/// A Migration that must happen on-chain upon a runtime-upgrade +pub trait Migration { + // TODO: this would involve some metadata about the migration as well as a means of calling + // the actual migration function + + // fn friendly_name() -> &str; +} + #[pallet] pub mod pallet { use super::*; use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; use sp_std::prelude::*; #[pallet::pallet] pub struct Pallet(PhantomData); - #[derive(Copy, Clone, PartialEq, Eq, Encode, Decode, RuntimeDebug)] - /// A Migration that must happen on-chain upon a runtime-upgrade - pub trait Migration { - // TODO: this would involve some metadata about the migration as well as a means of calling - // the actual migration function - - fn friendly_name() -> str; - } - /// Our list of migrations. Any ordering considerations can be specified here (?). - static MIGRATIONS: [Migration] = [ - MM_001_AuthorMappingAddDeposit, - MM_002_StakingFixTotalBalance, - MM_003_StakingTransitionBoundedSet, + const MIGRATIONS: [&dyn Migration; 3] = [ + &migrations::MM_001_AuthorMappingAddDeposit {}, + &migrations::MM_002_StakingFixTotalBalance {}, + &migrations::MM_003_StakingTransitionBoundedSet {}, ]; /// Configuration trait of this pallet. @@ -51,8 +51,6 @@ pub mod pallet { pub trait Config: frame_system::Config { /// Overarching event type type Event: From> + IsType<::Event>; - /// Weight information for extrinsics in this pallet. - type WeightInfo: WeightInfo; } #[pallet::error] @@ -79,15 +77,14 @@ pub mod pallet { // start by flagging that we are not fully upgraded >::put(false); - let weight: u32 = 0; + let mut weight: Weight = 0u64.into(); - let info = process_runtime_upgrades(); - weight += info.actual_weight.expect("Weight not provided"); + weight += process_runtime_upgrades(); // now flag that we are done with our runtime upgrade >::put(true); - weight + weight.into() } } @@ -96,16 +93,10 @@ pub mod pallet { /// True if all required migrations have completed type FullyUpgraded = StorageValue<_, bool, ValueQuery>; - #[pallet::call] - impl Pallet { - - // TODO: this isn't a call, but it should forward weight info - #[pallet::weight(0)] - pub fn process_runtime_upgrades(origin: OriginFor) -> DispatchResultWithPostInfo { - frame_system::ensure_root(origin)?; - // TODO: iterate over MIGRATIONS here and ensure that each one has been fully applied. - // additionally, write to storage about our progress if multi-block-update functionality - // is required. - } + fn process_runtime_upgrades() -> Weight { + // TODO: iterate over MIGRATIONS here and ensure that each one has been fully applied. + // additionally, write to storage about our progress if multi-block-update functionality + // is required. + 0u64.into() } } diff --git a/pallets/migrations/src/migrations.rs b/pallets/migrations/src/migrations.rs index c552c44a0a..126c3434af 100644 --- a/pallets/migrations/src/migrations.rs +++ b/pallets/migrations/src/migrations.rs @@ -21,23 +21,29 @@ use crate::*; /// This module acts as a registry where each migration is defined. Each migration should implement /// the "Migration" trait declared in this crate. -struct MM_001_AuthorMappingAddDeposit; +pub struct MM_001_AuthorMappingAddDeposit; impl Migration for MM_001_AuthorMappingAddDeposit { - fn friendly_name() -> str { + /* + fn friendly_name() -> &str { "AuthorMappingAddDeposit" } + */ } -struct MM_002_StakingFixTotalBalance; -impl Migration for StakingFixTotalBalance { - fn friendly_name() -> str { +pub struct MM_002_StakingFixTotalBalance; +impl Migration for MM_002_StakingFixTotalBalance { + /* + fn friendly_name() -> &str { "StakingFixTotalBalance" } + */ } -struct MM_003_StakingTransitionBoundedSet; // TODO: better name +pub struct MM_003_StakingTransitionBoundedSet; // TODO: better name impl Migration for MM_003_StakingTransitionBoundedSet { - fn friendly_name() -> str { + /* + fn friendly_name() -> &str { "StakingTransitionBoundedSet" } + */ } From cdc042aef9d6d68d65df136dbb9357b69e91de13 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Fri, 25 Jun 2021 11:27:53 -0600 Subject: [PATCH 04/79] Squelch warnings --- pallets/migrations/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index ef265655a0..45c5b3aeb4 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -16,6 +16,8 @@ //! # Migration Pallet +#![allow(non_camel_case_types)] + #![cfg_attr(not(feature = "std"), no_std)] use frame_support::pallet; @@ -34,6 +36,7 @@ pub mod pallet { use super::*; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; + #[allow(unused_imports)] // TODO: why does it detect this as unused? use sp_std::prelude::*; #[pallet::pallet] @@ -59,7 +62,6 @@ pub mod pallet { } #[pallet::event] - #[pallet::generate_deposit(pub(crate) fn deposit_event)] pub enum Event { // e.g. runtime upgrade started, completed, etc. } From c4204b4fb2ab701e0613ff110540497a3a1058d6 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Fri, 25 Jun 2021 11:52:35 -0600 Subject: [PATCH 05/79] Sketch out process_runtime_upgrades --- pallets/migrations/src/lib.rs | 55 +++++++++++++++++++++++----- pallets/migrations/src/migrations.rs | 9 +++++ 2 files changed, 55 insertions(+), 9 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 45c5b3aeb4..55cd14021a 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -20,15 +20,18 @@ #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::pallet; +use frame_support::{pallet, weights::Weight}; pub mod migrations; /// A Migration that must happen on-chain upon a runtime-upgrade pub trait Migration { - // TODO: this would involve some metadata about the migration as well as a means of calling - // the actual migration function + /// A human-readable name for this migration. Also used as storage key. + fn friendly_name() -> &str; - // fn friendly_name() -> &str; + /// Apply this migration. Will be called exactly once for this migration. + /// TODO: refactor to support multi-block migrations (or, alternatively, allow each Migration + /// to specify whether it requires this support and provide a different path) + fn apply() -> Weight; } #[pallet] @@ -76,6 +79,8 @@ pub mod pallet { /// In the event that a migration is expected to take more than one block, ongoing migration /// work could continue from block-to-block in this pallet's on_initialize function. fn on_runtime_upgrade() -> Weight { + log::warn!("Performing on_runtime_upgrade"); + // start by flagging that we are not fully upgraded >::put(false); @@ -95,10 +100,42 @@ pub mod pallet { /// True if all required migrations have completed type FullyUpgraded = StorageValue<_, bool, ValueQuery>; - fn process_runtime_upgrades() -> Weight { - // TODO: iterate over MIGRATIONS here and ensure that each one has been fully applied. - // additionally, write to storage about our progress if multi-block-update functionality - // is required. - 0u64.into() + #[pallet::storage] + #[pallet::getter(fn migration_state)] + /// MigrationState tracks the status of each migration + type MigrationState = StorageMap< + _, + Twox64Concat, + str, + bool, // whether it's been applied or not -- TODO: use struct or enum + OptionQuery, // TODO: what is this...? + >; + + fn process_runtime_upgrades() -> Weight { + log::info!("stepping runtime upgrade"); + + let weight: Weight = 0u64.into(); + + for migration in MIGRATIONS { + + // let migration_name = migration.friendly_name(); + let migration_name = "TODO"; // fix fn signature in trait... + log::trace!("evaluating migration {}", migration_name); + + let migration_state = >::get(migration_name); + if ! migration_state { + + + // Apply the migration. Here we assume that this can fit within our current block, + // but this could me modified to step through a migration across blocks until it + // is done. + weight += migration.apply(); + + >::insert(migration_name, true); + } + + } + + weight } } diff --git a/pallets/migrations/src/migrations.rs b/pallets/migrations/src/migrations.rs index 126c3434af..55ff486a23 100644 --- a/pallets/migrations/src/migrations.rs +++ b/pallets/migrations/src/migrations.rs @@ -28,6 +28,9 @@ impl Migration for MM_001_AuthorMappingAddDeposit { "AuthorMappingAddDeposit" } */ + fn apply() -> Weight { + 0u64.into() + } } pub struct MM_002_StakingFixTotalBalance; @@ -37,6 +40,9 @@ impl Migration for MM_002_StakingFixTotalBalance { "StakingFixTotalBalance" } */ + fn apply() -> Weight { + 0u64.into() + } } pub struct MM_003_StakingTransitionBoundedSet; // TODO: better name @@ -46,4 +52,7 @@ impl Migration for MM_003_StakingTransitionBoundedSet { "StakingTransitionBoundedSet" } */ + fn apply() -> Weight { + 0u64.into() + } } From 0cc885df4a35ed49ae8d428869bf2673daca3b0e Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Fri, 25 Jun 2021 11:55:06 -0600 Subject: [PATCH 06/79] Leave note for reviewers --- pallets/migrations/src/migrations.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pallets/migrations/src/migrations.rs b/pallets/migrations/src/migrations.rs index 55ff486a23..bca6d3ef61 100644 --- a/pallets/migrations/src/migrations.rs +++ b/pallets/migrations/src/migrations.rs @@ -29,6 +29,8 @@ impl Migration for MM_001_AuthorMappingAddDeposit { } */ fn apply() -> Weight { + /// reviewer note: this isn't meant to imply that migration code must live here. As noted + /// elsewhere, I would expect migration code to live close to the pallet it affects. 0u64.into() } } From 95308a15ca3fc2e162c82d92d0dc5f5c4acd7422 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 28 Jun 2021 15:23:48 -0600 Subject: [PATCH 07/79] Add &self to Migrations trait fns --- pallets/migrations/src/lib.rs | 18 +++++++++--------- pallets/migrations/src/migrations.rs | 18 ++++++------------ 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 55cd14021a..c8c681c4de 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -26,14 +26,21 @@ pub mod migrations; /// A Migration that must happen on-chain upon a runtime-upgrade pub trait Migration { /// A human-readable name for this migration. Also used as storage key. - fn friendly_name() -> &str; + fn friendly_name(&self) -> &str; /// Apply this migration. Will be called exactly once for this migration. /// TODO: refactor to support multi-block migrations (or, alternatively, allow each Migration /// to specify whether it requires this support and provide a different path) - fn apply() -> Weight; + fn apply(&self) -> Weight; } +/// Our list of migrations. Any ordering considerations can be specified here (?). +const MIGRATIONS: [&dyn Migration; 3] = [ + &migrations::MM_001_AuthorMappingAddDeposit {}, + &migrations::MM_002_StakingFixTotalBalance {}, + &migrations::MM_003_StakingTransitionBoundedSet {}, +]; + #[pallet] pub mod pallet { use super::*; @@ -45,13 +52,6 @@ pub mod pallet { #[pallet::pallet] pub struct Pallet(PhantomData); - /// Our list of migrations. Any ordering considerations can be specified here (?). - const MIGRATIONS: [&dyn Migration; 3] = [ - &migrations::MM_001_AuthorMappingAddDeposit {}, - &migrations::MM_002_StakingFixTotalBalance {}, - &migrations::MM_003_StakingTransitionBoundedSet {}, - ]; - /// Configuration trait of this pallet. #[pallet::config] pub trait Config: frame_system::Config { diff --git a/pallets/migrations/src/migrations.rs b/pallets/migrations/src/migrations.rs index bca6d3ef61..f2f7677386 100644 --- a/pallets/migrations/src/migrations.rs +++ b/pallets/migrations/src/migrations.rs @@ -23,12 +23,10 @@ use crate::*; pub struct MM_001_AuthorMappingAddDeposit; impl Migration for MM_001_AuthorMappingAddDeposit { - /* - fn friendly_name() -> &str { + fn friendly_name(&self) -> &str { "AuthorMappingAddDeposit" } - */ - fn apply() -> Weight { + fn apply(&self) -> Weight { /// reviewer note: this isn't meant to imply that migration code must live here. As noted /// elsewhere, I would expect migration code to live close to the pallet it affects. 0u64.into() @@ -37,24 +35,20 @@ impl Migration for MM_001_AuthorMappingAddDeposit { pub struct MM_002_StakingFixTotalBalance; impl Migration for MM_002_StakingFixTotalBalance { - /* - fn friendly_name() -> &str { + fn friendly_name(&self) -> &str { "StakingFixTotalBalance" } - */ - fn apply() -> Weight { + fn apply(&self) -> Weight { 0u64.into() } } pub struct MM_003_StakingTransitionBoundedSet; // TODO: better name impl Migration for MM_003_StakingTransitionBoundedSet { - /* - fn friendly_name() -> &str { + fn friendly_name(&self) -> &str { "StakingTransitionBoundedSet" } - */ - fn apply() -> Weight { + fn apply(&self) -> Weight { 0u64.into() } } From 93b96cecc71291c389d47be0d97b5de2c98989ef Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 28 Jun 2021 15:41:59 -0600 Subject: [PATCH 08/79] Make it compile --- pallets/migrations/src/lib.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index c8c681c4de..e184669f7b 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -86,7 +86,7 @@ pub mod pallet { let mut weight: Weight = 0u64.into(); - weight += process_runtime_upgrades(); + weight += process_runtime_upgrades::(); // now flag that we are done with our runtime upgrade >::put(true); @@ -106,7 +106,7 @@ pub mod pallet { type MigrationState = StorageMap< _, Twox64Concat, - str, + String, bool, // whether it's been applied or not -- TODO: use struct or enum OptionQuery, // TODO: what is this...? >; @@ -114,15 +114,16 @@ pub mod pallet { fn process_runtime_upgrades() -> Weight { log::info!("stepping runtime upgrade"); - let weight: Weight = 0u64.into(); + let mut weight: Weight = 0u64.into(); - for migration in MIGRATIONS { + for migration in &MIGRATIONS { // let migration_name = migration.friendly_name(); let migration_name = "TODO"; // fix fn signature in trait... log::trace!("evaluating migration {}", migration_name); - let migration_state = >::get(migration_name); + let migration_state = >::get(migration_name) + .unwrap_or(false); if ! migration_state { From 275531c0bbe81d14ad595a10633a1daba86fd642 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 28 Jun 2021 16:49:35 -0600 Subject: [PATCH 09/79] Refactor migrations design to use stepping instead of one-shot --- pallets/migrations/src/lib.rs | 51 ++++++++++++++++++++-------- pallets/migrations/src/migrations.rs | 12 +++---- 2 files changed, 43 insertions(+), 20 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index e184669f7b..b734ab1b3c 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -21,6 +21,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use frame_support::{pallet, weights::Weight}; +use sp_runtime::Perbill; pub mod migrations; /// A Migration that must happen on-chain upon a runtime-upgrade @@ -28,10 +29,20 @@ pub trait Migration { /// A human-readable name for this migration. Also used as storage key. fn friendly_name(&self) -> &str; - /// Apply this migration. Will be called exactly once for this migration. - /// TODO: refactor to support multi-block migrations (or, alternatively, allow each Migration - /// to specify whether it requires this support and provide a different path) - fn apply(&self) -> Weight; + /// Step through this migration, taking up to `available_weight` of execution time and providing + /// a status on the progress as well as the consumed weight. This allows a migration to perform + /// its logic in small batches across as many blocks as needed. + /// + /// Implementations should perform as much migration work as possible and then leave their + /// pallet in a valid state from which another 'step' of migration work can be performed. In no + /// case should a step consume more than `available_weight`. + /// + /// This should return a perbill indicating the aggregate progress of the migration. If + /// `Perbill::one()` is returned, the migration is considered complete and no further calls to + /// `step()` will be made. Any value less than `Perbill::one()` will result in another future + /// call to `step()`. Indeed, values < 1 are arbitrary, but the intent is to indicate progress + /// (so they should at least be monotonically increasing). + fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight); } /// Our list of migrations. Any ordering considerations can be specified here (?). @@ -102,37 +113,49 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn migration_state)] - /// MigrationState tracks the status of each migration + /// MigrationState tracks the progress of a migration. Migrations with progress < 1 type MigrationState = StorageMap< _, Twox64Concat, String, - bool, // whether it's been applied or not -- TODO: use struct or enum + Perbill, OptionQuery, // TODO: what is this...? >; fn process_runtime_upgrades() -> Weight { log::info!("stepping runtime upgrade"); + // TODO: query proper value or make configurable + let available_weight = 500_000_000_000u64.into(); let mut weight: Weight = 0u64.into(); for migration in &MIGRATIONS { // let migration_name = migration.friendly_name(); - let migration_name = "TODO"; // fix fn signature in trait... + let migration_name = migration.friendly_name(); log::trace!("evaluating migration {}", migration_name); let migration_state = >::get(migration_name) - .unwrap_or(false); - if ! migration_state { + .unwrap_or(Perbill::zero()); + if migration_state < Perbill::one() { - // Apply the migration. Here we assume that this can fit within our current block, - // but this could me modified to step through a migration across blocks until it - // is done. - weight += migration.apply(); + let available_for_step = available_weight - weight; - >::insert(migration_name, true); + // perform a step of this migration + let (updated_progress, consumed_weight) + = migration.step(migration_state, available_weight); + + weight += consumed_weight; + if weight > available_weight { + // TODO: the intent here is to complain obnoxiously so that this is caught + // during development. In production, this should probably be tolerated because + // failing is catastrophic. + log::error!("Migration {} consumed more weight than it was given! ({} > {})", + migration_name, consumed_weight, available_for_step); + } + + >::insert(migration_name, updated_progress); } } diff --git a/pallets/migrations/src/migrations.rs b/pallets/migrations/src/migrations.rs index f2f7677386..03bc69b1c1 100644 --- a/pallets/migrations/src/migrations.rs +++ b/pallets/migrations/src/migrations.rs @@ -26,10 +26,10 @@ impl Migration for MM_001_AuthorMappingAddDeposit { fn friendly_name(&self) -> &str { "AuthorMappingAddDeposit" } - fn apply(&self) -> Weight { + fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight) { /// reviewer note: this isn't meant to imply that migration code must live here. As noted /// elsewhere, I would expect migration code to live close to the pallet it affects. - 0u64.into() + (Perbill::one(), 0u64.into()) } } @@ -38,8 +38,8 @@ impl Migration for MM_002_StakingFixTotalBalance { fn friendly_name(&self) -> &str { "StakingFixTotalBalance" } - fn apply(&self) -> Weight { - 0u64.into() + fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight) { + (Perbill::one(), 0u64.into()) } } @@ -48,7 +48,7 @@ impl Migration for MM_003_StakingTransitionBoundedSet { fn friendly_name(&self) -> &str { "StakingTransitionBoundedSet" } - fn apply(&self) -> Weight { - 0u64.into() + fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight) { + (Perbill::one(), 0u64.into()) } } From d5abf1ffdc20ed840f599b71a0f00122d4e433ac Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 28 Jun 2021 16:58:07 -0600 Subject: [PATCH 10/79] Fix typo/bug --- pallets/migrations/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index b734ab1b3c..82775f00b1 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -141,10 +141,12 @@ pub mod pallet { if migration_state < Perbill::one() { let available_for_step = available_weight - weight; + log::trace!("stepping migration {}, prev: {}, avail weight: {}", + migration_name, migration_state, available_for_step); // perform a step of this migration let (updated_progress, consumed_weight) - = migration.step(migration_state, available_weight); + = migration.step(migration_state, available_for_step); weight += consumed_weight; if weight > available_weight { From d25ffc17d46f61337038041d65c71685af6db87d Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 28 Jun 2021 17:04:15 -0600 Subject: [PATCH 11/79] Track overall migration doneness --- pallets/migrations/src/lib.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 82775f00b1..b81ac45720 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -99,9 +99,6 @@ pub mod pallet { weight += process_runtime_upgrades::(); - // now flag that we are done with our runtime upgrade - >::put(true); - weight.into() } } @@ -113,7 +110,7 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn migration_state)] - /// MigrationState tracks the progress of a migration. Migrations with progress < 1 + /// MigrationState tracks the progress of a migration. type MigrationState = StorageMap< _, Twox64Concat, @@ -128,6 +125,7 @@ pub mod pallet { // TODO: query proper value or make configurable let available_weight = 500_000_000_000u64.into(); let mut weight: Weight = 0u64.into(); + let mut done: bool = true; for migration in &MIGRATIONS { @@ -141,7 +139,7 @@ pub mod pallet { if migration_state < Perbill::one() { let available_for_step = available_weight - weight; - log::trace!("stepping migration {}, prev: {}, avail weight: {}", + log::trace!("stepping migration {}, prev: {:?}, avail weight: {}", migration_name, migration_state, available_for_step); // perform a step of this migration @@ -157,11 +155,20 @@ pub mod pallet { migration_name, consumed_weight, available_for_step); } + // make note of any unfinished migrations + if updated_progress < Perbill::one() { + done = false; + } + >::insert(migration_name, updated_progress); } } + if done { + >::put(true); + } + weight } } From 0c9ce740d965c7056cb65b4906231f6289cdc634 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 28 Jun 2021 17:05:35 -0600 Subject: [PATCH 12/79] Optimize when progress remains unchanged --- pallets/migrations/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index b81ac45720..7112835faa 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -160,7 +160,9 @@ pub mod pallet { done = false; } - >::insert(migration_name, updated_progress); + if migration_state != updated_progress { + >::insert(migration_name, updated_progress); + } } } From 23837f8de399abc667de05b9426ab8385919f811 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 29 Jun 2021 08:52:38 -0600 Subject: [PATCH 13/79] Resolve compiler warnings --- pallets/migrations/src/migrations.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pallets/migrations/src/migrations.rs b/pallets/migrations/src/migrations.rs index 03bc69b1c1..07dc13f208 100644 --- a/pallets/migrations/src/migrations.rs +++ b/pallets/migrations/src/migrations.rs @@ -26,9 +26,9 @@ impl Migration for MM_001_AuthorMappingAddDeposit { fn friendly_name(&self) -> &str { "AuthorMappingAddDeposit" } - fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight) { - /// reviewer note: this isn't meant to imply that migration code must live here. As noted - /// elsewhere, I would expect migration code to live close to the pallet it affects. + fn step(&self, _previous_progress: Perbill, _available_weight: Weight) -> (Perbill, Weight) { + // reviewer note: this isn't meant to imply that migration code must live here. As noted + // elsewhere, I would expect migration code to live close to the pallet it affects. (Perbill::one(), 0u64.into()) } } @@ -38,7 +38,7 @@ impl Migration for MM_002_StakingFixTotalBalance { fn friendly_name(&self) -> &str { "StakingFixTotalBalance" } - fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight) { + fn step(&self, _previous_progress: Perbill, _available_weight: Weight) -> (Perbill, Weight) { (Perbill::one(), 0u64.into()) } } @@ -48,7 +48,7 @@ impl Migration for MM_003_StakingTransitionBoundedSet { fn friendly_name(&self) -> &str { "StakingTransitionBoundedSet" } - fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight) { + fn step(&self, _previous_progress: Perbill, _available_weight: Weight) -> (Perbill, Weight) { (Perbill::one(), 0u64.into()) } } From 85ecaa12eaae6e0afc58b08065b425dfded57e88 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 29 Jun 2021 10:26:30 -0600 Subject: [PATCH 14/79] Incremental progress on mock --- Cargo.lock | 1 + pallets/migrations/Cargo.toml | 5 ++ pallets/migrations/src/lib.rs | 44 +++++++++++-- pallets/migrations/src/mock.rs | 107 ++++++++++++++++++++++++++++++++ pallets/migrations/src/tests.rs | 32 ++++++++++ 5 files changed, 183 insertions(+), 6 deletions(-) create mode 100644 pallets/migrations/src/mock.rs create mode 100644 pallets/migrations/src/tests.rs diff --git a/Cargo.lock b/Cargo.lock index d4d55e568e..aaed615936 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4670,6 +4670,7 @@ dependencies = [ "frame-system", "log", "parity-scale-codec", + "sp-io", "sp-runtime", "sp-std", ] diff --git a/pallets/migrations/Cargo.toml b/pallets/migrations/Cargo.toml index 4a6cf5ba3f..96f5348ff4 100644 --- a/pallets/migrations/Cargo.toml +++ b/pallets/migrations/Cargo.toml @@ -13,6 +13,10 @@ sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } parity-scale-codec = { version = "2.0.0", default-features = false } +[dev-dependencies] +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } + + [features] default = ["std"] std = [ @@ -20,4 +24,5 @@ std = [ "frame-system/std", "sp-std/std", "sp-runtime/std", + "sp-io/std", ] diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 7112835faa..a04a5b1410 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -20,10 +20,17 @@ #![cfg_attr(not(feature = "std"), no_std)] +#[cfg(test)] +mod mock; +#[cfg(test)] +mod tests; + use frame_support::{pallet, weights::Weight}; use sp_runtime::Perbill; pub mod migrations; +pub use pallet::*; + /// A Migration that must happen on-chain upon a runtime-upgrade pub trait Migration { /// A human-readable name for this migration. Also used as storage key. @@ -61,7 +68,7 @@ pub mod pallet { use sp_std::prelude::*; #[pallet::pallet] - pub struct Pallet(PhantomData); + pub struct Pallet(_); /// Configuration trait of this pallet. #[pallet::config] @@ -70,14 +77,14 @@ pub mod pallet { type Event: From> + IsType<::Event>; } - #[pallet::error] - pub enum Error { - // errors in this pallet would be quite bad... - } - #[pallet::event] pub enum Event { // e.g. runtime upgrade started, completed, etc. + RuntimeUpgradeStarted, + RuntimeUpgradeCompleted, + MigrationStarted(String), + MigrationProgress(String, Perbill), + MigrationCompleted(String), } #[pallet::hooks] @@ -119,6 +126,31 @@ pub mod pallet { OptionQuery, // TODO: what is this...? >; + #[pallet::genesis_config] + pub struct GenesisConfig { + pub completed_migrations: Vec, + pub dummy: PhantomData // TODO: + } + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + Self { + completed_migrations: vec![], + dummy: PhantomData, + } + } + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + for migration_name in &self.completed_migrations { + >::insert(migration_name, Perbill::one()); + } + } + } + fn process_runtime_upgrades() -> Weight { log::info!("stepping runtime upgrade"); diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs new file mode 100644 index 0000000000..a97de84005 --- /dev/null +++ b/pallets/migrations/src/mock.rs @@ -0,0 +1,107 @@ +// Copyright 2019-2021 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +//! A minimal runtime including the migrations pallet +use crate as pallet_migrations; +use frame_support::{construct_runtime, parameter_types, traits::GenesisBuild, weights::Weight}; +use sp_runtime::{Perbill, {traits::IdentityLookup}}; + +pub type AccountId = u64; +pub type Balance = u128; +pub type BlockNumber = u64; + +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +// Configure a mock runtime to test the pallet. +construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, + } +); + +parameter_types! { + pub const BlockHashCount: u64 = 250; + pub const MaximumBlockWeight: Weight = 1024; + pub const MaximumBlockLength: u32 = 2 * 1024; + pub const AvailableBlockRatio: Perbill = Perbill::one(); +} +impl frame_system::Config for Test { + type BaseCallFilter = (); + type DbWeight = (); + type Origin = Origin; + type Index = u64; + type BlockNumber = BlockNumber; + type Call = Call; + type Hash = (); + type Hashing = (); + type AccountId = (); + type Lookup = IdentityLookup; + type Header = (); + type Event = Event; + type BlockHashCount = BlockHashCount; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = (); + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type BlockWeights = (); + type BlockLength = (); + type SS58Prefix = (); + type OnSetCode = (); +} +impl pallet_migrations::Config for Test { +} + +/* +/// Externality builder for pallet migration's mock runtime +pub(crate) struct ExtBuilder { +} + +impl Default for ExtBuilder { + fn default() -> ExtBuilder { + ExtBuilder {} + } +} + +impl ExtBuilder { + + pub(crate) fn build(self) -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::default() + .build_storage::() + .expect("Frame system builds valid default genesis config"); + + pallet_migrations::GenesisConfig:: { + } + .assimilate_storage(&mut t) + .expect("Pallet migration's storage can be assimilated"); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext + } +} + +pub(crate) fn last_event() -> Event { + System::events().pop().expect("Event expected").event +} +*/ diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs new file mode 100644 index 0000000000..bd9c95b5fe --- /dev/null +++ b/pallets/migrations/src/tests.rs @@ -0,0 +1,32 @@ +// Copyright 2019-2021 PureStake Inc. +// This file is part of Moonbeam. + +// Moonbeam is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Moonbeam is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Moonbeam. If not, see . + +/* +//! Unit testing +use crate::mock::{ + last_event, Migrations, Event as MetaEvent, ExtBuilder, Origin, System, Test, +}; + +#[test] +fn genesis_builder_works() { + ExtBuilder::default() + .build() + .execute_with(|| { + assert!(System::events().is_empty()); + }) +} +*/ + From f22ce8d354e84fff163798ab384d56e83be8af7c Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 29 Jun 2021 12:42:41 -0600 Subject: [PATCH 15/79] Mock is getting close --- Cargo.lock | 1 + pallets/migrations/Cargo.toml | 3 ++- pallets/migrations/src/lib.rs | 2 -- pallets/migrations/src/mock.rs | 20 +++++++++++++------- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aaed615936..e42ae9ebc1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4670,6 +4670,7 @@ dependencies = [ "frame-system", "log", "parity-scale-codec", + "sp-core", "sp-io", "sp-runtime", "sp-std", diff --git a/pallets/migrations/Cargo.toml b/pallets/migrations/Cargo.toml index 96f5348ff4..2b27bad885 100644 --- a/pallets/migrations/Cargo.toml +++ b/pallets/migrations/Cargo.toml @@ -15,7 +15,7 @@ parity-scale-codec = { version = "2.0.0", default-features = false } [dev-dependencies] sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } - +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } [features] default = ["std"] @@ -25,4 +25,5 @@ std = [ "sp-std/std", "sp-runtime/std", "sp-io/std", + "sp-core/std", ] diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index a04a5b1410..72f314917d 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -29,8 +29,6 @@ use frame_support::{pallet, weights::Weight}; use sp_runtime::Perbill; pub mod migrations; -pub use pallet::*; - /// A Migration that must happen on-chain upon a runtime-upgrade pub trait Migration { /// A human-readable name for this migration. Also used as storage key. diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index a97de84005..50bd7f89c0 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -16,8 +16,13 @@ //! A minimal runtime including the migrations pallet use crate as pallet_migrations; -use frame_support::{construct_runtime, parameter_types, traits::GenesisBuild, weights::Weight}; -use sp_runtime::{Perbill, {traits::IdentityLookup}}; +use frame_support::{construct_runtime, parameter_types, weights::Weight}; +use sp_core::H256; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, + Perbill, +}; pub type AccountId = u64; pub type Balance = u128; @@ -51,11 +56,11 @@ impl frame_system::Config for Test { type Index = u64; type BlockNumber = BlockNumber; type Call = Call; - type Hash = (); - type Hashing = (); - type AccountId = (); + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = (); + type Header = Header; type Event = Event; type BlockHashCount = BlockHashCount; type Version = (); @@ -69,7 +74,8 @@ impl frame_system::Config for Test { type SS58Prefix = (); type OnSetCode = (); } -impl pallet_migrations::Config for Test { +impl Config for Test { + type Event: Event; } /* From d8d2c3cf5c79d2b9c8fe5e846443495c1d4ad680 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 29 Jun 2021 16:40:14 -0600 Subject: [PATCH 16/79] Make mock build --- pallets/migrations/src/lib.rs | 5 ++++- pallets/migrations/src/mock.rs | 15 ++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 72f314917d..8c0f70f393 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -29,6 +29,8 @@ use frame_support::{pallet, weights::Weight}; use sp_runtime::Perbill; pub mod migrations; +pub use pallet::*; + /// A Migration that must happen on-chain upon a runtime-upgrade pub trait Migration { /// A human-readable name for this migration. Also used as storage key. @@ -65,8 +67,9 @@ pub mod pallet { #[allow(unused_imports)] // TODO: why does it detect this as unused? use sp_std::prelude::*; + /// Pallet for migrations #[pallet::pallet] - pub struct Pallet(_); + pub struct Pallet(PhantomData); /// Configuration trait of this pallet. #[pallet::config] diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 50bd7f89c0..88462c4e5c 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -15,13 +15,17 @@ // along with Moonbeam. If not, see . //! A minimal runtime including the migrations pallet +use super::*; use crate as pallet_migrations; -use frame_support::{construct_runtime, parameter_types, weights::Weight}; +use frame_support::{ + construct_runtime, parameter_types, + weights::Weight, +}; use sp_core::H256; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, - Perbill, + Perbill, Percent, }; pub type AccountId = u64; @@ -39,7 +43,7 @@ construct_runtime!( UncheckedExtrinsic = UncheckedExtrinsic, { System: frame_system::{Pallet, Call, Config, Storage, Event}, - Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, + Migrations: pallet_migrations::{Pallet, Call, Storage, Config, Event}, } ); @@ -48,6 +52,7 @@ parameter_types! { pub const MaximumBlockWeight: Weight = 1024; pub const MaximumBlockLength: u32 = 2 * 1024; pub const AvailableBlockRatio: Perbill = Perbill::one(); + pub const SS58Prefix: u8 = 42; } impl frame_system::Config for Test { type BaseCallFilter = (); @@ -71,11 +76,11 @@ impl frame_system::Config for Test { type SystemWeightInfo = (); type BlockWeights = (); type BlockLength = (); - type SS58Prefix = (); + type SS58Prefix = SS58Prefix; type OnSetCode = (); } impl Config for Test { - type Event: Event; + type Event = Event; } /* From bfd24f60d2d3cd7665d13f4ff6a9e0d637cad8a3 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 29 Jun 2021 19:41:21 -0600 Subject: [PATCH 17/79] Plumb genesis building in mock --- pallets/migrations/src/mock.rs | 10 +++++++--- pallets/migrations/src/tests.rs | 2 -- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 88462c4e5c..d4dcf92f96 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -19,6 +19,7 @@ use super::*; use crate as pallet_migrations; use frame_support::{ construct_runtime, parameter_types, + traits::{GenesisBuild}, weights::Weight, }; use sp_core::H256; @@ -83,14 +84,16 @@ impl Config for Test { type Event = Event; } -/* /// Externality builder for pallet migration's mock runtime pub(crate) struct ExtBuilder { + completed_migrations: Vec, } impl Default for ExtBuilder { fn default() -> ExtBuilder { - ExtBuilder {} + ExtBuilder { + completed_migrations: vec![], + } } } @@ -102,6 +105,8 @@ impl ExtBuilder { .expect("Frame system builds valid default genesis config"); pallet_migrations::GenesisConfig:: { + completed_migrations: self.completed_migrations, + dummy: Default::default(), } .assimilate_storage(&mut t) .expect("Pallet migration's storage can be assimilated"); @@ -115,4 +120,3 @@ impl ExtBuilder { pub(crate) fn last_event() -> Event { System::events().pop().expect("Event expected").event } -*/ diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index bd9c95b5fe..107a8096b5 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -14,7 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Moonbeam. If not, see . -/* //! Unit testing use crate::mock::{ last_event, Migrations, Event as MetaEvent, ExtBuilder, Origin, System, Test, @@ -28,5 +27,4 @@ fn genesis_builder_works() { assert!(System::events().is_empty()); }) } -*/ From 9404fbed2c32ec8919ba5301153eaa557eebb7f2 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 29 Jun 2021 20:17:53 -0600 Subject: [PATCH 18/79] Baby's first tests --- pallets/migrations/src/mock.rs | 16 +++++++++++++++- pallets/migrations/src/tests.rs | 29 ++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index d4dcf92f96..db7097a9d1 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -19,7 +19,7 @@ use super::*; use crate as pallet_migrations; use frame_support::{ construct_runtime, parameter_types, - traits::{GenesisBuild}, + traits::{GenesisBuild, OnRuntimeUpgrade}, weights::Weight, }; use sp_core::H256; @@ -117,6 +117,20 @@ impl ExtBuilder { } } +pub(crate) fn events() -> Vec> { + System::events() + .into_iter() + .map(|r| r.event) + .filter_map(|e| { + if let Event::pallet_migrations(inner) = e { + Some(inner) + } else { + None + } + }) + .collect::>() +} + pub(crate) fn last_event() -> Event { System::events().pop().expect("Event expected").event } diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 107a8096b5..387ed8878c 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -16,7 +16,11 @@ //! Unit testing use crate::mock::{ - last_event, Migrations, Event as MetaEvent, ExtBuilder, Origin, System, Test, + last_event, events, Migrations, Event as MetaEvent, ExtBuilder, Origin, System, Test, +}; +use crate::Event; +use frame_support::{ + traits::{OnRuntimeUpgrade}, }; #[test] @@ -28,3 +32,26 @@ fn genesis_builder_works() { }) } +#[test] +fn on_runtime_upgrade_returns() { + ExtBuilder::default() + .build() + .execute_with(|| { + Migrations::on_runtime_upgrade(); + }) +} + +#[test] +fn on_runtime_upgrade_emits_events() { + ExtBuilder::default() + .build() + .execute_with(|| { + Migrations::on_runtime_upgrade(); + + let mut expected = vec![ + Event::RuntimeUpgradeStarted, + Event::RuntimeUpgradeCompleted, + ]; + assert_eq!(events(), expected); + }); +} From edee830e2ab0e8bd0c0316048ef3458bed80137f Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 29 Jun 2021 20:35:24 -0600 Subject: [PATCH 19/79] Fix events --- pallets/migrations/src/lib.rs | 7 +++++-- pallets/migrations/src/tests.rs | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 8c0f70f393..423544ba1c 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -79,10 +79,11 @@ pub mod pallet { } #[pallet::event] + #[pallet::generate_deposit(pub(crate) fn deposit_event)] pub enum Event { // e.g. runtime upgrade started, completed, etc. - RuntimeUpgradeStarted, - RuntimeUpgradeCompleted, + RuntimeUpgradeStarted(), + RuntimeUpgradeCompleted(), MigrationStarted(String), MigrationProgress(String, Perbill), MigrationCompleted(String), @@ -102,6 +103,7 @@ pub mod pallet { // start by flagging that we are not fully upgraded >::put(false); + Self::deposit_event(Event::RuntimeUpgradeStarted()); let mut weight: Weight = 0u64.into(); @@ -201,6 +203,7 @@ pub mod pallet { } if done { + >::deposit_event(Event::RuntimeUpgradeCompleted()); >::put(true); } diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 387ed8878c..e6e86514a3 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -49,8 +49,8 @@ fn on_runtime_upgrade_emits_events() { Migrations::on_runtime_upgrade(); let mut expected = vec![ - Event::RuntimeUpgradeStarted, - Event::RuntimeUpgradeCompleted, + Event::RuntimeUpgradeStarted(), + Event::RuntimeUpgradeCompleted(), ]; assert_eq!(events(), expected); }); From d13a471b21d5120feae4133c3fd84ac78e04bd79 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 30 Jun 2021 16:58:38 -0600 Subject: [PATCH 20/79] Use Vec instead of String --- pallets/migrations/src/lib.rs | 19 ++++++++++++------- pallets/migrations/src/mock.rs | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 423544ba1c..817ed12058 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -84,9 +84,9 @@ pub mod pallet { // e.g. runtime upgrade started, completed, etc. RuntimeUpgradeStarted(), RuntimeUpgradeCompleted(), - MigrationStarted(String), - MigrationProgress(String, Perbill), - MigrationCompleted(String), + MigrationStarted(Vec), + MigrationProgress(Vec, Perbill), + MigrationCompleted(Vec), } #[pallet::hooks] @@ -121,17 +121,18 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn migration_state)] /// MigrationState tracks the progress of a migration. + /// Maps name (Vec) -> migration progress (Perbill) type MigrationState = StorageMap< _, Twox64Concat, - String, + Vec, Perbill, OptionQuery, // TODO: what is this...? >; #[pallet::genesis_config] pub struct GenesisConfig { - pub completed_migrations: Vec, + pub completed_migrations: Vec>, pub dummy: PhantomData // TODO: } @@ -168,11 +169,15 @@ pub mod pallet { let migration_name = migration.friendly_name(); log::trace!("evaluating migration {}", migration_name); - let migration_state = >::get(migration_name) + let migration_state = >::get(migration_name.as_bytes()) .unwrap_or(Perbill::zero()); if migration_state < Perbill::one() { + // TODO: we don't currently have a reliable way to know "started" + // TODO: multiple calls to as_bytes() or to_vec() may be expensive + >::deposit_event(Event::MigrationStarted(migration_name.as_bytes().to_vec())); + let available_for_step = available_weight - weight; log::trace!("stepping migration {}, prev: {:?}, avail weight: {}", migration_name, migration_state, available_for_step); @@ -196,7 +201,7 @@ pub mod pallet { } if migration_state != updated_progress { - >::insert(migration_name, updated_progress); + >::insert(migration_name.as_bytes(), updated_progress); } } diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index db7097a9d1..0fba9d159f 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -86,7 +86,7 @@ impl Config for Test { /// Externality builder for pallet migration's mock runtime pub(crate) struct ExtBuilder { - completed_migrations: Vec, + completed_migrations: Vec>, } impl Default for ExtBuilder { From 986433e44680d8e6515c15fcd242e3f41f4afa92 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 1 Jul 2021 06:05:19 -0600 Subject: [PATCH 21/79] Make MigrationsList part of pallet config; plumb through Moonbase runtime --- node/service/src/chain_spec/moonbase.rs | 1 + pallets/migrations/Cargo.toml | 2 +- pallets/migrations/src/lib.rs | 13 ++++------ pallets/migrations/src/mock.rs | 15 ++++++++++++ runtime/common/Cargo.toml | 13 +++++++++- runtime/common/src/lib.rs | 1 + .../common}/src/migrations.rs | 24 +++++++++++++++++-- runtime/moonbase/Cargo.toml | 2 ++ runtime/moonbase/src/lib.rs | 7 ++++++ 9 files changed, 65 insertions(+), 13 deletions(-) rename {pallets/migrations => runtime/common}/src/migrations.rs (73%) diff --git a/node/service/src/chain_spec/moonbase.rs b/node/service/src/chain_spec/moonbase.rs index 8fced8c49c..53d71b004b 100644 --- a/node/service/src/chain_spec/moonbase.rs +++ b/node/service/src/chain_spec/moonbase.rs @@ -241,6 +241,7 @@ pub fn testnet_genesis( .collect(), }, pallet_treasury: Default::default(), + pallet_migrations: Default::default(), } } diff --git a/pallets/migrations/Cargo.toml b/pallets/migrations/Cargo.toml index 2b27bad885..fc926eef4f 100644 --- a/pallets/migrations/Cargo.toml +++ b/pallets/migrations/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "migrations" +name = "pallet-migrations" version = "0.1.0" authors = ["PureStake"] edition = "2018" diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 817ed12058..c92620d3ef 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -27,7 +27,6 @@ mod tests; use frame_support::{pallet, weights::Weight}; use sp_runtime::Perbill; -pub mod migrations; pub use pallet::*; @@ -52,13 +51,6 @@ pub trait Migration { fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight); } -/// Our list of migrations. Any ordering considerations can be specified here (?). -const MIGRATIONS: [&dyn Migration; 3] = [ - &migrations::MM_001_AuthorMappingAddDeposit {}, - &migrations::MM_002_StakingFixTotalBalance {}, - &migrations::MM_003_StakingTransitionBoundedSet {}, -]; - #[pallet] pub mod pallet { use super::*; @@ -76,6 +68,8 @@ pub mod pallet { pub trait Config: frame_system::Config { /// Overarching event type type Event: From> + IsType<::Event>; + /// The list of migrations that will be performed + type MigrationsList: Get>>; } #[pallet::event] @@ -163,7 +157,7 @@ pub mod pallet { let mut weight: Weight = 0u64.into(); let mut done: bool = true; - for migration in &MIGRATIONS { + for migration in &T::MigrationsList::get() { // let migration_name = migration.friendly_name(); let migration_name = migration.friendly_name(); @@ -183,6 +177,7 @@ pub mod pallet { migration_name, migration_state, available_for_step); // perform a step of this migration + >::deposit_event(Event::MigrationStarted(migration_name.into())); let (updated_progress, consumed_weight) = migration.step(migration_state, available_for_step); diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 0fba9d159f..3f87288d83 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -17,7 +17,9 @@ //! A minimal runtime including the migrations pallet use super::*; use crate as pallet_migrations; +use crate::migrations; use frame_support::{ + pallet_prelude::*, construct_runtime, parameter_types, traits::{GenesisBuild, OnRuntimeUpgrade}, weights::Weight, @@ -80,8 +82,21 @@ impl frame_system::Config for Test { type SS58Prefix = SS58Prefix; type OnSetCode = (); } + +pub struct MockMigrations; +impl Get>> for MockMigrations { + fn get() -> Vec> { + vec![ + Box::new(migrations::MM_001_AuthorMappingAddDeposit), + Box::new(migrations::MM_002_StakingFixTotalBalance), + Box::new(migrations::MM_003_StakingTransitionBoundedSet), + ] + } +} + impl Config for Test { type Event = Event; + type MigrationsList = MockMigrations; } /// Externality builder for pallet migration's mock runtime diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 7333a3bf37..82915bc4d8 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -7,5 +7,16 @@ version = '0.8.0-dev' authors = ["PureStake"] edition = '2018' +[dependencies] +pallet-migrations = { path = "../../pallets/migrations", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.4" } + [features] -std = [] \ No newline at end of file +std = [ + "pallet-migrations/std", + "sp-runtime/std", + "sp-std/std", + "frame-support/std", +] diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 3ae7fa674b..391f508452 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -17,3 +17,4 @@ #![cfg_attr(not(feature = "std"), no_std)] mod apis; +pub mod migrations; diff --git a/pallets/migrations/src/migrations.rs b/runtime/common/src/migrations.rs similarity index 73% rename from pallets/migrations/src/migrations.rs rename to runtime/common/src/migrations.rs index 07dc13f208..89a94eb5b0 100644 --- a/pallets/migrations/src/migrations.rs +++ b/runtime/common/src/migrations.rs @@ -16,10 +16,16 @@ //! # Migrations -use crate::*; +use frame_support::{ + weights::Weight, + pallet_prelude::Get, +}; +use pallet_migrations::Migration; +use sp_runtime::Perbill; +use sp_std::prelude::*; /// This module acts as a registry where each migration is defined. Each migration should implement -/// the "Migration" trait declared in this crate. +/// the "Migration" trait declared in the pallet-migrations crate. pub struct MM_001_AuthorMappingAddDeposit; impl Migration for MM_001_AuthorMappingAddDeposit { @@ -52,3 +58,17 @@ impl Migration for MM_003_StakingTransitionBoundedSet { (Perbill::one(), 0u64.into()) } } + +pub struct CommonMigrations; +impl Get>> for CommonMigrations { + fn get() -> Vec> { + // TODO: this is a lot of allocation to do upon every get() call. this *should* be avoided + // except when pallet_migrations undergoes a runtime upgrade -- but TODO: review + vec![ + Box::new(MM_001_AuthorMappingAddDeposit), + // Box::new(migrations::MM_002_StakingFixTotalBalance), + // Box::new(migrations::MM_003_StakingTransitionBoundedSet), + ] + } +} + diff --git a/runtime/moonbase/Cargo.toml b/runtime/moonbase/Cargo.toml index ce4ec44c11..c1c6c2a52d 100644 --- a/runtime/moonbase/Cargo.toml +++ b/runtime/moonbase/Cargo.toml @@ -23,6 +23,7 @@ pallet-ethereum-chain-id = { path = "../../pallets/ethereum-chain-id", default-f parachain-staking = { path = "../../pallets/parachain-staking", default-features = false } parachain-staking-precompiles = { path = "../../precompiles/parachain-staking", default-features = false } pallet-author-slot-filter = { git = "https://github.com/purestake/cumulus", branch = "nimbus-polkadot-v0.9.4", default-features = false } +pallet-migrations = { path = "../../pallets/migrations", default-features = false } nimbus-primitives = { git = "https://github.com/purestake/cumulus", branch = "nimbus-polkadot-v0.9.4", default-features = false } pallet-author-mapping = { path = "../../pallets/author-mapping", default-features = false } evm = { version="0.27.0", default-features=false, features=["with-codec"] } @@ -144,6 +145,7 @@ std = [ "parachain-staking/std", "parachain-staking-precompiles/std", "pallet-author-slot-filter/std", + "pallet-migrations/std", "pallet-crowdloan-rewards/std", "frame-benchmarking/std", "pallet-society/std", diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index a53f1a7376..7011bc954a 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -53,6 +53,7 @@ use pallet_evm::{ }; use pallet_transaction_payment::CurrencyAdapter; pub use parachain_staking::{InflationInfo, Range}; +use pallet_migrations::*; use parity_scale_codec::{Decode, Encode}; use sp_api::impl_runtime_apis; use sp_core::{u32_trait::*, OpaqueMetadata, H160, H256, U256}; @@ -708,6 +709,11 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = AnnouncementDepositFactor; } +impl Config for Runtime { + type Event = Event; + type MigrationsList = runtime_common::migrations::CommonMigrations; +} + construct_runtime! { pub enum Runtime where Block = Block, @@ -739,6 +745,7 @@ construct_runtime! { CrowdloanRewards: pallet_crowdloan_rewards::{Pallet, Call, Config, Storage, Event}, AuthorMapping: pallet_author_mapping::{Pallet, Call, Config, Storage, Event}, Proxy: pallet_proxy::{Pallet, Call, Storage, Event}, + Migrations: pallet_migrations::{Pallet, Call, Storage, Config, Event}, } } From 92047ee1da4883dc2432a4e02121c421e6f6ea77 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 1 Jul 2021 06:15:13 -0600 Subject: [PATCH 22/79] Appease the compiler --- Cargo.lock | 35 +++++++++++++++++++------------- pallets/migrations/src/mock.rs | 12 ++--------- pallets/migrations/src/tests.rs | 4 ++-- runtime/common/src/migrations.rs | 3 +++ 4 files changed, 28 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e42ae9ebc1..250f039553 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4662,20 +4662,6 @@ dependencies = [ "thrift", ] -[[package]] -name = "migrations" -version = "0.1.0" -dependencies = [ - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - [[package]] name = "minicbor" version = "0.8.1" @@ -4822,6 +4808,7 @@ dependencies = [ "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", + "pallet-migrations", "pallet-proxy", "pallet-randomness-collective-flip", "pallet-scheduler", @@ -6274,6 +6261,20 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-migrations" +version = "0.1.0" +dependencies = [ + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-mmr" version = "3.0.0" @@ -9002,6 +9003,12 @@ dependencies = [ [[package]] name = "runtime-common" version = "0.8.0-dev" +dependencies = [ + "frame-support", + "pallet-migrations", + "sp-runtime", + "sp-std", +] [[package]] name = "rust-argon2" diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 3f87288d83..1a302da4c9 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -17,22 +17,20 @@ //! A minimal runtime including the migrations pallet use super::*; use crate as pallet_migrations; -use crate::migrations; use frame_support::{ pallet_prelude::*, construct_runtime, parameter_types, - traits::{GenesisBuild, OnRuntimeUpgrade}, + traits::GenesisBuild, weights::Weight, }; use sp_core::H256; use sp_runtime::{ testing::Header, traits::{BlakeTwo256, IdentityLookup}, - Perbill, Percent, + Perbill, }; pub type AccountId = u64; -pub type Balance = u128; pub type BlockNumber = u64; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; @@ -87,9 +85,6 @@ pub struct MockMigrations; impl Get>> for MockMigrations { fn get() -> Vec> { vec![ - Box::new(migrations::MM_001_AuthorMappingAddDeposit), - Box::new(migrations::MM_002_StakingFixTotalBalance), - Box::new(migrations::MM_003_StakingTransitionBoundedSet), ] } } @@ -146,6 +141,3 @@ pub(crate) fn events() -> Vec> { .collect::>() } -pub(crate) fn last_event() -> Event { - System::events().pop().expect("Event expected").event -} diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index e6e86514a3..e84e80caba 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -16,7 +16,7 @@ //! Unit testing use crate::mock::{ - last_event, events, Migrations, Event as MetaEvent, ExtBuilder, Origin, System, Test, + events, Migrations, ExtBuilder, System, }; use crate::Event; use frame_support::{ @@ -48,7 +48,7 @@ fn on_runtime_upgrade_emits_events() { .execute_with(|| { Migrations::on_runtime_upgrade(); - let mut expected = vec![ + let expected = vec![ Event::RuntimeUpgradeStarted(), Event::RuntimeUpgradeCompleted(), ]; diff --git a/runtime/common/src/migrations.rs b/runtime/common/src/migrations.rs index 89a94eb5b0..bb1079d400 100644 --- a/runtime/common/src/migrations.rs +++ b/runtime/common/src/migrations.rs @@ -27,6 +27,7 @@ use sp_std::prelude::*; /// This module acts as a registry where each migration is defined. Each migration should implement /// the "Migration" trait declared in the pallet-migrations crate. +#[allow(non_camel_case_types)] pub struct MM_001_AuthorMappingAddDeposit; impl Migration for MM_001_AuthorMappingAddDeposit { fn friendly_name(&self) -> &str { @@ -39,6 +40,7 @@ impl Migration for MM_001_AuthorMappingAddDeposit { } } +#[allow(non_camel_case_types)] pub struct MM_002_StakingFixTotalBalance; impl Migration for MM_002_StakingFixTotalBalance { fn friendly_name(&self) -> &str { @@ -49,6 +51,7 @@ impl Migration for MM_002_StakingFixTotalBalance { } } +#[allow(non_camel_case_types)] pub struct MM_003_StakingTransitionBoundedSet; // TODO: better name impl Migration for MM_003_StakingTransitionBoundedSet { fn friendly_name(&self) -> &str { From b885fc5d0e419ae45e118a673587b7d571c9fcdd Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 1 Jul 2021 06:21:26 -0600 Subject: [PATCH 23/79] Fix up CommonMigrations list --- runtime/common/src/migrations.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/common/src/migrations.rs b/runtime/common/src/migrations.rs index bb1079d400..caab568e07 100644 --- a/runtime/common/src/migrations.rs +++ b/runtime/common/src/migrations.rs @@ -52,10 +52,10 @@ impl Migration for MM_002_StakingFixTotalBalance { } #[allow(non_camel_case_types)] -pub struct MM_003_StakingTransitionBoundedSet; // TODO: better name -impl Migration for MM_003_StakingTransitionBoundedSet { +pub struct MM_003_StakingUnboundedCollatorNominations; +impl Migration for MM_003_StakingUnboundedCollatorNominations { fn friendly_name(&self) -> &str { - "StakingTransitionBoundedSet" + "StakingUnboundedCollatorNominations" } fn step(&self, _previous_progress: Perbill, _available_weight: Weight) -> (Perbill, Weight) { (Perbill::one(), 0u64.into()) @@ -69,8 +69,8 @@ impl Get>> for CommonMigrations { // except when pallet_migrations undergoes a runtime upgrade -- but TODO: review vec![ Box::new(MM_001_AuthorMappingAddDeposit), - // Box::new(migrations::MM_002_StakingFixTotalBalance), - // Box::new(migrations::MM_003_StakingTransitionBoundedSet), + Box::new(MM_002_StakingFixTotalBalance), + Box::new(MM_003_StakingUnboundedCollatorNominations), ] } } From aefb302a3d595479a0eafbdc2c928d011e854c4e Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 1 Jul 2021 06:36:55 -0600 Subject: [PATCH 24/79] Remove comment --- pallets/migrations/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index c92620d3ef..ad34b3ac61 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -121,7 +121,7 @@ pub mod pallet { Twox64Concat, Vec, Perbill, - OptionQuery, // TODO: what is this...? + OptionQuery, >; #[pallet::genesis_config] From f9f8a2a1239b15a359a90680c9f7b5a0cc9c6234 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 1 Jul 2021 07:21:48 -0600 Subject: [PATCH 25/79] Cargo fmt --- pallets/migrations/src/lib.rs | 49 ++++++++++++++++---------------- pallets/migrations/src/mock.rs | 10 ++----- pallets/migrations/src/tests.rs | 44 +++++++++++----------------- runtime/common/src/migrations.rs | 6 +--- runtime/moonbase/src/lib.rs | 2 +- 5 files changed, 45 insertions(+), 66 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index ad34b3ac61..1150eee1bc 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -17,7 +17,6 @@ //! # Migration Pallet #![allow(non_camel_case_types)] - #![cfg_attr(not(feature = "std"), no_std)] #[cfg(test)] @@ -37,8 +36,8 @@ pub trait Migration { /// Step through this migration, taking up to `available_weight` of execution time and providing /// a status on the progress as well as the consumed weight. This allows a migration to perform - /// its logic in small batches across as many blocks as needed. - /// + /// its logic in small batches across as many blocks as needed. + /// /// Implementations should perform as much migration work as possible and then leave their /// pallet in a valid state from which another 'step' of migration work can be performed. In no /// case should a step consume more than `available_weight`. @@ -85,11 +84,10 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { - /// on_runtime_upgrade is expected to be called exactly once after a runtime upgrade. /// We use this as a chance to flag that we are now in upgrade-mode and begin our /// migrations. - /// + /// /// In the event that a migration is expected to take more than one block, ongoing migration /// work could continue from block-to-block in this pallet's on_initialize function. fn on_runtime_upgrade() -> Weight { @@ -116,18 +114,12 @@ pub mod pallet { #[pallet::getter(fn migration_state)] /// MigrationState tracks the progress of a migration. /// Maps name (Vec) -> migration progress (Perbill) - type MigrationState = StorageMap< - _, - Twox64Concat, - Vec, - Perbill, - OptionQuery, - >; + type MigrationState = StorageMap<_, Twox64Concat, Vec, Perbill, OptionQuery>; #[pallet::genesis_config] pub struct GenesisConfig { pub completed_migrations: Vec>, - pub dummy: PhantomData // TODO: + pub dummy: PhantomData, // TODO: } #[cfg(feature = "std")] @@ -158,36 +150,44 @@ pub mod pallet { let mut done: bool = true; for migration in &T::MigrationsList::get() { - // let migration_name = migration.friendly_name(); let migration_name = migration.friendly_name(); log::trace!("evaluating migration {}", migration_name); - let migration_state = >::get(migration_name.as_bytes()) - .unwrap_or(Perbill::zero()); + let migration_state = + >::get(migration_name.as_bytes()).unwrap_or(Perbill::zero()); if migration_state < Perbill::one() { - // TODO: we don't currently have a reliable way to know "started" // TODO: multiple calls to as_bytes() or to_vec() may be expensive - >::deposit_event(Event::MigrationStarted(migration_name.as_bytes().to_vec())); + >::deposit_event(Event::MigrationStarted( + migration_name.as_bytes().to_vec(), + )); let available_for_step = available_weight - weight; - log::trace!("stepping migration {}, prev: {:?}, avail weight: {}", - migration_name, migration_state, available_for_step); + log::trace!( + "stepping migration {}, prev: {:?}, avail weight: {}", + migration_name, + migration_state, + available_for_step + ); // perform a step of this migration >::deposit_event(Event::MigrationStarted(migration_name.into())); - let (updated_progress, consumed_weight) - = migration.step(migration_state, available_for_step); + let (updated_progress, consumed_weight) = + migration.step(migration_state, available_for_step); weight += consumed_weight; if weight > available_weight { // TODO: the intent here is to complain obnoxiously so that this is caught // during development. In production, this should probably be tolerated because // failing is catastrophic. - log::error!("Migration {} consumed more weight than it was given! ({} > {})", - migration_name, consumed_weight, available_for_step); + log::error!( + "Migration {} consumed more weight than it was given! ({} > {})", + migration_name, + consumed_weight, + available_for_step + ); } // make note of any unfinished migrations @@ -199,7 +199,6 @@ pub mod pallet { >::insert(migration_name.as_bytes(), updated_progress); } } - } if done { diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 1a302da4c9..845f7800e9 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -18,10 +18,7 @@ use super::*; use crate as pallet_migrations; use frame_support::{ - pallet_prelude::*, - construct_runtime, parameter_types, - traits::GenesisBuild, - weights::Weight, + construct_runtime, pallet_prelude::*, parameter_types, traits::GenesisBuild, weights::Weight, }; use sp_core::H256; use sp_runtime::{ @@ -84,8 +81,7 @@ impl frame_system::Config for Test { pub struct MockMigrations; impl Get>> for MockMigrations { fn get() -> Vec> { - vec![ - ] + vec![] } } @@ -108,7 +104,6 @@ impl Default for ExtBuilder { } impl ExtBuilder { - pub(crate) fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::default() .build_storage::() @@ -140,4 +135,3 @@ pub(crate) fn events() -> Vec> { }) .collect::>() } - diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index e84e80caba..9bff3fa8e8 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -15,43 +15,33 @@ // along with Moonbeam. If not, see . //! Unit testing -use crate::mock::{ - events, Migrations, ExtBuilder, System, -}; +use crate::mock::{events, ExtBuilder, Migrations, System}; use crate::Event; -use frame_support::{ - traits::{OnRuntimeUpgrade}, -}; +use frame_support::traits::OnRuntimeUpgrade; #[test] fn genesis_builder_works() { - ExtBuilder::default() - .build() - .execute_with(|| { - assert!(System::events().is_empty()); - }) + ExtBuilder::default().build().execute_with(|| { + assert!(System::events().is_empty()); + }) } #[test] fn on_runtime_upgrade_returns() { - ExtBuilder::default() - .build() - .execute_with(|| { - Migrations::on_runtime_upgrade(); - }) + ExtBuilder::default().build().execute_with(|| { + Migrations::on_runtime_upgrade(); + }) } #[test] fn on_runtime_upgrade_emits_events() { - ExtBuilder::default() - .build() - .execute_with(|| { - Migrations::on_runtime_upgrade(); - - let expected = vec![ - Event::RuntimeUpgradeStarted(), - Event::RuntimeUpgradeCompleted(), - ]; - assert_eq!(events(), expected); - }); + ExtBuilder::default().build().execute_with(|| { + Migrations::on_runtime_upgrade(); + + let expected = vec![ + Event::RuntimeUpgradeStarted(), + Event::RuntimeUpgradeCompleted(), + ]; + assert_eq!(events(), expected); + }); } diff --git a/runtime/common/src/migrations.rs b/runtime/common/src/migrations.rs index caab568e07..abbc87a2ed 100644 --- a/runtime/common/src/migrations.rs +++ b/runtime/common/src/migrations.rs @@ -16,10 +16,7 @@ //! # Migrations -use frame_support::{ - weights::Weight, - pallet_prelude::Get, -}; +use frame_support::{pallet_prelude::Get, weights::Weight}; use pallet_migrations::Migration; use sp_runtime::Perbill; use sp_std::prelude::*; @@ -74,4 +71,3 @@ impl Get>> for CommonMigrations { ] } } - diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index 7011bc954a..5b2a64e5ef 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -51,9 +51,9 @@ use pallet_evm::{ Account as EVMAccount, EnsureAddressNever, EnsureAddressRoot, FeeCalculator, IdentityAddressMapping, Runner, }; +use pallet_migrations::*; use pallet_transaction_payment::CurrencyAdapter; pub use parachain_staking::{InflationInfo, Range}; -use pallet_migrations::*; use parity_scale_codec::{Decode, Encode}; use sp_api::impl_runtime_apis; use sp_core::{u32_trait::*, OpaqueMetadata, H160, H256, U256}; From bc2e5386977bdc4c55ca58ed849c35cec8f16549 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 1 Jul 2021 12:41:53 -0600 Subject: [PATCH 26/79] Per-test MigrationsList --- Cargo.lock | 29 +++++++++++++------------- pallets/migrations/Cargo.toml | 1 + pallets/migrations/src/mock.rs | 37 ++++++++++++++++++++++++++++++++- pallets/migrations/src/tests.rs | 31 +++++++++++++++++++++++++-- 4 files changed, 81 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 250f039553..38965c9aed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -245,7 +245,7 @@ dependencies = [ "concurrent-queue", "fastrand", "futures-lite", - "once_cell 1.7.2", + "once_cell 1.8.0", "vec-arena", ] @@ -262,7 +262,7 @@ dependencies = [ "blocking", "futures-lite", "num_cpus", - "once_cell 1.7.2", + "once_cell 1.8.0", ] [[package]] @@ -277,7 +277,7 @@ dependencies = [ "libc", "log", "nb-connect", - "once_cell 1.7.2", + "once_cell 1.8.0", "parking", "polling", "vec-arena", @@ -314,7 +314,7 @@ dependencies = [ "cfg-if 1.0.0", "event-listener", "futures-lite", - "once_cell 1.7.2", + "once_cell 1.8.0", "signal-hook", "winapi 0.3.9", ] @@ -341,7 +341,7 @@ dependencies = [ "log", "memchr", "num_cpus", - "once_cell 1.7.2", + "once_cell 1.8.0", "pin-project-lite 0.2.6", "pin-utils", "slab", @@ -729,7 +729,7 @@ dependencies = [ "atomic-waker", "fastrand", "futures-lite", - "once_cell 1.7.2", + "once_cell 1.8.0", ] [[package]] @@ -2012,7 +2012,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab01c2450bed354679e78bedbff1484e02910ef1be96755086a36cadd1247efa" dependencies = [ "log", - "once_cell 1.7.2", + "once_cell 1.8.0", "serde", "serde_json", ] @@ -2539,7 +2539,7 @@ dependencies = [ "impl-trait-for-tuples 0.2.1", "log", "max-encoded-len", - "once_cell 1.7.2", + "once_cell 1.8.0", "parity-scale-codec", "paste 1.0.5", "serde", @@ -5730,9 +5730,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" dependencies = [ "parking_lot 0.11.1", ] @@ -6268,6 +6268,7 @@ dependencies = [ "frame-support", "frame-system", "log", + "once_cell 1.8.0", "parity-scale-codec", "sp-core", "sp-io", @@ -8874,7 +8875,7 @@ checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", "libc", - "once_cell 1.7.2", + "once_cell 1.8.0", "spin", "untrusted", "web-sys", @@ -10060,7 +10061,7 @@ dependencies = [ "erased-serde", "lazy_static", "log", - "once_cell 1.7.2", + "once_cell 1.8.0", "parking_lot 0.11.1", "regex", "rustc-hash", @@ -11715,7 +11716,7 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" dependencies = [ - "once_cell 1.7.2", + "once_cell 1.8.0", ] [[package]] @@ -11774,7 +11775,7 @@ checksum = "d9e44c4759bae7f1032e286a7ef990bd9ed23fe831b7eeba0beb97484c2e59b8" dependencies = [ "anyhow", "hmac 0.8.1", - "once_cell 1.7.2", + "once_cell 1.8.0", "pbkdf2 0.4.0", "rand 0.7.3", "rustc-hash", diff --git a/pallets/migrations/Cargo.toml b/pallets/migrations/Cargo.toml index fc926eef4f..d4f1a6e679 100644 --- a/pallets/migrations/Cargo.toml +++ b/pallets/migrations/Cargo.toml @@ -16,6 +16,7 @@ parity-scale-codec = { version = "2.0.0", default-features = false } [dev-dependencies] sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } +once_cell = "1.8.0" [features] default = ["std"] diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 845f7800e9..72c4bef415 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -17,6 +17,8 @@ //! A minimal runtime including the migrations pallet use super::*; use crate as pallet_migrations; +use std::sync::{Arc, Mutex}; +use once_cell::sync::Lazy; use frame_support::{ construct_runtime, pallet_prelude::*, parameter_types, traits::GenesisBuild, weights::Weight, }; @@ -78,10 +80,43 @@ impl frame_system::Config for Test { type OnSetCode = (); } +type MigrationStepFn = fn (Perbill, Weight) -> (Perbill, Weight); + +#[derive(Clone)] +pub struct MockMigration { + pub name: String, + pub callback: MigrationStepFn, +} + +impl Migration for MockMigration { + fn friendly_name(&self) -> &str { + &self.name[..] + } + fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight) { + let f = self.callback; + f(previous_progress, available_weight) + } +} + +pub static MOCK_MIGRATIONS_LIST: Lazy>> = Lazy::new(|| { + Mutex::new(vec![]) +}); +pub fn replace_mock_migrations_list(new_vec: &mut Vec) { + let mut list = MOCK_MIGRATIONS_LIST.lock().unwrap(); + list.clear(); + list.append(new_vec); +} + pub struct MockMigrations; impl Get>> for MockMigrations { fn get() -> Vec> { - vec![] + + let mut migrations_list: Vec> = Vec::new(); + for mock in &*MOCK_MIGRATIONS_LIST.lock().unwrap() { + migrations_list.push(Box::new(mock.clone())); + } + + migrations_list } } diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 9bff3fa8e8..740070aad2 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -15,9 +15,16 @@ // along with Moonbeam. If not, see . //! Unit testing -use crate::mock::{events, ExtBuilder, Migrations, System}; +use crate::mock::{ + events, ExtBuilder, Migrations, System, MockMigration, replace_mock_migrations_list +}; use crate::Event; -use frame_support::traits::OnRuntimeUpgrade; +use std::sync::{Arc, Mutex}; +use frame_support::{ + traits::OnRuntimeUpgrade, + weights::Weight, +}; +use sp_runtime::Perbill; #[test] fn genesis_builder_works() { @@ -26,6 +33,26 @@ fn genesis_builder_works() { }) } +#[test] +fn mock_migrations_static_hack_works() { + let mut flip_me: bool = false; + replace_mock_migrations_list(&mut vec![ + MockMigration { + name: "test".into(), + callback: |_: Perbill, _: Weight| -> (Perbill, Weight) { + flip_me = true; + (Perbill::one(), 0u64.into()) + } + }, + ]); + + ExtBuilder::default().build().execute_with(|| { + Migrations::on_runtime_upgrade(); + }); + + assert_eq!(flip_me, true, "mock migration callback should work with closure"); +} + #[test] fn on_runtime_upgrade_returns() { ExtBuilder::default().build().execute_with(|| { From 19a99123633e17d2bc917cca24224326e2193370 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Fri, 2 Jul 2021 19:37:33 -0600 Subject: [PATCH 27/79] Attempt at a glue --- pallets/migrations/src/mock.rs | 63 ++++++++++++++++++++++++++++++++- pallets/migrations/src/tests.rs | 4 ++- 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 72c4bef415..faa2a0d10f 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -80,8 +80,68 @@ impl frame_system::Config for Test { type OnSetCode = (); } -type MigrationStepFn = fn (Perbill, Weight) -> (Perbill, Weight); +type MigrationNameFn = dyn FnMut() -> &'static str + Send + Sync; +type MigrationStepFn = dyn FnMut(Perbill, Weight) -> (Perbill, Weight) + Send + Sync; +#[derive(Default)] +pub struct MockMigrationManager { + name_fn_callbacks: Vec>>, + step_fn_callbacks: Vec>>, +} + +impl MockMigrationManager { + fn registerCallback(&mut self, name_fn: &MigrationNameFn, step_fn: &MigrationStepFn) { + // self.name_fn_callbacks.push(Arc::new(name_fn)); + // self.step_fn_callbacks.push(Arc::new(step_fn)); + } + + fn invoke_name_fn(&mut self, index: usize) -> &'static str { + // MigrationNameFn returns a String, we need a &str + let arc = self.name_fn_callbacks[index].clone(); + let mut f = arc.lock().unwrap(); + f() + } + + fn invoke_step_fn(&mut self, index: usize, previous_progress: Perbill, available_weight: Weight) + -> (Perbill, Weight) + { + let arc = self.step_fn_callbacks[index].clone(); + let mut f = arc.lock().unwrap(); + f(previous_progress, available_weight) + } + + fn generate_migrations_list(&self) -> Vec> { + panic!("FIXME"); + } +} + +#[derive(Clone)] +pub struct MockMigration { + pub index: usize, +} + +impl Migration for MockMigration { + fn friendly_name(&self) -> &str { + MOCK_MIGRATIONS_LIST.lock().unwrap().invoke_name_fn(self.index) + } + fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight) { + MOCK_MIGRATIONS_LIST.lock().unwrap() + .invoke_step_fn(self.index, previous_progress, available_weight) + } +} + +pub static MOCK_MIGRATIONS_LIST: Lazy> = Lazy::new(|| { + Default::default() +}); + +pub struct MockMigrations; +impl Get>> for MockMigrations { + fn get() -> Vec> { + MOCK_MIGRATIONS_LIST.lock().unwrap().generate_migrations_list() + } +} + +/* #[derive(Clone)] pub struct MockMigration { pub name: String, @@ -119,6 +179,7 @@ impl Get>> for MockMigrations { migrations_list } } +*/ impl Config for Test { type Event = Event; diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 740070aad2..cc4b396153 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -16,7 +16,7 @@ //! Unit testing use crate::mock::{ - events, ExtBuilder, Migrations, System, MockMigration, replace_mock_migrations_list + events, ExtBuilder, Migrations, System, MockMigration }; use crate::Event; use std::sync::{Arc, Mutex}; @@ -33,6 +33,7 @@ fn genesis_builder_works() { }) } +/* #[test] fn mock_migrations_static_hack_works() { let mut flip_me: bool = false; @@ -52,6 +53,7 @@ fn mock_migrations_static_hack_works() { assert_eq!(flip_me, true, "mock migration callback should work with closure"); } +*/ #[test] fn on_runtime_upgrade_returns() { From 1f70d01867d7ccbb3de48462f3488dc6b92a430c Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Fri, 2 Jul 2021 19:41:40 -0600 Subject: [PATCH 28/79] Fix FIXME --- pallets/migrations/src/mock.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index faa2a0d10f..8b1fc19e8d 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -111,7 +111,11 @@ impl MockMigrationManager { } fn generate_migrations_list(&self) -> Vec> { - panic!("FIXME"); + let mut migrations: Vec> = Vec::new(); + for i in 0..self.name_fn_callbacks.len() { + migrations.push(Box::new(MockMigration{index: i})); + } + migrations } } From 6e581f3ff0a08dc77cdfeae866770cc67fe22266 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Fri, 2 Jul 2021 20:07:08 -0600 Subject: [PATCH 29/79] Getting close --- pallets/migrations/src/mock.rs | 52 ++++++--------------------------- pallets/migrations/src/tests.rs | 30 +++++++++++-------- 2 files changed, 27 insertions(+), 55 deletions(-) diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 8b1fc19e8d..bc0c30d4b9 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -80,8 +80,10 @@ impl frame_system::Config for Test { type OnSetCode = (); } -type MigrationNameFn = dyn FnMut() -> &'static str + Send + Sync; -type MigrationStepFn = dyn FnMut(Perbill, Weight) -> (Perbill, Weight) + Send + Sync; +pub trait MigrationNameTrait: FnMut() -> &'static str + Send + Sync {} +pub trait MigrationStepTrait: FnMut(Perbill, Weight) -> (Perbill, Weight) + Send + Sync {} +type MigrationNameFn = dyn MigrationNameTrait; +type MigrationStepFn = dyn MigrationStepTrait; #[derive(Default)] pub struct MockMigrationManager { @@ -90,7 +92,11 @@ pub struct MockMigrationManager { } impl MockMigrationManager { - fn registerCallback(&mut self, name_fn: &MigrationNameFn, step_fn: &MigrationStepFn) { + pub fn registerCallback(&mut self, name_fn: &FN, step_fn: &FS) + where + FN: FnMut() -> &'static str + Send + Sync, + FS: FnMut(Perbill, Weight) -> (Perbill, Weight) + Send + Sync, + { // self.name_fn_callbacks.push(Arc::new(name_fn)); // self.step_fn_callbacks.push(Arc::new(step_fn)); } @@ -145,46 +151,6 @@ impl Get>> for MockMigrations { } } -/* -#[derive(Clone)] -pub struct MockMigration { - pub name: String, - pub callback: MigrationStepFn, -} - -impl Migration for MockMigration { - fn friendly_name(&self) -> &str { - &self.name[..] - } - fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight) { - let f = self.callback; - f(previous_progress, available_weight) - } -} - -pub static MOCK_MIGRATIONS_LIST: Lazy>> = Lazy::new(|| { - Mutex::new(vec![]) -}); -pub fn replace_mock_migrations_list(new_vec: &mut Vec) { - let mut list = MOCK_MIGRATIONS_LIST.lock().unwrap(); - list.clear(); - list.append(new_vec); -} - -pub struct MockMigrations; -impl Get>> for MockMigrations { - fn get() -> Vec> { - - let mut migrations_list: Vec> = Vec::new(); - for mock in &*MOCK_MIGRATIONS_LIST.lock().unwrap() { - migrations_list.push(Box::new(mock.clone())); - } - - migrations_list - } -} -*/ - impl Config for Test { type Event = Event; type MigrationsList = MockMigrations; diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index cc4b396153..4b1ef5a91f 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -33,27 +33,33 @@ fn genesis_builder_works() { }) } -/* #[test] fn mock_migrations_static_hack_works() { - let mut flip_me: bool = false; - replace_mock_migrations_list(&mut vec![ - MockMigration { - name: "test".into(), - callback: |_: Perbill, _: Weight| -> (Perbill, Weight) { - flip_me = true; - (Perbill::one(), 0u64.into()) + let mut name_fn_called: bool = false; + let mut step_fn_called: bool = false; + + // works: + // let name_fn: &(FnMut() -> &'static str + Send + Sync) = &|| { "hi" }; + + crate::mock::MOCK_MIGRATIONS_LIST.lock().unwrap() + .registerCallback( + &|| { + name_fn_called = true; + "hello, world" + }, + &|_, _| -> (Perbill, Weight) { + step_fn_called = true; + (Perbill::zero(), 0u64.into()) } - }, - ]); + ); ExtBuilder::default().build().execute_with(|| { Migrations::on_runtime_upgrade(); }); - assert_eq!(flip_me, true, "mock migration callback should work with closure"); + assert_eq!(name_fn_called, true, "mock migration should call friendly_name()"); + assert_eq!(step_fn_called, true, "mock migration should call step()"); } -*/ #[test] fn on_runtime_upgrade_returns() { From 2ea1e3b7ecdda42931e41c3b4b272ffddf3786f3 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Fri, 2 Jul 2021 21:52:48 -0600 Subject: [PATCH 30/79] Sort out lifetimes --- pallets/migrations/src/mock.rs | 24 +++++++++++------------- pallets/migrations/src/tests.rs | 11 +++++++---- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index bc0c30d4b9..0b8299dd9a 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -80,25 +80,23 @@ impl frame_system::Config for Test { type OnSetCode = (); } -pub trait MigrationNameTrait: FnMut() -> &'static str + Send + Sync {} -pub trait MigrationStepTrait: FnMut(Perbill, Weight) -> (Perbill, Weight) + Send + Sync {} -type MigrationNameFn = dyn MigrationNameTrait; -type MigrationStepFn = dyn MigrationStepTrait; +type MigrationNameFn<'test> = dyn FnMut() -> &'static str + Send + Sync + 'test; +type MigrationStepFn<'test> = dyn FnMut(Perbill, Weight) -> (Perbill, Weight) + Send + Sync + 'test; #[derive(Default)] -pub struct MockMigrationManager { - name_fn_callbacks: Vec>>, - step_fn_callbacks: Vec>>, +pub struct MockMigrationManager<'test> { + name_fn_callbacks: Vec>>>, + step_fn_callbacks: Vec>>>, } -impl MockMigrationManager { - pub fn registerCallback(&mut self, name_fn: &FN, step_fn: &FS) +impl<'test> MockMigrationManager<'test> { + pub fn registerCallback(&'test mut self, name_fn: &'test mut FN, step_fn: &'test mut FS) where - FN: FnMut() -> &'static str + Send + Sync, - FS: FnMut(Perbill, Weight) -> (Perbill, Weight) + Send + Sync, + FN: 'test + FnMut() -> &'static str + Send + Sync, + FS: 'test + FnMut(Perbill, Weight) -> (Perbill, Weight) + Send + Sync, { - // self.name_fn_callbacks.push(Arc::new(name_fn)); - // self.step_fn_callbacks.push(Arc::new(step_fn)); + self.name_fn_callbacks.push(Arc::new(Mutex::new(name_fn))); + self.step_fn_callbacks.push(Arc::new(Mutex::new(step_fn))); } fn invoke_name_fn(&mut self, index: usize) -> &'static str { diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 4b1ef5a91f..a53bad9aea 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -34,20 +34,23 @@ fn genesis_builder_works() { } #[test] -fn mock_migrations_static_hack_works() { +fn mock_migrations_static_hack_works<'test>() { let mut name_fn_called: bool = false; let mut step_fn_called: bool = false; + let mut mgr: crate::mock::MockMigrationManager = Default::default(); + // works: // let name_fn: &(FnMut() -> &'static str + Send + Sync) = &|| { "hi" }; - crate::mock::MOCK_MIGRATIONS_LIST.lock().unwrap() + // crate::mock::MOCK_MIGRATIONS_LIST.lock().unwrap() + mgr .registerCallback( - &|| { + &mut|| { name_fn_called = true; "hello, world" }, - &|_, _| -> (Perbill, Weight) { + &mut|_, _| -> (Perbill, Weight) { step_fn_called = true; (Perbill::zero(), 0u64.into()) } From 4afc532fcc4573bcf49190102e739b9ea4be779e Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 6 Jul 2021 16:01:28 -0600 Subject: [PATCH 31/79] Simplify FnMut arguments/storage --- Cargo.lock | 1 + pallets/migrations/Cargo.toml | 1 + pallets/migrations/src/lib.rs | 4 +++ pallets/migrations/src/mock.rs | 51 ++++++++++++++++----------------- pallets/migrations/src/tests.rs | 28 +++++++++--------- 5 files changed, 46 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 38965c9aed..f2edb4b27f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6265,6 +6265,7 @@ dependencies = [ name = "pallet-migrations" version = "0.1.0" dependencies = [ + "environmental", "frame-support", "frame-system", "log", diff --git a/pallets/migrations/Cargo.toml b/pallets/migrations/Cargo.toml index d4f1a6e679..e01667624b 100644 --- a/pallets/migrations/Cargo.toml +++ b/pallets/migrations/Cargo.toml @@ -12,6 +12,7 @@ log = "0.4" sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } parity-scale-codec = { version = "2.0.0", default-features = false } +environmental = "1.1.0" [dev-dependencies] sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 1150eee1bc..1ab5ca6701 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -29,6 +29,10 @@ use sp_runtime::Perbill; pub use pallet::*; +// TODO: compile error if this is in mock.rs: +// "an `extern crate` loading macros must be at the crate root" +#[macro_use] extern crate environmental; + /// A Migration that must happen on-chain upon a runtime-upgrade pub trait Migration { /// A human-readable name for this migration. Also used as storage key. diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 0b8299dd9a..0dffdd2cd7 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -80,38 +80,35 @@ impl frame_system::Config for Test { type OnSetCode = (); } -type MigrationNameFn<'test> = dyn FnMut() -> &'static str + Send + Sync + 'test; -type MigrationStepFn<'test> = dyn FnMut(Perbill, Weight) -> (Perbill, Weight) + Send + Sync + 'test; +type MigrationNameFn = dyn FnMut() -> &'static str; +type MigrationStepFn = dyn FnMut(Perbill, Weight) -> (Perbill, Weight); #[derive(Default)] pub struct MockMigrationManager<'test> { - name_fn_callbacks: Vec>>>, - step_fn_callbacks: Vec>>>, + // name_fn_callbacks: Vec<&'test mut MigrationNameFn>, + // step_fn_callbacks: Vec<&'test mut MigrationStepFn>, + name_fn_callbacks: Vec &'static str>>, + step_fn_callbacks: Vec (Perbill, Weight)>>, } impl<'test> MockMigrationManager<'test> { - pub fn registerCallback(&'test mut self, name_fn: &'test mut FN, step_fn: &'test mut FS) + pub fn registerCallback(&mut self, name_fn: FN, step_fn: FS) where - FN: 'test + FnMut() -> &'static str + Send + Sync, - FS: 'test + FnMut(Perbill, Weight) -> (Perbill, Weight) + Send + Sync, + FN: 'test + FnMut() -> &'static str, + FS: 'test + FnMut(Perbill, Weight) -> (Perbill, Weight), { - self.name_fn_callbacks.push(Arc::new(Mutex::new(name_fn))); - self.step_fn_callbacks.push(Arc::new(Mutex::new(step_fn))); + self.name_fn_callbacks.push(Box::new(name_fn)); + self.step_fn_callbacks.push(Box::new(step_fn)); } - fn invoke_name_fn(&mut self, index: usize) -> &'static str { - // MigrationNameFn returns a String, we need a &str - let arc = self.name_fn_callbacks[index].clone(); - let mut f = arc.lock().unwrap(); - f() + pub(crate) fn invoke_name_fn(&mut self, index: usize) -> &'static str { + self.name_fn_callbacks[index]() } - fn invoke_step_fn(&mut self, index: usize, previous_progress: Perbill, available_weight: Weight) + pub(crate) fn invoke_step_fn(&mut self, index: usize, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight) { - let arc = self.step_fn_callbacks[index].clone(); - let mut f = arc.lock().unwrap(); - f(previous_progress, available_weight) + self.step_fn_callbacks[index](previous_progress, available_weight) } fn generate_migrations_list(&self) -> Vec> { @@ -122,6 +119,7 @@ impl<'test> MockMigrationManager<'test> { migrations } } +// environmental!(MOCK_MIGRATIONS_LIST: MockMigrationManager<'static>); #[derive(Clone)] pub struct MockMigration { @@ -130,22 +128,23 @@ pub struct MockMigration { impl Migration for MockMigration { fn friendly_name(&self) -> &str { - MOCK_MIGRATIONS_LIST.lock().unwrap().invoke_name_fn(self.index) + panic!("fixme"); + // MOCK_MIGRATIONS_LIST.lock().unwrap().invoke_name_fn(self.index) } fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight) { - MOCK_MIGRATIONS_LIST.lock().unwrap() - .invoke_step_fn(self.index, previous_progress, available_weight) + panic!("fixme"); + // MOCK_MIGRATIONS_LIST.lock().unwrap() + // .invoke_step_fn(self.index, previous_progress, available_weight) } } -pub static MOCK_MIGRATIONS_LIST: Lazy> = Lazy::new(|| { - Default::default() -}); - pub struct MockMigrations; impl Get>> for MockMigrations { fn get() -> Vec> { - MOCK_MIGRATIONS_LIST.lock().unwrap().generate_migrations_list() + let mut migrations: Vec> = Vec::new(); + // MOCK_MIGRATIONS_LIST::with(|m| { migrations = m.generate_migrations_list(); }); + panic!("fixme"); + migrations } } diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index a53bad9aea..005e3be2e0 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -34,31 +34,33 @@ fn genesis_builder_works() { } #[test] -fn mock_migrations_static_hack_works<'test>() { +fn mock_migrations_static_hack_works() { let mut name_fn_called: bool = false; let mut step_fn_called: bool = false; - let mut mgr: crate::mock::MockMigrationManager = Default::default(); + { + let mut mgr: crate::mock::MockMigrationManager = Default::default(); - // works: - // let name_fn: &(FnMut() -> &'static str + Send + Sync) = &|| { "hi" }; - - // crate::mock::MOCK_MIGRATIONS_LIST.lock().unwrap() - mgr - .registerCallback( - &mut|| { + mgr.registerCallback( + || { name_fn_called = true; "hello, world" }, - &mut|_, _| -> (Perbill, Weight) { + |_, _| -> (Perbill, Weight) { step_fn_called = true; (Perbill::zero(), 0u64.into()) } ); - ExtBuilder::default().build().execute_with(|| { - Migrations::on_runtime_upgrade(); - }); + mgr.invoke_name_fn(0); + mgr.invoke_step_fn(0, Perbill::zero(), 1u64.into()); + + /* + ExtBuilder::default().build().execute_with(|| { + Migrations::on_runtime_upgrade(); + }); + */ + } assert_eq!(name_fn_called, true, "mock migration should call friendly_name()"); assert_eq!(step_fn_called, true, "mock migration should call step()"); From 85ed484ff424eccfd3362ff8c32ec254a9369519 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 6 Jul 2021 16:09:33 -0600 Subject: [PATCH 32/79] Clean up, fix FIXMEs --- pallets/migrations/src/mock.rs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 0dffdd2cd7..ee75d28407 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -80,13 +80,8 @@ impl frame_system::Config for Test { type OnSetCode = (); } -type MigrationNameFn = dyn FnMut() -> &'static str; -type MigrationStepFn = dyn FnMut(Perbill, Weight) -> (Perbill, Weight); - #[derive(Default)] pub struct MockMigrationManager<'test> { - // name_fn_callbacks: Vec<&'test mut MigrationNameFn>, - // step_fn_callbacks: Vec<&'test mut MigrationStepFn>, name_fn_callbacks: Vec &'static str>>, step_fn_callbacks: Vec (Perbill, Weight)>>, } @@ -119,7 +114,7 @@ impl<'test> MockMigrationManager<'test> { migrations } } -// environmental!(MOCK_MIGRATIONS_LIST: MockMigrationManager<'static>); +environmental!(MOCK_MIGRATIONS_LIST: MockMigrationManager<'static>); #[derive(Clone)] pub struct MockMigration { @@ -128,13 +123,18 @@ pub struct MockMigration { impl Migration for MockMigration { fn friendly_name(&self) -> &str { - panic!("fixme"); - // MOCK_MIGRATIONS_LIST.lock().unwrap().invoke_name_fn(self.index) + let mut result: &str = ""; + MOCK_MIGRATIONS_LIST::with(|mgr: &mut MockMigrationManager| { + result = mgr.invoke_name_fn(self.index); + }); + result } fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight) { - panic!("fixme"); - // MOCK_MIGRATIONS_LIST.lock().unwrap() - // .invoke_step_fn(self.index, previous_progress, available_weight) + let mut result: (Perbill, Weight) = (Perbill::zero(), 0u64.into()); + MOCK_MIGRATIONS_LIST::with(|mgr: &mut MockMigrationManager| { + result = mgr.invoke_step_fn(self.index, previous_progress, available_weight); + }); + result } } @@ -142,8 +142,9 @@ pub struct MockMigrations; impl Get>> for MockMigrations { fn get() -> Vec> { let mut migrations: Vec> = Vec::new(); - // MOCK_MIGRATIONS_LIST::with(|m| { migrations = m.generate_migrations_list(); }); - panic!("fixme"); + MOCK_MIGRATIONS_LIST::with(|mgr: &mut MockMigrationManager| { + migrations = mgr.generate_migrations_list(); + }); migrations } } From e377cafd2c5a26e35d7dda965d9cfe39205a4d9b Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 6 Jul 2021 20:33:55 -0600 Subject: [PATCH 33/79] It works --- Cargo.lock | 1 - pallets/migrations/Cargo.toml | 1 - pallets/migrations/src/mock.rs | 18 ++++++++++++-- pallets/migrations/src/tests.rs | 42 ++++++++++++++++----------------- 4 files changed, 37 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f2edb4b27f..9707e4a396 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6269,7 +6269,6 @@ dependencies = [ "frame-support", "frame-system", "log", - "once_cell 1.8.0", "parity-scale-codec", "sp-core", "sp-io", diff --git a/pallets/migrations/Cargo.toml b/pallets/migrations/Cargo.toml index e01667624b..92792f2c8a 100644 --- a/pallets/migrations/Cargo.toml +++ b/pallets/migrations/Cargo.toml @@ -17,7 +17,6 @@ environmental = "1.1.0" [dev-dependencies] sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } -once_cell = "1.8.0" [features] default = ["std"] diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index ee75d28407..9d8c08eb91 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -17,8 +17,6 @@ //! A minimal runtime including the migrations pallet use super::*; use crate as pallet_migrations; -use std::sync::{Arc, Mutex}; -use once_cell::sync::Lazy; use frame_support::{ construct_runtime, pallet_prelude::*, parameter_types, traits::GenesisBuild, weights::Weight, }; @@ -116,6 +114,22 @@ impl<'test> MockMigrationManager<'test> { } environmental!(MOCK_MIGRATIONS_LIST: MockMigrationManager<'static>); +pub fn execute_with_mock_migrations(callback: &mut CB) +where + CB: FnMut(&mut MockMigrationManager) +{ + let mut original_mgr: MockMigrationManager = Default::default(); + MOCK_MIGRATIONS_LIST::using(&mut original_mgr, || { + MOCK_MIGRATIONS_LIST::with(|inner_mgr: &mut MockMigrationManager| { + callback(inner_mgr); + }); + + ExtBuilder::default().build().execute_with(|| { + Migrations::on_runtime_upgrade(); + }); + }); +} + #[derive(Clone)] pub struct MockMigration { pub index: usize, diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 005e3be2e0..37276b302d 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -16,7 +16,7 @@ //! Unit testing use crate::mock::{ - events, ExtBuilder, Migrations, System, MockMigration + events, ExtBuilder, Migrations, System, MockMigrationManager, }; use crate::Event; use std::sync::{Arc, Mutex}; @@ -35,35 +35,35 @@ fn genesis_builder_works() { #[test] fn mock_migrations_static_hack_works() { - let mut name_fn_called: bool = false; - let mut step_fn_called: bool = false; - { - let mut mgr: crate::mock::MockMigrationManager = Default::default(); + let name_fn_called = Arc::new(Mutex::new(false)); + let step_fn_called = Arc::new(Mutex::new(false)); + println!("Calling execute_with_mock_migrations..."); + crate::mock::execute_with_mock_migrations(&mut |mgr: &mut MockMigrationManager| { + println!("Inside execute_with_mock_migrations"); + let name_fn_called = Arc::clone(&name_fn_called); + let step_fn_called = Arc::clone(&step_fn_called); + + println!("Registering callbacks..."); mgr.registerCallback( - || { - name_fn_called = true; + move || { + println!("inside name_fn callback!"); + *name_fn_called.lock().unwrap() = true; "hello, world" }, - |_, _| -> (Perbill, Weight) { - step_fn_called = true; + move |_, _| -> (Perbill, Weight) { + println!("inside step_fn callback!"); + *step_fn_called.lock().unwrap() = true; (Perbill::zero(), 0u64.into()) } ); + println!("Done registering callbacks."); + }); + println!("Done with execute_with_mock_migrations"); - mgr.invoke_name_fn(0); - mgr.invoke_step_fn(0, Perbill::zero(), 1u64.into()); - - /* - ExtBuilder::default().build().execute_with(|| { - Migrations::on_runtime_upgrade(); - }); - */ - } - - assert_eq!(name_fn_called, true, "mock migration should call friendly_name()"); - assert_eq!(step_fn_called, true, "mock migration should call step()"); + assert_eq!(*name_fn_called.lock().unwrap(), true, "mock migration should call friendly_name()"); + assert_eq!(*step_fn_called.lock().unwrap(), true, "mock migration should call step()"); } #[test] From 95d6b956aa054cec2dccb8c2c5d76ce95d9ac22d Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 7 Jul 2021 10:56:56 -0600 Subject: [PATCH 34/79] Implement Migrations::on_initialize --- pallets/migrations/src/lib.rs | 17 ++++++++++++++ pallets/migrations/src/mock.rs | 18 +++++++++++++++ pallets/migrations/src/tests.rs | 39 ++++++++++++++++++++++++++------- 3 files changed, 66 insertions(+), 8 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 1ab5ca6701..2cacea7e8c 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -80,6 +80,7 @@ pub mod pallet { pub enum Event { // e.g. runtime upgrade started, completed, etc. RuntimeUpgradeStarted(), + RuntimeUpgradeStepped(), RuntimeUpgradeCompleted(), MigrationStarted(Vec), MigrationProgress(Vec, Perbill), @@ -107,6 +108,22 @@ pub mod pallet { weight.into() } + + /// on_initialize implementation. Calls process_runtime_upgrades() if we are still in the + /// middle of a runtime upgrade. + /// TODO: use on_idle or some other hook? + fn on_initialize(_: T::BlockNumber) -> Weight { + + // TODO: should account for the minimum one DB read + let mut weight: Weight = 0u64.into(); + + if ! >::get() { + Self::deposit_event(Event::RuntimeUpgradeStepped()); + weight += process_runtime_upgrades::(); + } + + weight + } } #[pallet::storage] diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 9d8c08eb91..c4aeb4aaaa 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -124,8 +124,26 @@ where callback(inner_mgr); }); + // mimic the calls that would occur from the time a runtime upgrade starts until the + // Migrations pallet indicates that all upgrades are complete + ExtBuilder::default().build().execute_with(|| { + let mut block_number = 1u64; Migrations::on_runtime_upgrade(); + + while ! Migrations::is_fully_upgraded() { + System::set_block_number(block_number); + System::on_initialize(System::block_number()); + Migrations::on_initialize(System::block_number()); + Migrations::on_finalize(System::block_number()); + System::on_finalize(System::block_number()); + + block_number += 1; + + if block_number > 99999 { + panic!("Infinite loop?"); + } + } }); }); } diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 37276b302d..623edeb0b2 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -39,28 +39,21 @@ fn mock_migrations_static_hack_works() { let name_fn_called = Arc::new(Mutex::new(false)); let step_fn_called = Arc::new(Mutex::new(false)); - println!("Calling execute_with_mock_migrations..."); crate::mock::execute_with_mock_migrations(&mut |mgr: &mut MockMigrationManager| { - println!("Inside execute_with_mock_migrations"); let name_fn_called = Arc::clone(&name_fn_called); let step_fn_called = Arc::clone(&step_fn_called); - println!("Registering callbacks..."); mgr.registerCallback( move || { - println!("inside name_fn callback!"); *name_fn_called.lock().unwrap() = true; "hello, world" }, move |_, _| -> (Perbill, Weight) { - println!("inside step_fn callback!"); *step_fn_called.lock().unwrap() = true; - (Perbill::zero(), 0u64.into()) + (Perbill::one(), 0u64.into()) } ); - println!("Done registering callbacks."); }); - println!("Done with execute_with_mock_migrations"); assert_eq!(*name_fn_called.lock().unwrap(), true, "mock migration should call friendly_name()"); assert_eq!(*step_fn_called.lock().unwrap(), true, "mock migration should call step()"); @@ -85,3 +78,33 @@ fn on_runtime_upgrade_emits_events() { assert_eq!(events(), expected); }); } + +#[test] +fn step_called_until_done() { + + let num_step_calls = Arc::new(Mutex::new(0usize)); + + println!("step_called_until_done()..."); + + crate::mock::execute_with_mock_migrations(&mut |mgr: &mut MockMigrationManager| { + let num_step_calls = Arc::clone(&num_step_calls); + + mgr.registerCallback( + move || { + "migration1" + }, + move |_, _| -> (Perbill, Weight) { + let mut num_step_calls = num_step_calls.lock().unwrap(); + println!("step fn called, num times previously: {}", num_step_calls); + *num_step_calls += 1; + if *num_step_calls == 10 { + (Perbill::one(), 0u64.into()) + } else { + (Perbill::zero(), 0u64.into()) + } + } + ); + }); + + assert_eq!(*num_step_calls.lock().unwrap(), 10, "migration step should be called until done"); +} From d5da28af59c1c9a05956ce6782849269fb00ce92 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 7 Jul 2021 11:13:08 -0600 Subject: [PATCH 35/79] Resolve compilation warnings, add comments about how mock glue works --- pallets/migrations/src/lib.rs | 3 +-- pallets/migrations/src/mock.rs | 22 +++++++++++++++++++++- pallets/migrations/src/tests.rs | 4 ++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 2cacea7e8c..cdbb0cb613 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -29,8 +29,7 @@ use sp_runtime::Perbill; pub use pallet::*; -// TODO: compile error if this is in mock.rs: -// "an `extern crate` loading macros must be at the crate root" +#[cfg(test)] #[macro_use] extern crate environmental; /// A Migration that must happen on-chain upon a runtime-upgrade diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index c4aeb4aaaa..68e009de55 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -78,6 +78,15 @@ impl frame_system::Config for Test { type OnSetCode = (); } +/// MockMigrationManager stores the test-side callbacks/closures used in the Migrations list glue. +/// It is is expected to exist as a singleton, but only remain relevant within the scope of a test. +/// +/// Tests should use execute_with_mock_migrations(), which will create a MockMigrationManager and +/// provide it to the test. +/// +/// A pair of callbacks provided to register_callback() will map directly to a single instance of +/// Migration (done by the MockMigration glue below). Treat each pair of callbacks as though it were +/// a custom implementation of the Migration trait just as a normal Pallet would. #[derive(Default)] pub struct MockMigrationManager<'test> { name_fn_callbacks: Vec &'static str>>, @@ -85,7 +94,7 @@ pub struct MockMigrationManager<'test> { } impl<'test> MockMigrationManager<'test> { - pub fn registerCallback(&mut self, name_fn: FN, step_fn: FS) + pub fn register_callback(&mut self, name_fn: FN, step_fn: FS) where FN: 'test + FnMut() -> &'static str, FS: 'test + FnMut(Perbill, Weight) -> (Perbill, Weight), @@ -112,8 +121,14 @@ impl<'test> MockMigrationManager<'test> { migrations } } + +// Our global Migrations list. Necessary because the Get impl must be fulfilled with nothing but +// a static context. environmental!(MOCK_MIGRATIONS_LIST: MockMigrationManager<'static>); +/// Utility method for tests to implement their logic with a pre-generated MockMigrationManager. +/// This helps avoid lifetime issues between the implied 'static lifetime of MOCK_MIGRATIONS_LIST +/// and the function-scoped lifetimes of closures used in tests. pub fn execute_with_mock_migrations(callback: &mut CB) where CB: FnMut(&mut MockMigrationManager) @@ -153,6 +168,9 @@ pub struct MockMigration { pub index: usize, } +/// The implementation of Migration for our glue: MockMigration contains nothing more than an index +/// which is used inside of the callbacks at runtime to look up our global callbacks stored in +/// MOCK_MIGRATIONS_LIST and invoke those. impl Migration for MockMigration { fn friendly_name(&self) -> &str { let mut result: &str = ""; @@ -170,6 +188,8 @@ impl Migration for MockMigration { } } +/// Implementation of Migrations. Generates a Vec of MockMigrations on the fly based on the current +/// contents of MOCK_MIGRATIONS_LIST. pub struct MockMigrations; impl Get>> for MockMigrations { fn get() -> Vec> { diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 623edeb0b2..91232a8b1e 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -43,7 +43,7 @@ fn mock_migrations_static_hack_works() { let name_fn_called = Arc::clone(&name_fn_called); let step_fn_called = Arc::clone(&step_fn_called); - mgr.registerCallback( + mgr.register_callback( move || { *name_fn_called.lock().unwrap() = true; "hello, world" @@ -89,7 +89,7 @@ fn step_called_until_done() { crate::mock::execute_with_mock_migrations(&mut |mgr: &mut MockMigrationManager| { let num_step_calls = Arc::clone(&num_step_calls); - mgr.registerCallback( + mgr.register_callback( move || { "migration1" }, From 2c0bfe558b0b06df1899664d3ac011c9241c3f7f Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 7 Jul 2021 12:32:38 -0600 Subject: [PATCH 36/79] Move migration event impl --- pallets/migrations/src/lib.rs | 34 ++++++++++++------ pallets/migrations/src/mock.rs | 7 ++-- pallets/migrations/src/tests.rs | 63 ++++++++++++++++++++++++++++++++- 3 files changed, 90 insertions(+), 14 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index cdbb0cb613..8bdc51aa9b 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -79,10 +79,10 @@ pub mod pallet { pub enum Event { // e.g. runtime upgrade started, completed, etc. RuntimeUpgradeStarted(), - RuntimeUpgradeStepped(), + RuntimeUpgradeStepped(Weight), RuntimeUpgradeCompleted(), MigrationStarted(Vec), - MigrationProgress(Vec, Perbill), + MigrationStepped(Vec, Perbill, Weight), MigrationCompleted(Vec), } @@ -117,7 +117,6 @@ pub mod pallet { let mut weight: Weight = 0u64.into(); if ! >::get() { - Self::deposit_event(Event::RuntimeUpgradeStepped()); weight += process_runtime_upgrades::(); } @@ -165,24 +164,26 @@ pub mod pallet { log::info!("stepping runtime upgrade"); // TODO: query proper value or make configurable - let available_weight = 500_000_000_000u64.into(); + let available_weight: Weight = 500_000_000_000u64.into(); let mut weight: Weight = 0u64.into(); let mut done: bool = true; for migration in &T::MigrationsList::get() { // let migration_name = migration.friendly_name(); let migration_name = migration.friendly_name(); + let migration_name_as_bytes = migration_name.as_bytes(); log::trace!("evaluating migration {}", migration_name); let migration_state = - >::get(migration_name.as_bytes()).unwrap_or(Perbill::zero()); + >::get(migration_name_as_bytes).unwrap_or(Perbill::zero()); if migration_state < Perbill::one() { - // TODO: we don't currently have a reliable way to know "started" - // TODO: multiple calls to as_bytes() or to_vec() may be expensive - >::deposit_event(Event::MigrationStarted( - migration_name.as_bytes().to_vec(), - )); + + if migration_state.is_zero() { + >::deposit_event(Event::MigrationStarted( + migration_name_as_bytes.into() + )); + } let available_for_step = available_weight - weight; log::trace!( @@ -193,9 +194,14 @@ pub mod pallet { ); // perform a step of this migration - >::deposit_event(Event::MigrationStarted(migration_name.into())); let (updated_progress, consumed_weight) = migration.step(migration_state, available_for_step); + // TODO: error if progress == 0 still? + >::deposit_event(Event::MigrationStepped( + migration_name_as_bytes.into(), + updated_progress, + consumed_weight, + )); weight += consumed_weight; if weight > available_weight { @@ -213,6 +219,10 @@ pub mod pallet { // make note of any unfinished migrations if updated_progress < Perbill::one() { done = false; + } else { + >::deposit_event(Event::MigrationCompleted( + migration_name_as_bytes.into() + )); } if migration_state != updated_progress { @@ -221,6 +231,8 @@ pub mod pallet { } } + >::deposit_event(Event::RuntimeUpgradeStepped(weight)); + if done { >::deposit_event(Event::RuntimeUpgradeCompleted()); >::put(true); diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 68e009de55..5614530e3b 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -129,9 +129,10 @@ environmental!(MOCK_MIGRATIONS_LIST: MockMigrationManager<'static>); /// Utility method for tests to implement their logic with a pre-generated MockMigrationManager. /// This helps avoid lifetime issues between the implied 'static lifetime of MOCK_MIGRATIONS_LIST /// and the function-scoped lifetimes of closures used in tests. -pub fn execute_with_mock_migrations(callback: &mut CB) +pub fn execute_with_mock_migrations(callback: &mut CB, post_migration_callback: &mut ECB) where - CB: FnMut(&mut MockMigrationManager) + CB: FnMut(&mut MockMigrationManager), + ECB: FnMut(), { let mut original_mgr: MockMigrationManager = Default::default(); MOCK_MIGRATIONS_LIST::using(&mut original_mgr, || { @@ -159,6 +160,8 @@ where panic!("Infinite loop?"); } } + + post_migration_callback(); }); }); } diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 91232a8b1e..b335936771 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -38,6 +38,7 @@ fn mock_migrations_static_hack_works() { let name_fn_called = Arc::new(Mutex::new(false)); let step_fn_called = Arc::new(Mutex::new(false)); + let ecb_fn_called = Arc::new(Mutex::new(false)); crate::mock::execute_with_mock_migrations(&mut |mgr: &mut MockMigrationManager| { let name_fn_called = Arc::clone(&name_fn_called); @@ -53,10 +54,14 @@ fn mock_migrations_static_hack_works() { (Perbill::one(), 0u64.into()) } ); + }, + &mut || { + *ecb_fn_called.lock().unwrap() = true; }); assert_eq!(*name_fn_called.lock().unwrap(), true, "mock migration should call friendly_name()"); assert_eq!(*step_fn_called.lock().unwrap(), true, "mock migration should call step()"); + assert_eq!(*ecb_fn_called.lock().unwrap(), true, "mock migration should call ECB callback"); } #[test] @@ -73,6 +78,7 @@ fn on_runtime_upgrade_emits_events() { let expected = vec![ Event::RuntimeUpgradeStarted(), + Event::RuntimeUpgradeStepped(0u64.into()), Event::RuntimeUpgradeCompleted(), ]; assert_eq!(events(), expected); @@ -104,7 +110,62 @@ fn step_called_until_done() { } } ); - }); + }, + &mut || {} ); assert_eq!(*num_step_calls.lock().unwrap(), 10, "migration step should be called until done"); } + +#[test] +fn migration_progress_should_emit_events() { + + let num_steps = Arc::new(Mutex::new(0usize)); + + crate::mock::execute_with_mock_migrations(&mut |mgr: &mut MockMigrationManager| { + let num_steps = Arc::clone(&num_steps); + + mgr.register_callback( + move || { + "migration1" + }, + move |_, _| -> (Perbill, Weight) { + let mut num_steps = num_steps.lock().unwrap(); + + let result: (Perbill, Weight) = match *num_steps { + 0 => (Perbill::from_percent(50), 50), + 1 => (Perbill::from_percent(60), 51), + 2 => (Perbill::from_percent(70), 52), + 3 => (Perbill::from_percent(80), 53), + 4 => (Perbill::from_percent(100), 1), + _ => { unreachable!(); } + }; + + *num_steps += 1; + result + } + ); + }, + &mut || { + + let expected = vec![ + Event::RuntimeUpgradeStarted(), + Event::MigrationStarted("migration1".into()), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(50), 50), + Event::RuntimeUpgradeStepped(50), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(60), 51), + Event::RuntimeUpgradeStepped(51), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(70), 52), + Event::RuntimeUpgradeStepped(52), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(80), 53), + Event::RuntimeUpgradeStepped(53), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(100), 1), + Event::MigrationCompleted("migration1".into()), + Event::RuntimeUpgradeStepped(1), + Event::RuntimeUpgradeCompleted(), + ]; + assert_eq!(events(), expected); + }); + + assert_eq!(*num_steps.lock().unwrap(), 5, "migration step should be called until done"); + +} From 67bede2f8622a805e250af9155c26aa3b33926a8 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 8 Jul 2021 15:56:17 -0600 Subject: [PATCH 37/79] Let tests manage ExtBuilder ... execute_with() --- pallets/migrations/src/mock.rs | 59 +++++++++++++++++++-------------- pallets/migrations/src/tests.rs | 51 ++++++++++++++++------------ 2 files changed, 64 insertions(+), 46 deletions(-) diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 5614530e3b..3007f51cda 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -139,30 +139,7 @@ where MOCK_MIGRATIONS_LIST::with(|inner_mgr: &mut MockMigrationManager| { callback(inner_mgr); }); - - // mimic the calls that would occur from the time a runtime upgrade starts until the - // Migrations pallet indicates that all upgrades are complete - - ExtBuilder::default().build().execute_with(|| { - let mut block_number = 1u64; - Migrations::on_runtime_upgrade(); - - while ! Migrations::is_fully_upgraded() { - System::set_block_number(block_number); - System::on_initialize(System::block_number()); - Migrations::on_initialize(System::block_number()); - Migrations::on_finalize(System::block_number()); - System::on_finalize(System::block_number()); - - block_number += 1; - - if block_number > 99999 { - panic!("Infinite loop?"); - } - } - - post_migration_callback(); - }); + post_migration_callback(); }); } @@ -254,3 +231,37 @@ pub(crate) fn events() -> Vec> { }) .collect::>() } + +pub(crate) fn roll_to(block_number: u64, invoke_on_runtime_upgrade_first: bool) { + + if invoke_on_runtime_upgrade_first { + Migrations::on_runtime_upgrade(); + } + + while System::block_number() < block_number { + System::set_block_number(System::block_number() + 1); + System::on_initialize(System::block_number()); + Migrations::on_initialize(System::block_number()); + Migrations::on_finalize(System::block_number()); + System::on_finalize(System::block_number()); + } +} + +pub(crate) fn roll_until_upgraded(invoke_on_runtime_upgrade_first: bool) { + + if invoke_on_runtime_upgrade_first { + Migrations::on_runtime_upgrade(); + } + + while ! Migrations::is_fully_upgraded() { + System::set_block_number(System::block_number() + 1); + System::on_initialize(System::block_number()); + Migrations::on_initialize(System::block_number()); + Migrations::on_finalize(System::block_number()); + System::on_finalize(System::block_number()); + + if System::block_number() > 99999 { + panic!("Infinite loop?"); + } + } +} diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index b335936771..8403e2e354 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -56,6 +56,9 @@ fn mock_migrations_static_hack_works() { ); }, &mut || { + ExtBuilder::default().build().execute_with(|| { + crate::mock::roll_until_upgraded(true); + }); *ecb_fn_called.lock().unwrap() = true; }); @@ -90,8 +93,6 @@ fn step_called_until_done() { let num_step_calls = Arc::new(Mutex::new(0usize)); - println!("step_called_until_done()..."); - crate::mock::execute_with_mock_migrations(&mut |mgr: &mut MockMigrationManager| { let num_step_calls = Arc::clone(&num_step_calls); @@ -101,7 +102,6 @@ fn step_called_until_done() { }, move |_, _| -> (Perbill, Weight) { let mut num_step_calls = num_step_calls.lock().unwrap(); - println!("step fn called, num times previously: {}", num_step_calls); *num_step_calls += 1; if *num_step_calls == 10 { (Perbill::one(), 0u64.into()) @@ -111,7 +111,11 @@ fn step_called_until_done() { } ); }, - &mut || {} ); + &mut || { + ExtBuilder::default().build().execute_with(|| { + crate::mock::roll_until_upgraded(true); + }); + }); assert_eq!(*num_step_calls.lock().unwrap(), 10, "migration step should be called until done"); } @@ -146,24 +150,27 @@ fn migration_progress_should_emit_events() { ); }, &mut || { - - let expected = vec![ - Event::RuntimeUpgradeStarted(), - Event::MigrationStarted("migration1".into()), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(50), 50), - Event::RuntimeUpgradeStepped(50), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(60), 51), - Event::RuntimeUpgradeStepped(51), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(70), 52), - Event::RuntimeUpgradeStepped(52), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(80), 53), - Event::RuntimeUpgradeStepped(53), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(100), 1), - Event::MigrationCompleted("migration1".into()), - Event::RuntimeUpgradeStepped(1), - Event::RuntimeUpgradeCompleted(), - ]; - assert_eq!(events(), expected); + ExtBuilder::default().build().execute_with(|| { + crate::mock::roll_until_upgraded(true); + + let expected = vec![ + Event::RuntimeUpgradeStarted(), + Event::MigrationStarted("migration1".into()), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(50), 50), + Event::RuntimeUpgradeStepped(50), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(60), 51), + Event::RuntimeUpgradeStepped(51), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(70), 52), + Event::RuntimeUpgradeStepped(52), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(80), 53), + Event::RuntimeUpgradeStepped(53), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(100), 1), + Event::MigrationCompleted("migration1".into()), + Event::RuntimeUpgradeStepped(1), + Event::RuntimeUpgradeCompleted(), + ]; + assert_eq!(events(), expected); + }); }); assert_eq!(*num_steps.lock().unwrap(), 5, "migration step should be called until done"); From f92411241bef09796e79066d534114f41d6e28d7 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 8 Jul 2021 16:22:40 -0600 Subject: [PATCH 38/79] Test that migrations are only run once --- pallets/migrations/src/tests.rs | 68 +++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 8403e2e354..45d590eceb 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -176,3 +176,71 @@ fn migration_progress_should_emit_events() { assert_eq!(*num_steps.lock().unwrap(), 5, "migration step should be called until done"); } + +#[test] +fn migration_should_only_be_invoked_once() { + + let num_name_fn_calls = Arc::new(Mutex::new(0usize)); + let num_step_fn_calls = Arc::new(Mutex::new(0usize)); + + crate::mock::execute_with_mock_migrations(&mut |mgr: &mut MockMigrationManager| { + let num_name_fn_calls = Arc::clone(&num_name_fn_calls); + let num_step_fn_calls = Arc::clone(&num_step_fn_calls); + + mgr.register_callback( + move || { + let mut num_name_fn_calls = num_name_fn_calls.lock().unwrap(); + *num_name_fn_calls += 1; + "migration1" + }, + move |_, _| -> (Perbill, Weight) { + let mut num_step_fn_calls = num_step_fn_calls.lock().unwrap(); + *num_step_fn_calls += 1; + (Perbill::one(), 1) // immediately done + } + ); + }, + &mut || { + ExtBuilder::default().build().execute_with(|| { + // roll forward until upgraded, should happen before block even increments + crate::mock::roll_until_upgraded(true); + + assert_eq!(System::block_number(), 1); + assert_eq!(*num_name_fn_calls.lock().unwrap(), 1, "migration name needed once"); + assert_eq!(*num_step_fn_calls.lock().unwrap(), 1, "migration step needed once"); + let mut expected = vec![ + Event::RuntimeUpgradeStarted(), + Event::MigrationStarted("migration1".into()), + Event::MigrationStepped("migration1".into(), Perbill::one(), 1), + Event::MigrationCompleted("migration1".into()), + Event::RuntimeUpgradeStepped(1), + Event::RuntimeUpgradeCompleted(), + ]; + assert_eq!(events(), expected); + + // attempt to roll forward again, block should still not increment, and migration + // name fn should be called but pallet_migrations should immediately recognize that + // no work needs to be done (and not call step) + crate::mock::roll_until_upgraded(true); + + assert_eq!(System::block_number(), 1); + assert_eq!(*num_name_fn_calls.lock().unwrap(), 2, "migration name needed twice"); + assert_eq!(*num_step_fn_calls.lock().unwrap(), 1, "migration step not needed again"); + expected.append(&mut vec![ + Event::RuntimeUpgradeStarted(), + // TODO: it might be nice to see an event here about a migration being skipped + // is there much overhead in emitting events? + Event::RuntimeUpgradeStepped(0), + Event::RuntimeUpgradeCompleted(), + ]); + assert_eq!(events(), expected); + + // roll forward a few blocks + crate::mock::roll_to(3, false); + assert_eq!(*num_name_fn_calls.lock().unwrap(), 2, "migration name not needed again"); + assert_eq!(*num_step_fn_calls.lock().unwrap(), 1, "migration step not needed again"); + // assert that no new events have been emitted + assert_eq!(events(), expected); + }); + }); +} From 5022dcc83a032a4d5d94ef454423848bca30e9fb Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 8 Jul 2021 16:39:32 -0600 Subject: [PATCH 39/79] Remove TODO/comment; events are not cheap and should be used conservatively --- pallets/migrations/src/tests.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 45d590eceb..036fe9a01c 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -228,8 +228,6 @@ fn migration_should_only_be_invoked_once() { assert_eq!(*num_step_fn_calls.lock().unwrap(), 1, "migration step not needed again"); expected.append(&mut vec![ Event::RuntimeUpgradeStarted(), - // TODO: it might be nice to see an event here about a migration being skipped - // is there much overhead in emitting events? Event::RuntimeUpgradeStepped(0), Event::RuntimeUpgradeCompleted(), ]); From a2177dd430b7415bb5ed6104df5ed598e8c19940 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 19 Jul 2021 10:57:14 -0600 Subject: [PATCH 40/79] Post merge-master fixes --- Cargo.lock | 2 -- node/service/src/chain_spec/moonbase.rs | 2 +- pallets/migrations/Cargo.toml | 15 ++++++++------- pallets/migrations/src/mock.rs | 4 ++-- runtime/common/Cargo.toml | 6 +++--- runtime/moonbase/src/lib.rs | 2 +- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bd725b2a09..01e8632654 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -248,7 +248,6 @@ dependencies = [ "fastrand", "futures-lite", "once_cell 1.8.0", - "vec-arena", "slab", ] @@ -278,7 +277,6 @@ dependencies = [ "futures-lite", "libc", "log", - "nb-connect", "once_cell 1.8.0", "parking", "polling", diff --git a/node/service/src/chain_spec/moonbase.rs b/node/service/src/chain_spec/moonbase.rs index bff8c4a945..cd971ef85e 100644 --- a/node/service/src/chain_spec/moonbase.rs +++ b/node/service/src/chain_spec/moonbase.rs @@ -260,7 +260,7 @@ pub fn testnet_genesis( .collect(), }, treasury: Default::default(), - pallet_migrations: Default::default(), + migrations: Default::default(), } } diff --git a/pallets/migrations/Cargo.toml b/pallets/migrations/Cargo.toml index 92792f2c8a..8ba3532dd3 100644 --- a/pallets/migrations/Cargo.toml +++ b/pallets/migrations/Cargo.toml @@ -6,17 +6,17 @@ edition = "2018" description = "migrations management pallet" [dependencies] -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } +frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } log = "0.4" -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } parity-scale-codec = { version = "2.0.0", default-features = false } -environmental = "1.1.0" +environmental = { version = "1.1.2", default-features = false } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } [dev-dependencies] -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } [features] default = ["std"] @@ -27,4 +27,5 @@ std = [ "sp-runtime/std", "sp-io/std", "sp-core/std", + "environmental/std", ] diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 3007f51cda..8102338884 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -41,7 +41,7 @@ construct_runtime!( UncheckedExtrinsic = UncheckedExtrinsic, { System: frame_system::{Pallet, Call, Config, Storage, Event}, - Migrations: pallet_migrations::{Pallet, Call, Storage, Config, Event}, + Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, } ); @@ -223,7 +223,7 @@ pub(crate) fn events() -> Vec> { .into_iter() .map(|r| r.event) .filter_map(|e| { - if let Event::pallet_migrations(inner) = e { + if let Event::Migrations(inner) = e { Some(inner) } else { None diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 82915bc4d8..e3bb6cc812 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -9,9 +9,9 @@ edition = '2018' [dependencies] pallet-migrations = { path = "../../pallets/migrations", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.4", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.4" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.8" } [features] std = [ diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index 1b9da88600..afe07161d1 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -789,7 +789,7 @@ construct_runtime! { CrowdloanRewards: pallet_crowdloan_rewards::{Pallet, Call, Config, Storage, Event}, AuthorMapping: pallet_author_mapping::{Pallet, Call, Config, Storage, Event}, Proxy: pallet_proxy::{Pallet, Call, Storage, Event}, - Migrations: pallet_migrations::{Pallet, Call, Storage, Config, Event}, + Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, } } From 01727f8f2bbfab7cbb8853bb7eef512468b1318d Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 19 Jul 2021 11:11:51 -0600 Subject: [PATCH 41/79] Remove cruft --- pallets/migrations/Cargo.toml | 2 -- pallets/migrations/src/lib.rs | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pallets/migrations/Cargo.toml b/pallets/migrations/Cargo.toml index 8ba3532dd3..5f0491616b 100644 --- a/pallets/migrations/Cargo.toml +++ b/pallets/migrations/Cargo.toml @@ -16,8 +16,6 @@ environmental = { version = "1.1.2", default-features = false } sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } -[dev-dependencies] - [features] default = ["std"] std = [ diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 8bdc51aa9b..5f96e01c3e 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -77,7 +77,6 @@ pub mod pallet { #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] pub enum Event { - // e.g. runtime upgrade started, completed, etc. RuntimeUpgradeStarted(), RuntimeUpgradeStepped(Weight), RuntimeUpgradeCompleted(), @@ -110,7 +109,6 @@ pub mod pallet { /// on_initialize implementation. Calls process_runtime_upgrades() if we are still in the /// middle of a runtime upgrade. - /// TODO: use on_idle or some other hook? fn on_initialize(_: T::BlockNumber) -> Weight { // TODO: should account for the minimum one DB read @@ -138,7 +136,7 @@ pub mod pallet { #[pallet::genesis_config] pub struct GenesisConfig { pub completed_migrations: Vec>, - pub dummy: PhantomData, // TODO: + pub dummy: PhantomData, } #[cfg(feature = "std")] From 8ed861f7c7f48f706d5cbf6843126a1ade14fcdd Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 19 Jul 2021 12:29:27 -0600 Subject: [PATCH 42/79] Track some db reads and writes and charge accordingly --- pallets/migrations/src/lib.rs | 11 ++++++----- pallets/migrations/src/mock.rs | 5 +++-- pallets/migrations/src/tests.rs | 31 +++++++++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 5f96e01c3e..deb5ceb230 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -96,23 +96,23 @@ pub mod pallet { fn on_runtime_upgrade() -> Weight { log::warn!("Performing on_runtime_upgrade"); + let mut weight: Weight = 0u64.into(); + // start by flagging that we are not fully upgraded >::put(false); + weight += T::DbWeight::get().writes(1); Self::deposit_event(Event::RuntimeUpgradeStarted()); - let mut weight: Weight = 0u64.into(); - weight += process_runtime_upgrades::(); - weight.into() + weight } /// on_initialize implementation. Calls process_runtime_upgrades() if we are still in the /// middle of a runtime upgrade. fn on_initialize(_: T::BlockNumber) -> Weight { - // TODO: should account for the minimum one DB read - let mut weight: Weight = 0u64.into(); + let mut weight: Weight = T::DbWeight::get().reads(1 as Weight); if ! >::get() { weight += process_runtime_upgrades::(); @@ -234,6 +234,7 @@ pub mod pallet { if done { >::deposit_event(Event::RuntimeUpgradeCompleted()); >::put(true); + weight += T::DbWeight::get().writes(1); } weight diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 8102338884..066a24158a 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -18,7 +18,8 @@ use super::*; use crate as pallet_migrations; use frame_support::{ - construct_runtime, pallet_prelude::*, parameter_types, traits::GenesisBuild, weights::Weight, + construct_runtime, pallet_prelude::*, parameter_types, traits::GenesisBuild, + weights::{constants::RocksDbWeight, Weight}, }; use sp_core::H256; use sp_runtime::{ @@ -54,7 +55,7 @@ parameter_types! { } impl frame_system::Config for Test { type BaseCallFilter = (); - type DbWeight = (); + type DbWeight = RocksDbWeight; type Origin = Origin; type Index = u64; type BlockNumber = BlockNumber; diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 036fe9a01c..a5f65d9cf5 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -21,8 +21,8 @@ use crate::mock::{ use crate::Event; use std::sync::{Arc, Mutex}; use frame_support::{ - traits::OnRuntimeUpgrade, - weights::Weight, + traits::{OnRuntimeUpgrade, OnInitialize}, + weights::{constants::RocksDbWeight, Weight}, }; use sp_runtime::Perbill; @@ -242,3 +242,30 @@ fn migration_should_only_be_invoked_once() { }); }); } + +#[test] +fn on_initialize_should_charge_at_least_one_db_read() { + + ExtBuilder::default().build().execute_with(|| { + // first call to on_runtime_upgrade should flag FullyUpgraded as true + Migrations::on_runtime_upgrade(); + assert_eq!(Migrations::is_fully_upgraded(), true); + + // and subsequent call to on_initialize should do nothing but read this value and return + let weight = >::on_initialize(1); + assert_eq!(weight, RocksDbWeight::get().reads(1)); + }) +} + +#[test] +fn on_runtime_upgrade_charges_minimum_two_db_writes() { + + ExtBuilder::default().build().execute_with(|| { + let mut weight = Migrations::on_runtime_upgrade(); + + // substrate seems to add a write to this call, so substract one for our logic + weight -= RocksDbWeight::get().writes(1); + + assert_eq!(weight, RocksDbWeight::get().writes(2)); + }) +} From 0785e4891fb2804ae67d392d42ddce05b6b67f9b Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 20 Jul 2021 13:41:51 -0600 Subject: [PATCH 43/79] cargo fmt --- pallets/migrations/src/lib.rs | 11 +- pallets/migrations/src/mock.rs | 26 ++- pallets/migrations/src/tests.rs | 379 ++++++++++++++++++-------------- 3 files changed, 230 insertions(+), 186 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index deb5ceb230..fe0b380d63 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -30,7 +30,8 @@ use sp_runtime::Perbill; pub use pallet::*; #[cfg(test)] -#[macro_use] extern crate environmental; +#[macro_use] +extern crate environmental; /// A Migration that must happen on-chain upon a runtime-upgrade pub trait Migration { @@ -111,10 +112,9 @@ pub mod pallet { /// on_initialize implementation. Calls process_runtime_upgrades() if we are still in the /// middle of a runtime upgrade. fn on_initialize(_: T::BlockNumber) -> Weight { - let mut weight: Weight = T::DbWeight::get().reads(1 as Weight); - if ! >::get() { + if !>::get() { weight += process_runtime_upgrades::(); } @@ -176,10 +176,9 @@ pub mod pallet { >::get(migration_name_as_bytes).unwrap_or(Perbill::zero()); if migration_state < Perbill::one() { - if migration_state.is_zero() { >::deposit_event(Event::MigrationStarted( - migration_name_as_bytes.into() + migration_name_as_bytes.into(), )); } @@ -219,7 +218,7 @@ pub mod pallet { done = false; } else { >::deposit_event(Event::MigrationCompleted( - migration_name_as_bytes.into() + migration_name_as_bytes.into(), )); } diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 066a24158a..e674e383d2 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -18,7 +18,10 @@ use super::*; use crate as pallet_migrations; use frame_support::{ - construct_runtime, pallet_prelude::*, parameter_types, traits::GenesisBuild, + construct_runtime, + pallet_prelude::*, + parameter_types, + traits::GenesisBuild, weights::{constants::RocksDbWeight, Weight}, }; use sp_core::H256; @@ -81,10 +84,10 @@ impl frame_system::Config for Test { /// MockMigrationManager stores the test-side callbacks/closures used in the Migrations list glue. /// It is is expected to exist as a singleton, but only remain relevant within the scope of a test. -/// +/// /// Tests should use execute_with_mock_migrations(), which will create a MockMigrationManager and /// provide it to the test. -/// +/// /// A pair of callbacks provided to register_callback() will map directly to a single instance of /// Migration (done by the MockMigration glue below). Treat each pair of callbacks as though it were /// a custom implementation of the Migration trait just as a normal Pallet would. @@ -108,16 +111,19 @@ impl<'test> MockMigrationManager<'test> { self.name_fn_callbacks[index]() } - pub(crate) fn invoke_step_fn(&mut self, index: usize, previous_progress: Perbill, available_weight: Weight) - -> (Perbill, Weight) - { + pub(crate) fn invoke_step_fn( + &mut self, + index: usize, + previous_progress: Perbill, + available_weight: Weight, + ) -> (Perbill, Weight) { self.step_fn_callbacks[index](previous_progress, available_weight) } fn generate_migrations_list(&self) -> Vec> { let mut migrations: Vec> = Vec::new(); for i in 0..self.name_fn_callbacks.len() { - migrations.push(Box::new(MockMigration{index: i})); + migrations.push(Box::new(MockMigration { index: i })); } migrations } @@ -170,7 +176,7 @@ impl Migration for MockMigration { } /// Implementation of Migrations. Generates a Vec of MockMigrations on the fly based on the current -/// contents of MOCK_MIGRATIONS_LIST. +/// contents of MOCK_MIGRATIONS_LIST. pub struct MockMigrations; impl Get>> for MockMigrations { fn get() -> Vec> { @@ -234,7 +240,6 @@ pub(crate) fn events() -> Vec> { } pub(crate) fn roll_to(block_number: u64, invoke_on_runtime_upgrade_first: bool) { - if invoke_on_runtime_upgrade_first { Migrations::on_runtime_upgrade(); } @@ -249,12 +254,11 @@ pub(crate) fn roll_to(block_number: u64, invoke_on_runtime_upgrade_first: bool) } pub(crate) fn roll_until_upgraded(invoke_on_runtime_upgrade_first: bool) { - if invoke_on_runtime_upgrade_first { Migrations::on_runtime_upgrade(); } - while ! Migrations::is_fully_upgraded() { + while !Migrations::is_fully_upgraded() { System::set_block_number(System::block_number() + 1); System::on_initialize(System::block_number()); Migrations::on_initialize(System::block_number()); diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index a5f65d9cf5..7b88e176f4 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -15,16 +15,14 @@ // along with Moonbeam. If not, see . //! Unit testing -use crate::mock::{ - events, ExtBuilder, Migrations, System, MockMigrationManager, -}; +use crate::mock::{events, ExtBuilder, Migrations, MockMigrationManager, System}; use crate::Event; -use std::sync::{Arc, Mutex}; use frame_support::{ - traits::{OnRuntimeUpgrade, OnInitialize}, + traits::{OnInitialize, OnRuntimeUpgrade}, weights::{constants::RocksDbWeight, Weight}, }; use sp_runtime::Perbill; +use std::sync::{Arc, Mutex}; #[test] fn genesis_builder_works() { @@ -35,36 +33,49 @@ fn genesis_builder_works() { #[test] fn mock_migrations_static_hack_works() { - let name_fn_called = Arc::new(Mutex::new(false)); let step_fn_called = Arc::new(Mutex::new(false)); let ecb_fn_called = Arc::new(Mutex::new(false)); - crate::mock::execute_with_mock_migrations(&mut |mgr: &mut MockMigrationManager| { - let name_fn_called = Arc::clone(&name_fn_called); - let step_fn_called = Arc::clone(&step_fn_called); - - mgr.register_callback( - move || { - *name_fn_called.lock().unwrap() = true; - "hello, world" - }, - move |_, _| -> (Perbill, Weight) { - *step_fn_called.lock().unwrap() = true; - (Perbill::one(), 0u64.into()) - } - ); - }, - &mut || { - ExtBuilder::default().build().execute_with(|| { - crate::mock::roll_until_upgraded(true); - }); - *ecb_fn_called.lock().unwrap() = true; - }); - - assert_eq!(*name_fn_called.lock().unwrap(), true, "mock migration should call friendly_name()"); - assert_eq!(*step_fn_called.lock().unwrap(), true, "mock migration should call step()"); - assert_eq!(*ecb_fn_called.lock().unwrap(), true, "mock migration should call ECB callback"); + crate::mock::execute_with_mock_migrations( + &mut |mgr: &mut MockMigrationManager| { + let name_fn_called = Arc::clone(&name_fn_called); + let step_fn_called = Arc::clone(&step_fn_called); + + mgr.register_callback( + move || { + *name_fn_called.lock().unwrap() = true; + "hello, world" + }, + move |_, _| -> (Perbill, Weight) { + *step_fn_called.lock().unwrap() = true; + (Perbill::one(), 0u64.into()) + }, + ); + }, + &mut || { + ExtBuilder::default().build().execute_with(|| { + crate::mock::roll_until_upgraded(true); + }); + *ecb_fn_called.lock().unwrap() = true; + }, + ); + + assert_eq!( + *name_fn_called.lock().unwrap(), + true, + "mock migration should call friendly_name()" + ); + assert_eq!( + *step_fn_called.lock().unwrap(), + true, + "mock migration should call step()" + ); + assert_eq!( + *ecb_fn_called.lock().unwrap(), + true, + "mock migration should call ECB callback" + ); } #[test] @@ -90,162 +101,193 @@ fn on_runtime_upgrade_emits_events() { #[test] fn step_called_until_done() { - let num_step_calls = Arc::new(Mutex::new(0usize)); - crate::mock::execute_with_mock_migrations(&mut |mgr: &mut MockMigrationManager| { - let num_step_calls = Arc::clone(&num_step_calls); - - mgr.register_callback( - move || { - "migration1" - }, - move |_, _| -> (Perbill, Weight) { - let mut num_step_calls = num_step_calls.lock().unwrap(); - *num_step_calls += 1; - if *num_step_calls == 10 { - (Perbill::one(), 0u64.into()) - } else { - (Perbill::zero(), 0u64.into()) - } - } - ); - }, - &mut || { - ExtBuilder::default().build().execute_with(|| { - crate::mock::roll_until_upgraded(true); - }); - }); - - assert_eq!(*num_step_calls.lock().unwrap(), 10, "migration step should be called until done"); + crate::mock::execute_with_mock_migrations( + &mut |mgr: &mut MockMigrationManager| { + let num_step_calls = Arc::clone(&num_step_calls); + + mgr.register_callback( + move || "migration1", + move |_, _| -> (Perbill, Weight) { + let mut num_step_calls = num_step_calls.lock().unwrap(); + *num_step_calls += 1; + if *num_step_calls == 10 { + (Perbill::one(), 0u64.into()) + } else { + (Perbill::zero(), 0u64.into()) + } + }, + ); + }, + &mut || { + ExtBuilder::default().build().execute_with(|| { + crate::mock::roll_until_upgraded(true); + }); + }, + ); + + assert_eq!( + *num_step_calls.lock().unwrap(), + 10, + "migration step should be called until done" + ); } #[test] fn migration_progress_should_emit_events() { - let num_steps = Arc::new(Mutex::new(0usize)); - crate::mock::execute_with_mock_migrations(&mut |mgr: &mut MockMigrationManager| { - let num_steps = Arc::clone(&num_steps); - - mgr.register_callback( - move || { - "migration1" - }, - move |_, _| -> (Perbill, Weight) { - let mut num_steps = num_steps.lock().unwrap(); - - let result: (Perbill, Weight) = match *num_steps { - 0 => (Perbill::from_percent(50), 50), - 1 => (Perbill::from_percent(60), 51), - 2 => (Perbill::from_percent(70), 52), - 3 => (Perbill::from_percent(80), 53), - 4 => (Perbill::from_percent(100), 1), - _ => { unreachable!(); } - }; - - *num_steps += 1; - result - } - ); - }, - &mut || { - ExtBuilder::default().build().execute_with(|| { - crate::mock::roll_until_upgraded(true); - - let expected = vec![ - Event::RuntimeUpgradeStarted(), - Event::MigrationStarted("migration1".into()), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(50), 50), - Event::RuntimeUpgradeStepped(50), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(60), 51), - Event::RuntimeUpgradeStepped(51), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(70), 52), - Event::RuntimeUpgradeStepped(52), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(80), 53), - Event::RuntimeUpgradeStepped(53), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(100), 1), - Event::MigrationCompleted("migration1".into()), - Event::RuntimeUpgradeStepped(1), - Event::RuntimeUpgradeCompleted(), - ]; - assert_eq!(events(), expected); - }); - }); - - assert_eq!(*num_steps.lock().unwrap(), 5, "migration step should be called until done"); - + crate::mock::execute_with_mock_migrations( + &mut |mgr: &mut MockMigrationManager| { + let num_steps = Arc::clone(&num_steps); + + mgr.register_callback( + move || "migration1", + move |_, _| -> (Perbill, Weight) { + let mut num_steps = num_steps.lock().unwrap(); + + let result: (Perbill, Weight) = match *num_steps { + 0 => (Perbill::from_percent(50), 50), + 1 => (Perbill::from_percent(60), 51), + 2 => (Perbill::from_percent(70), 52), + 3 => (Perbill::from_percent(80), 53), + 4 => (Perbill::from_percent(100), 1), + _ => { + unreachable!(); + } + }; + + *num_steps += 1; + result + }, + ); + }, + &mut || { + ExtBuilder::default().build().execute_with(|| { + crate::mock::roll_until_upgraded(true); + + let expected = vec![ + Event::RuntimeUpgradeStarted(), + Event::MigrationStarted("migration1".into()), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(50), 50), + Event::RuntimeUpgradeStepped(50), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(60), 51), + Event::RuntimeUpgradeStepped(51), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(70), 52), + Event::RuntimeUpgradeStepped(52), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(80), 53), + Event::RuntimeUpgradeStepped(53), + Event::MigrationStepped("migration1".into(), Perbill::from_percent(100), 1), + Event::MigrationCompleted("migration1".into()), + Event::RuntimeUpgradeStepped(1), + Event::RuntimeUpgradeCompleted(), + ]; + assert_eq!(events(), expected); + }); + }, + ); + + assert_eq!( + *num_steps.lock().unwrap(), + 5, + "migration step should be called until done" + ); } #[test] fn migration_should_only_be_invoked_once() { - let num_name_fn_calls = Arc::new(Mutex::new(0usize)); let num_step_fn_calls = Arc::new(Mutex::new(0usize)); - crate::mock::execute_with_mock_migrations(&mut |mgr: &mut MockMigrationManager| { - let num_name_fn_calls = Arc::clone(&num_name_fn_calls); - let num_step_fn_calls = Arc::clone(&num_step_fn_calls); - - mgr.register_callback( - move || { - let mut num_name_fn_calls = num_name_fn_calls.lock().unwrap(); - *num_name_fn_calls += 1; - "migration1" - }, - move |_, _| -> (Perbill, Weight) { - let mut num_step_fn_calls = num_step_fn_calls.lock().unwrap(); - *num_step_fn_calls += 1; - (Perbill::one(), 1) // immediately done - } - ); - }, - &mut || { - ExtBuilder::default().build().execute_with(|| { - // roll forward until upgraded, should happen before block even increments - crate::mock::roll_until_upgraded(true); - - assert_eq!(System::block_number(), 1); - assert_eq!(*num_name_fn_calls.lock().unwrap(), 1, "migration name needed once"); - assert_eq!(*num_step_fn_calls.lock().unwrap(), 1, "migration step needed once"); - let mut expected = vec![ - Event::RuntimeUpgradeStarted(), - Event::MigrationStarted("migration1".into()), - Event::MigrationStepped("migration1".into(), Perbill::one(), 1), - Event::MigrationCompleted("migration1".into()), - Event::RuntimeUpgradeStepped(1), - Event::RuntimeUpgradeCompleted(), - ]; - assert_eq!(events(), expected); - - // attempt to roll forward again, block should still not increment, and migration - // name fn should be called but pallet_migrations should immediately recognize that - // no work needs to be done (and not call step) - crate::mock::roll_until_upgraded(true); - - assert_eq!(System::block_number(), 1); - assert_eq!(*num_name_fn_calls.lock().unwrap(), 2, "migration name needed twice"); - assert_eq!(*num_step_fn_calls.lock().unwrap(), 1, "migration step not needed again"); - expected.append(&mut vec![ - Event::RuntimeUpgradeStarted(), - Event::RuntimeUpgradeStepped(0), - Event::RuntimeUpgradeCompleted(), - ]); - assert_eq!(events(), expected); - - // roll forward a few blocks - crate::mock::roll_to(3, false); - assert_eq!(*num_name_fn_calls.lock().unwrap(), 2, "migration name not needed again"); - assert_eq!(*num_step_fn_calls.lock().unwrap(), 1, "migration step not needed again"); - // assert that no new events have been emitted - assert_eq!(events(), expected); - }); - }); + crate::mock::execute_with_mock_migrations( + &mut |mgr: &mut MockMigrationManager| { + let num_name_fn_calls = Arc::clone(&num_name_fn_calls); + let num_step_fn_calls = Arc::clone(&num_step_fn_calls); + + mgr.register_callback( + move || { + let mut num_name_fn_calls = num_name_fn_calls.lock().unwrap(); + *num_name_fn_calls += 1; + "migration1" + }, + move |_, _| -> (Perbill, Weight) { + let mut num_step_fn_calls = num_step_fn_calls.lock().unwrap(); + *num_step_fn_calls += 1; + (Perbill::one(), 1) // immediately done + }, + ); + }, + &mut || { + ExtBuilder::default().build().execute_with(|| { + // roll forward until upgraded, should happen before block even increments + crate::mock::roll_until_upgraded(true); + + assert_eq!(System::block_number(), 1); + assert_eq!( + *num_name_fn_calls.lock().unwrap(), + 1, + "migration name needed once" + ); + assert_eq!( + *num_step_fn_calls.lock().unwrap(), + 1, + "migration step needed once" + ); + let mut expected = vec![ + Event::RuntimeUpgradeStarted(), + Event::MigrationStarted("migration1".into()), + Event::MigrationStepped("migration1".into(), Perbill::one(), 1), + Event::MigrationCompleted("migration1".into()), + Event::RuntimeUpgradeStepped(1), + Event::RuntimeUpgradeCompleted(), + ]; + assert_eq!(events(), expected); + + // attempt to roll forward again, block should still not increment, and migration + // name fn should be called but pallet_migrations should immediately recognize that + // no work needs to be done (and not call step) + crate::mock::roll_until_upgraded(true); + + assert_eq!(System::block_number(), 1); + assert_eq!( + *num_name_fn_calls.lock().unwrap(), + 2, + "migration name needed twice" + ); + assert_eq!( + *num_step_fn_calls.lock().unwrap(), + 1, + "migration step not needed again" + ); + expected.append(&mut vec![ + Event::RuntimeUpgradeStarted(), + Event::RuntimeUpgradeStepped(0), + Event::RuntimeUpgradeCompleted(), + ]); + assert_eq!(events(), expected); + + // roll forward a few blocks + crate::mock::roll_to(3, false); + assert_eq!( + *num_name_fn_calls.lock().unwrap(), + 2, + "migration name not needed again" + ); + assert_eq!( + *num_step_fn_calls.lock().unwrap(), + 1, + "migration step not needed again" + ); + // assert that no new events have been emitted + assert_eq!(events(), expected); + }); + }, + ); } #[test] fn on_initialize_should_charge_at_least_one_db_read() { - ExtBuilder::default().build().execute_with(|| { // first call to on_runtime_upgrade should flag FullyUpgraded as true Migrations::on_runtime_upgrade(); @@ -259,7 +301,6 @@ fn on_initialize_should_charge_at_least_one_db_read() { #[test] fn on_runtime_upgrade_charges_minimum_two_db_writes() { - ExtBuilder::default().build().execute_with(|| { let mut weight = Migrations::on_runtime_upgrade(); From 8c444e77a3f7ad58efc6caa1b874e50cc5a2e9d9 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 21 Jul 2021 10:03:29 -0600 Subject: [PATCH 44/79] Add failing test about one-migration-at-a-time --- pallets/migrations/src/tests.rs | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 7b88e176f4..b677e6a87c 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -310,3 +310,54 @@ fn on_runtime_upgrade_charges_minimum_two_db_writes() { assert_eq!(weight, RocksDbWeight::get().writes(2)); }) } + +#[test] +fn only_one_outstanding_test_at_a_time() { + let num_migration1_calls = Arc::new(Mutex::new(0usize)); + let num_migration2_calls = Arc::new(Mutex::new(0usize)); + + // create two migrations. the first will return < Perbill::one(), which should cause + // pallet-migrations to not call the second in the first step. We only step once. + + crate::mock::execute_with_mock_migrations( + &mut |mgr: &mut MockMigrationManager| { + let num_migration1_calls = Arc::clone(&num_migration1_calls); + let num_migration2_calls = Arc::clone(&num_migration2_calls); + + mgr.register_callback( + move || "migration1", + move |_, _| -> (Perbill, Weight) { + let mut num_migration1_calls = num_migration1_calls.lock().unwrap(); + *num_migration1_calls += 1; + (Perbill::zero(), 0u64.into()) + }, + ); + + mgr.register_callback( + move || "migration2", + move |_, _| -> (Perbill, Weight) { + let mut num_migration2_calls = num_migration2_calls.lock().unwrap(); + *num_migration2_calls += 1; + (Perbill::zero(), 0u64.into()) + }, + ); + }, + &mut || { + ExtBuilder::default().build().execute_with(|| { + Migrations::on_runtime_upgrade(); + }); + }, + ); + + assert_eq!( + *num_migration1_calls.lock().unwrap(), + 1, + "mock migration should call friendly_name()" + ); + + assert_eq!( + *num_migration2_calls.lock().unwrap(), + 0, + "mock migration should call friendly_name()" + ); +} From 2e12fd2eea27adbfa15cd193aea9e68869107884 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 21 Jul 2021 10:19:59 -0600 Subject: [PATCH 45/79] Don't start next migration until current is done --- pallets/migrations/src/lib.rs | 9 ++++--- pallets/migrations/src/tests.rs | 43 +++++++++++++++++++++------------ 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index fe0b380d63..76b9976169 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -213,18 +213,19 @@ pub mod pallet { ); } + if migration_state != updated_progress { + >::insert(migration_name.as_bytes(), updated_progress); + } + // make note of any unfinished migrations if updated_progress < Perbill::one() { done = false; + break; } else { >::deposit_event(Event::MigrationCompleted( migration_name_as_bytes.into(), )); } - - if migration_state != updated_progress { - >::insert(migration_name.as_bytes(), updated_progress); - } } } diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index b677e6a87c..2bf42f3295 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -316,8 +316,8 @@ fn only_one_outstanding_test_at_a_time() { let num_migration1_calls = Arc::new(Mutex::new(0usize)); let num_migration2_calls = Arc::new(Mutex::new(0usize)); - // create two migrations. the first will return < Perbill::one(), which should cause - // pallet-migrations to not call the second in the first step. We only step once. + // create two migrations. the first will return < Perbill::one() until its 3rd step, which + // should prevent the second from running. Once it s done, the second should execute. crate::mock::execute_with_mock_migrations( &mut |mgr: &mut MockMigrationManager| { @@ -329,7 +329,13 @@ fn only_one_outstanding_test_at_a_time() { move |_, _| -> (Perbill, Weight) { let mut num_migration1_calls = num_migration1_calls.lock().unwrap(); *num_migration1_calls += 1; - (Perbill::zero(), 0u64.into()) + + // this migration is done on its 3rd step + if *num_migration1_calls < 3 { + (Perbill::zero(), 0u64.into()) + } else { + (Perbill::one(), 0u64.into()) + } }, ); @@ -338,26 +344,31 @@ fn only_one_outstanding_test_at_a_time() { move |_, _| -> (Perbill, Weight) { let mut num_migration2_calls = num_migration2_calls.lock().unwrap(); *num_migration2_calls += 1; - (Perbill::zero(), 0u64.into()) + (Perbill::one(), 0u64.into()) }, ); }, &mut || { ExtBuilder::default().build().execute_with(|| { + + // first pass should invoke migration1 once and not move on to migration2 Migrations::on_runtime_upgrade(); - }); - }, - ); + assert_eq!(*num_migration1_calls.lock().unwrap(), 1); + assert_eq!(*num_migration2_calls.lock().unwrap(), 0); - assert_eq!( - *num_migration1_calls.lock().unwrap(), - 1, - "mock migration should call friendly_name()" - ); + // second pass should do the same + crate::mock::roll_to(2, false); + assert_eq!(*num_migration1_calls.lock().unwrap(), 2); + assert_eq!(*num_migration2_calls.lock().unwrap(), 0); - assert_eq!( - *num_migration2_calls.lock().unwrap(), - 0, - "mock migration should call friendly_name()" + // third pass should invoke both + crate::mock::roll_to(3, false); + assert_eq!(*num_migration1_calls.lock().unwrap(), 3); + assert_eq!(*num_migration2_calls.lock().unwrap(), 1); + + // and both should be done now + assert_eq!(Migrations::is_fully_upgraded(), true); + }); + }, ); } From 9a9bfd4d2256ca0127574b6e55100bae65b8f3d1 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 22 Jul 2021 09:46:04 -0600 Subject: [PATCH 46/79] Add notes from meeting --- pallets/migrations/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 76b9976169..d580f24d93 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -100,6 +100,10 @@ pub mod pallet { let mut weight: Weight = 0u64.into(); // start by flagging that we are not fully upgraded + // TODO: case where this is already false (e.g. we started an upgrade while one was + // already in progress) + // notably, we might have started an individual migration and the list of + // migrations might change on our next on_runtime_upgrade() >::put(false); weight += T::DbWeight::get().writes(1); Self::deposit_event(Event::RuntimeUpgradeStarted()); @@ -114,6 +118,7 @@ pub mod pallet { fn on_initialize(_: T::BlockNumber) -> Weight { let mut weight: Weight = T::DbWeight::get().reads(1 as Weight); + // TODO: don't support this now, it's dangerous! if !>::get() { weight += process_runtime_upgrades::(); } From 274457150809b9506ca785326fc592bffcd3e159 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 22 Jul 2021 11:05:53 -0600 Subject: [PATCH 47/79] Allow multi-block migrations to be disabled --- pallets/migrations/src/lib.rs | 17 ++++++++++++++--- pallets/migrations/src/mock.rs | 25 +++++++++++++++++++++++- pallets/migrations/src/tests.rs | 34 +++++++++++++++++++++++++++++++++ runtime/moonbase/src/lib.rs | 6 ++++++ 4 files changed, 78 insertions(+), 4 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index d580f24d93..055b193838 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -73,6 +73,8 @@ pub mod pallet { type Event: From> + IsType<::Event>; /// The list of migrations that will be performed type MigrationsList: Get>>; + /// Whether or not multi-block migrations are supported + type MultiBlockMigrationsSupported: Get; } #[pallet::event] @@ -110,6 +112,14 @@ pub mod pallet { weight += process_runtime_upgrades::(); + // at least emit a warning if we aren't going to end up finishing our migrations... + if ! T::MultiBlockMigrationsSupported::get() { + if ! >::get() { + log::warn!("migrations weren't completed in on_runtime_upgrade(), but we're not + configured for multi-block migrations; state is potentially inconsistent!"); + } + } + weight } @@ -118,9 +128,10 @@ pub mod pallet { fn on_initialize(_: T::BlockNumber) -> Weight { let mut weight: Weight = T::DbWeight::get().reads(1 as Weight); - // TODO: don't support this now, it's dangerous! - if !>::get() { - weight += process_runtime_upgrades::(); + if T::MultiBlockMigrationsSupported::get() { + if !>::get() { + weight += process_runtime_upgrades::(); + } } weight diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index e674e383d2..84954450ef 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -91,10 +91,20 @@ impl frame_system::Config for Test { /// A pair of callbacks provided to register_callback() will map directly to a single instance of /// Migration (done by the MockMigration glue below). Treat each pair of callbacks as though it were /// a custom implementation of the Migration trait just as a normal Pallet would. -#[derive(Default)] pub struct MockMigrationManager<'test> { name_fn_callbacks: Vec &'static str>>, step_fn_callbacks: Vec (Perbill, Weight)>>, + pub is_multi_block: bool, // corresponds to MultiBlockMigrationsSupported. defaults to true. +} + +impl Default for MockMigrationManager<'_> { + fn default() -> Self { + Self { + name_fn_callbacks: Default::default(), + step_fn_callbacks: Default::default(), + is_multi_block: true, + } + } } impl<'test> MockMigrationManager<'test> { @@ -188,9 +198,22 @@ impl Get>> for MockMigrations { } } +/// Similar to the impl for Get>> but we return a value suitable for +/// MultiBlockMigrationsSupported +impl Get for MockMigrations { + fn get() -> bool { + let mut supported = false; + MOCK_MIGRATIONS_LIST::with(|mgr: &mut MockMigrationManager| { + supported = mgr.is_multi_block; + }); + supported + } +} + impl Config for Test { type Event = Event; type MigrationsList = MockMigrations; + type MultiBlockMigrationsSupported = MockMigrations; } /// Externality builder for pallet migration's mock runtime diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 2bf42f3295..9e6d333f3a 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -372,3 +372,37 @@ fn only_one_outstanding_test_at_a_time() { }, ); } + +#[test] +fn multi_block_migration_flag_works() { + let num_migration_calls = Arc::new(Mutex::new(0u32)); + + // we create a single migration that wants to take more than one block and ensure that it's only + // called once + + crate::mock::execute_with_mock_migrations( + &mut |mgr: &mut MockMigrationManager| { + let num_migration_calls = Arc::clone(&num_migration_calls); + + mgr.is_multi_block = false; + + mgr.register_callback( + move || { + "migration1" + }, + move |_, _| -> (Perbill, Weight) { + *num_migration_calls.lock().unwrap() += 1; + (Perbill::zero(), 0u64.into()) + }, + ); + }, + &mut || { + ExtBuilder::default().build().execute_with(|| { + crate::mock::roll_to(5, true); + + assert_eq!(*num_migration_calls.lock().unwrap(), 1); + assert_eq!(Migrations::is_fully_upgraded(), false); + }); + }, + ); +} diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index afe07161d1..de374e71eb 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -753,9 +753,15 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = AnnouncementDepositFactor; } +parameter_types! { + // Our runtime dosen't support multi-block migrations currently + pub const MultiBlockMigrationsNotSupported: bool = false; +} + impl Config for Runtime { type Event = Event; type MigrationsList = runtime_common::migrations::CommonMigrations; + type MultiBlockMigrationsSupported = MultiBlockMigrationsNotSupported; } construct_runtime! { From e1f49c6ddc23f3231baa0123f53f6e8b803f6db5 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 22 Jul 2021 11:30:44 -0600 Subject: [PATCH 48/79] Add failing test about overweight migrations --- pallets/migrations/src/tests.rs | 65 +++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 9e6d333f3a..cd6e6fbf34 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -406,3 +406,68 @@ fn multi_block_migration_flag_works() { }, ); } + +#[test] +fn overweight_migrations_tolerated() { + + // pallet-migrations currently tolerates a migration going over-weight. not only does it + // tolerate it, but it continues on to the next migration even if it's already overweight. + // + // Now that the pallet can be configured to not support multi-block migrations, this is sort of + // a feature and not really a bug -- this test case exists to explicitly acknowledge/protect + // that. + // + // The logic behind this is that we would rather go over-weight and risk a block taking too long + // (which *might* be "catastrophic") than outright prevent migrations from proceeding (which is + // certainly "catastrophic"). + // + // maybe_catastrophic > certainly_catastrophic + + let num_migration1_calls = Arc::new(Mutex::new(0u32)); + let num_migration2_calls = Arc::new(Mutex::new(0u32)); + let num_migration3_calls = Arc::new(Mutex::new(0u32)); + + crate::mock::execute_with_mock_migrations( + &mut |mgr: &mut MockMigrationManager| { + let num_migration1_calls = Arc::clone(&num_migration1_calls); + let num_migration2_calls = Arc::clone(&num_migration2_calls); + let num_migration3_calls = Arc::clone(&num_migration3_calls); + + mgr.is_multi_block = false; + + mgr.register_callback( + move || { "migration1" }, + move |_, _| -> (Perbill, Weight) { + *num_migration1_calls.lock().unwrap() += 1; + (Perbill::one(), 1_000_000_000_000u64.into()) + }, + ); + + mgr.register_callback( + move || { "migration2" }, + move |_, _| -> (Perbill, Weight) { + *num_migration2_calls.lock().unwrap() += 1; + (Perbill::one(), 1_000_000_000_000u64.into()) + }, + ); + + mgr.register_callback( + move || { "migration3" }, + move |_, _| -> (Perbill, Weight) { + *num_migration3_calls.lock().unwrap() += 1; + (Perbill::one(), 1_000_000_000_000u64.into()) + }, + ); + }, + &mut || { + ExtBuilder::default().build().execute_with(|| { + Migrations::on_runtime_upgrade(); + + assert_eq!(*num_migration1_calls.lock().unwrap(), 1); + assert_eq!(*num_migration2_calls.lock().unwrap(), 1); + assert_eq!(*num_migration3_calls.lock().unwrap(), 1); + assert_eq!(Migrations::is_fully_upgraded(), true); + }); + }, + ); +} From 0684874a864b3ea547aad09ffc3dd9c4851c0f06 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 22 Jul 2021 11:44:42 -0600 Subject: [PATCH 49/79] Explicitly embrace allowing overweight migrations --- pallets/migrations/src/lib.rs | 20 +++++++++++++++++++- pallets/migrations/src/tests.rs | 2 ++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 055b193838..eea437b21d 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -198,7 +198,25 @@ pub mod pallet { )); } - let available_for_step = available_weight - weight; + // TODO: here we allow migrations to go overweight because that's "safer" than not + // doing so in the case of MultiBlockMigrationsSupported == false. In this case, any + // migrations not handled in this pass will not occur at all, which will leave + // pallets unmigrated. + // + // Options for handling this more gracefully: + // 1) make this particular logic (whether or not we tolerate this) configurable + // 2) only follow this logic when MultiBlockMigrationsSupported == false + let available_for_step = if available_weight > weight { + available_weight - weight + } else { + log::warn!("previous migration went overweight; + ignoring and providing migration {} 0 weight.", + migration_name, + ); + + 0u64.into() + }; + log::trace!( "stepping migration {}, prev: {:?}, avail weight: {}", migration_name, diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index cd6e6fbf34..e017c8cd25 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -439,6 +439,8 @@ fn overweight_migrations_tolerated() { move || { "migration1" }, move |_, _| -> (Perbill, Weight) { *num_migration1_calls.lock().unwrap() += 1; + // TODO: this is brittle because it assumes it is larger than the value used at + // the top of process_runtime_upgrades() (Perbill::one(), 1_000_000_000_000u64.into()) }, ); From c19a4a1ebf2e020fed98065d8fd05f7cbf3a22da Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 22 Jul 2021 11:50:15 -0600 Subject: [PATCH 50/79] cargo fmt --- pallets/migrations/src/lib.rs | 13 ++++++++----- pallets/migrations/src/tests.rs | 12 ++++-------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index eea437b21d..b5c0593e43 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -113,10 +113,12 @@ pub mod pallet { weight += process_runtime_upgrades::(); // at least emit a warning if we aren't going to end up finishing our migrations... - if ! T::MultiBlockMigrationsSupported::get() { - if ! >::get() { - log::warn!("migrations weren't completed in on_runtime_upgrade(), but we're not - configured for multi-block migrations; state is potentially inconsistent!"); + if !T::MultiBlockMigrationsSupported::get() { + if !>::get() { + log::warn!( + "migrations weren't completed in on_runtime_upgrade(), but we're not + configured for multi-block migrations; state is potentially inconsistent!" + ); } } @@ -209,7 +211,8 @@ pub mod pallet { let available_for_step = if available_weight > weight { available_weight - weight } else { - log::warn!("previous migration went overweight; + log::warn!( + "previous migration went overweight; ignoring and providing migration {} 0 weight.", migration_name, ); diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index e017c8cd25..40ef4847c3 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -350,7 +350,6 @@ fn only_one_outstanding_test_at_a_time() { }, &mut || { ExtBuilder::default().build().execute_with(|| { - // first pass should invoke migration1 once and not move on to migration2 Migrations::on_runtime_upgrade(); assert_eq!(*num_migration1_calls.lock().unwrap(), 1); @@ -387,9 +386,7 @@ fn multi_block_migration_flag_works() { mgr.is_multi_block = false; mgr.register_callback( - move || { - "migration1" - }, + move || "migration1", move |_, _| -> (Perbill, Weight) { *num_migration_calls.lock().unwrap() += 1; (Perbill::zero(), 0u64.into()) @@ -409,7 +406,6 @@ fn multi_block_migration_flag_works() { #[test] fn overweight_migrations_tolerated() { - // pallet-migrations currently tolerates a migration going over-weight. not only does it // tolerate it, but it continues on to the next migration even if it's already overweight. // @@ -436,7 +432,7 @@ fn overweight_migrations_tolerated() { mgr.is_multi_block = false; mgr.register_callback( - move || { "migration1" }, + move || "migration1", move |_, _| -> (Perbill, Weight) { *num_migration1_calls.lock().unwrap() += 1; // TODO: this is brittle because it assumes it is larger than the value used at @@ -446,7 +442,7 @@ fn overweight_migrations_tolerated() { ); mgr.register_callback( - move || { "migration2" }, + move || "migration2", move |_, _| -> (Perbill, Weight) { *num_migration2_calls.lock().unwrap() += 1; (Perbill::one(), 1_000_000_000_000u64.into()) @@ -454,7 +450,7 @@ fn overweight_migrations_tolerated() { ); mgr.register_callback( - move || { "migration3" }, + move || "migration3", move |_, _| -> (Perbill, Weight) { *num_migration3_calls.lock().unwrap() += 1; (Perbill::one(), 1_000_000_000_000u64.into()) From 7d57a4ebb5180cc7356e77fea1f3191e34a4897c Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 26 Jul 2021 08:14:55 -0600 Subject: [PATCH 51/79] Clean up / add comments --- pallets/migrations/src/lib.rs | 12 ++++-------- pallets/migrations/src/mock.rs | 3 ++- pallets/migrations/src/tests.rs | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index b5c0593e43..f578ac9374 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -43,8 +43,9 @@ pub trait Migration { /// its logic in small batches across as many blocks as needed. /// /// Implementations should perform as much migration work as possible and then leave their - /// pallet in a valid state from which another 'step' of migration work can be performed. In no - /// case should a step consume more than `available_weight`. + /// pallet in a valid state from which another 'step' of migration work can be performed. + /// Consuming more weight than `available_weight` is dangerous and can lead to invalid blocks + /// for parachains. /// /// This should return a perbill indicating the aggregate progress of the migration. If /// `Perbill::one()` is returned, the migration is considered complete and no further calls to @@ -59,7 +60,6 @@ pub mod pallet { use super::*; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; - #[allow(unused_imports)] // TODO: why does it detect this as unused? use sp_std::prelude::*; /// Pallet for migrations @@ -230,7 +230,6 @@ pub mod pallet { // perform a step of this migration let (updated_progress, consumed_weight) = migration.step(migration_state, available_for_step); - // TODO: error if progress == 0 still? >::deposit_event(Event::MigrationStepped( migration_name_as_bytes.into(), updated_progress, @@ -239,9 +238,6 @@ pub mod pallet { weight += consumed_weight; if weight > available_weight { - // TODO: the intent here is to complain obnoxiously so that this is caught - // during development. In production, this should probably be tolerated because - // failing is catastrophic. log::error!( "Migration {} consumed more weight than it was given! ({} > {})", migration_name, @@ -254,7 +250,7 @@ pub mod pallet { >::insert(migration_name.as_bytes(), updated_progress); } - // make note of any unfinished migrations + // if we encounter any migrations which are incomplete, we're done for this block if updated_progress < Perbill::one() { done = false; break; diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 84954450ef..6de409b578 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -86,7 +86,8 @@ impl frame_system::Config for Test { /// It is is expected to exist as a singleton, but only remain relevant within the scope of a test. /// /// Tests should use execute_with_mock_migrations(), which will create a MockMigrationManager and -/// provide it to the test. +/// provide it to the test, ensuring that the MockMigrationManager remains valid for the duration of +/// the callback. /// /// A pair of callbacks provided to register_callback() will map directly to a single instance of /// Migration (done by the MockMigration glue below). Treat each pair of callbacks as though it were diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 40ef4847c3..27139c0c8b 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -31,28 +31,45 @@ fn genesis_builder_works() { }) } +// This test ensures that the mock migration mess works, but also serves as a minimal[-ish] example +// of how to use it. See comments within the fn itself for details. #[test] fn mock_migrations_static_hack_works() { let name_fn_called = Arc::new(Mutex::new(false)); let step_fn_called = Arc::new(Mutex::new(false)); let ecb_fn_called = Arc::new(Mutex::new(false)); + // invoke execute_with_mock_migrations(), which will set up the MockMigrationManager properly + // and provide a valid reference to it in the callbacks we create. crate::mock::execute_with_mock_migrations( + + // This callback receives a mutable ref to the mock which we can use to set up the + // migrations we wish to mock. &mut |mgr: &mut MockMigrationManager| { let name_fn_called = Arc::clone(&name_fn_called); let step_fn_called = Arc::clone(&step_fn_called); + // For each migration we wish to mock, we should call register_callback(). The + // callbacks we provide map to pallet-migration's Migration trait functions. mgr.register_callback( + + // mock Migration::friendly_name() move || { *name_fn_called.lock().unwrap() = true; "hello, world" }, + + // mock Migration::step() move |_, _| -> (Perbill, Weight) { *step_fn_called.lock().unwrap() = true; (Perbill::one(), 0u64.into()) }, ); }, + + // This callback provides no parameters, but ensures that the MockMigrationManager + // "singleton" is still valid. Interactions with the pallet should occur here since they + // will implicitly require MockMigrationManager to be in a valid state. &mut || { ExtBuilder::default().build().execute_with(|| { crate::mock::roll_until_upgraded(true); From 3f87f79857a5f411757ac675ae1461b620a737fa Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 26 Jul 2021 08:48:27 -0600 Subject: [PATCH 52/79] Derive block weight from Config (still needs improvement) --- pallets/migrations/src/lib.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index f578ac9374..210b1ba224 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -100,6 +100,8 @@ pub mod pallet { log::warn!("Performing on_runtime_upgrade"); let mut weight: Weight = 0u64.into(); + // TODO: derive a suitable value here, which is probably something < max_block + let available_weight: Weight = T::BlockWeights::get().max_block; // start by flagging that we are not fully upgraded // TODO: case where this is already false (e.g. we started an upgrade while one was @@ -110,7 +112,7 @@ pub mod pallet { weight += T::DbWeight::get().writes(1); Self::deposit_event(Event::RuntimeUpgradeStarted()); - weight += process_runtime_upgrades::(); + weight += process_runtime_upgrades::(available_weight - weight); // at least emit a warning if we aren't going to end up finishing our migrations... if !T::MultiBlockMigrationsSupported::get() { @@ -130,9 +132,12 @@ pub mod pallet { fn on_initialize(_: T::BlockNumber) -> Weight { let mut weight: Weight = T::DbWeight::get().reads(1 as Weight); + // TODO: derive a suitable value here, which is probably something < max_block + let available_weight: Weight = T::BlockWeights::get().max_block; + if T::MultiBlockMigrationsSupported::get() { if !>::get() { - weight += process_runtime_upgrades::(); + weight += process_runtime_upgrades::(available_weight); } } @@ -176,11 +181,9 @@ pub mod pallet { } } - fn process_runtime_upgrades() -> Weight { + fn process_runtime_upgrades(available_weight: Weight) -> Weight { log::info!("stepping runtime upgrade"); - // TODO: query proper value or make configurable - let available_weight: Weight = 500_000_000_000u64.into(); let mut weight: Weight = 0u64.into(); let mut done: bool = true; From 8f6e9e58b375dbf3670153b02b52017fa74da18d Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 26 Jul 2021 09:43:23 -0600 Subject: [PATCH 53/79] cargo fmt --- pallets/migrations/src/tests.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 27139c0c8b..d4df1c6b20 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -42,9 +42,8 @@ fn mock_migrations_static_hack_works() { // invoke execute_with_mock_migrations(), which will set up the MockMigrationManager properly // and provide a valid reference to it in the callbacks we create. crate::mock::execute_with_mock_migrations( - // This callback receives a mutable ref to the mock which we can use to set up the - // migrations we wish to mock. + // migrations we wish to mock. &mut |mgr: &mut MockMigrationManager| { let name_fn_called = Arc::clone(&name_fn_called); let step_fn_called = Arc::clone(&step_fn_called); @@ -52,13 +51,11 @@ fn mock_migrations_static_hack_works() { // For each migration we wish to mock, we should call register_callback(). The // callbacks we provide map to pallet-migration's Migration trait functions. mgr.register_callback( - // mock Migration::friendly_name() move || { *name_fn_called.lock().unwrap() = true; "hello, world" }, - // mock Migration::step() move |_, _| -> (Perbill, Weight) { *step_fn_called.lock().unwrap() = true; @@ -66,7 +63,6 @@ fn mock_migrations_static_hack_works() { }, ); }, - // This callback provides no parameters, but ensures that the MockMigrationManager // "singleton" is still valid. Interactions with the pallet should occur here since they // will implicitly require MockMigrationManager to be in a valid state. From a4e2acc39f5795401aa4a4e1861f7e42ce6fe125 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 26 Jul 2021 10:50:39 -0600 Subject: [PATCH 54/79] Configure all runtimes to include pallet-migrations --- Cargo.lock | 3 +++ node/service/src/chain_spec/moonbeam.rs | 1 + node/service/src/chain_spec/moonriver.rs | 1 + node/service/src/chain_spec/moonshadow.rs | 1 + runtime/moonbeam/Cargo.toml | 2 ++ runtime/moonbeam/src/lib.rs | 13 +++++++++++++ runtime/moonriver/Cargo.toml | 2 ++ runtime/moonriver/src/lib.rs | 13 +++++++++++++ runtime/moonshadow/Cargo.toml | 2 ++ runtime/moonshadow/src/lib.rs | 13 +++++++++++++ 10 files changed, 51 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 91c54befa6..ac2dac1fbe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5206,6 +5206,7 @@ dependencies = [ "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", + "pallet-migrations", "pallet-proxy", "pallet-randomness-collective-flip", "pallet-scheduler", @@ -5398,6 +5399,7 @@ dependencies = [ "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", + "pallet-migrations", "pallet-proxy", "pallet-randomness-collective-flip", "pallet-scheduler", @@ -5472,6 +5474,7 @@ dependencies = [ "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", + "pallet-migrations", "pallet-proxy", "pallet-randomness-collective-flip", "pallet-scheduler", diff --git a/node/service/src/chain_spec/moonbeam.rs b/node/service/src/chain_spec/moonbeam.rs index d3cebce922..8b727ec853 100644 --- a/node/service/src/chain_spec/moonbeam.rs +++ b/node/service/src/chain_spec/moonbeam.rs @@ -250,6 +250,7 @@ pub fn testnet_genesis( .collect(), }, treasury: Default::default(), + migrations: Default::default(), } } diff --git a/node/service/src/chain_spec/moonriver.rs b/node/service/src/chain_spec/moonriver.rs index 16f5a3d4b4..4894c2872c 100644 --- a/node/service/src/chain_spec/moonriver.rs +++ b/node/service/src/chain_spec/moonriver.rs @@ -250,6 +250,7 @@ pub fn testnet_genesis( .collect(), }, treasury: Default::default(), + migrations: Default::default(), } } diff --git a/node/service/src/chain_spec/moonshadow.rs b/node/service/src/chain_spec/moonshadow.rs index d4235dd159..eb64d255f6 100644 --- a/node/service/src/chain_spec/moonshadow.rs +++ b/node/service/src/chain_spec/moonshadow.rs @@ -250,6 +250,7 @@ pub fn testnet_genesis( .collect(), }, treasury: Default::default(), + migrations: Default::default(), } } diff --git a/runtime/moonbeam/Cargo.toml b/runtime/moonbeam/Cargo.toml index b1801f40d9..8c47d5bf5a 100644 --- a/runtime/moonbeam/Cargo.toml +++ b/runtime/moonbeam/Cargo.toml @@ -23,6 +23,7 @@ parachain-staking = { path = "../../pallets/parachain-staking", default-features parachain-staking-precompiles = { path = "../../precompiles/parachain-staking", default-features = false } pallet-author-slot-filter = { git = "https://github.com/purestake/cumulus", branch = "joshy-np098", default-features = false } nimbus-primitives = { git = "https://github.com/purestake/cumulus", branch = "joshy-np098", default-features = false } +pallet-migrations = { path = "../../pallets/migrations", default-features = false } pallet-author-mapping = { path = "../../pallets/author-mapping", default-features = false } evm = { version="0.27.0", default-features=false, features=["with-codec"] } pallet-evm-precompile-bn128 = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-v0.9.8" } @@ -146,6 +147,7 @@ std = [ "parachain-staking/std", "parachain-staking-precompiles/std", "pallet-author-slot-filter/std", + "pallet-migrations/std", "pallet-crowdloan-rewards/std", "frame-benchmarking/std", "pallet-society/std", diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index 7abc91221d..b2b429a7b2 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -52,6 +52,7 @@ use pallet_evm::{ Account as EVMAccount, EnsureAddressNever, EnsureAddressRoot, FeeCalculator, IdentityAddressMapping, Runner, }; +use pallet_migrations::*; use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment}; pub use parachain_staking::{InflationInfo, Range}; use parity_scale_codec::{Decode, Encode}; @@ -766,6 +767,17 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = AnnouncementDepositFactor; } +parameter_types! { + // Our runtime dosen't support multi-block migrations currently + pub const MultiBlockMigrationsNotSupported: bool = false; +} + +impl Config for Runtime { + type Event = Event; + type MigrationsList = runtime_common::migrations::CommonMigrations; + type MultiBlockMigrationsSupported = MultiBlockMigrationsNotSupported; +} + construct_runtime! { pub enum Runtime where Block = Block, @@ -797,6 +809,7 @@ construct_runtime! { CrowdloanRewards: pallet_crowdloan_rewards::{Pallet, Call, Config, Storage, Event}, AuthorMapping: pallet_author_mapping::{Pallet, Call, Config, Storage, Event}, Proxy: pallet_proxy::{Pallet, Call, Storage, Event}, + Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, } } diff --git a/runtime/moonriver/Cargo.toml b/runtime/moonriver/Cargo.toml index 6f40348807..f6e0bb8c35 100644 --- a/runtime/moonriver/Cargo.toml +++ b/runtime/moonriver/Cargo.toml @@ -23,6 +23,7 @@ parachain-staking = { path = "../../pallets/parachain-staking", default-features parachain-staking-precompiles = { path = "../../precompiles/parachain-staking", default-features = false } pallet-author-slot-filter = { git = "https://github.com/purestake/cumulus", branch = "joshy-np098", default-features = false } nimbus-primitives = { git = "https://github.com/purestake/cumulus", branch = "joshy-np098", default-features = false } +pallet-migrations = { path = "../../pallets/migrations", default-features = false } pallet-author-mapping = { path = "../../pallets/author-mapping", default-features = false } evm = { version="0.27.0", default-features=false, features=["with-codec"] } pallet-evm-precompile-bn128 = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-v0.9.8" } @@ -146,6 +147,7 @@ std = [ "parachain-staking/std", "parachain-staking-precompiles/std", "pallet-author-slot-filter/std", + "pallet-migrations/std", "pallet-crowdloan-rewards/std", "frame-benchmarking/std", "pallet-society/std", diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index a83dcbd26c..6c53ba76a9 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -52,6 +52,7 @@ use pallet_evm::{ Account as EVMAccount, EnsureAddressNever, EnsureAddressRoot, FeeCalculator, IdentityAddressMapping, Runner, }; +use pallet_migrations::*; use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment}; pub use parachain_staking::{InflationInfo, Range}; use parity_scale_codec::{Decode, Encode}; @@ -778,6 +779,17 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = AnnouncementDepositFactor; } +parameter_types! { + // Our runtime dosen't support multi-block migrations currently + pub const MultiBlockMigrationsNotSupported: bool = false; +} + +impl Config for Runtime { + type Event = Event; + type MigrationsList = runtime_common::migrations::CommonMigrations; + type MultiBlockMigrationsSupported = MultiBlockMigrationsNotSupported; +} + construct_runtime! { pub enum Runtime where Block = Block, @@ -828,6 +840,7 @@ construct_runtime! { // Crowdloan stuff. CrowdloanRewards: pallet_crowdloan_rewards::{Pallet, Call, Config, Storage, Event} = 90, + Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, } } diff --git a/runtime/moonshadow/Cargo.toml b/runtime/moonshadow/Cargo.toml index 2d59942ca3..c1f36f01bc 100644 --- a/runtime/moonshadow/Cargo.toml +++ b/runtime/moonshadow/Cargo.toml @@ -23,6 +23,7 @@ parachain-staking = { path = "../../pallets/parachain-staking", default-features parachain-staking-precompiles = { path = "../../precompiles/parachain-staking", default-features = false } pallet-author-slot-filter = { git = "https://github.com/purestake/cumulus", branch = "joshy-np098", default-features = false } nimbus-primitives = { git = "https://github.com/purestake/cumulus", branch = "joshy-np098", default-features = false } +pallet-migrations = { path = "../../pallets/migrations", default-features = false } pallet-author-mapping = { path = "../../pallets/author-mapping", default-features = false } evm = { version="0.27.0", default-features=false, features=["with-codec"] } pallet-evm-precompile-bn128 = { git="https://github.com/purestake/frontier", default-features=false, branch="moonbeam-polkadot-v0.9.8" } @@ -146,6 +147,7 @@ std = [ "parachain-staking/std", "parachain-staking-precompiles/std", "pallet-author-slot-filter/std", + "pallet-migrations/std", "pallet-crowdloan-rewards/std", "frame-benchmarking/std", "pallet-society/std", diff --git a/runtime/moonshadow/src/lib.rs b/runtime/moonshadow/src/lib.rs index c3e1423374..430f3f1328 100644 --- a/runtime/moonshadow/src/lib.rs +++ b/runtime/moonshadow/src/lib.rs @@ -52,6 +52,7 @@ use pallet_evm::{ Account as EVMAccount, EnsureAddressNever, EnsureAddressRoot, FeeCalculator, IdentityAddressMapping, Runner, }; +use pallet_migrations::*; use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment}; pub use parachain_staking::{InflationInfo, Range}; use parity_scale_codec::{Decode, Encode}; @@ -765,6 +766,17 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = AnnouncementDepositFactor; } +parameter_types! { + // Our runtime dosen't support multi-block migrations currently + pub const MultiBlockMigrationsNotSupported: bool = false; +} + +impl Config for Runtime { + type Event = Event; + type MigrationsList = runtime_common::migrations::CommonMigrations; + type MultiBlockMigrationsSupported = MultiBlockMigrationsNotSupported; +} + construct_runtime! { pub enum Runtime where Block = Block, @@ -796,6 +808,7 @@ construct_runtime! { CrowdloanRewards: pallet_crowdloan_rewards::{Pallet, Call, Config, Storage, Event}, AuthorMapping: pallet_author_mapping::{Pallet, Call, Config, Storage, Event}, Proxy: pallet_proxy::{Pallet, Call, Storage, Event}, + Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, } } From 41e9d0bc40a584f173a410529f11ace64df79971 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Mon, 26 Jul 2021 12:19:00 -0600 Subject: [PATCH 55/79] Add pallet-migrations genesis to specs --- pallets/migrations/src/lib.rs | 4 ++-- pallets/migrations/src/mock.rs | 2 +- specs/alphanet/parachain-specs-template.json | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 210b1ba224..59b474c1b7 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -159,7 +159,7 @@ pub mod pallet { #[pallet::genesis_config] pub struct GenesisConfig { pub completed_migrations: Vec>, - pub dummy: PhantomData, + pub phantom: PhantomData, } #[cfg(feature = "std")] @@ -167,7 +167,7 @@ pub mod pallet { fn default() -> Self { Self { completed_migrations: vec![], - dummy: PhantomData, + phantom: PhantomData, } } } diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index 6de409b578..bd65255777 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -238,7 +238,7 @@ impl ExtBuilder { pallet_migrations::GenesisConfig:: { completed_migrations: self.completed_migrations, - dummy: Default::default(), + phantom: Default::default(), } .assimilate_storage(&mut t) .expect("Pallet migration's storage can be assimilated"); diff --git a/specs/alphanet/parachain-specs-template.json b/specs/alphanet/parachain-specs-template.json index f70884be21..03b8ed63d4 100644 --- a/specs/alphanet/parachain-specs-template.json +++ b/specs/alphanet/parachain-specs-template.json @@ -199,7 +199,11 @@ ] }, "treasury": {}, - "scheduler": null + "scheduler": null, + "migrations": { + "phantom": null, + "completedMigrations": [] + } } } } From 0a3ae7ea2b3b2ae2da590d756f2b1e99ebd39122 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 29 Jul 2021 12:13:11 -0600 Subject: [PATCH 56/79] Update pallets/migrations/src/lib.rs Co-authored-by: Alexander Popiak --- pallets/migrations/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 59b474c1b7..cc438e265d 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -117,7 +117,7 @@ pub mod pallet { // at least emit a warning if we aren't going to end up finishing our migrations... if !T::MultiBlockMigrationsSupported::get() { if !>::get() { - log::warn!( + log::error!( "migrations weren't completed in on_runtime_upgrade(), but we're not configured for multi-block migrations; state is potentially inconsistent!" ); From 26ef7dbddb0864980889ba96593d641095c883ee Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Thu, 29 Jul 2021 12:13:20 -0600 Subject: [PATCH 57/79] Update pallets/migrations/src/lib.rs Co-authored-by: Alexander Popiak --- pallets/migrations/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index cc438e265d..0e5390e5b3 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -112,7 +112,7 @@ pub mod pallet { weight += T::DbWeight::get().writes(1); Self::deposit_event(Event::RuntimeUpgradeStarted()); - weight += process_runtime_upgrades::(available_weight - weight); + weight += process_runtime_upgrades::(available_weight.saturating_sub(weight)); // at least emit a warning if we aren't going to end up finishing our migrations... if !T::MultiBlockMigrationsSupported::get() { From e6543e61c5034697132dba20bbf88426d55f60ba Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Fri, 13 Aug 2021 14:26:11 -0600 Subject: [PATCH 58/79] First pass at ripping out multi-block migration support --- pallets/migrations/src/lib.rs | 140 ++++++++-------------------------- 1 file changed, 33 insertions(+), 107 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 0e5390e5b3..7858197bfe 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -25,7 +25,6 @@ mod mock; mod tests; use frame_support::{pallet, weights::Weight}; -use sp_runtime::Perbill; pub use pallet::*; @@ -38,21 +37,13 @@ pub trait Migration { /// A human-readable name for this migration. Also used as storage key. fn friendly_name(&self) -> &str; - /// Step through this migration, taking up to `available_weight` of execution time and providing - /// a status on the progress as well as the consumed weight. This allows a migration to perform - /// its logic in small batches across as many blocks as needed. - /// - /// Implementations should perform as much migration work as possible and then leave their - /// pallet in a valid state from which another 'step' of migration work can be performed. - /// Consuming more weight than `available_weight` is dangerous and can lead to invalid blocks - /// for parachains. - /// - /// This should return a perbill indicating the aggregate progress of the migration. If - /// `Perbill::one()` is returned, the migration is considered complete and no further calls to - /// `step()` will be made. Any value less than `Perbill::one()` will result in another future - /// call to `step()`. Indeed, values < 1 are arbitrary, but the intent is to indicate progress - /// (so they should at least be monotonically increasing). - fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight); + /// Perform the required migration and return the weight consumed. + /// + /// Currently there is no way to migrate across blocks, so this method must (1) perform its full + /// migration and (2) not produce a block that has gone over-weight. Not meeting these strict + /// constraints will lead to a bricked chain upon a runtime upgrade because the parachain will + /// not be able to produce a block that the relay chain will accept. + fn migrate(&self, available_weight: Weight) -> Weight; } #[pallet] @@ -73,19 +64,15 @@ pub mod pallet { type Event: From> + IsType<::Event>; /// The list of migrations that will be performed type MigrationsList: Get>>; - /// Whether or not multi-block migrations are supported - type MultiBlockMigrationsSupported: Get; } #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] pub enum Event { RuntimeUpgradeStarted(), - RuntimeUpgradeStepped(Weight), RuntimeUpgradeCompleted(), MigrationStarted(Vec), - MigrationStepped(Vec, Perbill, Weight), - MigrationCompleted(Vec), + MigrationCompleted(Vec, Weight), } #[pallet::hooks] @@ -93,9 +80,6 @@ pub mod pallet { /// on_runtime_upgrade is expected to be called exactly once after a runtime upgrade. /// We use this as a chance to flag that we are now in upgrade-mode and begin our /// migrations. - /// - /// In the event that a migration is expected to take more than one block, ongoing migration - /// work could continue from block-to-block in this pallet's on_initialize function. fn on_runtime_upgrade() -> Weight { log::warn!("Performing on_runtime_upgrade"); @@ -104,41 +88,17 @@ pub mod pallet { let available_weight: Weight = T::BlockWeights::get().max_block; // start by flagging that we are not fully upgraded - // TODO: case where this is already false (e.g. we started an upgrade while one was - // already in progress) - // notably, we might have started an individual migration and the list of - // migrations might change on our next on_runtime_upgrade() >::put(false); weight += T::DbWeight::get().writes(1); Self::deposit_event(Event::RuntimeUpgradeStarted()); - weight += process_runtime_upgrades::(available_weight.saturating_sub(weight)); + weight += perform_runtime_upgrades::(available_weight.saturating_sub(weight)); - // at least emit a warning if we aren't going to end up finishing our migrations... - if !T::MultiBlockMigrationsSupported::get() { - if !>::get() { - log::error!( - "migrations weren't completed in on_runtime_upgrade(), but we're not - configured for multi-block migrations; state is potentially inconsistent!" - ); - } - } - - weight - } - - /// on_initialize implementation. Calls process_runtime_upgrades() if we are still in the - /// middle of a runtime upgrade. - fn on_initialize(_: T::BlockNumber) -> Weight { - let mut weight: Weight = T::DbWeight::get().reads(1 as Weight); - - // TODO: derive a suitable value here, which is probably something < max_block - let available_weight: Weight = T::BlockWeights::get().max_block; - - if T::MultiBlockMigrationsSupported::get() { - if !>::get() { - weight += process_runtime_upgrades::(available_weight); - } + if !>::get() { + log::error!( + "migrations weren't completed in on_runtime_upgrade(), but we're not + configured for multi-block migrations; state is potentially inconsistent!" + ); } weight @@ -153,8 +113,8 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn migration_state)] /// MigrationState tracks the progress of a migration. - /// Maps name (Vec) -> migration progress (Perbill) - type MigrationState = StorageMap<_, Twox64Concat, Vec, Perbill, OptionQuery>; + /// Maps name (Vec) -> whether or not migration has been completed (bool) + type MigrationState = StorageMap<_, Twox64Concat, Vec, bool, OptionQuery>; #[pallet::genesis_config] pub struct GenesisConfig { @@ -176,45 +136,33 @@ pub mod pallet { impl GenesisBuild for GenesisConfig { fn build(&self) { for migration_name in &self.completed_migrations { - >::insert(migration_name, Perbill::one()); + >::insert(migration_name, true); } } } - fn process_runtime_upgrades(available_weight: Weight) -> Weight { - log::info!("stepping runtime upgrade"); - + fn perform_runtime_upgrades(available_weight: Weight) -> Weight { let mut weight: Weight = 0u64.into(); - let mut done: bool = true; for migration in &T::MigrationsList::get() { - // let migration_name = migration.friendly_name(); let migration_name = migration.friendly_name(); let migration_name_as_bytes = migration_name.as_bytes(); log::trace!("evaluating migration {}", migration_name); - let migration_state = - >::get(migration_name_as_bytes).unwrap_or(Perbill::zero()); + let migration_done = + >::get(migration_name_as_bytes).unwrap_or(false); - if migration_state < Perbill::one() { - if migration_state.is_zero() { - >::deposit_event(Event::MigrationStarted( - migration_name_as_bytes.into(), - )); - } + if ! migration_done { + >::deposit_event(Event::MigrationStarted( + migration_name_as_bytes.into(), + )); - // TODO: here we allow migrations to go overweight because that's "safer" than not - // doing so in the case of MultiBlockMigrationsSupported == false. In this case, any - // migrations not handled in this pass will not occur at all, which will leave - // pallets unmigrated. - // - // Options for handling this more gracefully: - // 1) make this particular logic (whether or not we tolerate this) configurable - // 2) only follow this logic when MultiBlockMigrationsSupported == false + // when we go overweight, leave a warning... there's nothing we can really do about + // this scenario other than hope that the block is actually accepted. let available_for_step = if available_weight > weight { available_weight - weight } else { - log::warn!( + log::error!( "previous migration went overweight; ignoring and providing migration {} 0 weight.", migration_name, @@ -224,18 +172,14 @@ pub mod pallet { }; log::trace!( - "stepping migration {}, prev: {:?}, avail weight: {}", + "performing migration {}, avail weight: {}", migration_name, - migration_state, available_for_step ); - // perform a step of this migration - let (updated_progress, consumed_weight) = - migration.step(migration_state, available_for_step); - >::deposit_event(Event::MigrationStepped( + let consumed_weight = migration.migrate(available_for_step); + >::deposit_event(Event::MigrationCompleted( migration_name_as_bytes.into(), - updated_progress, consumed_weight, )); @@ -248,30 +192,12 @@ pub mod pallet { available_for_step ); } - - if migration_state != updated_progress { - >::insert(migration_name.as_bytes(), updated_progress); - } - - // if we encounter any migrations which are incomplete, we're done for this block - if updated_progress < Perbill::one() { - done = false; - break; - } else { - >::deposit_event(Event::MigrationCompleted( - migration_name_as_bytes.into(), - )); - } } } - >::deposit_event(Event::RuntimeUpgradeStepped(weight)); - - if done { - >::deposit_event(Event::RuntimeUpgradeCompleted()); - >::put(true); - weight += T::DbWeight::get().writes(1); - } + >::deposit_event(Event::RuntimeUpgradeCompleted()); + >::put(true); + weight += T::DbWeight::get().writes(1); weight } From 01bc09f4ee7258ff39df7a1b01b3aa63d699a716 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Fri, 13 Aug 2021 15:33:48 -0600 Subject: [PATCH 59/79] Incremental work @ removing multi-block migration support --- pallets/migrations/src/mock.rs | 38 +++------ pallets/migrations/src/tests.rs | 132 +++++--------------------------- 2 files changed, 31 insertions(+), 139 deletions(-) diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index bd65255777..ed65286ff6 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -94,41 +94,38 @@ impl frame_system::Config for Test { /// a custom implementation of the Migration trait just as a normal Pallet would. pub struct MockMigrationManager<'test> { name_fn_callbacks: Vec &'static str>>, - step_fn_callbacks: Vec (Perbill, Weight)>>, - pub is_multi_block: bool, // corresponds to MultiBlockMigrationsSupported. defaults to true. + migrate_fn_callbacks: Vec Weight>>, } impl Default for MockMigrationManager<'_> { fn default() -> Self { Self { name_fn_callbacks: Default::default(), - step_fn_callbacks: Default::default(), - is_multi_block: true, + migrate_fn_callbacks: Default::default(), } } } impl<'test> MockMigrationManager<'test> { - pub fn register_callback(&mut self, name_fn: FN, step_fn: FS) + pub fn register_callback(&mut self, name_fn: FN, migrate_fn: FM) where FN: 'test + FnMut() -> &'static str, - FS: 'test + FnMut(Perbill, Weight) -> (Perbill, Weight), + FM: 'test + FnMut(Weight) -> Weight, { self.name_fn_callbacks.push(Box::new(name_fn)); - self.step_fn_callbacks.push(Box::new(step_fn)); + self.migrate_fn_callbacks.push(Box::new(migrate_fn)); } pub(crate) fn invoke_name_fn(&mut self, index: usize) -> &'static str { self.name_fn_callbacks[index]() } - pub(crate) fn invoke_step_fn( + pub(crate) fn invoke_migrate_fn( &mut self, index: usize, - previous_progress: Perbill, available_weight: Weight, - ) -> (Perbill, Weight) { - self.step_fn_callbacks[index](previous_progress, available_weight) + ) -> Weight { + self.migrate_fn_callbacks[index](available_weight) } fn generate_migrations_list(&self) -> Vec> { @@ -177,10 +174,10 @@ impl Migration for MockMigration { }); result } - fn step(&self, previous_progress: Perbill, available_weight: Weight) -> (Perbill, Weight) { - let mut result: (Perbill, Weight) = (Perbill::zero(), 0u64.into()); + fn migrate(&self, available_weight: Weight) -> Weight { + let mut result: Weight = 0u64.into(); MOCK_MIGRATIONS_LIST::with(|mgr: &mut MockMigrationManager| { - result = mgr.invoke_step_fn(self.index, previous_progress, available_weight); + result = mgr.invoke_migrate_fn(self.index, available_weight); }); result } @@ -199,22 +196,9 @@ impl Get>> for MockMigrations { } } -/// Similar to the impl for Get>> but we return a value suitable for -/// MultiBlockMigrationsSupported -impl Get for MockMigrations { - fn get() -> bool { - let mut supported = false; - MOCK_MIGRATIONS_LIST::with(|mgr: &mut MockMigrationManager| { - supported = mgr.is_multi_block; - }); - supported - } -} - impl Config for Test { type Event = Event; type MigrationsList = MockMigrations; - type MultiBlockMigrationsSupported = MockMigrations; } /// Externality builder for pallet migration's mock runtime diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index d4df1c6b20..86896fb07d 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -57,9 +57,9 @@ fn mock_migrations_static_hack_works() { "hello, world" }, // mock Migration::step() - move |_, _| -> (Perbill, Weight) { + move |_| -> Weight { *step_fn_called.lock().unwrap() = true; - (Perbill::one(), 0u64.into()) + 0u64.into() }, ); }, @@ -122,13 +122,13 @@ fn step_called_until_done() { mgr.register_callback( move || "migration1", - move |_, _| -> (Perbill, Weight) { + move |_| -> Weight { let mut num_step_calls = num_step_calls.lock().unwrap(); *num_step_calls += 1; if *num_step_calls == 10 { - (Perbill::one(), 0u64.into()) + 0u64.into() } else { - (Perbill::zero(), 0u64.into()) + 0u64.into() } }, ); @@ -147,67 +147,6 @@ fn step_called_until_done() { ); } -#[test] -fn migration_progress_should_emit_events() { - let num_steps = Arc::new(Mutex::new(0usize)); - - crate::mock::execute_with_mock_migrations( - &mut |mgr: &mut MockMigrationManager| { - let num_steps = Arc::clone(&num_steps); - - mgr.register_callback( - move || "migration1", - move |_, _| -> (Perbill, Weight) { - let mut num_steps = num_steps.lock().unwrap(); - - let result: (Perbill, Weight) = match *num_steps { - 0 => (Perbill::from_percent(50), 50), - 1 => (Perbill::from_percent(60), 51), - 2 => (Perbill::from_percent(70), 52), - 3 => (Perbill::from_percent(80), 53), - 4 => (Perbill::from_percent(100), 1), - _ => { - unreachable!(); - } - }; - - *num_steps += 1; - result - }, - ); - }, - &mut || { - ExtBuilder::default().build().execute_with(|| { - crate::mock::roll_until_upgraded(true); - - let expected = vec![ - Event::RuntimeUpgradeStarted(), - Event::MigrationStarted("migration1".into()), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(50), 50), - Event::RuntimeUpgradeStepped(50), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(60), 51), - Event::RuntimeUpgradeStepped(51), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(70), 52), - Event::RuntimeUpgradeStepped(52), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(80), 53), - Event::RuntimeUpgradeStepped(53), - Event::MigrationStepped("migration1".into(), Perbill::from_percent(100), 1), - Event::MigrationCompleted("migration1".into()), - Event::RuntimeUpgradeStepped(1), - Event::RuntimeUpgradeCompleted(), - ]; - assert_eq!(events(), expected); - }); - }, - ); - - assert_eq!( - *num_steps.lock().unwrap(), - 5, - "migration step should be called until done" - ); -} - #[test] fn migration_should_only_be_invoked_once() { let num_name_fn_calls = Arc::new(Mutex::new(0usize)); @@ -224,10 +163,10 @@ fn migration_should_only_be_invoked_once() { *num_name_fn_calls += 1; "migration1" }, - move |_, _| -> (Perbill, Weight) { + move |_| -> Weight { let mut num_step_fn_calls = num_step_fn_calls.lock().unwrap(); *num_step_fn_calls += 1; - (Perbill::one(), 1) // immediately done + 1u32.into() }, ); }, @@ -339,25 +278,25 @@ fn only_one_outstanding_test_at_a_time() { mgr.register_callback( move || "migration1", - move |_, _| -> (Perbill, Weight) { + move |_| -> Weight { let mut num_migration1_calls = num_migration1_calls.lock().unwrap(); *num_migration1_calls += 1; // this migration is done on its 3rd step if *num_migration1_calls < 3 { - (Perbill::zero(), 0u64.into()) + 0u64.into() } else { - (Perbill::one(), 0u64.into()) + 0u64.into() } }, ); mgr.register_callback( move || "migration2", - move |_, _| -> (Perbill, Weight) { + move |_| -> Weight { let mut num_migration2_calls = num_migration2_calls.lock().unwrap(); *num_migration2_calls += 1; - (Perbill::one(), 0u64.into()) + 0u64.into() }, ); }, @@ -385,38 +324,6 @@ fn only_one_outstanding_test_at_a_time() { ); } -#[test] -fn multi_block_migration_flag_works() { - let num_migration_calls = Arc::new(Mutex::new(0u32)); - - // we create a single migration that wants to take more than one block and ensure that it's only - // called once - - crate::mock::execute_with_mock_migrations( - &mut |mgr: &mut MockMigrationManager| { - let num_migration_calls = Arc::clone(&num_migration_calls); - - mgr.is_multi_block = false; - - mgr.register_callback( - move || "migration1", - move |_, _| -> (Perbill, Weight) { - *num_migration_calls.lock().unwrap() += 1; - (Perbill::zero(), 0u64.into()) - }, - ); - }, - &mut || { - ExtBuilder::default().build().execute_with(|| { - crate::mock::roll_to(5, true); - - assert_eq!(*num_migration_calls.lock().unwrap(), 1); - assert_eq!(Migrations::is_fully_upgraded(), false); - }); - }, - ); -} - #[test] fn overweight_migrations_tolerated() { // pallet-migrations currently tolerates a migration going over-weight. not only does it @@ -442,31 +349,32 @@ fn overweight_migrations_tolerated() { let num_migration2_calls = Arc::clone(&num_migration2_calls); let num_migration3_calls = Arc::clone(&num_migration3_calls); - mgr.is_multi_block = false; + panic!("fix me"); // this is a valid test but needs adapting to no-multi-block-support + // mgr.is_multi_block = false; mgr.register_callback( move || "migration1", - move |_, _| -> (Perbill, Weight) { + move |_| -> Weight { *num_migration1_calls.lock().unwrap() += 1; // TODO: this is brittle because it assumes it is larger than the value used at // the top of process_runtime_upgrades() - (Perbill::one(), 1_000_000_000_000u64.into()) + 1_000_000_000_000u64.into() }, ); mgr.register_callback( move || "migration2", - move |_, _| -> (Perbill, Weight) { + move |_| -> Weight { *num_migration2_calls.lock().unwrap() += 1; - (Perbill::one(), 1_000_000_000_000u64.into()) + 1_000_000_000_000u64.into() }, ); mgr.register_callback( move || "migration3", - move |_, _| -> (Perbill, Weight) { + move |_| -> Weight { *num_migration3_calls.lock().unwrap() += 1; - (Perbill::one(), 1_000_000_000_000u64.into()) + 1_000_000_000_000u64.into() }, ); }, From d2e5759c25f586b2099fc3329db71bd30b3ed7fa Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Fri, 13 Aug 2021 16:01:52 -0600 Subject: [PATCH 60/79] Make migration tests compile (not passing yet) --- pallets/migrations/src/lib.rs | 4 ++-- pallets/migrations/src/tests.rs | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 7858197bfe..c70720bb52 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -70,7 +70,7 @@ pub mod pallet { #[pallet::generate_deposit(pub(crate) fn deposit_event)] pub enum Event { RuntimeUpgradeStarted(), - RuntimeUpgradeCompleted(), + RuntimeUpgradeCompleted(Weight), MigrationStarted(Vec), MigrationCompleted(Vec, Weight), } @@ -195,9 +195,9 @@ pub mod pallet { } } - >::deposit_event(Event::RuntimeUpgradeCompleted()); >::put(true); weight += T::DbWeight::get().writes(1); + >::deposit_event(Event::RuntimeUpgradeCompleted(weight)); weight } diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 86896fb07d..b64b096afa 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -105,8 +105,7 @@ fn on_runtime_upgrade_emits_events() { let expected = vec![ Event::RuntimeUpgradeStarted(), - Event::RuntimeUpgradeStepped(0u64.into()), - Event::RuntimeUpgradeCompleted(), + Event::RuntimeUpgradeCompleted(0u64.into()), ]; assert_eq!(events(), expected); }); @@ -189,10 +188,8 @@ fn migration_should_only_be_invoked_once() { let mut expected = vec![ Event::RuntimeUpgradeStarted(), Event::MigrationStarted("migration1".into()), - Event::MigrationStepped("migration1".into(), Perbill::one(), 1), - Event::MigrationCompleted("migration1".into()), - Event::RuntimeUpgradeStepped(1), - Event::RuntimeUpgradeCompleted(), + Event::MigrationCompleted("migration1".into(), 1u32.into()), + Event::RuntimeUpgradeCompleted(1u32.into()), ]; assert_eq!(events(), expected); @@ -214,8 +211,7 @@ fn migration_should_only_be_invoked_once() { ); expected.append(&mut vec![ Event::RuntimeUpgradeStarted(), - Event::RuntimeUpgradeStepped(0), - Event::RuntimeUpgradeCompleted(), + Event::RuntimeUpgradeCompleted(0u32.into()), ]); assert_eq!(events(), expected); From 38ee3a4adc4d0a7db1cd8a2876eed6ebbfe58642 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 17 Aug 2021 13:47:31 -0600 Subject: [PATCH 61/79] Clean up runtime to reflect removal of multi-block migrations --- runtime/common/src/migrations.rs | 22 ++++++++++++---------- runtime/moonbase/src/lib.rs | 6 ------ runtime/moonbeam/src/lib.rs | 6 ------ runtime/moonriver/src/lib.rs | 6 ------ runtime/moonshadow/src/lib.rs | 6 ------ 5 files changed, 12 insertions(+), 34 deletions(-) diff --git a/runtime/common/src/migrations.rs b/runtime/common/src/migrations.rs index abbc87a2ed..e4c38cf21c 100644 --- a/runtime/common/src/migrations.rs +++ b/runtime/common/src/migrations.rs @@ -16,24 +16,23 @@ //! # Migrations -use frame_support::{pallet_prelude::Get, weights::Weight}; +use frame_support::pallet_prelude::Get; use pallet_migrations::Migration; -use sp_runtime::Perbill; use sp_std::prelude::*; /// This module acts as a registry where each migration is defined. Each migration should implement /// the "Migration" trait declared in the pallet-migrations crate. +/* + * These are left as examples. #[allow(non_camel_case_types)] pub struct MM_001_AuthorMappingAddDeposit; impl Migration for MM_001_AuthorMappingAddDeposit { fn friendly_name(&self) -> &str { "AuthorMappingAddDeposit" } - fn step(&self, _previous_progress: Perbill, _available_weight: Weight) -> (Perbill, Weight) { - // reviewer note: this isn't meant to imply that migration code must live here. As noted - // elsewhere, I would expect migration code to live close to the pallet it affects. - (Perbill::one(), 0u64.into()) + fn migrate(&self, _available_weight: Weight) -> Weight { + 0u64.into() } } @@ -43,8 +42,8 @@ impl Migration for MM_002_StakingFixTotalBalance { fn friendly_name(&self) -> &str { "StakingFixTotalBalance" } - fn step(&self, _previous_progress: Perbill, _available_weight: Weight) -> (Perbill, Weight) { - (Perbill::one(), 0u64.into()) + fn migrate(&self, _available_weight: Weight) -> Weight { + 0u64.into() } } @@ -54,10 +53,11 @@ impl Migration for MM_003_StakingUnboundedCollatorNominations { fn friendly_name(&self) -> &str { "StakingUnboundedCollatorNominations" } - fn step(&self, _previous_progress: Perbill, _available_weight: Weight) -> (Perbill, Weight) { - (Perbill::one(), 0u64.into()) + fn migrate(&self, _available_weight: Weight) -> Weight { + 0u64.into() } } +*/ pub struct CommonMigrations; impl Get>> for CommonMigrations { @@ -65,9 +65,11 @@ impl Get>> for CommonMigrations { // TODO: this is a lot of allocation to do upon every get() call. this *should* be avoided // except when pallet_migrations undergoes a runtime upgrade -- but TODO: review vec![ + /* Box::new(MM_001_AuthorMappingAddDeposit), Box::new(MM_002_StakingFixTotalBalance), Box::new(MM_003_StakingUnboundedCollatorNominations), + */ ] } } diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index e14303ce34..76fbc6f1b7 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -763,15 +763,9 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = AnnouncementDepositFactor; } -parameter_types! { - // Our runtime dosen't support multi-block migrations currently - pub const MultiBlockMigrationsNotSupported: bool = false; -} - impl Config for Runtime { type Event = Event; type MigrationsList = runtime_common::migrations::CommonMigrations; - type MultiBlockMigrationsSupported = MultiBlockMigrationsNotSupported; } construct_runtime! { diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index b2b429a7b2..4f6185376c 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -767,15 +767,9 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = AnnouncementDepositFactor; } -parameter_types! { - // Our runtime dosen't support multi-block migrations currently - pub const MultiBlockMigrationsNotSupported: bool = false; -} - impl Config for Runtime { type Event = Event; type MigrationsList = runtime_common::migrations::CommonMigrations; - type MultiBlockMigrationsSupported = MultiBlockMigrationsNotSupported; } construct_runtime! { diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index 6c53ba76a9..bf6e379f43 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -779,15 +779,9 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = AnnouncementDepositFactor; } -parameter_types! { - // Our runtime dosen't support multi-block migrations currently - pub const MultiBlockMigrationsNotSupported: bool = false; -} - impl Config for Runtime { type Event = Event; type MigrationsList = runtime_common::migrations::CommonMigrations; - type MultiBlockMigrationsSupported = MultiBlockMigrationsNotSupported; } construct_runtime! { diff --git a/runtime/moonshadow/src/lib.rs b/runtime/moonshadow/src/lib.rs index 430f3f1328..cd2751aec2 100644 --- a/runtime/moonshadow/src/lib.rs +++ b/runtime/moonshadow/src/lib.rs @@ -766,15 +766,9 @@ impl pallet_proxy::Config for Runtime { type AnnouncementDepositFactor = AnnouncementDepositFactor; } -parameter_types! { - // Our runtime dosen't support multi-block migrations currently - pub const MultiBlockMigrationsNotSupported: bool = false; -} - impl Config for Runtime { type Event = Event; type MigrationsList = runtime_common::migrations::CommonMigrations; - type MultiBlockMigrationsSupported = MultiBlockMigrationsNotSupported; } construct_runtime! { From 30033ee7a6a5fa52f287cd221dab2d31ef91ab1f Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 17 Aug 2021 14:02:22 -0600 Subject: [PATCH 62/79] You know your tests are good when they catch a critical refactor mistake --- pallets/migrations/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index c70720bb52..f536320962 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -182,6 +182,7 @@ pub mod pallet { migration_name_as_bytes.into(), consumed_weight, )); + >::insert(migration_name_as_bytes, true); weight += consumed_weight; if weight > available_weight { From dfb6f42920cce08df0ee576a0fe885435fe181ea Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 17 Aug 2021 14:02:41 -0600 Subject: [PATCH 63/79] Fix test logic to reflect no multi-block migrations --- pallets/migrations/src/tests.rs | 125 +------------------------------- 1 file changed, 4 insertions(+), 121 deletions(-) diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index b64b096afa..92a7139099 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -18,10 +18,9 @@ use crate::mock::{events, ExtBuilder, Migrations, MockMigrationManager, System}; use crate::Event; use frame_support::{ - traits::{OnInitialize, OnRuntimeUpgrade}, + traits::OnRuntimeUpgrade, weights::{constants::RocksDbWeight, Weight}, }; -use sp_runtime::Perbill; use std::sync::{Arc, Mutex}; #[test] @@ -105,47 +104,12 @@ fn on_runtime_upgrade_emits_events() { let expected = vec![ Event::RuntimeUpgradeStarted(), - Event::RuntimeUpgradeCompleted(0u64.into()), + Event::RuntimeUpgradeCompleted(100000000u64.into()), ]; assert_eq!(events(), expected); }); } -#[test] -fn step_called_until_done() { - let num_step_calls = Arc::new(Mutex::new(0usize)); - - crate::mock::execute_with_mock_migrations( - &mut |mgr: &mut MockMigrationManager| { - let num_step_calls = Arc::clone(&num_step_calls); - - mgr.register_callback( - move || "migration1", - move |_| -> Weight { - let mut num_step_calls = num_step_calls.lock().unwrap(); - *num_step_calls += 1; - if *num_step_calls == 10 { - 0u64.into() - } else { - 0u64.into() - } - }, - ); - }, - &mut || { - ExtBuilder::default().build().execute_with(|| { - crate::mock::roll_until_upgraded(true); - }); - }, - ); - - assert_eq!( - *num_step_calls.lock().unwrap(), - 10, - "migration step should be called until done" - ); -} - #[test] fn migration_should_only_be_invoked_once() { let num_name_fn_calls = Arc::new(Mutex::new(0usize)); @@ -189,7 +153,7 @@ fn migration_should_only_be_invoked_once() { Event::RuntimeUpgradeStarted(), Event::MigrationStarted("migration1".into()), Event::MigrationCompleted("migration1".into(), 1u32.into()), - Event::RuntimeUpgradeCompleted(1u32.into()), + Event::RuntimeUpgradeCompleted(100000001u32.into()), // includes reads/writes ]; assert_eq!(events(), expected); @@ -211,7 +175,7 @@ fn migration_should_only_be_invoked_once() { ); expected.append(&mut vec![ Event::RuntimeUpgradeStarted(), - Event::RuntimeUpgradeCompleted(0u32.into()), + Event::RuntimeUpgradeCompleted(100000000u32.into()), ]); assert_eq!(events(), expected); @@ -234,19 +198,6 @@ fn migration_should_only_be_invoked_once() { ); } -#[test] -fn on_initialize_should_charge_at_least_one_db_read() { - ExtBuilder::default().build().execute_with(|| { - // first call to on_runtime_upgrade should flag FullyUpgraded as true - Migrations::on_runtime_upgrade(); - assert_eq!(Migrations::is_fully_upgraded(), true); - - // and subsequent call to on_initialize should do nothing but read this value and return - let weight = >::on_initialize(1); - assert_eq!(weight, RocksDbWeight::get().reads(1)); - }) -} - #[test] fn on_runtime_upgrade_charges_minimum_two_db_writes() { ExtBuilder::default().build().execute_with(|| { @@ -259,76 +210,11 @@ fn on_runtime_upgrade_charges_minimum_two_db_writes() { }) } -#[test] -fn only_one_outstanding_test_at_a_time() { - let num_migration1_calls = Arc::new(Mutex::new(0usize)); - let num_migration2_calls = Arc::new(Mutex::new(0usize)); - - // create two migrations. the first will return < Perbill::one() until its 3rd step, which - // should prevent the second from running. Once it s done, the second should execute. - - crate::mock::execute_with_mock_migrations( - &mut |mgr: &mut MockMigrationManager| { - let num_migration1_calls = Arc::clone(&num_migration1_calls); - let num_migration2_calls = Arc::clone(&num_migration2_calls); - - mgr.register_callback( - move || "migration1", - move |_| -> Weight { - let mut num_migration1_calls = num_migration1_calls.lock().unwrap(); - *num_migration1_calls += 1; - - // this migration is done on its 3rd step - if *num_migration1_calls < 3 { - 0u64.into() - } else { - 0u64.into() - } - }, - ); - - mgr.register_callback( - move || "migration2", - move |_| -> Weight { - let mut num_migration2_calls = num_migration2_calls.lock().unwrap(); - *num_migration2_calls += 1; - 0u64.into() - }, - ); - }, - &mut || { - ExtBuilder::default().build().execute_with(|| { - // first pass should invoke migration1 once and not move on to migration2 - Migrations::on_runtime_upgrade(); - assert_eq!(*num_migration1_calls.lock().unwrap(), 1); - assert_eq!(*num_migration2_calls.lock().unwrap(), 0); - - // second pass should do the same - crate::mock::roll_to(2, false); - assert_eq!(*num_migration1_calls.lock().unwrap(), 2); - assert_eq!(*num_migration2_calls.lock().unwrap(), 0); - - // third pass should invoke both - crate::mock::roll_to(3, false); - assert_eq!(*num_migration1_calls.lock().unwrap(), 3); - assert_eq!(*num_migration2_calls.lock().unwrap(), 1); - - // and both should be done now - assert_eq!(Migrations::is_fully_upgraded(), true); - }); - }, - ); -} - #[test] fn overweight_migrations_tolerated() { // pallet-migrations currently tolerates a migration going over-weight. not only does it // tolerate it, but it continues on to the next migration even if it's already overweight. // - // Now that the pallet can be configured to not support multi-block migrations, this is sort of - // a feature and not really a bug -- this test case exists to explicitly acknowledge/protect - // that. - // // The logic behind this is that we would rather go over-weight and risk a block taking too long // (which *might* be "catastrophic") than outright prevent migrations from proceeding (which is // certainly "catastrophic"). @@ -345,9 +231,6 @@ fn overweight_migrations_tolerated() { let num_migration2_calls = Arc::clone(&num_migration2_calls); let num_migration3_calls = Arc::clone(&num_migration3_calls); - panic!("fix me"); // this is a valid test but needs adapting to no-multi-block-support - // mgr.is_multi_block = false; - mgr.register_callback( move || "migration1", move |_| -> Weight { From f6919773996ddcd7fb8f09d3782493238466c188 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 17 Aug 2021 14:04:49 -0600 Subject: [PATCH 64/79] cargo fmt --- pallets/migrations/src/lib.rs | 11 ++++------- pallets/migrations/src/mock.rs | 6 +----- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index f536320962..15f0df89cb 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -38,7 +38,7 @@ pub trait Migration { fn friendly_name(&self) -> &str; /// Perform the required migration and return the weight consumed. - /// + /// /// Currently there is no way to migrate across blocks, so this method must (1) perform its full /// migration and (2) not produce a block that has gone over-weight. Not meeting these strict /// constraints will lead to a bricked chain upon a runtime upgrade because the parachain will @@ -149,13 +149,10 @@ pub mod pallet { let migration_name_as_bytes = migration_name.as_bytes(); log::trace!("evaluating migration {}", migration_name); - let migration_done = - >::get(migration_name_as_bytes).unwrap_or(false); + let migration_done = >::get(migration_name_as_bytes).unwrap_or(false); - if ! migration_done { - >::deposit_event(Event::MigrationStarted( - migration_name_as_bytes.into(), - )); + if !migration_done { + >::deposit_event(Event::MigrationStarted(migration_name_as_bytes.into())); // when we go overweight, leave a warning... there's nothing we can really do about // this scenario other than hope that the block is actually accepted. diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index ed65286ff6..c1bd8f6018 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -120,11 +120,7 @@ impl<'test> MockMigrationManager<'test> { self.name_fn_callbacks[index]() } - pub(crate) fn invoke_migrate_fn( - &mut self, - index: usize, - available_weight: Weight, - ) -> Weight { + pub(crate) fn invoke_migrate_fn(&mut self, index: usize, available_weight: Weight) -> Weight { self.migrate_fn_callbacks[index](available_weight) } From dc4281903a07cf9898355d93b8ad0a2032eec7f3 Mon Sep 17 00:00:00 2001 From: Amar Singh Date: Wed, 18 Aug 2021 12:12:33 -0400 Subject: [PATCH 65/79] Remove phantomdata field from pallet_migrations::GenesisConfig (#701) * remove phantomdata from pallet migrations genesis config struct * skip migration if no weight available for step * revert --- pallets/migrations/src/lib.rs | 16 +++------------- pallets/migrations/src/mock.rs | 13 +++++++------ runtime/moonbase/src/lib.rs | 2 +- runtime/moonbeam/src/lib.rs | 2 +- runtime/moonriver/src/lib.rs | 2 +- runtime/moonshadow/src/lib.rs | 2 +- specs/alphanet/parachain-specs-template.json | 1 - 7 files changed, 14 insertions(+), 24 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 15f0df89cb..61bc6d948d 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -117,23 +117,13 @@ pub mod pallet { type MigrationState = StorageMap<_, Twox64Concat, Vec, bool, OptionQuery>; #[pallet::genesis_config] - pub struct GenesisConfig { + #[derive(Default)] + pub struct GenesisConfig { pub completed_migrations: Vec>, - pub phantom: PhantomData, - } - - #[cfg(feature = "std")] - impl Default for GenesisConfig { - fn default() -> Self { - Self { - completed_migrations: vec![], - phantom: PhantomData, - } - } } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl GenesisBuild for GenesisConfig { fn build(&self) { for migration_name in &self.completed_migrations { >::insert(migration_name, true); diff --git a/pallets/migrations/src/mock.rs b/pallets/migrations/src/mock.rs index c1bd8f6018..47814ca4c0 100644 --- a/pallets/migrations/src/mock.rs +++ b/pallets/migrations/src/mock.rs @@ -45,7 +45,7 @@ construct_runtime!( UncheckedExtrinsic = UncheckedExtrinsic, { System: frame_system::{Pallet, Call, Config, Storage, Event}, - Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, + Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, } ); @@ -216,11 +216,12 @@ impl ExtBuilder { .build_storage::() .expect("Frame system builds valid default genesis config"); - pallet_migrations::GenesisConfig:: { - completed_migrations: self.completed_migrations, - phantom: Default::default(), - } - .assimilate_storage(&mut t) + GenesisBuild::::assimilate_storage( + &pallet_migrations::GenesisConfig { + completed_migrations: self.completed_migrations, + }, + &mut t, + ) .expect("Pallet migration's storage can be assimilated"); let mut ext = sp_io::TestExternalities::new(t); diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index 76fbc6f1b7..817771ea4d 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -799,7 +799,7 @@ construct_runtime! { CrowdloanRewards: pallet_crowdloan_rewards::{Pallet, Call, Config, Storage, Event}, AuthorMapping: pallet_author_mapping::{Pallet, Call, Config, Storage, Event}, Proxy: pallet_proxy::{Pallet, Call, Storage, Event}, - Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, + Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, } } diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index 4f6185376c..5883e0bdf8 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -803,7 +803,7 @@ construct_runtime! { CrowdloanRewards: pallet_crowdloan_rewards::{Pallet, Call, Config, Storage, Event}, AuthorMapping: pallet_author_mapping::{Pallet, Call, Config, Storage, Event}, Proxy: pallet_proxy::{Pallet, Call, Storage, Event}, - Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, + Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, } } diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index bf6e379f43..8302129e2e 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -834,7 +834,7 @@ construct_runtime! { // Crowdloan stuff. CrowdloanRewards: pallet_crowdloan_rewards::{Pallet, Call, Config, Storage, Event} = 90, - Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, + Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, } } diff --git a/runtime/moonshadow/src/lib.rs b/runtime/moonshadow/src/lib.rs index cd2751aec2..7f23b7506b 100644 --- a/runtime/moonshadow/src/lib.rs +++ b/runtime/moonshadow/src/lib.rs @@ -802,7 +802,7 @@ construct_runtime! { CrowdloanRewards: pallet_crowdloan_rewards::{Pallet, Call, Config, Storage, Event}, AuthorMapping: pallet_author_mapping::{Pallet, Call, Config, Storage, Event}, Proxy: pallet_proxy::{Pallet, Call, Storage, Event}, - Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, + Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, } } diff --git a/specs/alphanet/parachain-specs-template.json b/specs/alphanet/parachain-specs-template.json index 03b8ed63d4..0ba567276f 100644 --- a/specs/alphanet/parachain-specs-template.json +++ b/specs/alphanet/parachain-specs-template.json @@ -201,7 +201,6 @@ "treasury": {}, "scheduler": null, "migrations": { - "phantom": null, "completedMigrations": [] } } From f31807a44bf9bcb0cdfd6512c050e9348cd56ac6 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 18 Aug 2021 11:42:18 -0600 Subject: [PATCH 66/79] Better log statement Co-authored-by: Amar Singh --- pallets/migrations/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 61bc6d948d..6a97b0377a 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -159,7 +159,7 @@ pub mod pallet { }; log::trace!( - "performing migration {}, avail weight: {}", + "performing migration {}, available weight: {}", migration_name, available_for_step ); From 607e0ee38eb6bdeb2a7cbf0b444776f79e57490c Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 18 Aug 2021 12:16:25 -0600 Subject: [PATCH 67/79] Use ValueQuery instead of OptionQuery --- pallets/migrations/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/migrations/src/lib.rs b/pallets/migrations/src/lib.rs index 6a97b0377a..505694394d 100644 --- a/pallets/migrations/src/lib.rs +++ b/pallets/migrations/src/lib.rs @@ -114,7 +114,7 @@ pub mod pallet { #[pallet::getter(fn migration_state)] /// MigrationState tracks the progress of a migration. /// Maps name (Vec) -> whether or not migration has been completed (bool) - type MigrationState = StorageMap<_, Twox64Concat, Vec, bool, OptionQuery>; + type MigrationState = StorageMap<_, Twox64Concat, Vec, bool, ValueQuery>; #[pallet::genesis_config] #[derive(Default)] @@ -139,7 +139,7 @@ pub mod pallet { let migration_name_as_bytes = migration_name.as_bytes(); log::trace!("evaluating migration {}", migration_name); - let migration_done = >::get(migration_name_as_bytes).unwrap_or(false); + let migration_done = >::get(migration_name_as_bytes); if !migration_done { >::deposit_event(Event::MigrationStarted(migration_name_as_bytes.into())); From 91f92f7f5fe5172e390fb634bf697aa571795524 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 18 Aug 2021 12:40:56 -0600 Subject: [PATCH 68/79] Update Cargo.lock --- Cargo.lock | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 458e84d186..d5628c3236 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5402,6 +5402,81 @@ dependencies = [ "structopt", ] +[[package]] +name = "moonriver-runtime" +version = "0.8.4" +dependencies = [ + "account", + "crowdloan-rewards-precompiles", + "cumulus-pallet-parachain-system", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-primitives-timestamp", + "cumulus-test-relay-sproof-builder", + "evm", + "fp-rpc", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "hex", + "log", + "max-encoded-len", + "moonbeam-core-primitives", + "moonbeam-evm-tracer", + "moonbeam-rpc-primitives-debug", + "moonbeam-rpc-primitives-txpool", + "nimbus-primitives", + "pallet-author-inherent", + "pallet-author-mapping", + "pallet-author-slot-filter", + "pallet-balances", + "pallet-collective", + "pallet-crowdloan-rewards", + "pallet-democracy", + "pallet-ethereum", + "pallet-ethereum-chain-id", + "pallet-evm", + "pallet-evm-precompile-bn128", + "pallet-evm-precompile-dispatch", + "pallet-evm-precompile-modexp", + "pallet-evm-precompile-sha3fips", + "pallet-evm-precompile-simple", + "pallet-migrations", + "pallet-proxy", + "pallet-randomness-collective-flip", + "pallet-scheduler", + "pallet-society", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "parachain-info", + "parachain-staking", + "parachain-staking-precompiles", + "parity-scale-codec", + "precompile-utils", + "rlp", + "runtime-common", + "serde", + "sha3 0.8.2", + "sp-api", + "sp-block-builder", + "sp-core", + "sp-inherents", + "sp-io", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "substrate-wasm-builder", +] + [[package]] name = "more-asserts" version = "0.2.1" From c0e6167886377b9f4b3cbc09814cfe583fb5f871 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 18 Aug 2021 16:13:49 -0600 Subject: [PATCH 69/79] Manually add back version = 3 --- Cargo.lock | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index d5628c3236..2976a5ddcb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "Inflector" version = "0.11.4" From d9e561b74c36091d6f129a8333626b6e515e8ce3 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 18 Aug 2021 16:25:04 -0600 Subject: [PATCH 70/79] Make some deps dev-dependencies --- pallets/migrations/Cargo.toml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pallets/migrations/Cargo.toml b/pallets/migrations/Cargo.toml index 5f0491616b..2458095740 100644 --- a/pallets/migrations/Cargo.toml +++ b/pallets/migrations/Cargo.toml @@ -12,9 +12,11 @@ log = "0.4" sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } parity-scale-codec = { version = "2.0.0", default-features = false } -environmental = { version = "1.1.2", default-features = false } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } + +[dev-dependencies] +environmental = { version = "1.1.2" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } [features] default = ["std"] From a585e3c46921dbbc3e3f4a4a61db20e506c64487 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 8 Sep 2021 14:25:33 -0600 Subject: [PATCH 71/79] Fix branch --- runtime/common/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index b11774992b..161505421c 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -9,9 +9,9 @@ edition = '2018' [dependencies] pallet-migrations = { path = "../../pallets/migrations", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "notlesh-nimbus-v0.9.9-block-response-length", default-features = false } -sp-std = { git = "https://github.com/paritytech/substrate", branch = "notlesh-nimbus-v0.9.9-block-response-length", default-features = false } -frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "notlesh-nimbus-v0.9.9-block-response-length" } +sp-runtime = { git = "https://github.com/purestake/substrate", branch = "crystalin-v0.9.9-block-response-length", default-features = false } +sp-std = { git = "https://github.com/purestake/substrate", branch = "crystalin-v0.9.9-block-response-length", default-features = false } +frame-support = { git = "https://github.com/purestake/substrate", default-features = false, branch = "crystalin-v0.9.9-block-response-length" } log = "0.4" [features] From bdafb76177fdc063eb2378164e8b8676b8406171 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 8 Sep 2021 14:30:56 -0600 Subject: [PATCH 72/79] Use hotfix branch in Migrations --- pallets/migrations/Cargo.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pallets/migrations/Cargo.toml b/pallets/migrations/Cargo.toml index 2458095740..200048235b 100644 --- a/pallets/migrations/Cargo.toml +++ b/pallets/migrations/Cargo.toml @@ -6,17 +6,17 @@ edition = "2018" description = "migrations management pallet" [dependencies] -frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } -frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } +frame-support = { git = "https://github.com/purestake/substrate", branch = "crystalin-v0.9.9-block-response-length", default-features = false } +frame-system = { git = "https://github.com/purestake/substrate", branch = "crystalin-v0.9.9-block-response-length", default-features = false } log = "0.4" -sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8", default-features = false } +sp-std = { git = "https://github.com/purestake/substrate", branch = "crystalin-v0.9.9-block-response-length", default-features = false } +sp-runtime = { git = "https://github.com/purestake/substrate", branch = "crystalin-v0.9.9-block-response-length", default-features = false } parity-scale-codec = { version = "2.0.0", default-features = false } [dev-dependencies] environmental = { version = "1.1.2" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.8" } +sp-io = { git = "https://github.com/purestake/substrate", branch = "crystalin-v0.9.9-block-response-length" } +sp-core = { git = "https://github.com/purestake/substrate", branch = "crystalin-v0.9.9-block-response-length" } [features] default = ["std"] From 9d27292bfa2419477049001ec901099ec8f918c3 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 8 Sep 2021 14:36:54 -0600 Subject: [PATCH 73/79] Clean up from merge --- Cargo.lock | 10 ++++------ runtime/moonbase/src/lib.rs | 7 ++----- runtime/moonbeam/src/lib.rs | 4 ++-- runtime/moonriver/src/lib.rs | 4 ++-- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0a5570d13b..8cd1f710d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,7 +1,5 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - [[package]] name = "Inflector" version = "0.11.4" @@ -5019,9 +5017,9 @@ dependencies = [ "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", - "pallet-migrations", "pallet-identity", "pallet-maintenance-mode", + "pallet-migrations", "pallet-proxy", "pallet-randomness-collective-flip", "pallet-scheduler", @@ -5349,9 +5347,9 @@ dependencies = [ "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", - "pallet-migrations", "pallet-identity", "pallet-maintenance-mode", + "pallet-migrations", "pallet-proxy", "pallet-randomness-collective-flip", "pallet-scheduler", @@ -5544,9 +5542,9 @@ dependencies = [ "pallet-evm-precompile-modexp", "pallet-evm-precompile-sha3fips", "pallet-evm-precompile-simple", - "pallet-migrations", "pallet-identity", "pallet-maintenance-mode", + "pallet-migrations", "pallet-proxy", "pallet-randomness-collective-flip", "pallet-scheduler", @@ -9495,10 +9493,10 @@ name = "runtime-common" version = "0.8.0-dev" dependencies = [ "frame-support", + "log", "pallet-migrations", "sp-runtime", "sp-std", - "log", ] [[package]] diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index f76a24a8d3..3d3da9f9f8 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -52,7 +52,7 @@ use pallet_evm::{ Account as EVMAccount, EnsureAddressNever, EnsureAddressRoot, FeeCalculator, IdentityAddressMapping, Runner, }; -use pallet_migrations::{Pallet, Storage, Config, Event}; +use pallet_migrations::{Pallet, Config}; use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment}; pub use parachain_staking::{InflationInfo, Range}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; @@ -862,12 +862,9 @@ construct_runtime! { CrowdloanRewards: pallet_crowdloan_rewards::{Pallet, Call, Config, Storage, Event} = 20, AuthorMapping: pallet_author_mapping::{Pallet, Call, Config, Storage, Event} = 21, Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 22, -<<<<<<< HEAD - Migrations: pallet_migrations::{Pallet, Storage, Config, Event} = 23, -======= MaintenanceMode: pallet_maintenance_mode::{Pallet, Call, Config, Storage, Event} = 23, Identity: pallet_identity::{Pallet, Call, Storage, Event} = 24, ->>>>>>> master + Migrations: pallet_migrations::{Pallet, Storage, Config, Event} = 25, } } diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index 8ccf74bf52..2f927ad953 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -52,7 +52,7 @@ use pallet_evm::{ Account as EVMAccount, EnsureAddressNever, EnsureAddressRoot, FeeCalculator, IdentityAddressMapping, Runner, }; -use pallet_migrations::{Pallet, Storage, Config, Event}; +use pallet_migrations::{Pallet, Config}; use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment}; pub use parachain_staking::{InflationInfo, Range}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; @@ -856,9 +856,9 @@ construct_runtime! { CrowdloanRewards: pallet_crowdloan_rewards::{Pallet, Call, Config, Storage, Event}, AuthorMapping: pallet_author_mapping::{Pallet, Call, Config, Storage, Event}, Proxy: pallet_proxy::{Pallet, Call, Storage, Event}, - Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, MaintenanceMode: pallet_maintenance_mode::{Pallet, Call, Config, Storage, Event}, Identity: pallet_identity::{Pallet, Call, Storage, Event}, + Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, } } diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index d22cb101bf..f87b1d03d0 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -52,7 +52,7 @@ use pallet_evm::{ Account as EVMAccount, EnsureAddressNever, EnsureAddressRoot, FeeCalculator, IdentityAddressMapping, Runner, }; -use pallet_migrations::{Pallet, Storage, Config, Event}; +use pallet_migrations::{Pallet, Config}; use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment}; pub use parachain_staking::{InflationInfo, Range}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; @@ -843,6 +843,7 @@ construct_runtime! { Proxy: pallet_proxy::{Pallet, Call, Storage, Event} = 31, MaintenanceMode: pallet_maintenance_mode::{Pallet, Call, Config, Storage, Event} = 32, Identity: pallet_identity::{Pallet, Call, Storage, Event} = 33, + Migrations: pallet_migrations::{Pallet, Storage, Config, Event} = 34, // Sudo was previously index 40 @@ -866,7 +867,6 @@ construct_runtime! { // Crowdloan stuff. CrowdloanRewards: pallet_crowdloan_rewards::{Pallet, Call, Config, Storage, Event} = 90, - Migrations: pallet_migrations::{Pallet, Storage, Config, Event}, } } From e346883a56682771d72946898d2093c367257291 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 8 Sep 2021 14:40:24 -0600 Subject: [PATCH 74/79] cargo fmt --- runtime/moonbase/src/lib.rs | 2 +- runtime/moonbeam/src/lib.rs | 2 +- runtime/moonriver/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index 3d3da9f9f8..881d8be9ac 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -52,7 +52,7 @@ use pallet_evm::{ Account as EVMAccount, EnsureAddressNever, EnsureAddressRoot, FeeCalculator, IdentityAddressMapping, Runner, }; -use pallet_migrations::{Pallet, Config}; +use pallet_migrations::{Config, Pallet}; use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment}; pub use parachain_staking::{InflationInfo, Range}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index 2f927ad953..ac5c1ce72e 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -52,7 +52,7 @@ use pallet_evm::{ Account as EVMAccount, EnsureAddressNever, EnsureAddressRoot, FeeCalculator, IdentityAddressMapping, Runner, }; -use pallet_migrations::{Pallet, Config}; +use pallet_migrations::{Config, Pallet}; use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment}; pub use parachain_staking::{InflationInfo, Range}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index f87b1d03d0..201e00839d 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -52,7 +52,7 @@ use pallet_evm::{ Account as EVMAccount, EnsureAddressNever, EnsureAddressRoot, FeeCalculator, IdentityAddressMapping, Runner, }; -use pallet_migrations::{Pallet, Config}; +use pallet_migrations::{Config, Pallet}; use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment}; pub use parachain_staking::{InflationInfo, Range}; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; From 3cb8bb4c26dc065562e5f9acea7ab064ec492e85 Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Wed, 8 Sep 2021 15:37:07 -0600 Subject: [PATCH 75/79] Remove prior hack in test --- pallets/migrations/src/tests.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 92a7139099..491535ea72 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -202,10 +202,6 @@ fn migration_should_only_be_invoked_once() { fn on_runtime_upgrade_charges_minimum_two_db_writes() { ExtBuilder::default().build().execute_with(|| { let mut weight = Migrations::on_runtime_upgrade(); - - // substrate seems to add a write to this call, so substract one for our logic - weight -= RocksDbWeight::get().writes(1); - assert_eq!(weight, RocksDbWeight::get().writes(2)); }) } From 99ca06167d56ec406d6697710dbee0ad93a10c30 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Thu, 16 Sep 2021 16:21:38 -0400 Subject: [PATCH 76/79] cargo.lock --- Cargo.lock | 1533 +++++++++++++++++++++++++++------------------------- 1 file changed, 803 insertions(+), 730 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8cd1f710d4..04f57b44ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "Inflector" version = "0.11.4" @@ -28,13 +30,22 @@ dependencies = [ "sp-std", ] +[[package]] +name = "addr2line" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" +dependencies = [ + "gimli 0.23.0", +] + [[package]] name = "addr2line" version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7a2e47a1fbe209ee101dd6d61285226744c6c8d3c21c8dc878ba6cb9f467f3a" dependencies = [ - "gimli", + "gimli 0.24.0", ] [[package]] @@ -73,7 +84,7 @@ dependencies = [ "aes", "block-cipher", "ghash", - "subtle 2.4.1", + "subtle 2.4.0", ] [[package]] @@ -109,16 +120,16 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" dependencies = [ - "getrandom 0.2.3", - "once_cell 1.8.0", + "getrandom 0.2.2", + "once_cell 1.7.2", "version_check", ] [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" dependencies = [ "memchr", ] @@ -149,9 +160,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.42" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595d3cfa7a60d4555cb5067b99f07142a08ea778de5cf993f7b75c7d8fabc486" +checksum = "81cddc5f91628367664cc7c69714ff08deee8a3efc54623011c772544d7b2767" [[package]] name = "approx" @@ -185,9 +196,9 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrayvec" -version = "0.7.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd" +checksum = "5a2f58b0bb10c380af2b26e57212856b8c9a59e0925b4c20f4a174a49734eaf7" [[package]] name = "asn1_der" @@ -238,16 +249,16 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.4.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" +checksum = "eb877970c7b440ead138f6321a3b5395d6061183af779340b65e20c0fede9146" dependencies = [ "async-task", "concurrent-queue", "fastrand", "futures-lite", - "once_cell 1.8.0", - "slab", + "once_cell 1.7.2", + "vec-arena", ] [[package]] @@ -263,33 +274,34 @@ dependencies = [ "blocking", "futures-lite", "num_cpus", - "once_cell 1.8.0", + "once_cell 1.7.2", ] [[package]] name = "async-io" -version = "1.6.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" +checksum = "9315f8f07556761c3e48fec2e6b276004acf426e6dc068b2c2251854d65ee0fd" dependencies = [ "concurrent-queue", + "fastrand", "futures-lite", "libc", "log", - "once_cell 1.8.0", + "nb-connect", + "once_cell 1.7.2", "parking", "polling", - "slab", - "socket2 0.4.0", + "vec-arena", "waker-fn", "winapi 0.3.9", ] [[package]] name = "async-lock" -version = "2.4.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" +checksum = "1996609732bde4a9988bc42125f55f2af5f3c36370e27c778d5191a4a1b63bfb" dependencies = [ "event-listener", ] @@ -305,9 +317,9 @@ dependencies = [ [[package]] name = "async-process" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f38756dd9ac84671c428afbf7c9f7495feff9ec5b0710f17100098e5b354ac" +checksum = "b21b63ab5a0db0369deb913540af2892750e42d949faacc7a61495ac418a1692" dependencies = [ "async-io", "blocking", @@ -315,7 +327,7 @@ dependencies = [ "event-listener", "futures-lite", "libc", - "once_cell 1.8.0", + "once_cell 1.7.2", "signal-hook", "winapi 0.3.9", ] @@ -332,7 +344,7 @@ dependencies = [ "async-io", "async-lock", "async-process", - "crossbeam-utils 0.8.5", + "crossbeam-utils 0.8.3", "futures-channel", "futures-core", "futures-io", @@ -342,8 +354,8 @@ dependencies = [ "log", "memchr", "num_cpus", - "once_cell 1.8.0", - "pin-project-lite 0.2.7", + "once_cell 1.7.2", + "pin-project-lite 0.2.6", "pin-utils", "slab", "wasm-bindgen-futures", @@ -351,9 +363,9 @@ dependencies = [ [[package]] name = "async-std-resolver" -version = "0.20.3" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed4e2c3da14d8ad45acb1e3191db7a918e9505b6f155b218e70a7c9a1a48c638" +checksum = "4d613d619c2886fc0f4b5a777eceab405b23de82d73f0fc61ae402fdb9bc6fb2" dependencies = [ "async-std", "async-trait", @@ -371,9 +383,9 @@ checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" [[package]] name = "async-trait" -version = "0.1.50" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b98e84bbb4cbcdd97da190ba0c58a1bb0de2c1fdf67d159e192ed766aeca722" +checksum = "44318e776df68115a881de9a8fd1b9e53368d7a4a5ce4cc48517da3393233a5e" dependencies = [ "proc-macro2", "quote", @@ -390,7 +402,7 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.6", ] [[package]] @@ -403,7 +415,7 @@ dependencies = [ "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.6", ] [[package]] @@ -446,16 +458,15 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.60" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7815ea54e4d821e791162e078acbebfd6d8c8939cd559c9335dceb1c8ca7282" +checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" dependencies = [ - "addr2line", - "cc", + "addr2line 0.14.1", "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.25.3", + "object 0.23.0", "rustc-demangle", ] @@ -512,7 +523,7 @@ source = "git+https://github.com/purestake/grandpa-bridge-gadget?branch=notlesh- dependencies = [ "beefy-primitives", "fnv", - "futures 0.3.16", + "futures 0.3.17", "hex", "log", "parity-scale-codec", @@ -542,7 +553,7 @@ source = "git+https://github.com/purestake/grandpa-bridge-gadget?branch=notlesh- dependencies = [ "beefy-gadget", "beefy-primitives", - "futures 0.3.16", + "futures 0.3.17", "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", "jsonrpc-derive 15.1.0", @@ -576,10 +587,11 @@ dependencies = [ [[package]] name = "bincode" -version = "1.3.3" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +checksum = "d175dfa69e619905c4c3cdb7c3c203fa3bdd5d51184e3afdb2742c0280493772" dependencies = [ + "byteorder", "serde", ] @@ -622,9 +634,9 @@ dependencies = [ [[package]] name = "bitvec" -version = "0.20.4" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" +checksum = "1f682656975d3a682daff957be4ddeb65d6ad656737cd821f2d00685ae466af1" dependencies = [ "funty", "radium 0.6.2", @@ -677,9 +689,9 @@ dependencies = [ [[package]] name = "blake3" -version = "0.3.8" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3" +checksum = "e9ff35b701f3914bdb8fad3368d822c766ef2858b2583198e41639b936f09d3f" dependencies = [ "arrayref", "arrayvec 0.5.2", @@ -747,7 +759,7 @@ dependencies = [ "atomic-waker", "fastrand", "futures-lite", - "once_cell 1.8.0", + "once_cell 1.7.2", ] [[package]] @@ -781,7 +793,7 @@ name = "bp-messages" version = "0.1.0" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "bitvec 0.20.4", + "bitvec 0.20.2", "bp-runtime", "frame-support", "frame-system", @@ -917,9 +929,9 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bstr" -version = "0.2.16" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279" +checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" dependencies = [ "lazy_static", "memchr", @@ -937,9 +949,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.7.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" +checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" [[package]] name = "byte-slice-cast" @@ -955,9 +967,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "bytes" @@ -1022,9 +1034,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.69" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" +checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" dependencies = [ "jobserver", ] @@ -1123,9 +1135,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.2.0" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "853eda514c284c2287f4bf20ae614f8781f40a81d32ecda6e91449304dfe077c" +checksum = "10612c0ec0e0a1ff0e97980647cb058a6e7aedb913d01d009c406b8b7d0b26ee" dependencies = [ "glob", "libc", @@ -1224,21 +1236,19 @@ checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" [[package]] name = "cpp_demangle" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea47428dc9d2237f3c6bc134472edfd63ebba0af932e783506dcfd66f10d18a" +checksum = "44919ecaf6f99e8e737bc239408931c9a01e9a6c74814fee8242dd2506b65390" dependencies = [ "cfg-if 1.0.0", + "glob", ] [[package]] -name = "cpufeatures" -version = "0.1.5" +name = "cpuid-bool" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66c99696f6c9dd7f35d486b9d04d7e6e202aa3e8c40d553f2fdf5e7e0c6a71ef" -dependencies = [ - "libc", -] +checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" [[package]] name = "cpuid-bool" @@ -1265,7 +1275,7 @@ dependencies = [ "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli", + "gimli 0.24.0", "log", "regalloc", "serde", @@ -1332,7 +1342,7 @@ dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools 0.10.1", + "itertools 0.10.0", "log", "serde", "smallvec 1.6.1", @@ -1351,12 +1361,12 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.5", + "crossbeam-utils 0.8.3", ] [[package]] @@ -1377,8 +1387,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch 0.9.5", - "crossbeam-utils 0.8.5", + "crossbeam-epoch 0.9.3", + "crossbeam-utils 0.8.3", ] [[package]] @@ -1398,14 +1408,14 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.5" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" +checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.5", + "crossbeam-utils 0.8.3", "lazy_static", - "memoffset 0.6.4", + "memoffset 0.6.1", "scopeguard 1.1.0", ] @@ -1433,10 +1443,11 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" +checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" dependencies = [ + "autocfg 1.0.1", "cfg-if 1.0.0", "lazy_static", ] @@ -1494,7 +1505,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ "generic-array 0.14.4", - "subtle 2.4.1", + "subtle 2.4.0", ] [[package]] @@ -1545,7 +1556,7 @@ dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-primitives-core", - "futures 0.3.16", + "futures 0.3.17", "parity-scale-codec", "parking_lot 0.10.2", "polkadot-node-primitives", @@ -1568,7 +1579,7 @@ source = "git+https://github.com/purestake/cumulus?branch=notlesh-nimbus-v0.9.9- dependencies = [ "async-trait", "dyn-clone", - "futures 0.3.16", + "futures 0.3.17", "parity-scale-codec", "polkadot-primitives", "polkadot-runtime", @@ -1594,7 +1605,7 @@ dependencies = [ "async-trait", "cumulus-client-consensus-common", "cumulus-primitives-core", - "futures 0.3.16", + "futures 0.3.17", "parity-scale-codec", "parking_lot 0.10.2", "polkadot-client", @@ -1617,7 +1628,7 @@ version = "0.1.0" source = "git+https://github.com/purestake/cumulus?branch=notlesh-nimbus-v0.9.9-block-response-length#fb4a31550b5bbf734e36057fa7a5a6a5de7b5b33" dependencies = [ "derive_more", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "parity-scale-codec", "parking_lot 0.10.2", @@ -1641,7 +1652,7 @@ version = "0.1.0" source = "git+https://github.com/purestake/cumulus?branch=notlesh-nimbus-v0.9.9-block-response-length#fb4a31550b5bbf734e36057fa7a5a6a5de7b5b33" dependencies = [ "cumulus-primitives-core", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "parity-scale-codec", "polkadot-node-primitives", @@ -1792,27 +1803,27 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "2.1.3" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" +checksum = "434e1720189a637d44fe464f4df1e6eb900b4835255b14354497c78af37d9bb8" dependencies = [ "byteorder", "digest 0.8.1", "rand_core 0.5.1", - "subtle 2.4.1", + "subtle 2.4.0", "zeroize", ] [[package]] name = "curve25519-dalek" -version = "3.1.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639891fde0dbea823fc3d798a0fdf9d2f9440a42d64a78ab3488b0ca025117b3" +checksum = "f627126b946c25a4638eec0ea634fc52506dea98db118aae985118ce7c3d723f" dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", - "subtle 2.4.1", + "subtle 2.4.0", "zeroize", ] @@ -1824,9 +1835,9 @@ checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" [[package]] name = "data-encoding-macro" -version = "0.1.12" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86927b7cd2fe88fa698b87404b287ab98d1a0063a34071d92e575b72d3029aca" +checksum = "0a94feec3d2ba66c0b6621bca8bc6f68415b1e5c69af3586fdd0af9fd9f29b17" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -1834,9 +1845,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.10" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5bbed42daaa95e780b60a50546aa345b8413a1e46f9a40a12907d3598f038db" +checksum = "f0f83e699727abca3c56e187945f303389590305ab2f0185ea445aa66e8d5f2a" dependencies = [ "data-encoding", "syn", @@ -1892,9 +1903,9 @@ dependencies = [ [[package]] name = "directories" -version = "3.0.2" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e69600ff1703123957937708eb27f7a564e48885c537782722ed0ba3189ce1d7" +checksum = "f8fed639d60b58d0f53498ab13d26f621fd77569cc6edb031f4cc36a2ad9da0f" dependencies = [ "dirs-sys", ] @@ -1911,12 +1922,12 @@ dependencies = [ [[package]] name = "dirs-sys" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" dependencies = [ "libc", - "redox_users", + "redox_users 0.3.5", "winapi 0.3.9", ] @@ -1927,7 +1938,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", - "redox_users", + "redox_users 0.4.0", "winapi 0.3.9", ] @@ -1982,9 +1993,9 @@ checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf" [[package]] name = "ed25519" -version = "1.1.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d0860415b12243916284c67a9be413e044ee6668247b99ba26d94b2bc06c8f6" +checksum = "37c66a534cbb46ab4ea03477eae19d5c22c01da8258030280b7bd9d8433fb6ef" dependencies = [ "signature", ] @@ -1995,11 +2006,11 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek 3.1.0", + "curve25519-dalek 3.0.2", "ed25519", "rand 0.7.3", "serde", - "sha2 0.9.5", + "sha2 0.9.3", "zeroize", ] @@ -2073,9 +2084,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" +checksum = "17392a012ea30ef05a610aa97dfb49496e71c9f676b27879922ea5bdf60d9d3f" dependencies = [ "atty", "humantime 2.1.0", @@ -2092,9 +2103,9 @@ checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" [[package]] name = "erased-serde" -version = "0.3.16" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3de9ad4541d99dc22b59134e7ff8dc3d6c988c89ecd7324bf10a8362b07a2afa" +checksum = "0465971a8cc1fa2455c8465aaa377131e1f1cf4983280f474a13e68793aa770c" dependencies = [ "serde", ] @@ -2122,12 +2133,12 @@ dependencies = [ [[package]] name = "escargot" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bb3f795fe1b9d34f089c7fab034c2b757998d65361d95ef008045b57665262" +checksum = "ab01c2450bed354679e78bedbff1484e02910ef1be96755086a36cadd1247efa" dependencies = [ "log", - "once_cell 1.8.0", + "once_cell 1.7.2", "serde", "serde_json", ] @@ -2252,7 +2263,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", ] [[package]] @@ -2291,9 +2302,9 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b394ed3d285a429378d3b384b9eb1285267e7df4b166df24b7a6939a04dc392e" +checksum = "ca5faf057445ce5c9d4329e382b2ce7ca38550ef3b73a5348362d5f24e0c7fe3" dependencies = [ "instant", ] @@ -2301,14 +2312,14 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "async-trait", "derive_more", "fc-db", "fp-consensus", "fp-rpc", - "futures 0.3.16", + "futures 0.3.17", "log", "parity-scale-codec", "sc-client-api", @@ -2327,7 +2338,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "fp-storage", "kvdb", @@ -2343,13 +2354,13 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "fc-consensus", "fc-db", "fp-consensus", "fp-rpc", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "log", "sc-client-api", @@ -2361,7 +2372,7 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "ethereum", "ethereum-types", @@ -2373,7 +2384,7 @@ dependencies = [ "fp-evm", "fp-rpc", "fp-storage", - "futures 0.3.16", + "futures 0.3.17", "jsonrpc-core 15.1.0", "jsonrpc-core-client 14.2.0", "jsonrpc-derive 14.2.2", @@ -2403,7 +2414,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "ethereum-types", "jsonrpc-core 15.1.0", @@ -2436,17 +2447,18 @@ dependencies = [ [[package]] name = "finality-grandpa" -version = "0.14.1" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74a1bfdcc776e63e49f741c7ce6116fa1b887e8ac2e3ccb14dd4aa113e54feb9" +checksum = "e8ac3ff5224ef91f3c97e03eb1de2db82743427e91aaa5ac635f454f0b164f5a" dependencies = [ "either", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "log", "num-traits", "parity-scale-codec", "parking_lot 0.11.1", + "scale-info 1.0.0", ] [[package]] @@ -2489,7 +2501,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "parity-scale-codec", ] @@ -2507,7 +2519,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "ethereum", "parity-scale-codec", @@ -2521,7 +2533,7 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "evm", "impl-trait-for-tuples 0.1.3", @@ -2534,7 +2546,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "ethereum", "ethereum-types", @@ -2550,12 +2562,12 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -2574,7 +2586,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "Inflector", "chrono", @@ -2600,7 +2612,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -2613,7 +2625,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -2628,7 +2640,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "14.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "parity-scale-codec", "serde", @@ -2639,14 +2651,14 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "bitflags", "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples 0.2.1", "log", - "once_cell 1.8.0", + "once_cell 1.7.2", "parity-scale-codec", "paste", "serde", @@ -2665,7 +2677,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2677,7 +2689,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 1.0.0", @@ -2689,7 +2701,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "proc-macro2", "quote", @@ -2699,7 +2711,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "impl-trait-for-tuples 0.2.1", @@ -2716,7 +2728,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-benchmarking", "frame-support", @@ -2730,7 +2742,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "parity-scale-codec", "sp-api", @@ -2739,7 +2751,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "parity-scale-codec", @@ -2750,9 +2762,9 @@ dependencies = [ [[package]] name = "fs-err" -version = "2.6.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ebd3504ad6116843b8375ad70df74e7bfe83cac77a1f3fe73200c844d43bfe0" +checksum = "bcd1163ae48bda72a20ae26d66a04d3094135cadab911cff418ae5e33f253431" [[package]] name = "fs-swap" @@ -2812,9 +2824,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adc00f486adfc9ce99f77d717836f0c5aa84965eb0b4f051f4e83f7cab53f8b" +checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca" dependencies = [ "futures-channel", "futures-core", @@ -2827,9 +2839,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74ed2411805f6e4e3d9bc904c95d5d423b89b3b25dc0250aa74729de20629ff9" +checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" dependencies = [ "futures-core", "futures-sink", @@ -2837,9 +2849,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af51b1b4a7fdff033703db39de8802c673eb91855f2e0d47dcf3bf2c0ef01f99" +checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" [[package]] name = "futures-cpupool" @@ -2853,9 +2865,9 @@ dependencies = [ [[package]] name = "futures-executor" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d0d535a57b87e1ae31437b892713aee90cd2d7b0ee48727cd11fc72ef54761c" +checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" dependencies = [ "futures-core", "futures-task", @@ -2865,30 +2877,30 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b0e06c393068f3a6ef246c75cdca793d6a46347e75286933e5e75fd2fd11582" +checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" [[package]] name = "futures-lite" -version = "1.12.0" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +checksum = "b4481d0cd0de1d204a4fa55e7d45f07b1d958abcb06714b3446438e2eff695fb" dependencies = [ "fastrand", "futures-core", "futures-io", "memchr", "parking", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.6", "waker-fn", ] [[package]] name = "futures-macro" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54913bae956fb8df7f4dc6fc90362aa72e69148e3f39041fbe8742d21e0ac57" +checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb" dependencies = [ "autocfg 1.0.1", "proc-macro-hack", @@ -2910,15 +2922,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0f30aaa67363d119812743aa5f33c201a7a66329f97d1a887022971feea4b53" +checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" [[package]] name = "futures-task" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe54a98670017f3be909561f6ad13e810d9a51f3f061b902062ca3da80799f2" +checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" [[package]] name = "futures-timer" @@ -2934,9 +2946,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eb846bfd58e44a8481a00049e82c43e0ccb5d61f8dc071057cb19249dd4d78" +checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" dependencies = [ "autocfg 1.0.1", "futures 0.1.31", @@ -2947,7 +2959,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.6", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -2992,9 +3004,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" dependencies = [ "cfg-if 1.0.0", "libc", @@ -3011,6 +3023,12 @@ dependencies = [ "polyval", ] +[[package]] +name = "gimli" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" + [[package]] name = "gimli" version = "0.24.0" @@ -3030,9 +3048,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "globset" -version = "0.4.8" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd" +checksum = "c152169ef1e421390738366d2f796655fec62621dabbd0fd476f905934061e4a" dependencies = [ "aho-corasick", "bstr", @@ -3083,7 +3101,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.4", + "http 0.2.3", "indexmap", "slab", "tokio 0.2.25", @@ -3094,14 +3112,14 @@ dependencies = [ [[package]] name = "handlebars" -version = "3.5.5" +version = "3.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4498fc115fa7d34de968184e473529abb40eeb6be8bc5f7faba3d08c316cb3e3" +checksum = "cdb0867bbc5a3da37a753e78021d5fcf8a4db00e18dd2dd90fd36e24190e162d" dependencies = [ "log", "pest", "pest_derive", - "quick-error 2.0.1", + "quick-error 2.0.0", "serde", "serde_json", ] @@ -3151,18 +3169,18 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.19" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" dependencies = [ "libc", ] @@ -3178,9 +3196,9 @@ dependencies = [ [[package]] name = "hex-literal" -version = "0.3.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e4590e13640f19f249fe3e4eca5113bc4289f2497710378190e7f4bd96f45b" +checksum = "5af1f635ef1bc545d78392b136bfe1c9809e029023c84a3638a864a10b8819c8" [[package]] name = "hex_fmt" @@ -3254,9 +3272,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.4" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527e8c9ac747e28542699a951517aa9a6945af506cd1f2e1b53a576c17b6cc11" +checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" dependencies = [ "bytes 1.0.1", "fnv", @@ -3282,25 +3300,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ "bytes 0.5.6", - "http 0.2.4", + "http 0.2.3", ] [[package]] name = "http-body" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60daa14be0e0786db0f03a9e57cb404c9d756eed2b6c62b9ea98ec5743ec75a9" +checksum = "399c583b2979440c60be0821a6199eca73bc3c8dcd9d070d75ac726e2c6186e5" dependencies = [ "bytes 1.0.1", - "http 0.2.4", - "pin-project-lite 0.2.7", + "http 0.2.3", + "pin-project-lite 0.2.6", ] [[package]] name = "httparse" -version = "1.4.1" +version = "1.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a87b616e37e93c22fb19bcd386f02f3af5ea98a25670ad0fce773de23c5e68" +checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" [[package]] name = "httpdate" @@ -3308,12 +3326,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" -[[package]] -name = "httpdate" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" - [[package]] name = "humantime" version = "1.3.0" @@ -3370,10 +3382,10 @@ dependencies = [ "futures-core", "futures-util", "h2 0.2.7", - "http 0.2.4", + "http 0.2.3", "http-body 0.3.1", "httparse", - "httpdate 0.3.2", + "httpdate", "itoa", "pin-project 1.0.8", "socket2 0.3.19", @@ -3385,21 +3397,21 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.10" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7728a72c4c7d72665fde02204bcbd93b247721025b222ef78606f14513e0fd03" +checksum = "8bf09f61b52cfcf4c00de50df88ae423d6c02354e385a86341133b5338630ad1" dependencies = [ "bytes 1.0.1", "futures-channel", "futures-core", "futures-util", - "http 0.2.4", - "http-body 0.4.2", + "http 0.2.3", + "http-body 0.4.3", "httparse", - "httpdate 1.0.1", + "httpdate", "itoa", - "pin-project-lite 0.2.7", - "tokio 1.8.2", + "pin-project 1.0.8", + "tokio 1.11.0", "tower-service", "tracing", "want 0.3.0", @@ -3436,9 +3448,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.3" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" dependencies = [ "matches", "unicode-bidi", @@ -3473,7 +3485,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae8ab7f67bad3240049cb24fb9cb0b4c2c6af4c245840917fbbdededeee91179" dependencies = [ "async-io", - "futures 0.3.16", + "futures 0.3.17", "futures-lite", "if-addrs", "ipnet", @@ -3544,9 +3556,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.10" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d" +checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" dependencies = [ "cfg-if 1.0.0", ] @@ -3572,7 +3584,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "futures-timer 2.0.2", ] @@ -3605,9 +3617,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.3.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" +checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" [[package]] name = "itertools" @@ -3620,9 +3632,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf" +checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319" dependencies = [ "either", ] @@ -3635,18 +3647,18 @@ checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "jobserver" -version = "0.1.22" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fd" +checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.51" +version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" +checksum = "2d99f9e3e84b8f67f846ef5b4cbbc3b1c29f6c759fcbce6f01aa0e73d932a24c" dependencies = [ "wasm-bindgen", ] @@ -3860,7 +3872,7 @@ dependencies = [ "beef", "futures-channel", "futures-util", - "hyper 0.14.10", + "hyper 0.14.5", "log", "serde", "serde_json", @@ -3876,7 +3888,7 @@ checksum = "8e2834b6e7f57ce9a4412ed4d6dc95125d2c8612e68f86b9d9a07369164e4198" dependencies = [ "async-trait", "fnv", - "futures 0.3.16", + "futures 0.3.17", "jsonrpsee-types", "log", "pin-project 1.0.8", @@ -3889,7 +3901,7 @@ dependencies = [ "tokio 0.2.25", "tokio-rustls 0.15.0", "tokio-util", - "url 2.2.2", + "url 2.2.1", ] [[package]] @@ -3914,7 +3926,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "beefy-primitives", - "bitvec 0.20.4", + "bitvec 0.20.2", "frame-election-provider-support", "frame-executive", "frame-support", @@ -4070,9 +4082,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.98" +version = "0.2.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790" +checksum = "a2a5ac8f984bfcf3a823267e5fde638acc3325f6496633a5da6bb6eb2171e103" [[package]] name = "libloading" @@ -4108,7 +4120,7 @@ checksum = "08053fbef67cd777049ef7a95ebaca2ece370b4ed7712c3fa404d69a88cb741b" dependencies = [ "atomic", "bytes 1.0.1", - "futures 0.3.16", + "futures 0.3.17", "lazy_static", "libp2p-core", "libp2p-deflate", @@ -4150,7 +4162,7 @@ dependencies = [ "ed25519-dalek", "either", "fnv", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "lazy_static", "libsecp256k1 0.3.5", @@ -4165,7 +4177,7 @@ dependencies = [ "rand 0.7.3", "ring", "rw-stream-sink", - "sha2 0.9.5", + "sha2 0.9.3", "smallvec 1.6.1", "thiserror", "unsigned-varint 0.7.0", @@ -4180,7 +4192,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2181a641cd15f9b6ba71b1335800f309012a0a97a29ffaabbbf40e9d3d58f08" dependencies = [ "flate2", - "futures 0.3.16", + "futures 0.3.17", "libp2p-core", ] @@ -4191,7 +4203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62e63dab8b5ff35e0c101a3e51e843ba782c07bbb1682f5fd827622e0d02b98b" dependencies = [ "async-std-resolver", - "futures 0.3.16", + "futures 0.3.17", "libp2p-core", "log", "smallvec 1.6.1", @@ -4206,7 +4218,7 @@ checksum = "48a9b570f6766301d9c4aa00fce3554cad1598e2f466debbc4dde909028417cf" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.16", + "futures 0.3.17", "libp2p-core", "libp2p-swarm", "log", @@ -4227,7 +4239,7 @@ dependencies = [ "byteorder", "bytes 1.0.1", "fnv", - "futures 0.3.16", + "futures 0.3.17", "hex_fmt", "libp2p-core", "libp2p-swarm", @@ -4236,7 +4248,7 @@ dependencies = [ "prost-build", "rand 0.7.3", "regex", - "sha2 0.9.5", + "sha2 0.9.3", "smallvec 1.6.1", "unsigned-varint 0.7.0", "wasm-timer", @@ -4248,7 +4260,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f668f00efd9883e8b7bcc582eaf0164615792608f886f6577da18bcbeea0a46" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "libp2p-core", "libp2p-swarm", "log", @@ -4269,14 +4281,14 @@ dependencies = [ "bytes 1.0.1", "either", "fnv", - "futures 0.3.16", + "futures 0.3.17", "libp2p-core", "libp2p-swarm", "log", "prost", "prost-build", "rand 0.7.3", - "sha2 0.9.5", + "sha2 0.9.3", "smallvec 1.6.1", "uint", "unsigned-varint 0.7.0", @@ -4286,14 +4298,14 @@ dependencies = [ [[package]] name = "libp2p-mdns" -version = "0.30.2" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4efa70c1c3d2d91237f8546e27aeb85e287d62c066a7b4f3ea6a696d43ced714" +checksum = "41e282f974c4bea56db8acca50387f05189406e346318cb30190b0bde662961e" dependencies = [ "async-io", "data-encoding", "dns-parser", - "futures 0.3.16", + "futures 0.3.17", "if-watch", "lazy_static", "libp2p-core", @@ -4313,7 +4325,7 @@ checksum = "85e9b544335d1ed30af71daa96edbefadef6f19c7a55f078b9fc92c87163105d" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.0.1", - "futures 0.3.16", + "futures 0.3.17", "libp2p-core", "log", "nohash-hasher", @@ -4330,15 +4342,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36db0f0db3b0433f5b9463f1c0cd9eadc0a3734a9170439ce501ff99733a88bd" dependencies = [ "bytes 1.0.1", - "curve25519-dalek 3.1.0", - "futures 0.3.16", + "curve25519-dalek 3.0.2", + "futures 0.3.17", "lazy_static", "libp2p-core", "log", "prost", "prost-build", "rand 0.7.3", - "sha2 0.9.5", + "sha2 0.9.3", "snow", "static_assertions", "x25519-dalek", @@ -4351,7 +4363,7 @@ version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4bfaffac63bf3c7ec11ed9d8879d455966ddea7e78ee14737f0b6dce0d1cd1" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "libp2p-core", "libp2p-swarm", "log", @@ -4368,7 +4380,7 @@ checksum = "0c8c37b4d2a075b4be8442760a5f8c037180f0c8dd5b5734b9978ab868b3aa11" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.0.1", - "futures 0.3.16", + "futures 0.3.17", "libp2p-core", "log", "prost", @@ -4383,7 +4395,7 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce3374f3b28162db9d3442c9347c4f14cb01e8290052615c7d341d40eae0599" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "log", "pin-project 1.0.8", "rand 0.7.3", @@ -4399,7 +4411,7 @@ checksum = "0b8786aca3f18671d8776289706a5521f6c9124a820f69e358de214b9939440d" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.0.1", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "libp2p-core", "libp2p-swarm", @@ -4422,7 +4434,7 @@ checksum = "1cdbe172f08e6d0f95fa8634e273d4c4268c4063de2e33e7435194b0130c62e3" dependencies = [ "async-trait", "bytes 1.0.1", - "futures 0.3.16", + "futures 0.3.17", "libp2p-core", "libp2p-swarm", "log", @@ -4441,7 +4453,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e04d8e1eef675029ec728ba14e8d0da7975d84b6679b699b4ae91a1de9c3a92" dependencies = [ "either", - "futures 0.3.16", + "futures 0.3.17", "libp2p-core", "log", "rand 0.7.3", @@ -4467,7 +4479,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b1a27d21c477951799e99d5c105d78868258502ce092988040a808d5a19bbd9" dependencies = [ "async-io", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "if-watch", "ipnet", @@ -4484,7 +4496,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffd6564bb3b7ff203661ccbb69003c2b551e34cef974f2d6c6a28306a12170b5" dependencies = [ "async-std", - "futures 0.3.16", + "futures 0.3.17", "libp2p-core", "log", ] @@ -4495,7 +4507,7 @@ version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2d413e4cf9b8e5dfbcd2a60d3dc5a3391308bdb463684093d4f67137b7113de" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -4510,14 +4522,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cace60995ef6f637e4752cccbb2590f6bc358e8741a0d066307636c69a4b3a74" dependencies = [ "either", - "futures 0.3.16", + "futures 0.3.17", "futures-rustls", "libp2p-core", "log", "quicksink", "rw-stream-sink", "soketto 0.4.2", - "url 2.2.2", + "url 2.2.1", "webpki-roots", ] @@ -4527,7 +4539,7 @@ version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f35da42cfc6d5cb0dcf3ad6881bc68d146cdf38f98655e09e33fbba4d13eabc4" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "libp2p-core", "parking_lot 0.11.1", "thiserror", @@ -4558,7 +4570,7 @@ dependencies = [ "hmac-drbg 0.2.0", "rand 0.7.3", "sha2 0.8.2", - "subtle 2.4.1", + "subtle 2.4.0", "typenum", ] @@ -4577,7 +4589,7 @@ dependencies = [ "libsecp256k1-gen-genmult", "rand 0.7.3", "serde", - "sha2 0.9.5", + "sha2 0.9.3", "typenum", ] @@ -4596,7 +4608,7 @@ dependencies = [ "libsecp256k1-gen-genmult", "rand 0.7.3", "serde", - "sha2 0.9.5", + "sha2 0.9.3", "typenum", ] @@ -4608,7 +4620,7 @@ checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" dependencies = [ "crunchy", "digest 0.9.0", - "subtle 2.4.1", + "subtle 2.4.0", ] [[package]] @@ -4631,9 +4643,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66" +checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" dependencies = [ "cc", "pkg-config", @@ -4657,9 +4669,9 @@ dependencies = [ [[package]] name = "linregress" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6e407dadb4ca4b31bc69c27aff00e7ca4534fdcee855159b039a7cebb5f395" +checksum = "d6c601a85f5ecd1aba625247bca0031585fb1c446461b142878a16f8245ddeb8" dependencies = [ "nalgebra", "statrs", @@ -4686,9 +4698,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.4" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" +checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" dependencies = [ "scopeguard 1.1.0", ] @@ -4774,15 +4786,15 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.4.0" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] name = "memmap2" -version = "0.2.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723e3ebdcdc5c023db1df315364573789f8857c11b631a2fdfad7c00f5c046b4" +checksum = "04e3e85b970d650e2ae6d70592474087051c11c54da7f7b4949725c5735fbcc6" dependencies = [ "libc", ] @@ -4798,9 +4810,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.4" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9" +checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" dependencies = [ "autocfg 1.0.1", ] @@ -4855,7 +4867,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "derive_more", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", ] @@ -4865,7 +4877,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c023c3f16109e7f33aa451f773fd61070e265b4977d0b6e344a51049296dd7df" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "rand 0.7.3", "thrift", ] @@ -5058,7 +5070,7 @@ name = "moonbeam" version = "0.11.3" dependencies = [ "assert_cmd", - "futures 0.3.16", + "futures 0.3.17", "hex", "moonbeam-cli", "moonbeam-service", @@ -5158,7 +5170,7 @@ name = "moonbeam-rpc-core-debug" version = "0.1.0" dependencies = [ "ethereum-types", - "futures 0.3.16", + "futures 0.3.17", "jsonrpc-core 15.1.0", "jsonrpc-core-client 14.2.0", "jsonrpc-derive 14.2.2", @@ -5173,7 +5185,7 @@ name = "moonbeam-rpc-core-trace" version = "0.6.0" dependencies = [ "ethereum-types", - "futures 0.3.16", + "futures 0.3.17", "jsonrpc-core 15.1.0", "jsonrpc-core-client 14.2.0", "jsonrpc-derive 14.2.2", @@ -5206,7 +5218,7 @@ dependencies = [ "fc-db", "fc-rpc", "fp-rpc", - "futures 0.3.16", + "futures 0.3.17", "jsonrpc-core 15.1.0", "moonbeam-rpc-core-debug", "moonbeam-rpc-primitives-debug", @@ -5264,7 +5276,7 @@ dependencies = [ "fc-rpc", "fc-rpc-core", "fp-rpc", - "futures 0.3.16", + "futures 0.3.17", "jsonrpc-core 15.1.0", "moonbeam-rpc-core-trace", "moonbeam-rpc-primitives-debug", @@ -5412,7 +5424,7 @@ dependencies = [ "frame-benchmarking", "frame-benchmarking-cli", "frame-system-rpc-runtime-api", - "futures 0.3.16", + "futures 0.3.17", "jsonrpc-core 15.1.0", "jsonrpc-pubsub 15.1.0", "log", @@ -5606,18 +5618,18 @@ dependencies = [ "digest 0.9.0", "generic-array 0.14.4", "multihash-derive", - "sha2 0.9.5", + "sha2 0.9.3", "sha3 0.9.1", "unsigned-varint 0.5.1", ] [[package]] name = "multihash-derive" -version = "0.7.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" +checksum = "85ee3c48cb9d9b275ad967a0e96715badc13c6029adb92f34fa17b9ff28fd81f" dependencies = [ - "proc-macro-crate 1.0.0", + "proc-macro-crate 0.1.5", "proc-macro-error 1.0.4", "proc-macro2", "quote", @@ -5638,7 +5650,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d91ec0a2440aaff5f78ec35631a7027d50386c6163aa975f7caa0d5da4b6ff8" dependencies = [ "bytes 1.0.1", - "futures 0.3.16", + "futures 0.3.17", "log", "pin-project 1.0.8", "smallvec 1.6.1", @@ -5683,6 +5695,16 @@ dependencies = [ "rand 0.3.23", ] +[[package]] +name = "nb-connect" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19900e7eee95eb2b3c2e26d12a874cc80aaf750e31be6fcbe743ead369fa45d" +dependencies = [ + "libc", + "socket2 0.4.0", +] + [[package]] name = "net2" version = "0.2.37" @@ -5703,7 +5725,7 @@ dependencies = [ "cumulus-client-consensus-common", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", - "futures 0.3.16", + "futures 0.3.17", "log", "nimbus-primitives", "parity-scale-codec", @@ -5767,9 +5789,9 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" [[package]] name = "nom" -version = "6.1.2" +version = "6.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" +checksum = "9c5c51b9083a3c620fa67a2a635d1ce7d95b897e957d6b28ff9a5da960a103a6" dependencies = [ "bitvec 0.19.5", "funty", @@ -5909,9 +5931,9 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2c8fd66061a707503d515639b8af10fd3807a5b5ee6959f7ff1bd303634bd5" +checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f" dependencies = [ "derivative", "num_enum_derive", @@ -5919,9 +5941,9 @@ dependencies = [ [[package]] name = "num_enum_derive" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "474fd1d096da3ad17084694eebed40ba09c4a36c5255cd772bd8b98859cc562e" +checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9" dependencies = [ "proc-macro2", "quote", @@ -5930,21 +5952,18 @@ dependencies = [ [[package]] name = "object" -version = "0.24.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a5b3dd1c072ee7963717671d1ca129f1048fda25edea6b752bfc71ac8854170" -dependencies = [ - "crc32fast", - "indexmap", -] +checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" [[package]] name = "object" -version = "0.25.3" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38f2be3697a57b4060074ff41b44c16870d916ad7877c17696e063257482bc7" +checksum = "1a5b3dd1c072ee7963717671d1ca129f1048fda25edea6b752bfc71ac8854170" dependencies = [ - "memchr", + "crc32fast", + "indexmap", ] [[package]] @@ -5958,9 +5977,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.8.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" dependencies = [ "parking_lot 0.11.1", ] @@ -5979,9 +5998,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl-probe" -version = "0.1.4" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" +checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" [[package]] name = "ordered-float" @@ -6058,7 +6077,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6073,7 +6092,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6087,7 +6106,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6110,7 +6129,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6131,7 +6150,7 @@ dependencies = [ "frame-system", "pallet-session", "parity-scale-codec", - "scale-info", + "scale-info 0.10.0", "serde", "sp-runtime", "sp-std", @@ -6154,7 +6173,7 @@ dependencies = [ "pallet-mmr-primitives", "pallet-session", "parity-scale-codec", - "scale-info", + "scale-info 0.10.0", "serde", "sp-core", "sp-io", @@ -6165,7 +6184,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6217,7 +6236,7 @@ name = "pallet-bridge-messages" version = "0.1.0" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "bitvec 0.20.4", + "bitvec 0.20.2", "bp-message-dispatch", "bp-messages", "bp-rialto", @@ -6236,7 +6255,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6252,7 +6271,7 @@ dependencies = [ [[package]] name = "pallet-crowdloan-rewards" version = "0.6.0" -source = "git+https://github.com/purestake/crowdloan-rewards?branch=notlesh-v0.9.9-block-response-length#9228d6ec37dff55ea28e3ad39df4a3a631573625" +source = "git+https://github.com/purestake/crowdloan-rewards?branch=notlesh-v0.9.9-block-response-length#86bade7d1f8e2ad16c5a84a4d2f951e30e7c7846" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -6276,7 +6295,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6291,7 +6310,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-election-provider-support", "frame-support", @@ -6310,7 +6329,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6326,7 +6345,7 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "ethereum", "ethereum-types", @@ -6364,7 +6383,7 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "evm", "evm-gasometer", @@ -6391,7 +6410,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-bn128" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "evm", "fp-evm", @@ -6403,7 +6422,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-dispatch" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "evm", "fp-evm", @@ -6417,7 +6436,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "evm", "fp-evm", @@ -6429,7 +6448,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "evm", "fp-evm", @@ -6441,7 +6460,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#c344bed4dddb5986026e7ba0c399fd05aa5a2506" +source = "git+https://github.com/purestake/frontier?branch=notlesh-v0.9.9-block-response-length#1b0c43e5f9656df807c2524642f33d1bb54d539a" dependencies = [ "evm", "fp-evm", @@ -6453,7 +6472,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6467,7 +6486,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6489,7 +6508,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6504,7 +6523,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6522,7 +6541,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6551,7 +6570,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6581,7 +6600,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -6598,7 +6617,7 @@ dependencies = [ [[package]] name = "pallet-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6614,7 +6633,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", @@ -6632,7 +6651,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6646,7 +6665,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6659,7 +6678,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6675,7 +6694,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6689,7 +6708,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6702,7 +6721,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "enumflags2", "frame-support", @@ -6716,7 +6735,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6731,7 +6750,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6751,7 +6770,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6764,7 +6783,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6788,7 +6807,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -6799,7 +6818,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "log", "sp-arithmetic", @@ -6808,7 +6827,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6821,7 +6840,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-benchmarking", "frame-support", @@ -6839,7 +6858,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6853,7 +6872,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6869,7 +6888,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", @@ -6886,7 +6905,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -6897,7 +6916,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6912,7 +6931,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-support", "frame-system", @@ -6926,7 +6945,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "enumflags2", "frame-support", @@ -7041,17 +7060,17 @@ dependencies = [ "serde", "static_assertions", "unsigned-varint 0.7.0", - "url 2.2.2", + "url 2.2.1", ] [[package]] name = "parity-scale-codec" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8975095a2a03bbbdc70a74ab11a4f76a6d0b84680d87c68d722531b0ac28e8a9" +checksum = "e11263a97373b43da4b426edbb52ef99a7b51e2d9752ef56a7f8b356f48495a5" dependencies = [ - "arrayvec 0.7.1", - "bitvec 0.20.4", + "arrayvec 0.7.0", + "bitvec 0.20.2", "byte-slice-cast", "impl-trait-for-tuples 0.2.1", "parity-scale-codec-derive", @@ -7060,9 +7079,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40dbbfef7f0a1143c5b06e0d76a6278e25dac0bc1af4be51a0fbb73f07e7ad09" +checksum = "b157dc92b3db2bae522afb31b3843e91ae097eb01d66c72dda66a2e86bc3ca14" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -7141,9 +7160,9 @@ checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" [[package]] name = "parity-ws" -version = "0.10.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322d72dfe461b8b9e367d057ceace105379d64d5b03907d23c481ccf3fbf8aa4" +checksum = "9e02a625dd75084c2a7024f07c575b61b782f729d18702dabb3cdbf31911dc61" dependencies = [ "byteorder", "bytes 0.4.12", @@ -7154,7 +7173,7 @@ dependencies = [ "rand 0.7.3", "sha-1 0.8.2", "slab", - "url 2.2.2", + "url 2.2.1", ] [[package]] @@ -7201,7 +7220,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ "instant", - "lock_api 0.4.4", + "lock_api 0.4.2", "parking_lot_core 0.8.3", ] @@ -7256,7 +7275,7 @@ dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall 0.2.9", + "redox_syscall 0.2.5", "smallvec 1.6.1", "winapi 0.3.9", ] @@ -7365,11 +7384,11 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.28" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "918192b5c59119d51e0cd221f4d49dde9112824ba717369e903c97d076083d0f" +checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" dependencies = [ - "pin-project-internal 0.4.28", + "pin-project-internal 0.4.27", ] [[package]] @@ -7383,9 +7402,9 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "0.4.28" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be26700300be6d9d23264c73211d8190e755b6b5ca7a1b28230025511b52a5e" +checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" dependencies = [ "proc-macro2", "quote", @@ -7411,9 +7430,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" [[package]] name = "pin-utils" @@ -7438,7 +7457,7 @@ name = "polkadot-approval-distribution" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7452,7 +7471,7 @@ name = "polkadot-availability-bitfield-distribution" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7465,7 +7484,7 @@ name = "polkadot-availability-distribution" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "lru", "parity-scale-codec", "polkadot-erasure-coding", @@ -7488,7 +7507,7 @@ name = "polkadot-availability-recovery" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "lru", "parity-scale-codec", "polkadot-erasure-coding", @@ -7508,7 +7527,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "frame-benchmarking-cli", - "futures 0.3.16", + "futures 0.3.17", "log", "polkadot-node-core-pvf", "polkadot-service", @@ -7561,7 +7580,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "always-assert", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -7592,7 +7611,7 @@ name = "polkadot-dispute-distribution" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "lru", "parity-scale-codec", "polkadot-erasure-coding", @@ -7630,7 +7649,7 @@ name = "polkadot-gossip-support" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7649,7 +7668,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "async-trait", - "futures 0.3.16", + "futures 0.3.17", "parity-scale-codec", "parking_lot 0.11.1", "polkadot-node-network-protocol", @@ -7668,7 +7687,7 @@ name = "polkadot-node-collation-generation" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-primitives", @@ -7686,9 +7705,9 @@ name = "polkadot-node-core-approval-voting" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "bitvec 0.20.4", + "bitvec 0.20.2", "derive_more", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "kvdb", "lru", @@ -7716,8 +7735,8 @@ name = "polkadot-node-core-av-store" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "bitvec 0.20.4", - "futures 0.3.16", + "bitvec 0.20.2", + "futures 0.3.17", "futures-timer 3.0.2", "kvdb", "parity-scale-codec", @@ -7736,8 +7755,8 @@ name = "polkadot-node-core-backing" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "bitvec 0.20.4", - "futures 0.3.16", + "bitvec 0.20.2", + "futures 0.3.17", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7754,7 +7773,7 @@ name = "polkadot-node-core-bitfield-signing" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", @@ -7770,7 +7789,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "async-trait", - "futures 0.3.16", + "futures 0.3.17", "parity-scale-codec", "polkadot-node-core-pvf", "polkadot-node-primitives", @@ -7787,7 +7806,7 @@ name = "polkadot-node-core-chain-api" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", @@ -7802,7 +7821,7 @@ name = "polkadot-node-core-chain-selection" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "kvdb", "parity-scale-codec", @@ -7819,9 +7838,9 @@ name = "polkadot-node-core-dispute-coordinator" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "bitvec 0.20.4", + "bitvec 0.20.2", "derive_more", - "futures 0.3.16", + "futures 0.3.17", "kvdb", "parity-scale-codec", "polkadot-node-primitives", @@ -7838,7 +7857,7 @@ name = "polkadot-node-core-dispute-participation" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-primitives", @@ -7852,7 +7871,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "async-trait", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "polkadot-node-subsystem", "polkadot-primitives", @@ -7868,8 +7887,8 @@ name = "polkadot-node-core-provisioner" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "bitvec 0.20.4", - "futures 0.3.16", + "bitvec 0.20.2", + "futures 0.3.17", "futures-timer 3.0.2", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7887,7 +7906,7 @@ dependencies = [ "assert_matches", "async-process", "async-std", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "libc", "parity-scale-codec", @@ -7913,7 +7932,7 @@ name = "polkadot-node-core-runtime-api" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "memory-lru", "parity-util-mem", "polkadot-node-subsystem", @@ -7950,7 +7969,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "async-trait", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "metered-channel", "sc-network", @@ -7966,7 +7985,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "async-trait", - "futures 0.3.16", + "futures 0.3.17", "parity-scale-codec", "polkadot-node-jaeger", "polkadot-node-primitives", @@ -7982,7 +8001,7 @@ name = "polkadot-node-primitives" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "parity-scale-codec", "polkadot-parachain", "polkadot-primitives", @@ -8019,7 +8038,7 @@ dependencies = [ "async-std", "async-trait", "derive_more", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "lazy_static", "log", @@ -8047,9 +8066,9 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "async-trait", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", - "itertools 0.10.1", + "itertools 0.10.0", "lru", "metered-channel", "parity-scale-codec", @@ -8077,7 +8096,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "async-trait", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "lru", "parking_lot 0.11.1", @@ -8110,7 +8129,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "async-trait", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "metered-channel", "pin-project 1.0.8", @@ -8153,7 +8172,7 @@ name = "polkadot-primitives" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "bitvec 0.20.4", + "bitvec 0.20.2", "frame-system", "hex-literal", "parity-scale-codec", @@ -8217,7 +8236,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "beefy-primitives", - "bitvec 0.20.4", + "bitvec 0.20.2", "frame-election-provider-support", "frame-executive", "frame-support", @@ -8286,7 +8305,7 @@ name = "polkadot-runtime-common" version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ - "bitvec 0.20.4", + "bitvec 0.20.2", "frame-benchmarking", "frame-support", "frame-system", @@ -8330,7 +8349,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "bitflags", - "bitvec 0.20.4", + "bitvec 0.20.2", "derive_more", "frame-benchmarking", "frame-support", @@ -8372,7 +8391,7 @@ dependencies = [ "beefy-gadget", "beefy-primitives", "frame-system-rpc-runtime-api", - "futures 0.3.16", + "futures 0.3.17", "hex-literal", "kusama-runtime", "kvdb", @@ -8465,7 +8484,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "arrayvec 0.5.2", - "futures 0.3.16", + "futures 0.3.17", "indexmap", "parity-scale-codec", "polkadot-node-network-protocol", @@ -8496,7 +8515,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "beefy-primitives", - "bitvec 0.20.4", + "bitvec 0.20.2", "frame-election-provider-support", "frame-executive", "frame-support", @@ -8558,7 +8577,7 @@ dependencies = [ "frame-benchmarking", "frame-system", "futures 0.1.31", - "futures 0.3.16", + "futures 0.3.17", "hex", "pallet-balances", "pallet-staking", @@ -8604,14 +8623,14 @@ dependencies = [ [[package]] name = "polling" -version = "2.1.0" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92341d779fa34ea8437ef4d82d440d5e1ce3f3ff7f824aa64424cd481f9a1f25" +checksum = "4fc12d774e799ee9ebae13f4076ca003b40d18a11ac0f3641e6f899618580b7b" dependencies = [ "cfg-if 1.0.0", "libc", "log", - "wepoll-ffi", + "wepoll-sys", "winapi 0.3.9", ] @@ -8621,7 +8640,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b7456bc1ad2d4cf82b3a016be4c2ac48daf11bf990c1603ebd447fe6f30fca8" dependencies = [ - "cpuid-bool", + "cpuid-bool 0.2.0", "universal-hash", ] @@ -8631,7 +8650,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cd" dependencies = [ - "cpuid-bool", + "cpuid-bool 0.2.0", "opaque-debug 0.3.0", "universal-hash", ] @@ -8672,9 +8691,9 @@ dependencies = [ [[package]] name = "predicates" -version = "1.0.8" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49cfaf7fdaa3bfacc6fa3e7054e65148878354a5cfddcf661df4c851f8021df" +checksum = "eeb433456c1a57cc93554dea3ce40b4c19c4057e41c55d4a0f3d84ea71c325aa" dependencies = [ "difference", "predicates-core", @@ -8792,9 +8811,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.28" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612" +checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" dependencies = [ "unicode-xid", ] @@ -8866,18 +8885,18 @@ dependencies = [ [[package]] name = "psm" -version = "0.1.13" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21ff0279b4a85e576b97e4a21d13e437ebcd56612706cde5d3f0d5c9399490c0" +checksum = "3abf49e5417290756acfd26501536358560c4a5cc4a0934d390939acb3e7083a" dependencies = [ "cc", ] [[package]] name = "pwasm-utils" -version = "0.18.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c1a2f10b47d446372a4f397c58b329aaea72b2daf9395a623a411cb8ccb54f" +checksum = "a0e517f47d9964362883182404b68d0b6949382c0baa40aa5ffca94f5f1e3481" dependencies = [ "byteorder", "log", @@ -8892,9 +8911,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quick-error" -version = "2.0.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" +checksum = "3ac73b1112776fc109b2e61909bc46c7e1bf0d7f690ffb1676553acce16d5cda" [[package]] name = "quicksink" @@ -8992,8 +9011,8 @@ checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" dependencies = [ "libc", "rand_chacha 0.3.1", - "rand_core 0.6.3", - "rand_hc 0.3.1", + "rand_core 0.6.2", + "rand_hc 0.3.0", ] [[package]] @@ -9023,7 +9042,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core 0.6.2", ] [[package]] @@ -9052,11 +9071,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" dependencies = [ - "getrandom 0.2.3", + "getrandom 0.2.2", ] [[package]] @@ -9089,11 +9108,11 @@ dependencies = [ [[package]] name = "rand_hc" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" dependencies = [ - "rand_core 0.6.3", + "rand_core 0.6.2", ] [[package]] @@ -9166,9 +9185,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.5.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" dependencies = [ "autocfg 1.0.1", "crossbeam-deque 0.8.0", @@ -9178,13 +9197,13 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" dependencies = [ "crossbeam-channel", "crossbeam-deque 0.8.0", - "crossbeam-utils 0.8.5", + "crossbeam-utils 0.8.3", "lazy_static", "num_cpus", ] @@ -9206,21 +9225,32 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_syscall" -version = "0.2.9" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab49abadf3f9e1c4bc499e8845e152ad87d2ad2d30371841171169e9d75feee" +checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" dependencies = [ "bitflags", ] +[[package]] +name = "redox_users" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" +dependencies = [ + "getrandom 0.1.16", + "redox_syscall 0.1.57", + "rust-argon2", +] + [[package]] name = "redox_users" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ - "getrandom 0.2.3", - "redox_syscall 0.2.9", + "getrandom 0.2.2", + "redox_syscall 0.2.5", ] [[package]] @@ -9231,7 +9261,7 @@ checksum = "3bd8f48b2066e9f69ab192797d66da804d1935bf22763204ed3675740cb0f221" dependencies = [ "derive_more", "fs-err", - "itertools 0.10.1", + "itertools 0.10.0", "static_init", "thiserror", ] @@ -9270,9 +9300,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.4" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" dependencies = [ "aho-corasick", "memchr", @@ -9281,18 +9311,19 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.1.10" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" dependencies = [ + "byteorder", "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" [[package]] name = "region" @@ -9309,9 +9340,9 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ - "env_logger 0.8.4", + "env_logger 0.8.3", "hex", "jsonrpsee-proc-macros", "jsonrpsee-ws-client", @@ -9357,7 +9388,7 @@ checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", "libc", - "once_cell 1.8.0", + "once_cell 1.7.2", "spin", "untrusted", "web-sys", @@ -9499,11 +9530,23 @@ dependencies = [ "sp-std", ] +[[package]] +name = "rust-argon2" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" +dependencies = [ + "base64 0.13.0", + "blake2b_simd", + "constant_time_eq", + "crossbeam-utils 0.8.3", +] + [[package]] name = "rustc-demangle" -version = "0.1.20" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dead70b0b5e03e9c814bcb6b01e03e68f7c57a80aa48c72ec92152ab3e818d49" +checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" [[package]] name = "rustc-hash" @@ -9587,9 +9630,9 @@ dependencies = [ [[package]] name = "ruzstd" -version = "0.2.4" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cada0ef59efa6a5f4dc5e491f93d9f31e3fc7758df421ff1de8a706338e1100" +checksum = "3d425143485a37727c7a46e689bbe3b883a00f42b4a52c4ac0f44855c1009b00" dependencies = [ "byteorder", "twox-hash", @@ -9601,8 +9644,8 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.16", - "pin-project 0.4.28", + "futures 0.3.17", + "pin-project 0.4.27", "static_assertions", ] @@ -9642,7 +9685,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "log", "sp-core", @@ -9653,12 +9696,12 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", "derive_more", "either", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "ip_network", "libp2p", @@ -9682,9 +9725,9 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "log", "parity-scale-codec", @@ -9705,7 +9748,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -9721,7 +9764,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "impl-trait-for-tuples 0.2.1", "parity-scale-codec", @@ -9737,7 +9780,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -9748,11 +9791,11 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "chrono", "fdlimit", - "futures 0.3.16", + "futures 0.3.17", "hex", "libp2p", "log", @@ -9786,11 +9829,11 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "derive_more", "fnv", - "futures 0.3.16", + "futures 0.3.17", "hash-db", "kvdb", "lazy_static", @@ -9820,7 +9863,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "blake2-rfc", "hash-db", @@ -9849,10 +9892,10 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "libp2p", "log", @@ -9874,12 +9917,12 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", "derive_more", "fork-tree", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "log", "merlin", @@ -9921,10 +9964,10 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "derive_more", - "futures 0.3.16", + "futures 0.3.17", "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", "jsonrpc-derive 15.1.0", @@ -9945,7 +9988,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "fork-tree", "parity-scale-codec", @@ -9958,12 +10001,12 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "assert_matches", "async-trait", "derive_more", - "futures 0.3.16", + "futures 0.3.17", "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", "jsonrpc-derive 15.1.0", @@ -9994,10 +10037,10 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "impl-trait-for-tuples 0.2.1", "log", @@ -10023,7 +10066,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "sc-client-api", "sp-authorship", @@ -10034,7 +10077,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "derive_more", "lazy_static", @@ -10063,7 +10106,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "derive_more", "parity-scale-codec", @@ -10080,7 +10123,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "log", "parity-scale-codec", @@ -10095,7 +10138,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "cfg-if 1.0.0", "libc", @@ -10115,14 +10158,14 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", "derive_more", "dyn-clone", "finality-grandpa", "fork-tree", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "linked-hash-map", "log", @@ -10156,11 +10199,11 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "derive_more", "finality-grandpa", - "futures 0.3.16", + "futures 0.3.17", "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", "jsonrpc-derive 15.1.0", @@ -10180,10 +10223,10 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "ansi_term 0.12.1", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "log", "parity-util-mem", @@ -10198,11 +10241,11 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", "derive_more", - "futures 0.3.16", + "futures 0.3.17", "futures-util", "hex", "merlin", @@ -10212,13 +10255,13 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-keystore", - "subtle 2.4.1", + "subtle 2.4.0", ] [[package]] name = "sc-light" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "hash-db", "lazy_static", @@ -10237,7 +10280,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-std", "async-trait", @@ -10251,7 +10294,7 @@ dependencies = [ "erased-serde", "fnv", "fork-tree", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "hex", "ip_network", @@ -10292,9 +10335,9 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "libp2p", "log", @@ -10309,11 +10352,11 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "bytes 0.5.6", "fnv", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "hex", "hyper 0.13.10", @@ -10337,9 +10380,9 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "libp2p", "log", "serde_json", @@ -10350,7 +10393,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.9.0" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10359,9 +10402,9 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "hash-db", "jsonrpc-core 15.1.0", "jsonrpc-pubsub 15.1.0", @@ -10394,10 +10437,10 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "derive_more", - "futures 0.3.16", + "futures 0.3.17", "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", "jsonrpc-derive 15.1.0", @@ -10419,7 +10462,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "futures 0.1.31", "jsonrpc-core 15.1.0", @@ -10437,13 +10480,13 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", "directories", "exit-future 0.2.0", "futures 0.1.31", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "hash-db", "jsonrpc-core 15.1.0", @@ -10505,7 +10548,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "log", "parity-scale-codec", @@ -10520,7 +10563,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", @@ -10542,10 +10585,10 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "chrono", - "futures 0.3.16", + "futures 0.3.17", "libp2p", "log", "parking_lot 0.11.1", @@ -10562,14 +10605,14 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "ansi_term 0.12.1", "atty", "erased-serde", "lazy_static", "log", - "once_cell 1.8.0", + "once_cell 1.7.2", "parking_lot 0.11.1", "regex", "rustc-hash", @@ -10599,7 +10642,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -10610,10 +10653,10 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "derive_more", - "futures 0.3.16", + "futures 0.3.17", "intervalier", "linked-hash-map", "log", @@ -10639,10 +10682,10 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "derive_more", - "futures 0.3.16", + "futures 0.3.17", "log", "parity-scale-codec", "serde", @@ -10657,11 +10700,24 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2e62ff266e136db561a007c84569985805f84a1d5a08278e52c36aacb6e061b" dependencies = [ - "bitvec 0.20.4", + "bitvec 0.20.2", + "cfg-if 1.0.0", + "derive_more", + "parity-scale-codec", + "scale-info-derive 0.7.0", +] + +[[package]] +name = "scale-info" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c55b744399c25532d63a0d2789b109df8d46fc93752d46b0782991a931a782f" +dependencies = [ + "bitvec 0.20.2", "cfg-if 1.0.0", "derive_more", "parity-scale-codec", - "scale-info-derive", + "scale-info-derive 1.0.0", ] [[package]] @@ -10676,6 +10732,18 @@ dependencies = [ "syn", ] +[[package]] +name = "scale-info-derive" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baeb2780690380592f86205aa4ee49815feb2acad8c2f59e6dd207148c3f1fcd" +dependencies = [ + "proc-macro-crate 1.0.0", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "schannel" version = "0.1.19" @@ -10694,13 +10762,13 @@ checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" dependencies = [ "arrayref", "arrayvec 0.5.2", - "curve25519-dalek 2.1.3", + "curve25519-dalek 2.1.2", "getrandom 0.1.16", "merlin", "rand 0.7.3", "rand_core 0.5.1", "sha2 0.8.2", - "subtle 2.4.1", + "subtle 2.4.0", "zeroize", ] @@ -10724,9 +10792,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "sct" -version = "0.6.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" dependencies = [ "ring", "untrusted", @@ -10764,7 +10832,7 @@ dependencies = [ "core-foundation 0.9.1", "core-foundation-sys 0.8.2", "libc", - "security-framework-sys 2.3.0", + "security-framework-sys 2.4.2", ] [[package]] @@ -10779,9 +10847,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.3.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4effb91b4b8b6fb7732e670b6cee160278ff8e6bf485c7805d9e319d76e284" +checksum = "a9dd14d83160b528b7bfd66439110573efcfbe281b17fc2ca9f39f550d619c7e" dependencies = [ "core-foundation-sys 0.8.2", "libc", @@ -10832,18 +10900,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.129" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1f72836d2aa753853178eda473a3b9d8e4eefdaf20523b919677e6de489f8f1" +checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.129" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57ae87ad533d9a56427558b516d0adac283614e347abf85b0dc0cbbf0a249f3" +checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" dependencies = [ "proc-macro2", "quote", @@ -10875,13 +10943,13 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.9.7" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a0c8611594e2ab4ebbf06ec7cbbf0a99450b8570e96cbf5188b5d5f6ef18d81" +checksum = "dfebf75d25bd900fd1e7d11501efab59bc846dbc76196839663e6637bba9f25f" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", - "cpufeatures", + "cpuid-bool 0.1.2", "digest 0.9.0", "opaque-debug 0.3.0", ] @@ -10900,13 +10968,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.9.5" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362ae5752fd2137731f9fa25fd4d9058af34666ca1966fb969119cc35719f12" +checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", - "cpufeatures", + "cpuid-bool 0.1.2", "digest 0.9.0", "opaque-debug 0.3.0", ] @@ -10947,15 +11015,15 @@ dependencies = [ [[package]] name = "shlex" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a568c8f2cd051a4d283bd6eb0343ac214c1b0f1ac19f93e1175b2dee38c73d" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "signal-hook" -version = "0.3.9" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "470c5a6397076fae0094aaf06a08e6ba6f37acb77d3b1b91ea92b4d6c8650c39" +checksum = "6aa894ef3fade0ee7243422f4fbbd6c2b48e6de767e621d37ef65f2310f53cea" dependencies = [ "libc", "signal-hook-registry", @@ -10963,18 +11031,18 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" dependencies = [ "libc", ] [[package]] name = "signature" -version = "1.3.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19772be3c4dd2ceaacf03cb41d5885f2a02c4d8804884918e3a258480803335" +checksum = "0f0242b8e50dd9accdd56170e94ca1ebd223b098eb9c83539a6e367d0f36ae68" [[package]] name = "simba" @@ -11010,9 +11078,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "slog" @@ -11037,9 +11105,9 @@ dependencies = [ [[package]] name = "slotmap" -version = "1.0.5" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a952280edbecfb1d4bd3cf2dbc309dc6ab523e53487c438ae21a6df09fe84bc4" +checksum = "585cd5dffe4e9e06f6dfdf66708b70aca3f781bed561f4f667b2d9c0d4559e36" dependencies = [ "version_check", ] @@ -11072,8 +11140,8 @@ dependencies = [ "rand_core 0.5.1", "ring", "rustc_version 0.2.3", - "sha2 0.9.5", - "subtle 2.4.1", + "sha2 0.9.3", + "subtle 2.4.0", "x25519-dalek", ] @@ -11107,11 +11175,11 @@ dependencies = [ "base64 0.12.3", "bytes 0.5.6", "flate2", - "futures 0.3.16", + "futures 0.3.17", "httparse", "log", "rand 0.7.3", - "sha-1 0.9.7", + "sha-1 0.9.4", ] [[package]] @@ -11122,17 +11190,17 @@ checksum = "a74e48087dbeed4833785c2f3352b59140095dc192dce966a3bfc155020a439f" dependencies = [ "base64 0.13.0", "bytes 1.0.1", - "futures 0.3.16", + "futures 0.3.17", "httparse", "log", "rand 0.8.4", - "sha-1 0.9.7", + "sha-1 0.9.4", ] [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "hash-db", "log", @@ -11149,7 +11217,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "blake2-rfc", "proc-macro-crate 1.0.0", @@ -11161,7 +11229,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "parity-scale-codec", "serde", @@ -11173,7 +11241,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "integer-sqrt", "num-traits", @@ -11187,7 +11255,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "parity-scale-codec", "sp-api", @@ -11199,7 +11267,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", "parity-scale-codec", @@ -11211,7 +11279,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "parity-scale-codec", "sp-api", @@ -11223,9 +11291,9 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "log", "lru", "parity-scale-codec", @@ -11241,10 +11309,10 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", - "futures 0.3.16", + "futures 0.3.17", "futures-timer 3.0.2", "log", "parity-scale-codec", @@ -11267,7 +11335,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", "parity-scale-codec", @@ -11284,7 +11352,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", "merlin", @@ -11306,7 +11374,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "parity-scale-codec", "sp-arithmetic", @@ -11316,7 +11384,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -11328,14 +11396,14 @@ dependencies = [ [[package]] name = "sp-core" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "base58", "blake2-rfc", "byteorder", "dyn-clonable", "ed25519-dalek", - "futures 0.3.16", + "futures 0.3.17", "hash-db", "hash256-std-hasher", "hex", @@ -11354,7 +11422,7 @@ dependencies = [ "schnorrkel", "secrecy", "serde", - "sha2 0.9.5", + "sha2 0.9.3", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", @@ -11372,7 +11440,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -11381,7 +11449,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "3.0.0" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "proc-macro2", "quote", @@ -11391,7 +11459,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "environmental", "parity-scale-codec", @@ -11402,7 +11470,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "finality-grandpa", "log", @@ -11419,7 +11487,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", "impl-trait-for-tuples 0.2.1", @@ -11433,9 +11501,9 @@ dependencies = [ [[package]] name = "sp-io" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "hash-db", "libsecp256k1 0.3.5", "log", @@ -11458,7 +11526,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "lazy_static", "sp-core", @@ -11469,11 +11537,11 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", "derive_more", - "futures 0.3.16", + "futures 0.3.17", "merlin", "parity-scale-codec", "parking_lot 0.11.1", @@ -11486,7 +11554,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "ruzstd", "zstd", @@ -11495,7 +11563,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "parity-scale-codec", "serde", @@ -11508,7 +11576,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-compact" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "proc-macro-crate 1.0.0", "proc-macro2", @@ -11519,7 +11587,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "sp-api", "sp-core", @@ -11529,7 +11597,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "3.0.0" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "backtrace", ] @@ -11537,7 +11605,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "rustc-hash", "serde", @@ -11548,7 +11616,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "either", "hash256-std-hasher", @@ -11569,7 +11637,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "impl-trait-for-tuples 0.2.1", "parity-scale-codec", @@ -11586,7 +11654,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "Inflector", "proc-macro-crate 1.0.0", @@ -11598,7 +11666,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "3.0.0" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "serde", "serde_json", @@ -11607,7 +11675,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "parity-scale-codec", "sp-api", @@ -11620,7 +11688,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -11630,7 +11698,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "hash-db", "log", @@ -11653,12 +11721,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" [[package]] name = "sp-storage" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "impl-serde", "parity-scale-codec", @@ -11671,7 +11739,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "log", "sp-core", @@ -11684,7 +11752,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", "futures-timer 3.0.2", @@ -11701,7 +11769,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "erased-serde", "log", @@ -11719,7 +11787,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "sp-api", "sp-runtime", @@ -11728,7 +11796,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", "log", @@ -11743,7 +11811,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "hash-db", "memory-db", @@ -11757,9 +11825,9 @@ dependencies = [ [[package]] name = "sp-utils" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "futures-core", "futures-timer 3.0.2", "lazy_static", @@ -11769,7 +11837,7 @@ dependencies = [ [[package]] name = "sp-version" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "impl-serde", "parity-scale-codec", @@ -11784,7 +11852,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "parity-scale-codec", "proc-macro-crate 1.0.0", @@ -11796,7 +11864,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "impl-trait-for-tuples 0.2.1", "parity-scale-codec", @@ -11887,9 +11955,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "structopt" -version = "0.3.22" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69b041cdcb67226aca307e6e7be44c8806423d83e018bd662360a93dabce4d71" +checksum = "5277acd7ee46e63e5168a80734c9f6ee81b1367a7d8772a2d765df2a3705d28c" dependencies = [ "clap", "lazy_static", @@ -11898,9 +11966,9 @@ dependencies = [ [[package]] name = "structopt-derive" -version = "0.4.15" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7813934aecf5f51a54775e00068c237de98489463968231a51746bbbc03f9c10" +checksum = "5ba9cdfda491b814720b6b06e0cac513d922fc407582032e8706e9f137976f90" dependencies = [ "heck", "proc-macro-error 1.0.4", @@ -11959,7 +12027,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "platforms", ] @@ -11976,10 +12044,10 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.16", + "futures 0.3.17", "jsonrpc-core 15.1.0", "jsonrpc-core-client 15.1.0", "jsonrpc-derive 15.1.0", @@ -11999,7 +12067,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.9.0" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-std", "derive_more", @@ -12013,11 +12081,11 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "async-trait", "futures 0.1.31", - "futures 0.3.16", + "futures 0.3.17", "hash-db", "hex", "parity-scale-codec", @@ -12042,7 +12110,7 @@ dependencies = [ [[package]] name = "substrate-test-runtime" version = "2.0.0" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "cfg-if 1.0.0", "frame-support", @@ -12083,9 +12151,9 @@ dependencies = [ [[package]] name = "substrate-test-runtime-client" version = "2.0.0" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "parity-scale-codec", "sc-block-builder", "sc-client-api", @@ -12104,7 +12172,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "ansi_term 0.12.1", "atty", @@ -12125,15 +12193,15 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" -version = "2.4.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" -version = "1.0.73" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "c6f107db402c2c2055242dbf4d2af0e69197202e9faacbef9571bbe47f5a1b84" dependencies = [ "proc-macro2", "quote", @@ -12153,9 +12221,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.12.5" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "474aaa926faa1603c40b7885a9eaea29b444d1cb2850cb7c0e37bb1a4182f4fa" +checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" dependencies = [ "proc-macro2", "quote", @@ -12177,9 +12245,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0652da4c4121005e9ed22b79f6c5f2d9e2752906b53a33e9490489ba421a6fb" +checksum = "64ae3b39281e4b14b8123bdbaddd472b7dfe215e444181f2f9d2443c2444f834" [[package]] name = "tempfile" @@ -12190,7 +12258,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "rand 0.8.4", - "redox_syscall 0.2.9", + "redox_syscall 0.2.5", "remove_dir_all", "winapi 0.3.9", ] @@ -12225,18 +12293,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.26" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93119e4feac1cbe6c798c34d3a53ea0026b0b1de6a120deef895137c0529bfe2" +checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.26" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "060d69a0afe7796bf42e9e2ff91f5ee691fb15c53d38b4b62a9a53eb23164745" +checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" dependencies = [ "proc-macro2", "quote", @@ -12249,7 +12317,7 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" dependencies = [ - "once_cell 1.8.0", + "once_cell 1.7.2", ] [[package]] @@ -12308,11 +12376,11 @@ checksum = "d9e44c4759bae7f1032e286a7ef990bd9ed23fe831b7eeba0beb97484c2e59b8" dependencies = [ "anyhow", "hmac 0.8.1", - "once_cell 1.8.0", + "once_cell 1.7.2", "pbkdf2 0.4.0", "rand 0.7.3", "rustc-hash", - "sha2 0.9.5", + "sha2 0.9.3", "thiserror", "unicode-normalization", "zeroize", @@ -12342,9 +12410,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.3.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac2e1d4bd0f75279cfd5a076e0d578bbf02c22b7c39e766c437dd49b3ec43e0" +checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" dependencies = [ "tinyvec_macros", ] @@ -12404,12 +12472,12 @@ dependencies = [ [[package]] name = "tokio" -version = "1.8.2" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2602b8af3767c285202012822834005f596c811042315fa7e9f5b12b2a43207" +checksum = "b4efe6fc2395938c8155973d7be49fe8d03a843726e285e100a8a383cc0154ce" dependencies = [ "autocfg 1.0.1", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.6", ] [[package]] @@ -12676,7 +12744,7 @@ checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" dependencies = [ "cfg-if 1.0.0", "log", - "pin-project-lite 0.2.7", + "pin-project-lite 0.2.6", "tracing-attributes", "tracing-core", ] @@ -12734,9 +12802,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab69019741fca4d98be3c62d2b75254528b5432233fd8a4d2739fec20278de48" +checksum = "b9cbe87a2fa7e35900ce5de20220a582a9483a7063811defce79d7cbd59d4cfe" dependencies = [ "ansi_term 0.12.1", "chrono", @@ -12803,9 +12871,9 @@ dependencies = [ [[package]] name = "trust-dns-proto" -version = "0.20.3" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0d7f5db438199a6e2609debe3f69f808d074e0a2888ee0bccb45fe234d03f4" +checksum = "952a078337565ba39007de99b151770f41039253a31846f0a3d5cd5a4ac8eedf" dependencies = [ "async-trait", "cfg-if 1.0.0", @@ -12814,7 +12882,7 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna 0.2.3", + "idna 0.2.2", "ipnet", "lazy_static", "log", @@ -12822,14 +12890,14 @@ dependencies = [ "smallvec 1.6.1", "thiserror", "tinyvec", - "url 2.2.2", + "url 2.2.1", ] [[package]] name = "trust-dns-resolver" -version = "0.20.3" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ad17b608a64bd0735e67bde16b0636f8aa8591f831a25d18443ed00a699770" +checksum = "da9c97f7d103e0f94dbe384a57908833505ae5870126492f166821b7cf685589" dependencies = [ "cfg-if 1.0.0", "futures-util", @@ -12853,7 +12921,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#47890e8fe9ce97ca4ebe1f153caf9a988f1cd840" +source = "git+https://github.com/purestake/substrate?branch=crystalin-v0.9.9-block-response-length#2af6e2cc7bad234b92da4f92ad3a3c4fe5782dd8" dependencies = [ "frame-try-runtime", "log", @@ -12900,9 +12968,9 @@ checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" [[package]] name = "uint" -version = "0.9.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6470ab50f482bde894a037a57064480a246dbfdd5960bd65a44824693f08da5f" +checksum = "e11fe9a9348741cf134085ad57c249508345fe16411b3d7fb4ff2da2f1d6382e" dependencies = [ "byteorder", "crunchy", @@ -12921,27 +12989,27 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.5" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0" +checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" dependencies = [ "matches", ] [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.8.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" +checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" [[package]] name = "unicode-width" @@ -12951,18 +13019,18 @@ checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" [[package]] name = "unicode-xid" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] name = "universal-hash" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" dependencies = [ "generic-array 0.14.4", - "subtle 2.4.1", + "subtle 2.4.0", ] [[package]] @@ -13014,31 +13082,36 @@ dependencies = [ [[package]] name = "url" -version = "2.2.2" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" dependencies = [ "form_urlencoded", - "idna 0.2.3", + "idna 0.2.2", "matches", "percent-encoding 2.1.0", ] [[package]] name = "value-bag" -version = "1.0.0-alpha.7" +version = "1.0.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd320e1520f94261153e96f7534476ad869c14022aee1e59af7c778075d840ae" +checksum = "6b676010e055c99033117c2343b33a40a30b91fecd6c49055ac9cd2d6c305ab1" dependencies = [ "ctor", - "version_check", ] [[package]] name = "vcpkg" -version = "0.2.15" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" + +[[package]] +name = "vec-arena" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +checksum = "34b2f665b594b07095e3ac3f718e13c2197143416fae4c5706cffb7b1af8d7f1" [[package]] name = "vec_map" @@ -13119,9 +13192,9 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasm-bindgen" -version = "0.2.74" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" +checksum = "83240549659d187488f91f33c0f8547cbfef0b2088bc470c116d1d260ef623d9" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -13129,9 +13202,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.74" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" +checksum = "ae70622411ca953215ca6d06d3ebeb1e915f0f6613e3b495122878d7ebec7dae" dependencies = [ "bumpalo", "lazy_static", @@ -13144,9 +13217,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.24" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1" +checksum = "73157efb9af26fb564bb59a009afd1c7c334a44db171d280690d0c3faaec3468" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -13156,9 +13229,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.74" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" +checksum = "3e734d91443f177bfdb41969de821e15c516931c3c3db3d318fa1b68975d0f6f" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -13166,9 +13239,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.74" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" +checksum = "d53739ff08c8a68b0fdbcd54c372b8ab800b1449ab3c9d706503bc7dd1621b2c" dependencies = [ "proc-macro2", "quote", @@ -13179,9 +13252,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.74" +version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" +checksum = "d9a543ae66aa233d14bb765ed9af4a33e81b8b58d1584cf1b47ff8cd0b9e4489" [[package]] name = "wasm-gc-api" @@ -13200,7 +13273,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "js-sys", "parking_lot 0.11.1", "pin-utils", @@ -13285,7 +13358,7 @@ dependencies = [ "libc", "log", "serde", - "sha2 0.9.5", + "sha2 0.9.3", "toml", "winapi 0.3.9", "zstd", @@ -13313,7 +13386,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5d2a763e7a6fc734218e0e463196762a4f409c483063d81e0e85f96343b2e0a" dependencies = [ "anyhow", - "gimli", + "gimli 0.24.0", "more-asserts", "object 0.24.0", "target-lexicon", @@ -13332,7 +13405,7 @@ dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-wasm", - "gimli", + "gimli 0.24.0", "indexmap", "log", "more-asserts", @@ -13347,7 +13420,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d4539ea734422b7c868107e2187d7746d8affbcaa71916d72639f53757ad707" dependencies = [ - "addr2line", + "addr2line 0.15.2", "anyhow", "cfg-if 1.0.0", "cranelift-codegen", @@ -13355,7 +13428,7 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli", + "gimli 0.24.0", "log", "more-asserts", "object 0.24.0", @@ -13419,7 +13492,7 @@ dependencies = [ "libc", "log", "mach", - "memoffset 0.6.4", + "memoffset 0.6.1", "more-asserts", "rand 0.8.4", "region", @@ -13430,9 +13503,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.51" +version = "0.3.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582" +checksum = "59fe19d70f5dacc03f6e46777213facae5ac3801575d56ca6cbd4c93dcd12310" dependencies = [ "js-sys", "wasm-bindgen", @@ -13450,18 +13523,18 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.21.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" dependencies = [ "webpki", ] [[package]] -name = "wepoll-ffi" -version = "0.1.2" +name = "wepoll-sys" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +checksum = "0fcb14dea929042224824779fbc82d9fab8d2e6d3cbc0ac404de8edf489e77ff" dependencies = [ "cc", ] @@ -13472,7 +13545,7 @@ version = "0.9.9-1" source = "git+https://github.com/purestake/polkadot?branch=notlesh-v0.9.9-block-response-length#43d9b89910ac0467dc14048213656e31b2019374" dependencies = [ "beefy-primitives", - "bitvec 0.20.4", + "bitvec 0.20.2", "frame-election-provider-support", "frame-executive", "frame-support", @@ -13545,12 +13618,12 @@ dependencies = [ [[package]] name = "which" -version = "4.1.0" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" +checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" dependencies = [ - "either", "libc", + "thiserror", ] [[package]] @@ -13629,11 +13702,11 @@ checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" [[package]] name = "x25519-dalek" -version = "1.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +checksum = "bc614d95359fd7afc321b66d2107ede58b246b844cf5d8a0adcca413e439f088" dependencies = [ - "curve25519-dalek 3.1.0", + "curve25519-dalek 3.0.2", "rand_core 0.5.1", "zeroize", ] @@ -13691,7 +13764,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7d9028f208dd5e63c614be69f115c1b53cacc1111437d4c765185856666c107" dependencies = [ - "futures 0.3.16", + "futures 0.3.17", "log", "nohash-hasher", "parking_lot 0.11.1", @@ -13701,18 +13774,18 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.4.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "377db0846015f7ae377174787dd452e1c5f5a9050bc6f954911d01f116daa0cd" +checksum = "81a974bcdd357f0dca4d41677db03436324d45a4c9ed2d0b873a5a360ce41c36" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.1.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2c1e130bebaeab2f23886bf9acbaca14b092408c452543c857f66399cd6dab1" +checksum = "c3f369ddb18862aba61aa49bf31e74d29f0f162dec753063200e1dc084345d16" dependencies = [ "proc-macro2", "quote", From cf735f9483a731d5f6872f9c2b1bc8e6dcc308b7 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Thu, 16 Sep 2021 16:27:22 -0400 Subject: [PATCH 77/79] fix warning --- pallets/migrations/src/tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/migrations/src/tests.rs b/pallets/migrations/src/tests.rs index 491535ea72..bbf3e72a55 100644 --- a/pallets/migrations/src/tests.rs +++ b/pallets/migrations/src/tests.rs @@ -201,7 +201,7 @@ fn migration_should_only_be_invoked_once() { #[test] fn on_runtime_upgrade_charges_minimum_two_db_writes() { ExtBuilder::default().build().execute_with(|| { - let mut weight = Migrations::on_runtime_upgrade(); + let weight = Migrations::on_runtime_upgrade(); assert_eq!(weight, RocksDbWeight::get().writes(2)); }) } From fd0a1659f6bc8729eeba3ffc5cfc04032cd15f63 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Thu, 16 Sep 2021 16:32:28 -0400 Subject: [PATCH 78/79] minor cleaning in cargo.toml --- pallets/migrations/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/migrations/Cargo.toml b/pallets/migrations/Cargo.toml index 200048235b..5be7bd0b46 100644 --- a/pallets/migrations/Cargo.toml +++ b/pallets/migrations/Cargo.toml @@ -14,7 +14,7 @@ sp-runtime = { git = "https://github.com/purestake/substrate", branch = "crystal parity-scale-codec = { version = "2.0.0", default-features = false } [dev-dependencies] -environmental = { version = "1.1.2" } +environmental = "1.1.2" sp-io = { git = "https://github.com/purestake/substrate", branch = "crystalin-v0.9.9-block-response-length" } sp-core = { git = "https://github.com/purestake/substrate", branch = "crystalin-v0.9.9-block-response-length" } From 3bcfce5eda18bbdec0f49b73c392bd01e097a860 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Mon, 20 Sep 2021 15:44:54 -0400 Subject: [PATCH 79/79] clean up cargo.ttoml --- pallets/migrations/Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pallets/migrations/Cargo.toml b/pallets/migrations/Cargo.toml index 5be7bd0b46..90aae9e0f6 100644 --- a/pallets/migrations/Cargo.toml +++ b/pallets/migrations/Cargo.toml @@ -25,7 +25,4 @@ std = [ "frame-system/std", "sp-std/std", "sp-runtime/std", - "sp-io/std", - "sp-core/std", - "environmental/std", ]