Skip to content

Commit

Permalink
add missing current step checks
Browse files Browse the repository at this point in the history
  • Loading branch information
akildemir committed Aug 11, 2024
1 parent 7f2d47d commit 98628a7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions coordinator/tributary/tendermint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -709,12 +709,16 @@ impl<N: Network + 'static> TendermintMachine<N> {
match self.network.validate(block).await {
Ok(()) => {}
Err(BlockError::Temporal) => {
self.broadcast(Data::Prevote(None));
if self.block.round().step == Step::Propose {
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));
if self.block.round().step == Step::Propose {
self.broadcast(Data::Prevote(None));
}
self
.slash(
msg.sender,
Expand All @@ -733,7 +737,9 @@ impl<N: Network + 'static> TendermintMachine<N> {
target: "tendermint",
"proposed proposed with a syntactically invalid valid round",
);
self.broadcast(Data::Prevote(None));
if self.block.round().step == Step::Propose {
self.broadcast(Data::Prevote(None));
}
self
.slash(msg.sender, SlashEvent::WithEvidence(Evidence::InvalidValidRound(msg.encode())))
.await;
Expand Down

0 comments on commit 98628a7

Please sign in to comment.