Skip to content

Commit bf225dc

Browse files
committed
sync when justified block is not found
1 parent ce1f235 commit bf225dc

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

dan_layer/consensus/src/hotstuff/on_receive_local_proposal.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,13 @@ impl<TConsensusSpec: ConsensusSpec> OnReceiveLocalProposalHandler<TConsensusSpec
137137
self.store.with_write_tx(|tx| {
138138
match self.validate_local_proposed_block(tx, block, &local_committee, &local_committee_shard) {
139139
Ok(validated) => Ok(Some(validated)),
140+
// Propagate this error out as sync is needed in the case where we have a valid QC but do not know the
141+
// block
142+
Err(
143+
err @ HotStuffError::ProposalValidationError(ProposalValidationError::JustifyBlockNotFound {
144+
..
145+
}),
146+
) => Err(err),
140147
// Validation errors should not cause a FAILURE state transition
141148
Err(HotStuffError::ProposalValidationError(err)) => {
142149
warn!(target: LOG_TARGET, "❌ Block failed validation: {}", err);

dan_layer/consensus/src/hotstuff/pacemaker_handle.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,6 @@ impl PaceMakerHandle {
9898
.map_err(|e| HotStuffError::PacemakerChannelDropped { details: e.to_string() })
9999
}
100100

101-
pub async fn reset_view(
102-
&self,
103-
last_seen_height: NodeHeight,
104-
high_qc_height: NodeHeight,
105-
) -> Result<(), HotStuffError> {
106-
self.current_height.set(last_seen_height);
107-
self.sender
108-
.send(PacemakerRequest::ResetLeaderTimeout { high_qc_height })
109-
.await
110-
.map_err(|e| HotStuffError::PacemakerChannelDropped { details: e.to_string() })
111-
}
112-
113101
pub fn current_height(&self) -> NodeHeight {
114102
self.current_height.get()
115103
}

dan_layer/consensus/src/hotstuff/worker.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,6 @@ where TConsensusSpec: ConsensusSpec
494494
self.pacemaker.current_height()
495495
);
496496

497-
self.pacemaker
498-
.reset_view(high_qc.block_height(), high_qc.block_height())
499-
.await?;
500-
501497
let current_epoch = self.epoch_manager.current_epoch().await?;
502498
// Send the request message
503499
if self

0 commit comments

Comments
 (0)