From bf1c493d9a9b8a87be7a4a0df1ac23ff653b0cff Mon Sep 17 00:00:00 2001 From: akildemir <34187742+akildemir@users.noreply.github.com> Date: Wed, 14 Aug 2024 22:00:48 +0300 Subject: [PATCH] add missing prevotes (#590) * add missing prevotes * remove the TODO * add missing current step checks --------- Co-authored-by: akildemir --- coordinator/tributary/tendermint/src/lib.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/coordinator/tributary/tendermint/src/lib.rs b/coordinator/tributary/tendermint/src/lib.rs index e5193908..d9ecd253 100644 --- a/coordinator/tributary/tendermint/src/lib.rs +++ b/coordinator/tributary/tendermint/src/lib.rs @@ -708,9 +708,17 @@ impl TendermintMachine { 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, @@ -729,6 +737,9 @@ impl TendermintMachine { 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;