mirror of https://github.com/poanetwork/hbbft.git
Enable overflow-checks and fix a bug that slipped through during their absence. (#231)
* Fixed bug in `average_higher`, due to wrong assumptions about operator precendence. * Enable overflow checks in `--release` tests. This will hardly impact test performance, as the heavy lifting is done in the threshold crypto crate. Rough benchmarks showed significant differences only when `overflow-checks` was enable for `[profile.release]` (instead of `[profile.bench]`), causing it to be applied to `threshold_crypto` as well.
This commit is contained in:
parent
0266a4107c
commit
23bc38bbeb
|
@ -47,3 +47,9 @@ name = "consensus-node"
|
|||
|
||||
[[example]]
|
||||
name = "simulation"
|
||||
|
||||
# This will turn on overflow checks in `cargo test --release` and
|
||||
# `cargo bench`. Dependencies will not be affected, as they use the
|
||||
# `[profile.release]` block in both cases.
|
||||
[profile.bench]
|
||||
overflow-checks = true
|
||||
|
|
|
@ -54,7 +54,7 @@ impl NetworkDimension {
|
|||
};
|
||||
|
||||
// Reduce the number of faulty nodes, if we are outside our limits.
|
||||
if !half.faulty * 3 <= half.size {
|
||||
if !(half.faulty * 3 <= half.size) {
|
||||
half.faulty -= 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue