From 9592b55fea3fa36e606d68874ed392547b53bfa3 Mon Sep 17 00:00:00 2001
From: Svyatoslav Nikolsky <svyatonik@gmail.com>
Date: Mon, 24 Oct 2022 11:41:37 +0300
Subject: [PATCH] fix parameter to match used value GRANDPA benchmarks (#1616)

---
 bridges/bin/millau/runtime/src/lib.rs       | 10 ++++++++--
 bridges/modules/grandpa/src/benchmarking.rs |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/bridges/bin/millau/runtime/src/lib.rs b/bridges/bin/millau/runtime/src/lib.rs
index 6439c045655..1f60e91f59f 100644
--- a/bridges/bin/millau/runtime/src/lib.rs
+++ b/bridges/bin/millau/runtime/src/lib.rs
@@ -417,6 +417,12 @@ parameter_types! {
 	///
 	/// Note: This is lower than regular value, to speed up benchmarking setup.
 	pub const HeadersToKeep: u32 = 1024;
+	/// Maximal number of authorities at Rialto.
+	///
+	/// In benchmarks we're using sets of up to `1024` authorities to prepare for possible
+	/// upgrades in the future and see if performance degrades when number of authorities
+	/// grow.
+	pub const MaxAuthoritiesAtRialto: u32 = pallet_bridge_grandpa::benchmarking::MAX_VALIDATOR_SET_SIZE;
 }
 
 #[cfg(not(feature = "runtime-benchmarks"))]
@@ -426,11 +432,11 @@ parameter_types! {
 	/// Assuming the worst case of every header being finalized, we will keep headers at least for a
 	/// week.
 	pub const HeadersToKeep: u32 = 7 * bp_rialto::DAYS;
+	/// Maximal number of authorities at Rialto.
+	pub const MaxAuthoritiesAtRialto: u32 = bp_rialto::MAX_AUTHORITIES_COUNT;
 }
 
 parameter_types! {
-	/// Maximal number of authorities at Rialto.
-	pub const MaxAuthoritiesAtRialto: u32 = bp_rialto::MAX_AUTHORITIES_COUNT;
 	/// Maximal size of SCALE-encoded Rialto header.
 	pub const MaxRialtoHeaderSize: u32 = bp_rialto::MAX_HEADER_SIZE;
 
diff --git a/bridges/modules/grandpa/src/benchmarking.rs b/bridges/modules/grandpa/src/benchmarking.rs
index f93798536a3..e937f7a0bf4 100644
--- a/bridges/modules/grandpa/src/benchmarking.rs
+++ b/bridges/modules/grandpa/src/benchmarking.rs
@@ -61,7 +61,7 @@ const MAX_VOTE_ANCESTRIES: u32 = 1000;
 
 // The maximum number of pre-commits to include in a justification. In practice this scales with the
 // number of validators.
-const MAX_VALIDATOR_SET_SIZE: u32 = 1024;
+pub const MAX_VALIDATOR_SET_SIZE: u32 = 1024;
 
 // `1..MAX_VALIDATOR_SET_SIZE` and `1..MAX_VOTE_ANCESTRIES` are too large && benchmarks are
 // running for almost 40m (steps=50, repeat=20) on a decent laptop, which is too much. Since
-- 
GitLab