Skip to content

Commit

Permalink
add missing prevotes (#590)
Browse files Browse the repository at this point in the history
* add missing prevotes

* remove the TODO

* add missing current step checks

---------

Co-authored-by: akildemir <[email protected]>
  • Loading branch information
akildemir and akildemir authored Aug 14, 2024
1 parent 3de1e4d commit bf1c493
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion coordinator/tributary/tendermint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,9 +708,17 @@ 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) => {
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");
if self.block.round().step == Step::Propose {
self.broadcast(Data::Prevote(None));
}
self
.slash(
msg.sender,
Expand All @@ -729,6 +737,9 @@ impl<N: Network + 'static> TendermintMachine<N> {
target: "tendermint",
"proposed proposed with a syntactically invalid valid round",
);
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 bf1c493

Please sign in to comment.