Skip to content

Commit

Permalink
fix rococo-dev bench (#5688)
Browse files Browse the repository at this point in the history
the range should always contain at least 2 values for the benchmark to
work
closes #5680
  • Loading branch information
ordian authored Sep 16, 2024
1 parent 22bdc3e commit 655382f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use super::*;
use crate::{inclusion, ParaId};
use alloc::collections::btree_map::BTreeMap;
use core::cmp::min;
use core::cmp::{max, min};
use frame_benchmarking::{benchmarks, impl_benchmark_test_suite};
use frame_system::RawOrigin;

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

let cores_with_backed: BTreeMap<_, _>
= vec![(0, v)] // The backed candidate will have `v` validity votes.
Expand Down
10 changes: 10 additions & 0 deletions prdoc/pr_5688.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: "Fix `paras_inherent` benchmark"

doc:
- audience: Runtime Dev
description: |
Fixes the benchmark for relay chains like rococo-dev with `max_validators_per_core` value lower than 2.

crates:
- name: polkadot-runtime-parachains
bump: patch

0 comments on commit 655382f

Please sign in to comment.