Clarify Arc RwLocks and sleeps in coordinator

This commit is contained in:
Luke Parker
2023-04-23 18:29:50 -04:00
parent ad5522d854
commit 72633d6421
3 changed files with 29 additions and 16 deletions

View File

@@ -240,6 +240,9 @@ impl<D: Db, T: Transaction, P: P2p> Network for TendermintNetwork<D, T, P> {
type Weights = Arc<Validators>;
type Block = TendermintBlock;
// These are in seconds and create a six-second block time.
// The block time is the latency on message delivery (where a message is some piece of data
// embedded in a transaction), hence why it should be kept low.
const BLOCK_PROCESSING_TIME: u32 = 3;
const LATENCY_TIME: u32 = 1;
@@ -307,7 +310,7 @@ impl<D: Db, T: Transaction, P: P2p> Network for TendermintNetwork<D, T, P> {
hex::encode(hash),
hex::encode(self.genesis)
);
sleep(Duration::from_secs(30)).await;
sleep(Duration::from_secs(Tendermint::<D, T, P>::block_time())).await;
}
_ => return invalid_block(),
}