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
128 let candidates = (0..count)128 let candidates = (0..count)
129 .map(|c| account("candidate", c, SEED))129 .map(|c| account("candidate", c, SEED))
130 .collect::<Vec<_>>();130 .collect::<Vec<_>>();
131 /*assert!(131 assert!(
132 <LicenseBond<T>>::get() > 0u32.into(),132 <LicenseBond<T>>::get() > 0u32.into(),
133 "Bond cannot be zero!"133 "Bond cannot be zero!"
134 );*/134 );
135135
136 for who in candidates {136 for who in candidates {
137 T::Currency::make_free_balance_be(&who, <LicenseBond<T>>::get() * 2u32.into());137 T::Currency::make_free_balance_be(&who, <LicenseBond<T>>::get() * 2u32.into());
144 let candidates = (0..count)144 let candidates = (0..count)
145 .map(|c| account("candidate", c, SEED))145 .map(|c| account("candidate", c, SEED))
146 .collect::<Vec<_>>();146 .collect::<Vec<_>>();
147 /*assert!(147 assert!(
148 <LicenseBond<T>>::get() > 0u32.into(),148 <LicenseBond<T>>::get() > 0u32.into(),
149 "Bond cannot be zero!"149 "Bond cannot be zero!"
150 );*/150 );
151151
152 for who in candidates {152 for who in candidates {
153 T::Currency::make_free_balance_be(&who, <LicenseBond<T>>::get() * 2u32.into());153 T::Currency::make_free_balance_be(&who, <LicenseBond<T>>::get() * 2u32.into());
158benchmarks! {158benchmarks! {
159 where_clause { where T: pallet_authorship::Config + session::Config + configuration::Config }159 where_clause { where T: pallet_authorship::Config + session::Config + configuration::Config }
160160
161 // todo:collator this and all the following do not work for some reason, going all the way up to 10 in length
162 // Both invulnerables and candidates count together against MaxCollators.
163 // Maybe try putting it in braces? 1 .. (T::MaxCollators::get() - 2)
161 add_invulnerable {164 add_invulnerable {
162 let b in 1 .. T::MaxCollators::get() - 3;165 let b in 1 .. T::MaxCollators::get() - 3;
163 register_validators::<T>(b);166 register_validators::<T>(b);
modifiedpallets/collator-selection/src/mock.rsdiffbeforeafterboth
--- a/pallets/collator-selection/src/mock.rs
+++ b/pallets/collator-selection/src/mock.rs
@@ -219,13 +219,13 @@
 	type DefaultCollatorSelectionMaxCollators = MaxCollators;
 	type DefaultCollatorSelectionKickThreshold = KickThreshold;
 	type DefaultCollatorSelectionLicenseBond = LicenseBond;
-	// the following we don't care about
+	// the following constants we don't care about
 	type DefaultWeightToFeeCoefficient = DefaultWeightToFeeCoefficient;
 	type DefaultMinGasPrice = DefaultMinGasPrice;
 	type MaxXcmAllowedLocations = MaxXcmAllowedLocations;
 	type AppPromotionDailyRate = AppPromotionDailyRate;
 	type DayRelayBlocks = DayRelayBlocks;
-	type WeightInfo = ();
+	type WeightInfo = pallet_configuration::weights::SubstrateWeight<Self>;
 }
 
 ord_parameter_types! {