Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion consensus/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aleph-bft"
version = "0.42.1"
version = "0.42.2"
edition = "2021"
authors = ["Cardinal Cryptography"]
categories = ["algorithms", "data-structures", "cryptography", "database"]
Expand Down
10 changes: 7 additions & 3 deletions consensus/src/extension/extender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl<U: UnitWithParents> Extender<U> {

#[cfg(test)]
mod test {
use crate::units::{minimal_reconstructed_dag_units_up_to, Unit};
use crate::units::{minimal_reconstructed_dag_units_up_to, Unit, UnitWithParents};
use crate::{
extension::extender::Extender, units::random_full_parent_reconstrusted_units_up_to,
NodeCount, Round,
Expand Down Expand Up @@ -104,7 +104,7 @@ mod test {
let mut extender = Extender::new();
let n_members = NodeCount(4);
let threshold = n_members.consensus_threshold();
let max_round: Round = 4;
let max_round: Round = 11;
let session_id = 2137;
let keychains = Keychain::new_vec(n_members);
let mut batches = Vec::new();
Expand All @@ -119,7 +119,11 @@ mod test {
assert_eq!(batches[0].len(), 1);
assert_eq!(batches[0][0].round(), 0);
for batch in batches.iter().skip(1) {
assert_eq!(batch.len(), threshold.0);
assert!(batch.len() == threshold.0 || batch.len() == n_members.0);
if batch.len() == n_members.0 {
// the batch that should have ancient unit
assert!(batch.iter().any(|unit| unit.parents().count() == 0));
}
}
}
}
2 changes: 1 addition & 1 deletion consensus/src/units/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ pub fn minimal_reconstructed_dag_units_up_to(
.choose_multiple(&mut rng, threshold)
.into_iter()
.collect();
if r == round {
if r == round / 2 {
let ancestor_unit = dag
.first()
.expect("first round present")
Expand Down
Loading