Skip to content

Commit

Permalink
remove tributary sleeping
Browse files Browse the repository at this point in the history
  • Loading branch information
akildemir committed Sep 25, 2023
1 parent ae5f901 commit 98e8b99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 1 addition & 7 deletions coordinator/tributary/src/tendermint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ use tendermint::{
SlashEvent,
};

use tokio::{
sync::RwLock,
time::{Duration, sleep},
};
use tokio::sync::RwLock;

use crate::{
TENDERMINT_MESSAGE, TRANSACTION_MESSAGE, BLOCK_MESSAGE, ReadWrite,
Expand Down Expand Up @@ -399,9 +396,6 @@ impl<D: Db, T: TransactionTrait, P: P2p> Network for TendermintNetwork<D, T, P>
hex::encode(hash),
hex::encode(self.genesis)
);
// TODO: Use a notification system for when we have a new provided, in order to minimize
// latency
sleep(Duration::from_secs(Self::block_time().into())).await;
}
_ => return invalid_block(),
}
Expand Down
3 changes: 3 additions & 0 deletions coordinator/tributary/tendermint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,9 @@ impl<N: Network + 'static> TendermintMachine<N> {
if self.block.log.has_consensus(self.block.round().number, Data::Prevote(Some(block.id()))) {
match self.network.validate(block).await {
Ok(_) => (),
// BlockError::Temporal is due to us not having the locally provided tx yet,
// since the majority has voted on this block, it should be us that
// have the problem. So we just accept that the block is valid.
Err(BlockError::Temporal) => (),
Err(BlockError::Fatal) => {
log::warn!(target: "tendermint", "Validator proposed a fatally invalid block");
Expand Down

0 comments on commit 98e8b99

Please sign in to comment.