Skip to content

Commit

Permalink
Compute order extension last
Browse files Browse the repository at this point in the history
Probably doesn't actually impact sending delays, but it also doesn't hurt.
  • Loading branch information
timorleph committed Apr 15, 2024
1 parent ffbcaff commit 5b1906e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion consensus/src/extension/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mod units;
use extender::Extender;

/// A struct responsible for executing the Consensus protocol on a local copy of the Dag.
/// It receives units which are guaranteed to be eventually in the Dags
/// It receives units which are guaranteed to eventually appear in the Dags
/// of all honest nodes. The static Aleph Consensus algorithm is then run on this Dag in order
/// to finalize subsequent rounds of the Dag. More specifically whenever a new unit is received
/// this process checks whether a new round can be finalized and if so, it computes the batch of
Expand Down
16 changes: 9 additions & 7 deletions consensus/src/runway/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ where
self.dag.finished_processing(&unit_hash);
self.resolve_missing_parents(&unit_hash);
self.resolve_missing_coord(&unit.coord());
self.ordering.add_unit(unit.clone());
if self
.parents_for_creator
.unbounded_send(unit.clone())
Expand All @@ -471,13 +470,16 @@ where
warn!(target: "AlephBFT-runway", "Creator channel should be open.");
self.exiting = true;
}
let unit = unit.unpack();
self.send_message_for_network(RunwayNotificationOut::NewAnyUnit(unit.clone().into()));

if unit.as_signable().creator() == self.index() {
trace!(target: "AlephBFT-runway", "{:?} Sending a unit {:?}.", self.index(), unit.as_signable().hash());
self.send_message_for_network(RunwayNotificationOut::NewSelfUnit(unit.into()));
let unpacked_unit = unit.clone().unpack();
self.send_message_for_network(RunwayNotificationOut::NewAnyUnit(
unpacked_unit.clone().into(),
));

if unit.creator() == self.index() {
trace!(target: "AlephBFT-runway", "{:?} Sending a unit {:?}.", self.index(), unit.hash());
self.send_message_for_network(RunwayNotificationOut::NewSelfUnit(unpacked_unit.into()));
}
self.ordering.add_unit(unit.clone());
}

fn on_missing_coord(&mut self, coord: UnitCoord) {
Expand Down

0 comments on commit 5b1906e

Please sign in to comment.