Skip to content

Commit

Permalink
reproduce
Browse files Browse the repository at this point in the history
  • Loading branch information
ananas-block committed Sep 11, 2024
1 parent 8a92b33 commit 3f542f8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions forester/src/epoch_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ impl<R: RpcConnection, I: Indexer<R>> EpochManager<R, I> {
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);
Expand Down
2 changes: 1 addition & 1 deletion forester/src/telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
26 changes: 21 additions & 5 deletions forester/tests/photon_tests.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -161,14 +165,20 @@ 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(),
vec![init_seed.to_bytes()],
)
.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(())
Expand All @@ -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
}

0 comments on commit 3f542f8

Please sign in to comment.