From 8252107e968d8f90c248fc12b7b01b0f9759bb79 Mon Sep 17 00:00:00 2001 From: Uncle Stretch Date: Wed, 10 Jun 2026 11:14:06 +0300 Subject: [PATCH] make multiplication to round up during slash fraction calculation Signed-off-by: Uncle Stretch --- pallets/slow-clap/Cargo.toml | 2 +- pallets/slow-clap/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/slow-clap/Cargo.toml b/pallets/slow-clap/Cargo.toml index 862e9fa..aae9eda 100644 --- a/pallets/slow-clap/Cargo.toml +++ b/pallets/slow-clap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ghost-slow-clap" -version = "0.4.28" +version = "0.4.29" description = "Applause protocol for the EVM bridge" license.workspace = true authors.workspace = true diff --git a/pallets/slow-clap/src/lib.rs b/pallets/slow-clap/src/lib.rs index d3aab81..52d9fa9 100644 --- a/pallets/slow-clap/src/lib.rs +++ b/pallets/slow-clap/src/lib.rs @@ -1637,7 +1637,7 @@ impl Offence for SlowClapOffence { missed_percent.saturating_mul(Perbill::from_rational(1, offenders_count)) } OffenceType::CommitmentOffence => offenders_count - .checked_sub(Perbill::from_percent(9).mul_ceil(self.validator_set_count)) + .checked_sub(Perbill::from_percent(9).mul_floor(self.validator_set_count)) .map(|threshold| { Perbill::from_rational(threshold.saturating_mul(4), self.validator_set_count) .square()