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
146 make _bench PALLET=app-promotion PALLET_DIR=app-promotion146 make _bench PALLET=app-promotion PALLET_DIR=app-promotion
147 147
148.PHONY: bench148.PHONY: bench
149# Disabled: bench-scheduler, bench-rmrk-core, bench-rmrk-equip149# Disabled: bench-scheduler, bench-collator-selection, bench-rmrk-core, bench-rmrk-equip
150bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-collator-selection bench-identity150bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-identity
151151
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
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! {