make multiplication to round up during slash fraction calculation

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch 2026-06-10 11:14:06 +03:00
parent 6419d4ba16
commit 8252107e96
Signed by: str3tch
GPG Key ID: 84F3190747EE79AA
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -1637,7 +1637,7 @@ impl<Offender: Clone> Offence<Offender> for SlowClapOffence<Offender> {
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()