diff --git a/src/task_monitor/tasks/finalize_identities.rs b/src/task_monitor/tasks/finalize_identities.rs index 39d0d0ba..0869f11a 100644 --- a/src/task_monitor/tasks/finalize_identities.rs +++ b/src/task_monitor/tasks/finalize_identities.rs @@ -84,26 +84,7 @@ async fn finalize_roots_loop( } } -async fn finalize_roots( - database: &Database, - identity_manager: &IdentityManager, - finalized_tree: &TreeVersion, - all_roots: Vec, -) -> Result<(), anyhow::Error> { - Ok(for root in all_roots { - info!(?root, "Finalizing root"); - - let is_root_finalized = identity_manager.is_root_mined_multi_chain(root).await?; - - if is_root_finalized { - finalized_tree.apply_updates_up_to(root.into()); - database.mark_root_as_mined(&root.into()).await?; - - info!(?root, "Root finalized"); - } - }) -} - +#[instrument(level = "info", skip_all)] async fn fetch_logs( mainnet_scanner: &mut BlockScanner, secondary_scanners: &mut HashMap>, @@ -155,6 +136,27 @@ where Ok(all_roots) } +#[instrument(level = "info", skip_all)] +async fn finalize_roots( + database: &Database, + identity_manager: &IdentityManager, + finalized_tree: &TreeVersion, + all_roots: Vec, +) -> Result<(), anyhow::Error> { + Ok(for root in all_roots { + info!(?root, "Finalizing root"); + + let is_root_finalized = identity_manager.is_root_mined_multi_chain(root).await?; + + if is_root_finalized { + finalized_tree.apply_updates_up_to(root.into()); + database.mark_root_as_mined(&root.into()).await?; + + info!(?root, "Root finalized"); + } + }) +} + async fn init_secondary_scanners( providers: &[BridgedWorldId], scanning_window_size: u64,