This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Selectable on-runtime-upgrade checks #13045
Merged
paritytech-processbot
merged 10 commits into
master
from
oty-try-runtime-cli-select-check
Jan 4, 2023
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
33c01bb
Make try-runtime checks selectable
ggwpez 1f9eb3a
Update frame/support/src/traits/try_runtime.rs
ggwpez e29538c
Add Clap wrapper for enum UpgradeCheckSelect
ggwpez fbd6724
Revert "Add Clap wrapper for enum UpgradeCheckSelect"
ggwpez d32ae61
fix pools sanity check
kianenigma d6b2f4d
Set default for --checks to None
ggwpez 9142400
Merge branch 'oty-try-runtime-cli-select-check' of github.com:parityt…
kianenigma f8b3069
Merge branch 'oty-try-runtime-cli-select-check' of github.com:parityt…
kianenigma ca27a6a
Make --checks backwards comp
ggwpez 7269f21
Add clap attr comment
ggwpez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
// limitations under the License. | ||
|
||
use crate::{build_executor, state_machine_call_with_proof, SharedParams, State, LOG_TARGET}; | ||
use frame_try_runtime::UpgradeCheckSelect; | ||
use parity_scale_codec::{Decode, Encode}; | ||
use sc_executor::sp_wasm_interface::HostFunctions; | ||
use sp_runtime::traits::{Block as BlockT, NumberFor}; | ||
|
@@ -29,12 +30,21 @@ pub struct OnRuntimeUpgradeCmd { | |
#[command(subcommand)] | ||
pub state: State, | ||
|
||
/// Execute `try_state`, `pre_upgrade` and `post_upgrade` checks as well. | ||
/// Select which optional checks to perform. Selects all when no value is given. | ||
/// | ||
/// This will perform more checks, but it will also makes the reported PoV/Weight be | ||
/// inaccurate. | ||
#[clap(long)] | ||
pub checks: bool, | ||
/// - `none`: Perform no checks (default when the arg is not present). | ||
/// - `all`: Perform all checks (default when the arg is present). | ||
/// - `pre-and-post`: Perform pre- and post-upgrade checks. | ||
/// - `try-state`: Perform the try-state checks. | ||
/// | ||
/// Performing any checks will potentially invalidate the measured PoV/Weight. | ||
#[clap(long, | ||
default_value = "None", | ||
default_missing_value = "All", | ||
num_args = 0..=1, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need this or? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could also use some context on what these flags do, but I believe they help us remain backwards compat. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is needed since otherwise it does not work as flag without arg. The difference in the help print: I added a comment. |
||
require_equals = true, | ||
verbatim_doc_comment)] | ||
pub checks: UpgradeCheckSelect, | ||
} | ||
|
||
pub(crate) async fn on_runtime_upgrade<Block, HostFns>( | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you removed the assert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did, it does not hold anymore because we changed ED in Kusama :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Context paritytech/polkadot#6372 (comment)