mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 06:01:02 +00:00
Don't use fixed nominator count for report_equivocation weight calculation (#14471)
* babe: fix report_equivocation weight calculation * grandpa: fix report_equivocation weight calculation * beefy: fix report_equivocation weight calculation * runtime: add missing MaxNominators constant
This commit is contained in:
@@ -72,7 +72,7 @@ pub use pallet::*;
|
||||
|
||||
pub trait WeightInfo {
|
||||
fn plan_config_change() -> Weight;
|
||||
fn report_equivocation(validator_count: u32) -> Weight;
|
||||
fn report_equivocation(validator_count: u32, max_nominators_per_validator: u32) -> Weight;
|
||||
}
|
||||
|
||||
/// Trigger an epoch change, if any should take place.
|
||||
@@ -153,6 +153,10 @@ pub mod pallet {
|
||||
#[pallet::constant]
|
||||
type MaxAuthorities: Get<u32>;
|
||||
|
||||
/// The maximum number of nominators for each validator.
|
||||
#[pallet::constant]
|
||||
type MaxNominators: Get<u32>;
|
||||
|
||||
/// The proof of key ownership, used for validating equivocation reports.
|
||||
/// The proof must include the session index and validator count of the
|
||||
/// session at which the equivocation occurred.
|
||||
@@ -407,6 +411,7 @@ pub mod pallet {
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(<T as Config>::WeightInfo::report_equivocation(
|
||||
key_owner_proof.validator_count(),
|
||||
T::MaxNominators::get(),
|
||||
))]
|
||||
pub fn report_equivocation(
|
||||
origin: OriginFor<T>,
|
||||
@@ -433,6 +438,7 @@ pub mod pallet {
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight(<T as Config>::WeightInfo::report_equivocation(
|
||||
key_owner_proof.validator_count(),
|
||||
T::MaxNominators::get(),
|
||||
))]
|
||||
pub fn report_equivocation_unsigned(
|
||||
origin: OriginFor<T>,
|
||||
|
||||
Reference in New Issue
Block a user