Skip to content

Commit 2c8aa21

Browse files
authored
Move request logic into its own module (#551)
1 parent 28f2ca7 commit 2c8aa21

File tree

9 files changed

+759
-730
lines changed

9 files changed

+759
-730
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

consensus/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"
3-
version = "0.44.0"
3+
version = "0.44.1"
44
edition = "2021"
55
authors = ["Cardinal Cryptography"]
66
categories = ["algorithms", "data-structures", "cryptography", "database"]

consensus/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub type RecipientCountSchedule = Arc<dyn Fn(usize) -> usize + Sync + Send + 'st
1818
/// Configuration of several parameters related to delaying various tasks.
1919
#[derive(Clone)]
2020
pub struct DelayConfig {
21-
/// Tick frequency of the Member. Governs internal task queue of the Member.
21+
/// Tick frequency of the request task queue, impacts how often tasks are send out.
2222
pub tick_interval: Duration,
2323
/// Minimum frequency of broadcast of top known units. Units have to be at least this old to be
2424
/// rebroadcast at all.

consensus/src/dag/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ impl<H: Hasher, D: Data, MK: MultiKeychain> Dag<H, D, MK> {
203203
result
204204
}
205205

206+
/// The store of units currently being processed by this dag.
207+
pub fn processing_units(&self) -> &UnitStore<SignedUnit<H, D, MK>> {
208+
self.validator.processing_units()
209+
}
210+
206211
/// Notify the dag that a unit has finished processing and can be cleared from the cache.
207212
pub fn finished_processing(&mut self, hash: &H::Hash) {
208213
self.validator.finished_processing(hash);

consensus/src/dag/validation.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ impl<H: Hasher, D: Data, MK: MultiKeychain> Validator<H, D, MK> {
162162
Ok(unit)
163163
}
164164

165+
/// The store of units currently being processed.
166+
pub fn processing_units(&self) -> &UnitStore<SignedUnit<H, D, MK>> {
167+
&self.processing_units
168+
}
169+
165170
/// Signal that a unit finished processing and thus it's copy no longer has to be kept for fork detection.
166171
/// NOTE: This is only a memory optimization, if the units stay there forever everything still works.
167172
pub fn finished_processing(&mut self, unit: &H::Hash) {

consensus/src/dissemination/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mod responder;
1010
mod task;
1111

1212
pub use responder::Responder;
13-
pub use task::DisseminationTask;
13+
pub use task::{Manager as TaskManager, ManagerStatus as TaskManagerStatus};
1414

1515
/// Some form of message with the intended recipients.
1616
#[derive(Eq, PartialEq, Debug, Clone)]
@@ -33,6 +33,11 @@ impl<T> Addressed<T> {
3333
Addressed::new(message, vec![Recipient::Node(node_id)])
3434
}
3535

36+
/// Message that should be broadcast.
37+
pub fn broadcast(message: T) -> Self {
38+
Addressed::new(message, vec![Recipient::Everyone])
39+
}
40+
3641
/// All the recipients of this message.
3742
pub fn recipients(&self) -> &Vec<Recipient> {
3843
&self.recipients

0 commit comments

Comments
 (0)