Skip to content

Commit

Permalink
add missing prevotes
Browse files Browse the repository at this point in the history
  • Loading branch information
akildemir committed Aug 8, 2024
1 parent 3de1e4d commit ae93892
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion coordinator/tributary/tendermint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,9 +708,15 @@ impl<N: Network + 'static> TendermintMachine<N> {
if let Data::Proposal(_, block) = &msg.data {
match self.network.validate(block).await {
Ok(()) => {}
Err(BlockError::Temporal) => return Err(TendermintError::Temporal),
Err(BlockError::Temporal) => {
// TODO: should we do these after we add the msg to the block log?
// Since this will change the step to prevote without having a proposal at hand.
self.broadcast(Data::Prevote(None));
Err(TendermintError::Temporal)?;
}
Err(BlockError::Fatal) => {
log::warn!(target: "tendermint", "validator proposed a fatally invalid block");
self.broadcast(Data::Prevote(None));
self
.slash(
msg.sender,
Expand All @@ -729,6 +735,7 @@ impl<N: Network + 'static> TendermintMachine<N> {
target: "tendermint",
"proposed proposed with a syntactically invalid valid round",
);
self.broadcast(Data::Prevote(None));
self
.slash(msg.sender, SlashEvent::WithEvidence(Evidence::InvalidValidRound(msg.encode())))
.await;
Expand Down

0 comments on commit ae93892

Please sign in to comment.