From 3f542f826d5f1b8b525e8326ae3398f78e4b5f09 Mon Sep 17 00:00:00 2001 From: ananas-block Date: Wed, 11 Sep 2024 22:11:23 +0700 Subject: [PATCH] reproduce --- forester/src/epoch_manager.rs | 1 + forester/src/telemetry.rs | 2 +- forester/tests/photon_tests.rs | 26 +++++++++++++++++++++----- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/forester/src/epoch_manager.rs b/forester/src/epoch_manager.rs index f0bd857bc0..873b553979 100644 --- a/forester/src/epoch_manager.rs +++ b/forester/src/epoch_manager.rs @@ -157,6 +157,7 @@ impl> EpochManager { while let Some(epoch) = rx.recv().await { debug!("Received new epoch: {}", epoch); let self_clone = Arc::clone(&self); + info!("self clone trees {:?}", self_clone.trees.lock().await); tokio::spawn(async move { if let Err(e) = self_clone.process_epoch(epoch).await { error!("Error processing epoch {}: {:?}", epoch, e); diff --git a/forester/src/telemetry.rs b/forester/src/telemetry.rs index 2954b15a48..6fdd764fd9 100644 --- a/forester/src/telemetry.rs +++ b/forester/src/telemetry.rs @@ -15,7 +15,7 @@ pub fn setup_telemetry() { let file_env_filter = EnvFilter::new("info,forester=debug"); let stdout_env_filter = - EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info,forester=debug")); + EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")); // forester=debug let stdout_layer = fmt::Layer::new() .with_writer(std::io::stdout) diff --git a/forester/tests/photon_tests.rs b/forester/tests/photon_tests.rs index 82d5f89df5..e4dfbee68d 100644 --- a/forester/tests/photon_tests.rs +++ b/forester/tests/photon_tests.rs @@ -1,3 +1,4 @@ +use account_compression::utils::constants::ADDRESS_QUEUE_VALUES; use forester::photon_indexer::PhotonIndexer; use forester::queue_helpers::fetch_queue_item_data; use forester::utils::LightValidatorConfig; @@ -132,8 +133,11 @@ async fn test_multiple_address_trees_with_photon() { Some(0), ) .await; + env.create_address(None, None).await; + env.create_address(None, None).await; for i in 0..10 { + info!("Iteration: {}", i); let address_tree_accounts = env.create_address_tree(Some(95)).await; tokio::time::sleep(Duration::from_secs(2)).await; @@ -161,6 +165,7 @@ async fn test_multiple_address_trees_with_photon() { sleep(Duration::from_secs(1)).await; info!("sleeping until address queue is empty"); } + sleep(Duration::from_secs(2)).await; let address_proof = photon_indexer .get_multiple_new_address_proofs( address_tree_accounts.merkle_tree.to_bytes(), @@ -168,7 +173,12 @@ async fn test_multiple_address_trees_with_photon() { ) .await .unwrap(); - assert_ne!(init_address_proof, address_proof); + let seed = Pubkey::new_unique(); + info!("new Merkle tree"); + env.create_address(Some(vec![seed]), Some(i + 1)).await; + info!("address Merkle tree"); + env.create_address(None, None).await; + // assert_ne!(init_address_proof, address_proof); } shutdown_sender .send(()) @@ -186,9 +196,15 @@ pub async fn address_queue_len_is_equal_to( queue: Pubkey, expected_len: u64, ) -> bool { - let queue_length = fetch_queue_item_data(&mut *rpc, &queue) - .await - .unwrap() - .len() as u64; + let queue_length = fetch_queue_item_data( + &mut *rpc, + &queue, + 0, + ADDRESS_QUEUE_VALUES, + ADDRESS_QUEUE_VALUES, + ) + .await + .unwrap() + .len() as u64; queue_length == expected_len }