difftreelog
fix(collator-selection) configuration weights + disable benchmarking for now
in: master
3 files changed
Makefilediffbeforeafterboth146 make _bench PALLET=app-promotion PALLET_DIR=app-promotion146 make _bench PALLET=app-promotion PALLET_DIR=app-promotion147 147 148.PHONY: bench148.PHONY: bench149# Disabled: bench-scheduler, bench-rmrk-core, bench-rmrk-equip149# Disabled: bench-scheduler, bench-collator-selection, bench-rmrk-core, bench-rmrk-equip150bench: 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-identity151151pallets/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);
pallets/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! {