Skip to content

Commit

Permalink
A0-3958: Refactor extender (#406)
Browse files Browse the repository at this point in the history
* Refactor extender

* Review fixes
  • Loading branch information
timorleph authored Feb 7, 2024
1 parent fd99c36 commit 6ff871b
Show file tree
Hide file tree
Showing 11 changed files with 828 additions and 393 deletions.
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.33.0"
version = "0.33.1"
edition = "2021"
authors = ["Cardinal Cryptography"]
categories = ["algorithms", "data-structures", "cryptography", "database"]
Expand Down
7 changes: 3 additions & 4 deletions consensus/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use log::{debug, error, warn};
use crate::{
config::Config,
creation,
extender::Extender,
extension::Service as Extender,
handle_task_termination,
runway::{NotificationIn, NotificationOut},
terminal::Terminal,
Expand All @@ -26,15 +26,14 @@ pub(crate) async fn run<H: Hasher + 'static>(
) {
debug!(target: "AlephBFT", "{:?} Starting all services...", conf.node_ix());

let n_members = conf.n_members();
let index = conf.node_ix();

let (electors_tx, electors_rx) = mpsc::unbounded();
let mut extender = Extender::<H>::new(index, n_members, electors_rx, ordered_batch_tx);
let extender = Extender::<H>::new(index, electors_rx, ordered_batch_tx);
let extender_terminator = terminator.add_offspring_connection("AlephBFT-extender");
let mut extender_handle = spawn_handle
.spawn_essential("consensus/extender", async move {
extender.extend(extender_terminator).await
extender.run(extender_terminator).await
})
.fuse();

Expand Down
Loading

0 comments on commit 6ff871b

Please sign in to comment.