From 99c43a0c246d07a988f307492bedba85d2e30fee Mon Sep 17 00:00:00 2001 From: Uncle Stinky Date: Wed, 18 Jun 2025 14:17:02 +0300 Subject: [PATCH] runtime update, with history depth for the slow clap Signed-off-by: Uncle Stinky --- Cargo.lock | 4 ++-- runtime/casper/Cargo.toml | 2 +- runtime/casper/src/lib.rs | 13 +++++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b1722b5..3eea85f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1186,7 +1186,7 @@ dependencies = [ [[package]] name = "casper-runtime" -version = "3.5.22" +version = "3.5.23" dependencies = [ "casper-runtime-constants", "frame-benchmarking", @@ -3834,7 +3834,7 @@ dependencies = [ [[package]] name = "ghost-slow-clap" -version = "0.3.24" +version = "0.3.25" dependencies = [ "frame-benchmarking", "frame-support", diff --git a/runtime/casper/Cargo.toml b/runtime/casper/Cargo.toml index 23eab53..9b0d9dd 100644 --- a/runtime/casper/Cargo.toml +++ b/runtime/casper/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "casper-runtime" -version = "3.5.22" +version = "3.5.23" 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 46de801..46e792e 100644 --- a/runtime/casper/src/lib.rs +++ b/runtime/casper/src/lib.rs @@ -492,6 +492,8 @@ parameter_types! { pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(17); pub const MaxNominations: u32 = ::LIMIT as u32; + pub const StakingHistoryDepth: u32 = 84; + pub const MaxUnlockingChunks: u32 = 32; } impl pallet_staking::Config for Runtime { @@ -520,8 +522,8 @@ impl pallet_staking::Config for Runtime { type VoterList = VoterList; type TargetList = UseValidatorsMap; type NominationsQuota = pallet_staking::FixedNominationsQuota<{ MaxNominations::get() }>; - type MaxUnlockingChunks = frame_support::traits::ConstU32<32>; - type HistoryDepth = frame_support::traits::ConstU32<84>; + type MaxUnlockingChunks = MaxUnlockingChunks; + type HistoryDepth = StakingHistoryDepth; type MaxControllersInDeprecationBatch = ConstU32<5314>; type BenchmarkingConfig = runtime_common::StakingBenchmarkingConfig; type EventListeners = NominationPools; @@ -1075,10 +1077,12 @@ impl ghost_claims::Config for Runtime { parameter_types! { // will be used in `Perbill::from_percent()` - pub ApplauseThreshold: u32 = 70; + pub const ApplauseThreshold: u32 = 70; // will be used in `Perbill::from_percent()` - pub OffenceThreshold: u32 = 40; + pub const OffenceThreshold: u32 = 40; pub const SlowClapUnsignedPriority: TransactionPriority = TransactionPriority::MAX; + pub const SlowClapHistoryDepth: sp_staking::SessionIndex = + StakingHistoryDepth::get() * SessionsPerEra::get(); } impl ghost_slow_clap::Config for Runtime { @@ -1096,6 +1100,7 @@ impl ghost_slow_clap::Config for Runtime { type ApplauseThreshold = ApplauseThreshold; type OffenceThreshold = OffenceThreshold; type UnsignedPriority = SlowClapUnsignedPriority; + type HistoryDepth = SlowClapHistoryDepth; type WeightInfo = weights::ghost_slow_clap::WeightInfo; }