mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-22 11:39:35 +00:00
add missing prevotes (#590)
Some checks failed
Full Stack Tests / build (push) Waiting to run
Lint / clippy (macos-14) (push) Waiting to run
Lint / clippy (ubuntu-latest) (push) Waiting to run
Lint / clippy (windows-latest) (push) Waiting to run
Lint / deny (push) Waiting to run
Lint / fmt (push) Waiting to run
Lint / machete (push) Waiting to run
Lint / clippy (macos-13) (push) Waiting to run
Tests / test-infra (push) Waiting to run
Tests / test-substrate (push) Waiting to run
Tests / test-serai-client (push) Waiting to run
Coordinator Tests / build (push) Has been cancelled
Some checks failed
Full Stack Tests / build (push) Waiting to run
Lint / clippy (macos-14) (push) Waiting to run
Lint / clippy (ubuntu-latest) (push) Waiting to run
Lint / clippy (windows-latest) (push) Waiting to run
Lint / deny (push) Waiting to run
Lint / fmt (push) Waiting to run
Lint / machete (push) Waiting to run
Lint / clippy (macos-13) (push) Waiting to run
Tests / test-infra (push) Waiting to run
Tests / test-substrate (push) Waiting to run
Tests / test-serai-client (push) Waiting to run
Coordinator Tests / build (push) Has been cancelled
* add missing prevotes * remove the TODO * add missing current step checks --------- Co-authored-by: akildemir <aeg_asd@hotmail.com>
This commit is contained in:
parent
3de1e4dee2
commit
bf1c493d9a
1 changed files with 12 additions and 1 deletions
|
@ -708,9 +708,17 @@ impl<N: Network + 'static> TendermintMachine<N> {
|
||||||
if let Data::Proposal(_, block) = &msg.data {
|
if let Data::Proposal(_, block) = &msg.data {
|
||||||
match self.network.validate(block).await {
|
match self.network.validate(block).await {
|
||||||
Ok(()) => {}
|
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) => {
|
Err(BlockError::Fatal) => {
|
||||||
log::warn!(target: "tendermint", "validator proposed a fatally invalid block");
|
log::warn!(target: "tendermint", "validator proposed a fatally invalid block");
|
||||||
|
if self.block.round().step == Step::Propose {
|
||||||
|
self.broadcast(Data::Prevote(None));
|
||||||
|
}
|
||||||
self
|
self
|
||||||
.slash(
|
.slash(
|
||||||
msg.sender,
|
msg.sender,
|
||||||
|
@ -729,6 +737,9 @@ impl<N: Network + 'static> TendermintMachine<N> {
|
||||||
target: "tendermint",
|
target: "tendermint",
|
||||||
"proposed proposed with a syntactically invalid valid round",
|
"proposed proposed with a syntactically invalid valid round",
|
||||||
);
|
);
|
||||||
|
if self.block.round().step == Step::Propose {
|
||||||
|
self.broadcast(Data::Prevote(None));
|
||||||
|
}
|
||||||
self
|
self
|
||||||
.slash(msg.sender, SlashEvent::WithEvidence(Evidence::InvalidValidRound(msg.encode())))
|
.slash(msg.sender, SlashEvent::WithEvidence(Evidence::InvalidValidRound(msg.encode())))
|
||||||
.await;
|
.await;
|
||||||
|
|
Loading…
Reference in a new issue