Skip to content
Merged
Show file tree
Hide file tree
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
11 changes: 9 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resolver = "2"
members = ["cli", "core"]

[workspace.package]
version = "0.5.1"
version = "0.5.2"
authors = ["Parity Technologies <[email protected]>"]
description = "Substrate's programmatic testing framework."
edition = "2021"
Expand Down
1 change: 1 addition & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ sp-version = { workspace = true }
sp-weights = { workspace = true }

substrate-rpc-client = { workspace = true }
paris = "1.5.15"

[dev-dependencies]
assert_cmd = { workspace = true }
Expand Down
58 changes: 52 additions & 6 deletions core/src/commands/on_runtime_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use std::{fmt::Debug, str::FromStr};

use bytesize::ByteSize;
use frame_try_runtime::UpgradeCheckSelect;
use paris::formatter::colorize_string;
use parity_scale_codec::Encode;
use sc_executor::sp_wasm_interface::HostFunctions;
use sp_core::{hexdisplay::HexDisplay, Hasher};
Expand Down Expand Up @@ -101,8 +102,23 @@ where

// Run `TryRuntime_on_runtime_upgrade` with the given checks.
log::info!(
"🔬 Running TryRuntime_on_runtime_upgrade with checks: {:?}",
command.checks
"{}",
colorize_string(
"<bold><blue>-------------------------------------------------------------------\n\n"
)
);
log::info!(
"{}",
colorize_string(format!(
"🔬 <bold><blue>Running TryRuntime_on_runtime_upgrade with checks: {:?}\n\n",
command.checks
))
);
log::info!(
"{}",
colorize_string(
"<bold><blue>-------------------------------------------------------------------"
)
);
// Save the overlayed changes from the first run, so we can use them later for idempotency
// checks.
Expand All @@ -126,7 +142,16 @@ where
UpgradeCheckSelect::None => (proof, ref_time_results),
_ => {
log::info!(
"🔬 TryRuntime_on_runtime_upgrade succeeded! Running it again without checks for weight measurements."
"{}",
colorize_string("<bold><blue>-------------------------------------------------------------------\n\n")
);
log::info!(
"{}",
colorize_string("🔬 <bold><blue>TryRuntime_on_runtime_upgrade succeeded! Running it again without checks for weight measurements.\n\n"),
);
log::info!(
"{}",
colorize_string("<bold><blue>-------------------------------------------------------------------")
);
let (proof, encoded_result) = state_machine_call_with_proof::<Block, HostFns>(
&ext,
Expand All @@ -150,8 +175,16 @@ where
}
false => {
log::info!(
"🔬 Running TryRuntime_on_runtime_upgrade again to check idempotency: {:?}",
command.checks
"{}",
colorize_string("<bold><blue>-------------------------------------------------------------------\n\n")
);
log::info!(
"{}",
colorize_string(format!("🔬 <bold><blue>Running TryRuntime_on_runtime_upgrade again to check idempotency: {:?}\n\n", command.checks)),
);
log::info!(
"{}",
colorize_string("<bold><blue>-------------------------------------------------------------------")
);
let (oc_pre_root, _) = overlayed_changes.storage_root(&ext.backend, ext.state_version);
match state_machine_call_with_proof::<Block, HostFns>(
Expand Down Expand Up @@ -213,7 +246,20 @@ where
};

if !weight_ok || !idempotency_ok {
log::error!("❌ Issues detected, exiting non-zero. See logs.");
log::error!(
"{}",
colorize_string("<bold><red>-------------------------------------------------------------------\n\n")
);
log::error!(
"{}",
colorize_string("❌ <bold><red>Issues detected, exiting non-zero. See logs.\n\n"),
);
log::error!(
"{}",
colorize_string(
"<bold><red>-------------------------------------------------------------------"
)
);
std::process::exit(1);
}

Expand Down