Skip to content

Commit

Permalink
Dont ignore errors in pallet benchmarking (paritytech#12449)
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <[email protected]>

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
ggwpez authored and ark0f committed Feb 27, 2023
1 parent ef59faf commit 32c989d
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions utils/frame/benchmarking-cli/src/pallet/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,16 +297,15 @@ impl PalletCmd {
for (s, selected_components) in all_components.iter().enumerate() {
// First we run a verification
if !self.no_verify {
// Dont use these results since verification code will add overhead
let state = &state_without_tracking;
let _results = StateMachine::new(
let result = StateMachine::new(
state,
&mut changes,
&executor,
"Benchmark_dispatch_benchmark",
&(
&pallet.clone(),
&extrinsic.clone(),
&pallet,
&extrinsic,
&selected_components.clone(),
true, // run verification code
1, // no need to do internal repeats
Expand All @@ -321,6 +320,20 @@ impl PalletCmd {
.map_err(|e| {
format!("Error executing and verifying runtime benchmark: {}", e)
})?;
// Dont use these results since verification code will add overhead.
let _batch =
<std::result::Result<Vec<BenchmarkBatch>, String> as Decode>::decode(
&mut &result[..],
)
.map_err(|e| format!("Failed to decode benchmark results: {:?}", e))?
.map_err(|e| {
format!(
"Benchmark {}::{} failed: {}",
String::from_utf8_lossy(&pallet),
String::from_utf8_lossy(&extrinsic),
e
)
})?;
}
// Do one loop of DB tracking.
{
Expand Down

0 comments on commit 32c989d

Please sign in to comment.