@@ -421,13 +421,13 @@ async fn live_sync_backfill_and_purge(
421
421
return ;
422
422
} ;
423
423
424
+ stats:: new_mithril_update ( cfg. chain , update. tip . slot_or_default ( ) ) ;
425
+
424
426
debug ! (
425
427
"Before Backfill: Size of the Live Chain is: {} Blocks" ,
426
428
live_chain_length( cfg. chain)
427
429
) ;
428
430
429
- let live_chain_head: Point ;
430
-
431
431
loop {
432
432
// We will re-attempt backfill, until its successful.
433
433
// Backfill is atomic, it either fully works, or none of the live-chain is changed.
@@ -437,23 +437,15 @@ async fn live_sync_backfill_and_purge(
437
437
sleep ( Duration :: from_secs ( 10 ) ) . await ;
438
438
}
439
439
440
- if let Some ( head_point) = get_live_head_point ( cfg. chain ) {
441
- live_chain_head = head_point;
440
+ if get_live_head_point ( cfg. chain ) . is_some ( ) {
442
441
break ;
443
442
}
444
443
}
445
444
446
- stats:: new_mithril_update (
447
- cfg. chain ,
448
- update. tip . slot_or_default ( ) ,
449
- live_chain_length ( cfg. chain ) as u64 ,
450
- live_chain_head. slot_or_default ( ) ,
451
- ) ;
445
+ let new_live_chain_length = live_chain_length ( cfg. chain ) ;
446
+ stats:: new_live_total_blocks ( cfg. chain , new_live_chain_length as u64 ) ;
452
447
453
- debug ! (
454
- "After Backfill: Size of the Live Chain is: {} Blocks" ,
455
- live_chain_length( cfg. chain)
456
- ) ;
448
+ debug ! ( "After Backfill: Size of the Live Chain is: {new_live_chain_length} Blocks" , ) ;
457
449
458
450
// Once Backfill is completed OK we can use the Blockchain data for Syncing and Querying
459
451
sync_ready. signal ( ) ;
@@ -471,6 +463,8 @@ async fn live_sync_backfill_and_purge(
471
463
update_sender = get_chain_update_tx_queue ( cfg. chain ) . await ;
472
464
}
473
465
466
+ stats:: new_mithril_update ( cfg. chain , update. tip . slot_or_default ( ) ) ;
467
+
474
468
debug ! ( "Mithril Tip has advanced to: {update:?} : PURGE NEEDED" ) ;
475
469
476
470
let update_point: Point = update. tip . clone ( ) ;
@@ -480,9 +474,11 @@ async fn live_sync_backfill_and_purge(
480
474
error ! ( "Mithril Purge Failed: {}" , error) ;
481
475
}
482
476
477
+ let new_live_chain_length = live_chain_length ( cfg. chain ) ;
478
+ stats:: new_live_total_blocks ( cfg. chain , new_live_chain_length as u64 ) ;
479
+
483
480
debug ! (
484
- "After Purge: Size of the Live Chain is: {} Blocks: Triggering Sleeping Followers." ,
485
- live_chain_length( cfg. chain)
481
+ "After Purge: Size of the Live Chain is: {new_live_chain_length} Blocks: Triggering Sleeping Followers." ,
486
482
) ;
487
483
488
484
// Trigger any sleeping followers that data has changed.
0 commit comments