mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-13 14:39:25 +00:00
add missing current step checks
This commit is contained in:
@@ -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,
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user