Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable try_decode_entire_state try-runtime checks #2283

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions substrate/frame/executive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,6 @@ where
log::error!(target: LOG_TARGET, "failure: {:?}", e);
e
})?;
if select.any() {
let res = AllPalletsWithSystem::try_decode_entire_state();
Self::log_decode_result(res)?;
}
drop(_guard);

// do some of the checks that would normally happen in `final_checks`, but perhaps skip
Expand Down Expand Up @@ -375,12 +371,6 @@ where
// Nothing should modify the state after the migrations ran:
let _guard = StorageNoopGuard::default();

// The state must be decodable:
if checks.any() {
let res = AllPalletsWithSystem::try_decode_entire_state();
Self::log_decode_result(res)?;
}

// Check all storage invariants:
if checks.try_state() {
AllPalletsWithSystem::try_state(
Expand All @@ -392,7 +382,11 @@ where
Ok(before_all_weight.saturating_add(try_on_runtime_upgrade_weight))
}

/// Logs the result of trying to decode the entire state.
/// Logs the result of `Tuple::try_decode_entire_state()`.
///
/// Not currently used anywhere. Will implement once we have a cleaner way to call state checks
/// (tracked <https://github.com/paritytech/polkadot-sdk/pull/2263>).
#[allow(dead_code)]
fn log_decode_result(
res: Result<usize, Vec<TryDecodeEntireStorageError>>,
) -> Result<(), TryRuntimeError> {
Expand Down