Compare commits

..

4 Commits

Author SHA1 Message Date
562efe5744
apply final changes to casper runtime
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2026-02-26 21:38:34 +03:00
b0a69493cd
fix benchmarking for slow clap
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2026-02-26 21:36:14 +03:00
bd8d7145af
more optimized version for try_offend_validators
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2026-02-26 14:44:36 +03:00
ba7d2a8222
additional function for exposure trait
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2026-02-26 14:42:39 +03:00
12 changed files with 209 additions and 142 deletions

5
Cargo.lock generated
View File

@ -3838,7 +3838,7 @@ dependencies = [
[[package]]
name = "ghost-slow-clap"
version = "0.4.24"
version = "0.4.25"
dependencies = [
"frame-benchmarking",
"frame-support",
@ -3890,10 +3890,11 @@ dependencies = [
[[package]]
name = "ghost-traits"
version = "0.3.31"
version = "0.3.32"
dependencies = [
"frame-support",
"sp-runtime 31.0.1",
"sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk.git?tag=polkadot-v1.12.0)",
]
[[package]]

View File

@ -1,6 +1,6 @@
[package]
name = "ghost-slow-clap"
version = "0.4.24"
version = "0.4.26"
description = "Applause protocol for the EVM bridge"
license.workspace = true
authors.workspace = true

View File

@ -111,8 +111,8 @@ benchmarks! {
}
try_offend_validators {
let n in 4 .. T::MaxAuthorities::get();
let d in 0 .. T::MaxAuthorities::get().saturating_div(3);
let n in 1 .. T::MaxAuthorities::get();
let d in 0 .. T::MaxAuthorities::get();
let session_index = T::ValidatorSet::session_index();
let mut validators_vec = Vec::new();

View File

@ -1441,41 +1441,53 @@ impl<T: Config> Pallet<T> {
disabled_bitmap: BitMap,
offence_type: OffenceType,
) -> Weight {
let validator_set_count = validators.len() as u32;
let mut weight = T::DbWeight::get().reads_writes(1, 1);
let validator_set_count = validators.len();
let offenders = validators
.into_iter()
.enumerate()
.filter_map(|(index, id)| {
(offence_bitmap.exists(&(index as AuthIndex))).then(|| {
<T::ValidatorSet as ValidatorSetWithIdentification<T::AccountId>>::IdentificationOf::convert(
id.clone(),
).map(|full_id| (id.clone(), full_id))
})
.flatten()
})
.collect::<Vec<IdentificationTuple<T>>>();
let mut offenders = Vec::with_capacity(offence_bitmap.count_ones() as usize);
let mut reporter_indexes = Vec::with_capacity(validator_set_count);
let disabled_or_offence_bitmap = disabled_bitmap.bitor(offence_bitmap);
let disabled_or_offence_bitmap = disabled_bitmap.bitor(offence_bitmap.clone());
let validator_set_count = validator_set_count as u32;
for (index, id) in validators.iter().enumerate() {
let authority_index = index as AuthIndex;
if offence_bitmap.exists(&authority_index) {
weight.saturating_accrue(T::DbWeight::get().reads(1));
if let Some(full_id) = <T::ValidatorSet as ValidatorSetWithIdentification<
T::AccountId,
>>::IdentificationOf::convert(id.clone())
{
offenders.push((id.clone(), full_id));
}
} else if !disabled_or_offence_bitmap.exists(&authority_index) {
reporter_indexes.push(index);
}
}
let offenders_len = offenders.len() as u32;
let not_enough_validators_left = validator_set_count
.saturating_sub(disabled_or_offence_bitmap.count_ones())
.lt(&T::MinAuthoritiesNumber::get());
if not_enough_validators_left && offenders.len() > 0 {
if not_enough_validators_left && offenders_len > 0 {
Self::deposit_event(Event::<T>::BlackSwan);
return T::DbWeight::get().writes(1);
return weight;
}
let offenders_len = offenders.len() as u32;
if offenders_len == 0 {
let equilibrium_event = match offence_type {
OffenceType::CommitmentOffence => Event::<T>::AuthoritiesCommitmentEquilibrium,
OffenceType::ThrottlingOffence(_) => Event::<T>::AuthoritiesApplauseEquilibrium,
};
Self::deposit_event(equilibrium_event);
return T::DbWeight::get().writes(1);
return weight;
}
weight.saturating_accrue(T::DbWeight::get().reads(1));
let reporters = T::ExposureListener::get_accounts_by_indexes(reporter_indexes.into_iter());
let offence_event = match offence_type {
OffenceType::CommitmentOffence => Event::<T>::SomeAuthoritiesDelayed {
delayed: offenders.clone(),
@ -1494,21 +1506,13 @@ impl<T: Config> Pallet<T> {
offence_type,
};
let reporters = validators
.into_iter()
.enumerate()
.filter_map(|(index, _)| {
(!disabled_or_offence_bitmap.exists(&(index as AuthIndex)))
.then(|| T::ExposureListener::get_account_by_index(index))
.flatten()
})
.collect();
if let Err(e) = T::ReportUnresponsiveness::report_offence(reporters, offence) {
sp_runtime::print(e);
}
T::WeightInfo::try_offend_validators(offenders_len)
let extra_weight = T::WeightInfo::try_offend_validators(validator_set_count, offenders_len);
weight.saturating_add(extra_weight)
}
}

View File

@ -177,6 +177,15 @@ impl ExposureListener<Balance, u64> for TestExposureListener
where
Balance: AtLeast32BitUnsigned + From<u64>,
{
fn get_accounts_by_indexes(
indexes_iterator: impl Iterator<Item = usize>,
) -> sp_std::prelude::Vec<u64> {
let all_validators = FixedValidators::get();
indexes_iterator
.filter_map(|i| all_validators.get(i).copied())
.collect()
}
fn get_account_by_index(index: usize) -> Option<u64> {
FixedValidators::get().get(index).copied()
}

View File

@ -49,7 +49,7 @@ use core::marker::PhantomData;
pub trait WeightInfo {
fn slow_clap() -> Weight;
fn commit_block()-> Weight;
fn try_offend_validators(offenders_len: u32) -> Weight;
fn try_offend_validators(validators_len: u32, offenders_len: u32) -> Weight;
}
impl WeightInfo for () {
@ -105,7 +105,7 @@ impl WeightInfo for () {
.saturating_add(RocksDbWeight::get().writes(1))
}
fn try_offend_validators(_offenders_len: u32) -> Weight {
fn try_offend_validators(_validators_len: u32, _offenders_len: u32) -> Weight {
Default::default()
}
}

View File

@ -1,6 +1,6 @@
[package]
name = "ghost-traits"
version = "0.3.31"
version = "0.3.32"
license.workspace = true
authors.workspace = true
edition.workspace = true
@ -10,10 +10,12 @@ repository.workspace = true
[dependencies]
frame-support = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
[features]
default = ["std"]
std = [
"frame-support/std",
"sp-runtime/std",
"sp-std/std",
]

View File

@ -1,6 +1,9 @@
use sp_runtime::traits::AtLeast32BitUnsigned;
pub trait ExposureListener<Balance: AtLeast32BitUnsigned, AccountId> {
fn get_accounts_by_indexes(
indexes: impl Iterator<Item = usize>,
) -> sp_std::prelude::Vec<AccountId>;
fn get_account_by_index(index: usize) -> Option<AccountId>;
fn get_total_exposure() -> Balance;
fn get_validator_exposure(index: &AccountId) -> Balance;

View File

@ -1,6 +1,6 @@
[package]
name = "casper-runtime"
version = "3.5.38"
version = "3.5.39"
build = "build.rs"
description = "Runtime of the Casper Network"
edition.workspace = true

View File

@ -86,6 +86,21 @@ where
u128: From<T::CurrencyBalance>,
AccountIdOf<T>: From<<T as pallet_session::Config>::ValidatorId>,
{
fn get_accounts_by_indexes(
indexes_iterator: impl Iterator<Item = usize>,
) -> sp_std::prelude::Vec<AccountIdOf<T>> {
let all_validators = pallet_session::Pallet::<T>::validators();
indexes_iterator
.filter_map(|index| all_validators
.get(index)
.map(|validator| {
let account_id: AccountIdOf<T> = validator.clone().into();
account_id
})
)
.collect()
}
fn get_account_by_index(index: usize) -> Option<AccountIdOf<T>> {
pallet_session::Pallet::<T>::validators()
.get(index)

View File

@ -16,7 +16,7 @@
//! Autogenerated weights for `ghost_networks`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2025-11-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2026-02-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `ghostown`, CPU: `Intel(R) Core(TM) i3-2310M CPU @ 2.10GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("casper-dev")`, DB CACHE: 1024
@ -30,7 +30,6 @@
// --repeat=20
// --pallet=ghost_networks
// --extrinsic=*
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./runtime/casper/src/weights/ghost_networks.rs
@ -48,35 +47,35 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> ghost_networks::WeightInfo for WeightInfo<T> {
/// Storage: `GhostNetworks::Networks` (r:1 w:1)
/// Proof: `GhostNetworks::Networks` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `GhostNetworks::NetworkIndexes` (r:1 w:1)
/// Proof: `GhostNetworks::NetworkIndexes` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// The range of component `i` is `[1, 20]`.
/// The range of component `j` is `[1, 150]`.
/// The range of component `k` is `[1, 20]`.
fn register_network(i: u32, j: u32, k: u32, ) -> Weight {
fn register_network(_i: u32, j: u32, k: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `109`
// Estimated: `3574`
// Minimum execution time: 47_308_000 picoseconds.
Weight::from_parts(32_768_615, 0)
// Minimum execution time: 48_419_000 picoseconds.
Weight::from_parts(35_655_823, 0)
.saturating_add(Weight::from_parts(0, 3574))
// Standard Error: 5_701
.saturating_add(Weight::from_parts(31_258, 0).saturating_mul(i.into()))
// Standard Error: 748
.saturating_add(Weight::from_parts(102_765, 0).saturating_mul(j.into()))
// Standard Error: 5_701
.saturating_add(Weight::from_parts(1_500_633, 0).saturating_mul(k.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
// Standard Error: 1_212
.saturating_add(Weight::from_parts(96_762, 0).saturating_mul(j.into()))
// Standard Error: 9_235
.saturating_add(Weight::from_parts(1_460_410, 0).saturating_mul(k.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `GhostNetworks::Networks` (r:1 w:1)
/// Proof: `GhostNetworks::Networks` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// The range of component `n` is `[1, 20]`.
fn update_network_name(_n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `310`
// Estimated: `3775`
// Minimum execution time: 51_079_000 picoseconds.
Weight::from_parts(52_557_946, 0)
.saturating_add(Weight::from_parts(0, 3775))
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 48_422_000 picoseconds.
Weight::from_parts(49_987_541, 0)
.saturating_add(Weight::from_parts(0, 3804))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@ -85,13 +84,13 @@ impl<T: frame_system::Config> ghost_networks::WeightInfo for WeightInfo<T> {
/// The range of component `n` is `[1, 150]`.
fn update_network_endpoint(n: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `310`
// Estimated: `3775`
// Minimum execution time: 51_709_000 picoseconds.
Weight::from_parts(53_451_989, 0)
.saturating_add(Weight::from_parts(0, 3775))
// Standard Error: 605
.saturating_add(Weight::from_parts(6_984, 0).saturating_mul(n.into()))
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 48_651_000 picoseconds.
Weight::from_parts(50_776_912, 0)
.saturating_add(Weight::from_parts(0, 3804))
// Standard Error: 1_062
.saturating_add(Weight::from_parts(838, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@ -99,11 +98,11 @@ impl<T: frame_system::Config> ghost_networks::WeightInfo for WeightInfo<T> {
/// Proof: `GhostNetworks::Networks` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn update_network_finality_delay() -> Weight {
// Proof Size summary in bytes:
// Measured: `310`
// Estimated: `3775`
// Minimum execution time: 50_475_000 picoseconds.
Weight::from_parts(51_344_000, 0)
.saturating_add(Weight::from_parts(0, 3775))
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 48_080_000 picoseconds.
Weight::from_parts(51_781_000, 0)
.saturating_add(Weight::from_parts(0, 3804))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@ -111,11 +110,11 @@ impl<T: frame_system::Config> ghost_networks::WeightInfo for WeightInfo<T> {
/// Proof: `GhostNetworks::Networks` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn update_network_rate_limit_delay() -> Weight {
// Proof Size summary in bytes:
// Measured: `310`
// Estimated: `3775`
// Minimum execution time: 50_467_000 picoseconds.
Weight::from_parts(51_264_000, 0)
.saturating_add(Weight::from_parts(0, 3775))
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 47_950_000 picoseconds.
Weight::from_parts(48_925_000, 0)
.saturating_add(Weight::from_parts(0, 3804))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@ -123,11 +122,11 @@ impl<T: frame_system::Config> ghost_networks::WeightInfo for WeightInfo<T> {
/// Proof: `GhostNetworks::Networks` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn update_network_block_distance() -> Weight {
// Proof Size summary in bytes:
// Measured: `310`
// Estimated: `3775`
// Minimum execution time: 50_473_000 picoseconds.
Weight::from_parts(51_107_000, 0)
.saturating_add(Weight::from_parts(0, 3775))
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 48_324_000 picoseconds.
Weight::from_parts(50_801_000, 0)
.saturating_add(Weight::from_parts(0, 3804))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@ -135,11 +134,11 @@ impl<T: frame_system::Config> ghost_networks::WeightInfo for WeightInfo<T> {
/// Proof: `GhostNetworks::Networks` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn update_network_type() -> Weight {
// Proof Size summary in bytes:
// Measured: `310`
// Estimated: `3775`
// Minimum execution time: 49_597_000 picoseconds.
Weight::from_parts(50_283_000, 0)
.saturating_add(Weight::from_parts(0, 3775))
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 46_962_000 picoseconds.
Weight::from_parts(47_729_000, 0)
.saturating_add(Weight::from_parts(0, 3804))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@ -147,11 +146,11 @@ impl<T: frame_system::Config> ghost_networks::WeightInfo for WeightInfo<T> {
/// Proof: `GhostNetworks::Networks` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn update_network_gatekeeper() -> Weight {
// Proof Size summary in bytes:
// Measured: `310`
// Estimated: `3775`
// Minimum execution time: 51_083_000 picoseconds.
Weight::from_parts(52_464_000, 0)
.saturating_add(Weight::from_parts(0, 3775))
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 48_728_000 picoseconds.
Weight::from_parts(53_054_000, 0)
.saturating_add(Weight::from_parts(0, 3804))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@ -159,11 +158,11 @@ impl<T: frame_system::Config> ghost_networks::WeightInfo for WeightInfo<T> {
/// Proof: `GhostNetworks::Networks` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn update_network_topic_name() -> Weight {
// Proof Size summary in bytes:
// Measured: `310`
// Estimated: `3775`
// Minimum execution time: 51_270_000 picoseconds.
Weight::from_parts(52_099_000, 0)
.saturating_add(Weight::from_parts(0, 3775))
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 48_632_000 picoseconds.
Weight::from_parts(49_954_000, 0)
.saturating_add(Weight::from_parts(0, 3804))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@ -171,11 +170,11 @@ impl<T: frame_system::Config> ghost_networks::WeightInfo for WeightInfo<T> {
/// Proof: `GhostNetworks::Networks` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn update_incoming_network_fee() -> Weight {
// Proof Size summary in bytes:
// Measured: `310`
// Estimated: `3775`
// Minimum execution time: 50_289_000 picoseconds.
Weight::from_parts(50_924_000, 0)
.saturating_add(Weight::from_parts(0, 3775))
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 47_660_000 picoseconds.
Weight::from_parts(53_763_000, 0)
.saturating_add(Weight::from_parts(0, 3804))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@ -183,11 +182,11 @@ impl<T: frame_system::Config> ghost_networks::WeightInfo for WeightInfo<T> {
/// Proof: `GhostNetworks::Networks` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn update_outgoing_network_fee() -> Weight {
// Proof Size summary in bytes:
// Measured: `310`
// Estimated: `3775`
// Minimum execution time: 49_880_000 picoseconds.
Weight::from_parts(51_277_000, 0)
.saturating_add(Weight::from_parts(0, 3775))
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 48_164_000 picoseconds.
Weight::from_parts(48_953_000, 0)
.saturating_add(Weight::from_parts(0, 3804))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
@ -195,24 +194,26 @@ impl<T: frame_system::Config> ghost_networks::WeightInfo for WeightInfo<T> {
/// Proof: `GhostNetworks::Networks` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn update_avg_block_speed() -> Weight {
// Proof Size summary in bytes:
// Measured: `310`
// Estimated: `3775`
// Minimum execution time: 50_612_000 picoseconds.
Weight::from_parts(51_546_000, 0)
.saturating_add(Weight::from_parts(0, 3775))
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 47_789_000 picoseconds.
Weight::from_parts(52_131_000, 0)
.saturating_add(Weight::from_parts(0, 3804))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `GhostNetworks::NetworkIndexes` (r:1 w:1)
/// Proof: `GhostNetworks::NetworkIndexes` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `GhostNetworks::Networks` (r:1 w:1)
/// Proof: `GhostNetworks::Networks` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn remove_network() -> Weight {
// Proof Size summary in bytes:
// Measured: `310`
// Estimated: `3775`
// Minimum execution time: 45_819_000 picoseconds.
Weight::from_parts(46_590_000, 0)
.saturating_add(Weight::from_parts(0, 3775))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
// Measured: `339`
// Estimated: `3804`
// Minimum execution time: 49_720_000 picoseconds.
Weight::from_parts(50_526_000, 0)
.saturating_add(Weight::from_parts(0, 3804))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2))
}
}

View File

@ -16,7 +16,7 @@
//! Autogenerated weights for `ghost_slow_clap`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2025-11-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2026-02-26, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `ghostown`, CPU: `Intel(R) Core(TM) i3-2310M CPU @ 2.10GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("casper-dev")`, DB CACHE: 1024
@ -48,6 +48,8 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> ghost_slow_clap::WeightInfo for WeightInfo<T> {
/// Storage: `GhostNetworks::Networks` (r:1 w:0)
/// Proof: `GhostNetworks::Networks` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `GhostSlowClaps::LatestExecutedBlock` (r:1 w:1)
/// Proof: `GhostSlowClaps::LatestExecutedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `GhostSlowClaps::ApplauseDetails` (r:1 w:1)
/// Proof: `GhostSlowClaps::ApplauseDetails` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `GhostSlowClaps::Authorities` (r:1 w:0)
@ -62,10 +64,6 @@ impl<T: frame_system::Config> ghost_slow_clap::WeightInfo for WeightInfo<T> {
/// Proof: `Staking::CurrentEra` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `Staking::ErasStakersOverview` (r:1 w:0)
/// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`)
/// Storage: `GhostSlowClaps::LatestExecutedBlock` (r:1 w:1)
/// Proof: `GhostSlowClaps::LatestExecutedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `GhostNetworks::NullifyNeeded` (r:1 w:0)
/// Proof: `GhostNetworks::NullifyNeeded` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `GhostNetworks::GatekeeperAmount` (r:1 w:1)
/// Proof: `GhostNetworks::GatekeeperAmount` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `GhostNetworks::BridgedImbalance` (r:1 w:1)
@ -76,36 +74,70 @@ impl<T: frame_system::Config> ghost_slow_clap::WeightInfo for WeightInfo<T> {
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn slow_clap() -> Weight {
// Proof Size summary in bytes:
// Measured: `1388`
// Estimated: `4853`
// Minimum execution time: 261_978_000 picoseconds.
Weight::from_parts(266_289_000, 0)
.saturating_add(Weight::from_parts(0, 4853))
.saturating_add(T::DbWeight::get().reads(14))
// Measured: `1417`
// Estimated: `4882`
// Minimum execution time: 243_099_000 picoseconds.
Weight::from_parts(247_253_000, 0)
.saturating_add(Weight::from_parts(0, 4882))
.saturating_add(T::DbWeight::get().reads(13))
.saturating_add(T::DbWeight::get().writes(6))
}
/// Storage: `Session::CurrentIndex` (r:1 w:0)
/// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `GhostSlowClaps::LatestExecutedBlock` (r:1 w:0)
/// Proof: `GhostSlowClaps::LatestExecutedBlock` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `GhostNetworks::Networks` (r:1 w:0)
/// Proof: `GhostNetworks::Networks` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `GhostSlowClaps::BlockCommitments` (r:1 w:1)
/// Proof: `GhostSlowClaps::BlockCommitments` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `Session::CurrentIndex` (r:1 w:0)
/// Proof: `Session::CurrentIndex` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `GhostSlowClaps::Validators` (r:1 w:0)
/// Proof: `GhostSlowClaps::Validators` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `GhostSlowClaps::DisabledAuthorityIndexes` (r:1 w:0)
/// Proof: `GhostSlowClaps::DisabledAuthorityIndexes` (`max_values`: None, `max_size`: None, mode: `Measured`)
fn commit_block() -> Weight {
// Proof Size summary in bytes:
// Measured: `859`
// Estimated: `4324`
// Minimum execution time: 108_966_000 picoseconds.
Weight::from_parts(110_454_000, 0)
.saturating_add(Weight::from_parts(0, 4324))
.saturating_add(T::DbWeight::get().reads(5))
// Measured: `701`
// Estimated: `4166`
// Minimum execution time: 74_725_000 picoseconds.
Weight::from_parts(76_067_000, 0)
.saturating_add(Weight::from_parts(0, 4166))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1))
}
fn try_offend_validators(_offenders_len: u32) -> Weight {
Default::default()
}
/// Storage: `Staking::ActiveEra` (r:1 w:0)
/// Proof: `Staking::ActiveEra` (`max_values`: Some(1), `max_size`: Some(13), added: 508, mode: `MaxEncodedLen`)
/// Storage: `Staking::ErasStakersOverview` (r:100000 w:0)
/// Proof: `Staking::ErasStakersOverview` (`max_values`: None, `max_size`: Some(92), added: 2567, mode: `MaxEncodedLen`)
/// Storage: `Staking::ErasStakers` (r:100000 w:0)
/// Proof: `Staking::ErasStakers` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `Session::Validators` (r:1 w:0)
/// Proof: `Session::Validators` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `Offences::ConcurrentReportsIndex` (r:1 w:1)
/// Proof: `Offences::ConcurrentReportsIndex` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `Offences::Reports` (r:97959 w:97959)
/// Proof: `Offences::Reports` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `Staking::SlashRewardFraction` (r:1 w:0)
/// Proof: `Staking::SlashRewardFraction` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `Staking::ErasStartSessionIndex` (r:1 w:0)
/// Proof: `Staking::ErasStartSessionIndex` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `MaxEncodedLen`)
/// Storage: `Staking::Invulnerables` (r:1 w:0)
/// Proof: `Staking::Invulnerables` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// Storage: `Staking::SlashingSpans` (r:97959 w:97959)
/// Proof: `Staking::SlashingSpans` (`max_values`: None, `max_size`: None, mode: `Measured`)
/// Storage: `Staking::DisabledValidators` (r:1 w:1)
/// Proof: `Staking::DisabledValidators` (`max_values`: Some(1), `max_size`: None, mode: `Measured`)
/// The range of component `n` is `[1, 100000]`.
/// The range of component `d` is `[0, 100000]`.
fn try_offend_validators(n: u32, d: u32, ) -> Weight {
// Proof Size summary in bytes:
// Measured: `674`
// Estimated: `1886 + d * (2567 ±0)`
// Minimum execution time: 13_192_257_000 picoseconds.
Weight::from_parts(13_208_069_000, 0)
.saturating_add(Weight::from_parts(0, 1886))
// Standard Error: 732_167
.saturating_add(Weight::from_parts(19_211_621, 0).saturating_mul(n.into()))
// Standard Error: 732_168
.saturating_add(Weight::from_parts(9_755_300, 0).saturating_mul(d.into()))
.saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(n.into())))
.saturating_add(T::DbWeight::get().reads((2_u64).saturating_mul(d.into())))
.saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(n.into())))
.saturating_add(Weight::from_parts(0, 2567).saturating_mul(d.into()))
}
}