From 60b92b58ba9b58a79e6acebf2b0c9ef69ab8b333 Mon Sep 17 00:00:00 2001 From: Youngjoon Lee Date: Wed, 20 Sep 2023 19:40:22 +0900 Subject: [PATCH] use ceil instead of floor --- consensus-engine/src/overlay/threshold.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus-engine/src/overlay/threshold.rs b/consensus-engine/src/overlay/threshold.rs index 87283478b..2a7d719bd 100644 --- a/consensus-engine/src/overlay/threshold.rs +++ b/consensus-engine/src/overlay/threshold.rs @@ -13,7 +13,7 @@ pub fn default_leader_super_majority_threshold() -> GenericFraction { pub fn apply_threshold(size: usize, threshold: GenericFraction) -> usize { // `threshold` is a tuple of (num, den) where `num/den` is the super majority threshold (Fraction::from(size) * threshold) - .floor() + .ceil() .to_usize() .unwrap() }