Skip to content

Commit 4b1b3fe

Browse files
committed
Clearer complement calculation
1 parent a9894d9 commit 4b1b3fe

File tree

9 files changed

+26
-20
lines changed

9 files changed

+26
-20
lines changed

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ More details are available [in the book][reference-link-implementation-details].
6060
- Import AlephBFT in your crate
6161
```toml
6262
[dependencies]
63-
aleph-bft = "^0.43"
63+
aleph-bft = "^0.44"
6464
```
6565
- The main entry point is the `run_session` function, which returns a Future that runs the
6666
consensus algorithm.

consensus/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aleph-bft"
3-
version = "0.43.1"
3+
version = "0.44.0"
44
edition = "2021"
55
authors = ["Cardinal Cryptography"]
66
categories = ["algorithms", "data-structures", "cryptography", "database"]
@@ -13,8 +13,8 @@ readme = "../README.md"
1313
description = "AlephBFT is an asynchronous and Byzantine fault tolerant consensus protocol aimed at ordering arbitrary messages (transactions). It has been designed to continuously operate even in the harshest conditions: with no bounds on message-delivery delays and in the presence of malicious actors. This makes it an excellent fit for blockchain-related applications."
1414

1515
[dependencies]
16-
aleph-bft-rmc = { path = "../rmc", version = "0.14" }
17-
aleph-bft-types = { path = "../types", version = "0.14" }
16+
aleph-bft-rmc = { path = "../rmc", version = "0.15" }
17+
aleph-bft-types = { path = "../types", version = "0.15" }
1818
anyhow = "1.0"
1919
async-trait = "0.1"
2020
codec = { package = "parity-scale-codec", version = "3.0", default-features = false, features = ["derive"] }

consensus/src/collection/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ impl<'a, MK: Keychain> Collection<'a, MK> {
196196

197197
fn missing_responders(&self) -> Vec<Recipient> {
198198
self.collected_starting_rounds
199-
.size()
200-
.into_iterator()
201-
.filter(|node_id| self.collected_starting_rounds.get(*node_id).is_none())
199+
.to_subset()
200+
.complement()
201+
.elements()
202202
.map(Recipient::Node)
203203
.collect()
204204
}

crypto/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aleph-bft-crypto"
3-
version = "0.9.1"
3+
version = "0.10.0"
44
edition = "2021"
55
authors = ["Cardinal Cryptography"]
66
documentation = "https://docs.rs/?"

crypto/src/node.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@ impl NodeSubset {
237237
.filter_map(|(i, b)| if b { Some(i.into()) } else { None })
238238
}
239239

240+
pub fn complement(&self) -> NodeSubset {
241+
let mut result = self.0.clone();
242+
result.negate();
243+
NodeSubset(result)
244+
}
245+
240246
pub fn len(&self) -> usize {
241247
self.elements().count()
242248
}

mock/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aleph-bft-mock"
3-
version = "0.16.0"
3+
version = "0.17.0"
44
edition = "2021"
55
authors = ["Cardinal Cryptography"]
66
documentation = "https://docs.rs/?"
@@ -11,7 +11,7 @@ readme = "./README.md"
1111
description = "Mock implementations of traits required by the aleph-bft package. Do NOT use outside of testing!"
1212

1313
[dependencies]
14-
aleph-bft-types = { path = "../types", version = "0.14" }
14+
aleph-bft-types = { path = "../types", version = "0.15" }
1515
async-trait = "0.1"
1616
codec = { package = "parity-scale-codec", version = "3.0", default-features = false, features = ["derive"] }
1717
futures = "0.3"

rmc/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aleph-bft-rmc"
3-
version = "0.14.0"
3+
version = "0.15.0"
44
edition = "2021"
55
authors = ["Cardinal Cryptography"]
66
categories = ["algorithms", "cryptography"]
@@ -13,8 +13,8 @@ readme = "./README.md"
1313
description = "Reliable MultiCast - a primitive for Reliable Broadcast protocol."
1414

1515
[dependencies]
16-
aleph-bft-crypto = { path = "../crypto", version = "0.9" }
17-
aleph-bft-types = { path = "../types", version = "0.14" }
16+
aleph-bft-crypto = { path = "../crypto", version = "0.10" }
17+
aleph-bft-types = { path = "../types", version = "0.15" }
1818
async-trait = "0.1"
1919
codec = { package = "parity-scale-codec", version = "3.0", default-features = false, features = ["derive"] }
2020
futures = "0.3"

types/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "aleph-bft-types"
3-
version = "0.14.0"
3+
version = "0.15.0"
44
edition = "2021"
55
authors = ["Cardinal Cryptography"]
66
documentation = "https://docs.rs/?"
@@ -11,7 +11,7 @@ readme = "./README.md"
1111
description = "Traits that need to be implemented by the user of the aleph-bft package."
1212

1313
[dependencies]
14-
aleph-bft-crypto = { path = "../crypto", version = "0.9" }
14+
aleph-bft-crypto = { path = "../crypto", version = "0.10" }
1515
async-trait = "0.1"
1616
codec = { package = "parity-scale-codec", version = "3.0", default-features = false, features = ["derive"] }
1717
futures = "0.3"

0 commit comments

Comments
 (0)