Skip to content

Commit fb4c6a0

Browse files
committed
fix rococo-dev bench (#5688)
the range should always contain at least 2 values for the benchmark to work closes #5680
1 parent c1b1394 commit fb4c6a0

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

polkadot/runtime/parachains/src/paras_inherent/benchmarking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use super::*;
1818
use crate::{inclusion, ParaId};
1919
use alloc::collections::btree_map::BTreeMap;
20-
use core::cmp::min;
20+
use core::cmp::{max, min};
2121
use frame_benchmarking::{benchmarks, impl_benchmark_test_suite};
2222
use frame_system::RawOrigin;
2323

@@ -107,7 +107,7 @@ benchmarks! {
107107
// of a single backed candidate.
108108
enter_backed_candidates_variable {
109109
let v in (BenchBuilder::<T>::fallback_min_backing_votes())
110-
..(BenchBuilder::<T>::fallback_max_validators_per_core());
110+
.. max(BenchBuilder::<T>::fallback_min_backing_votes() + 1, BenchBuilder::<T>::fallback_max_validators_per_core());
111111

112112
let cores_with_backed: BTreeMap<_, _>
113113
= vec![(0, v)] // The backed candidate will have `v` validity votes.

prdoc/pr_5688.prdoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
title: "Fix `paras_inherent` benchmark"
2+
3+
doc:
4+
- audience: Runtime Dev
5+
description: |
6+
Fixes the benchmark for relay chains like rococo-dev with `max_validators_per_core` value lower than 2.
7+
8+
crates:
9+
- name: polkadot-runtime-parachains
10+
bump: patch

0 commit comments

Comments
 (0)