Skip to content

Commit

Permalink
[stable2409]: Backport #5688 (#5727)
Browse files Browse the repository at this point in the history
As requested here:
#5688 (comment)

I don't think it need to be backported to 2407, as the issue was not
present there yet.
  • Loading branch information
ordian authored Sep 16, 2024
1 parent 692daf4 commit a45d203
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 a45d203

Please sign in to comment.