Enable verification logic when executing benchmarks (#6929)

* Add `--verify` flag to benchmark execution

* make it so `--verify` can be used for getting the actual benchmarks

* undo manual testing

* oops

* use benchmark config struct

* verify is default on, docs update

* remove clone

* improve formatting

* fix test

* bump impl for ci
This commit is contained in:
Shawn Tabrizi
2020-08-24 15:24:00 +02:00
committed by GitHub
parent c8ca2ce183
commit 4462f7150d
7 changed files with 150 additions and 113 deletions
+2 -8
View File
@@ -1134,13 +1134,7 @@ impl_runtime_apis! {
#[cfg(feature = "runtime-benchmarks")]
impl frame_benchmarking::Benchmark<Block> for Runtime {
fn dispatch_benchmark(
pallet: Vec<u8>,
benchmark: Vec<u8>,
lowest_range_values: Vec<u32>,
highest_range_values: Vec<u32>,
steps: Vec<u32>,
repeat: u32,
extra: bool,
config: frame_benchmarking::BenchmarkConfig
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {
use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};
// Trying to add benchmarks directly to the Session Pallet caused cyclic dependency issues.
@@ -1170,7 +1164,7 @@ impl_runtime_apis! {
];
let mut batches = Vec::<BenchmarkBatch>::new();
let params = (&pallet, &benchmark, &lowest_range_values, &highest_range_values, &steps, repeat, &whitelist, extra);
let params = (&config, &whitelist);
add_benchmark!(params, batches, pallet_babe, Babe);
add_benchmark!(params, batches, pallet_balances, Balances);