Selectable on-runtime-upgrade checks (#13045)

* Make try-runtime checks selectable

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/support/src/traits/try_runtime.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* Add Clap wrapper for enum UpgradeCheckSelect

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Revert "Add Clap wrapper for enum UpgradeCheckSelect"

This reverts commit e29538c1a79d1711b43addc9400d871f6aa32844.

* fix pools sanity check

* Set default for --checks to None

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make --checks backwards comp

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add clap attr comment

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: kianenigma <kian@parity.io>
This commit is contained in:
Oliver Tale-Yazdi
2023-01-04 13:44:41 +01:00
committed by GitHub
parent 7ead16802e
commit d0bbec32ad
8 changed files with 79 additions and 21 deletions
+2 -2
View File
@@ -20,7 +20,7 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg(feature = "try-runtime")]
pub use frame_support::traits::TryStateSelect;
pub use frame_support::traits::{TryStateSelect, UpgradeCheckSelect};
use frame_support::weights::Weight;
sp_api::decl_runtime_apis! {
@@ -37,7 +37,7 @@ sp_api::decl_runtime_apis! {
/// If `checks` is `true`, `pre_migrate` and `post_migrate` of each migration and
/// `try_state` of all pallets will be executed. Else, no. If checks are executed, the PoV
/// tracking is likely inaccurate.
fn on_runtime_upgrade(checks: bool) -> (Weight, Weight);
fn on_runtime_upgrade(checks: UpgradeCheckSelect) -> (Weight, Weight);
/// Execute the given block, but optionally disable state-root and signature checks.
///