Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions crates/node_types/prover/src/prover/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::*;
use prism_common::test_transaction_builder::TestTransactionBuilder;
use prism_common::{digest::Digest, test_transaction_builder::TestTransactionBuilder};

Check failure on line 2 in crates/node_types/prover/src/prover/tests/mod.rs

View workflow job for this annotation

GitHub Actions / unit-test

unused import: `digest::Digest`

Check failure on line 2 in crates/node_types/prover/src/prover/tests/mod.rs

View workflow job for this annotation

GitHub Actions / coverage

unused import: `digest::Digest`

Check failure on line 2 in crates/node_types/prover/src/prover/tests/mod.rs

View workflow job for this annotation

GitHub Actions / clippy

unused import: `digest::Digest`
use prism_keys::{CryptoAlgorithm, SigningKey, VerifyingKey};
use prism_tree::proofs::Proof;
use std::{self, sync::Arc, time::Duration};
Expand Down Expand Up @@ -366,7 +366,7 @@
let mut prover_synced = false;
let mut fullnode_synced = false;

for _ in 0..50 {
for _ in 0..10 {
// 5 second timeout
let prover_height = prover.get_db().get_last_synced_height().unwrap_or(0);
let fullnode_height = fullnode.get_db().get_last_synced_height().unwrap_or(0);
Expand All @@ -383,7 +383,7 @@
break;
}

tokio::time::sleep(Duration::from_millis(100)).await;
tokio::time::sleep(Duration::from_millis(500)).await;
}

assert!(
Expand All @@ -401,7 +401,7 @@
}

// Wait a bit for transactions to be processed
tokio::time::sleep(Duration::from_millis(100)).await;
tokio::time::sleep(Duration::from_millis(150)).await;

// Submit racing transactions that arrive while prover is creating proof
for transaction in racing_transactions {
Expand All @@ -419,8 +419,9 @@
assert!(epoch_found, "Prover should have created an epoch");

// Wait for fullnode to sync the epoch
// If this test flakes, it could be because it needs a tiny bit more time here
tokio::time::sleep(Duration::from_millis(5000)).await;
while prover.get_commitment().await.unwrap() != fullnode.get_commitment().await.unwrap() {
tokio::time::sleep(Duration::from_millis(200)).await;
}

// Both nodes should have the same commitment despite racing transactions
let prover_commitment = prover.get_commitment().await.unwrap();
Expand Down
Loading