Skip to content

Commit b1c62ba

Browse files
committed
ignore zero-weight hosts in the auto-select mode
1 parent be3f8f2 commit b1c62ba

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "chaindev"
3-
version = "0.52.2"
3+
version = "0.52.3"
44
edition = "2021"
55
authors = ["[email protected]"]
66
description = "Powerful development and testing utils for blockchain developers."

src/beacon_based/ddev/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,6 +1571,7 @@ where
15711571
.hosts
15721572
.as_ref()
15731573
.values()
1574+
.filter(|h| h.weight > 0) // never allocate on 'zero-weight hosts'
15741575
.map(|h| (h.meta.clone(), (h.node_cnt * max_weight) / h.weight))
15751576
.collect::<Vec<_>>();
15761577
seq.sort_by(|a, b| a.1.cmp(&b.1));

src/common/remote.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<'a> From<&'a Host> for Remote<'a> {
3232
}
3333
}
3434

35-
impl<'a> Remote<'a> {
35+
impl Remote<'_> {
3636
// Execute a cmd on a remote host and get its outputs
3737
pub fn exec_cmd(&self, cmd: &str) -> Result<String> {
3838
let cmd = format!("ulimit -n 100000 >/dev/null 2>&1;{}", cmd);

src/tendermint_based/ddev/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,7 @@ where
12781278
.hosts
12791279
.as_ref()
12801280
.values()
1281+
.filter(|h| h.weight > 0) // never allocate on 'zero-weight hosts'
12811282
.map(|h| (h.meta.clone(), (h.node_cnt * max_weight) / h.weight))
12821283
.collect::<Vec<_>>();
12831284
seq.sort_by(|a, b| a.1.cmp(&b.1));

0 commit comments

Comments
 (0)