Use Vote Ancestries Directly in Weight Calculations (#862)

* Use more accurate weight calculation in declared weight

* Remove session length and validator set size config constants

* Remove config params from mock

* Allow specifying total number of votes-ancestries per justification

* Change limits used during benchmarking

* Regenerate weights

* Use simplified weight annotation

* Remove comment

* Address leftover TODO

* Prevent possible divide by zero errors

* Use correct argument order in weight declaration
This commit is contained in:
Hernando Castano
2021-04-05 12:36:29 -04:00
committed by Bastian Köcher
parent 0d7291d729
commit 1928e2b870
8 changed files with 90 additions and 112 deletions
-6
View File
@@ -417,17 +417,11 @@ parameter_types! {
// Note that once this is hit the pallet will essentially throttle incoming requests down to one
// call per block.
pub const MaxRequests: u32 = 50;
pub const MillauSessionLength: bp_millau::BlockNumber = bp_millau::SESSION_LENGTH;
// TODO [#846]: Right now this will break benchmarking if it is greater than `u8::MAX`
pub const MillauValidatorCount: u32 = 255;
}
impl pallet_bridge_grandpa::Config for Runtime {
type BridgedChain = bp_millau::Millau;
type MaxRequests = MaxRequests;
type MaxBridgedSessionLength = MillauSessionLength;
type MaxBridgedValidatorCount = MillauValidatorCount;
type WeightInfo = pallet_bridge_grandpa::weights::RialtoWeight<Runtime>;
}