Skip to content

Commit

Permalink
consensus: stop iter with success quorum
Browse files Browse the repository at this point in the history
  • Loading branch information
fed-franz committed Oct 15, 2024
1 parent a88920c commit d81e4a8
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions consensus/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ use crate::errors::ConsensusError;
use crate::operations::Operations;
use crate::phase::Phase;

use node_data::message::payload::RatificationResult;
use node_data::message::{AsyncQueue, Message, Payload};

use crate::execution_ctx::ExecutionCtx;
use crate::proposal;
use crate::queue::MsgRegistry;
use crate::user::provisioners::Provisioners;
use crate::{ratification, validation};
use tracing::{debug, error, info, warn, Instrument};
use tracing::{debug, error, warn, Instrument};

use crate::iteration_ctx::IterationCtx;
use crate::step_votes_reg::AttInfoRegistry;
Expand Down Expand Up @@ -260,7 +259,7 @@ impl<T: Operations + 'static, D: Database + 'static> Consensus<T, D> {
// means the iteration is over.
if let Payload::Quorum(ref qmsg) = msg.payload {
debug!(
event = "New Quorum",
event = "New Quorum. Terminating iteration",
round = qmsg.header.round,
iter = qmsg.header.iteration,
vote = ?qmsg.vote(),
Expand All @@ -270,24 +269,9 @@ impl<T: Operations + 'static, D: Database + 'static> Consensus<T, D> {
// Broadcast/Rebroadcast
sender.send_quorum(msg.clone()).await;

match qmsg.att.result {
// With a Fail Quorum, we move to the next iteration
RatificationResult::Fail(_) => {
info!(
event =
"Fail Quorum. Terminating iteration",
round = ru.round,
iter,
);

break;
}

_ => {
// INFO: we keep running consensus in case we
// fail to accept the block.
}
}
// INFO: we keep running consensus even with Success
// Quorum in case we fail to accept the block.
break;
}
}

Expand Down

0 comments on commit d81e4a8

Please sign in to comment.