From e3c8e517491da1dadbaeaaf5a13a8ccac04aba73 Mon Sep 17 00:00:00 2001 From: Uncle Stinky Date: Thu, 27 Nov 2025 17:12:22 +0300 Subject: [PATCH] update casper runtime in accordance with new functionality. not final Signed-off-by: Uncle Stinky --- runtime/casper/Cargo.toml | 2 +- runtime/casper/src/lib.rs | 10 +++--- runtime/casper/src/weights/ghost_slow_clap.rs | 31 ++----------------- 3 files changed, 8 insertions(+), 35 deletions(-) diff --git a/runtime/casper/Cargo.toml b/runtime/casper/Cargo.toml index 104bbe1..bf9c70b 100644 --- a/runtime/casper/Cargo.toml +++ b/runtime/casper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "casper-runtime" -version = "3.5.33" +version = "3.5.34" build = "build.rs" description = "Runtime of the Casper Network" edition.workspace = true diff --git a/runtime/casper/src/lib.rs b/runtime/casper/src/lib.rs index d5f9cb8..5f3f590 100644 --- a/runtime/casper/src/lib.rs +++ b/runtime/casper/src/lib.rs @@ -1058,10 +1058,9 @@ impl ghost_claims::Config for Runtime { } parameter_types! { - // will be used in `Perbill::from_percent()` - pub const ApplauseThreshold: u32 = 70; - // will be used in `Perbill::from_percent()` - pub const OffenceThreshold: u32 = 40; + // will be used in `Perbill::from_parts()` + pub const ApplauseThreshold: u32 = 500_000_000; + pub const MinAuthoritiesNumber: u32 = 5; pub const SlowClapUnsignedPriority: TransactionPriority = TransactionPriority::MAX; pub const SlowClapHistoryDepth: sp_staking::SessionIndex = StakingHistoryDepth::get() * SessionsPerEra::get(); @@ -1071,18 +1070,19 @@ impl ghost_slow_clap::Config for Runtime { type RuntimeEvent = RuntimeEvent; type AuthorityId = SlowClapId; - type NextSessionRotation = Babe; type ValidatorSet = Historical; type Currency = Balances; type NetworkDataHandler = GhostNetworks; type BlockNumberProvider = System; type ReportUnresponsiveness = Offences; + type DisabledValidators = Session; type MaxAuthorities = MaxAuthorities; type ApplauseThreshold = ApplauseThreshold; type OffenceThreshold = OffenceThreshold; type UnsignedPriority = SlowClapUnsignedPriority; type HistoryDepth = SlowClapHistoryDepth; + type MinAuthoritiesNumber = MinAuthoritiesNumber; type WeightInfo = weights::ghost_slow_clap::WeightInfo; } diff --git a/runtime/casper/src/weights/ghost_slow_clap.rs b/runtime/casper/src/weights/ghost_slow_clap.rs index 2fe78ca..0ebe739 100644 --- a/runtime/casper/src/weights/ghost_slow_clap.rs +++ b/runtime/casper/src/weights/ghost_slow_clap.rs @@ -76,34 +76,7 @@ impl ghost_slow_clap::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().reads(10)) .saturating_add(T::DbWeight::get().writes(7)) } - /// Storage: `GhostSlowClaps::Authorities` (r:2 w:0) - /// Proof: `GhostSlowClaps::Authorities` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `GhostSlowClaps::ReceivedClaps` (r:2 w:0) - /// Proof: `GhostSlowClaps::ReceivedClaps` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `GhostSlowClaps::ClapsInSession` (r:1 w:0) - /// Proof: `GhostSlowClaps::ClapsInSession` (`max_values`: None, `max_size`: None, mode: `Measured`) - /// Storage: `GhostSlowClaps::ApplausesForTransaction` (r:1 w:1) - /// Proof: `GhostSlowClaps::ApplausesForTransaction` (`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::Networks` (r:1 w:0) - /// Proof: `GhostNetworks::Networks` (`max_values`: None, `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) - /// Proof: `GhostNetworks::BridgedImbalance` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `GhostNetworks::AccumulatedCommission` (r:1 w:1) - /// Proof: `GhostNetworks::AccumulatedCommission` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) - /// Storage: `System::Account` (r:1 w:1) - /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - fn self_applause() -> Weight { - // Proof Size summary in bytes: - // Measured: `861` - // Estimated: `6801` - // Minimum execution time: 258_510_000 picoseconds. - Weight::from_parts(262_353_000, 0) - .saturating_add(Weight::from_parts(0, 6801)) - .saturating_add(T::DbWeight::get().reads(12)) - .saturating_add(T::DbWeight::get().writes(5)) + fn commit_block()-> Weight { + Default::default() } }