diff --git a/Cargo.toml b/Cargo.toml index 6cbdde9..a6d5dad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ resolver = "2" [workspace.package] homepage = "https://projectglove.io/" repository = "https://github.com/projectglove/glove-monorepo/" -version = "0.0.14" +version = "0.0.15" [workspace.dependencies] anyhow = "1.0.86" diff --git a/service/src/lib.rs b/service/src/lib.rs index 5450192..edc516a 100644 --- a/service/src/lib.rs +++ b/service/src/lib.rs @@ -50,6 +50,7 @@ pub async fn calculate_mixing_time( Ok(MixingTime::Deciding(decision_end - GLOVE_MIX_PERIOD)) } +#[derive(Debug)] pub enum MixingTime { Deciding(u32), Confirming(u32), diff --git a/service/src/main.rs b/service/src/main.rs index 68bc2b5..6f69dd0 100644 --- a/service/src/main.rs +++ b/service/src/main.rs @@ -306,6 +306,7 @@ async fn mark_voted_polls_as_final( fn start_background_thread(context: Arc, subscan: Subscan) { spawn(async move { loop { + debug!("Running background task..."); if let Err(error) = run_background_task(context.clone(), subscan.clone()).await { warn!("Error from background task: {:?}", error) } @@ -377,13 +378,15 @@ async fn is_poll_ready_for_final_mix( network: &SubstrateNetwork ) -> Result { let now = network.current_block_number().await?; - match calculate_mixing_time(poll_status, network).await? { - MixingTime::Deciding(block_number) if block_number >= now => { + let mixing_time = calculate_mixing_time(poll_status, network).await?; + debug!("Mixing time for {} @ now={}: {:?}", poll_index, now, mixing_time); + match mixing_time { + MixingTime::Deciding(block_number) if now >= block_number => { info!("Poll {} is nearing the end of its decision period and will be mixed", poll_index); Ok(true) } - MixingTime::Confirming(block_number) if block_number >= now => { + MixingTime::Confirming(block_number) if now >= block_number => { info!("Poll {} is nearing the end of its confirmation period and will be mixed", poll_index); Ok(true)