git.delta.rocks / unique-network / refs/commits / d18d30e1eb6f

difftreelog

fix(collator-selection) configuration weights + disable benchmarking for now

Fahrrader2022-12-29parent: #4091fe1.patch.diff
in: master

3 files changed

modifiedMakefilediffbeforeafterboth
--- a/Makefile
+++ b/Makefile
@@ -146,5 +146,5 @@
 	make _bench PALLET=app-promotion PALLET_DIR=app-promotion
 	
 .PHONY: bench
-# Disabled: bench-scheduler, bench-rmrk-core, bench-rmrk-equip
-bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-collator-selection bench-identity
+# Disabled: bench-scheduler, bench-collator-selection, bench-rmrk-core, bench-rmrk-equip
+bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-identity
modifiedpallets/collator-selection/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/collator-selection/src/benchmarking.rs
+++ b/pallets/collator-selection/src/benchmarking.rs
@@ -128,10 +128,10 @@
 	let candidates = (0..count)
 		.map(|c| account("candidate", c, SEED))
 		.collect::<Vec<_>>();
-	/*assert!(
+	assert!(
 		<LicenseBond<T>>::get() > 0u32.into(),
 		"Bond cannot be zero!"
-	);*/
+	);
 
 	for who in candidates {
 		T::Currency::make_free_balance_be(&who, <LicenseBond<T>>::get() * 2u32.into());
@@ -144,10 +144,10 @@
 	let candidates = (0..count)
 		.map(|c| account("candidate", c, SEED))
 		.collect::<Vec<_>>();
-	/*assert!(
+	assert!(
 		<LicenseBond<T>>::get() > 0u32.into(),
 		"Bond cannot be zero!"
-	);*/
+	);
 
 	for who in candidates {
 		T::Currency::make_free_balance_be(&who, <LicenseBond<T>>::get() * 2u32.into());
@@ -158,6 +158,9 @@
 benchmarks! {
 	where_clause { where T: pallet_authorship::Config + session::Config + configuration::Config }
 
+	// todo:collator this and all the following do not work for some reason, going all the way up to 10 in length
+	// Both invulnerables and candidates count together against MaxCollators.
+	// Maybe try putting it in braces? 1 .. (T::MaxCollators::get() - 2)
 	add_invulnerable {
 		let b in 1 .. T::MaxCollators::get() - 3;
 		register_validators::<T>(b);
modifiedpallets/collator-selection/src/mock.rsdiffbeforeafterboth
219 type DefaultCollatorSelectionMaxCollators = MaxCollators;219 type DefaultCollatorSelectionMaxCollators = MaxCollators;
220 type DefaultCollatorSelectionKickThreshold = KickThreshold;220 type DefaultCollatorSelectionKickThreshold = KickThreshold;
221 type DefaultCollatorSelectionLicenseBond = LicenseBond;221 type DefaultCollatorSelectionLicenseBond = LicenseBond;
222 // the following we don't care about222 // the following constants we don't care about
223 type DefaultWeightToFeeCoefficient = DefaultWeightToFeeCoefficient;223 type DefaultWeightToFeeCoefficient = DefaultWeightToFeeCoefficient;
224 type DefaultMinGasPrice = DefaultMinGasPrice;224 type DefaultMinGasPrice = DefaultMinGasPrice;
225 type MaxXcmAllowedLocations = MaxXcmAllowedLocations;225 type MaxXcmAllowedLocations = MaxXcmAllowedLocations;
226 type AppPromotionDailyRate = AppPromotionDailyRate;226 type AppPromotionDailyRate = AppPromotionDailyRate;
227 type DayRelayBlocks = DayRelayBlocks;227 type DayRelayBlocks = DayRelayBlocks;
228 type WeightInfo = ();228 type WeightInfo = pallet_configuration::weights::SubstrateWeight<Self>;
229}229}
230230
231ord_parameter_types! {231ord_parameter_types! {