Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
special case view 1
Browse files Browse the repository at this point in the history
  • Loading branch information
ss-es committed Apr 17, 2024
1 parent 944773c commit a1ac972
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,15 +554,21 @@ async fn handle_qc_event<Types: NodeType>(
qc_proposal: Proposal<Types, QuorumProposal<Types>>,
sender: <Types as NodeType>::SignatureKey,
leader: <Types as NodeType>::SignatureKey,
_instance_state: &Types::InstanceState,
instance_state: &Types::InstanceState,
) {
tracing::debug!(
"QCProposal: Leader: {:?} for the view: {:?}",
leader,
qc_proposal.data.view_number
);

let leaf = Leaf::from_quorum_proposal(&qc_proposal.data);
let mut leaf = Leaf::from_quorum_proposal(&qc_proposal.data);

// Hack for genesis mis-handling in HotShot.
// Once the is_genesis field is removed, you can delete this block.
if qc_proposal.data.justify_qc.is_genesis {
leaf.set_parent_commitment(Leaf::genesis(instance_state).commit());
}

// check if the sender is the leader and the signature is valid; if yes, broadcast the QC proposal
if sender == leader && sender.validate(&qc_proposal.signature, leaf.commit().as_ref()) {
Expand Down

0 comments on commit a1ac972

Please sign in to comment.