@@ -235,43 +235,48 @@ impl<H: BlockHeaderStorage> SyncManager for MasternodesManager<H> {
235235 tracing:: info!( "Fed {} block heights to engine" , fed) ;
236236
237237 // Feed QRInfo to engine first to populate masternode lists
238- if let Err ( e ) = engine. feed_qr_info ( qr_info. clone ( ) , true , true ) {
239- // Check if this is a tip ChainLock error (h - 0 means the tip block)
240- // The QRInfo response always includes `mn_list_diff_tip` which is the current
241- // chain tip. If the tip was just mined, the ChainLock hasn't propagated yet.
242- let is_tip_chainlock_error = matches ! (
243- e ,
244- QuorumValidationError :: RequiredRotatedChainLockSigNotPresent ( 0 , _ )
245- ) ;
246-
247- if is_tip_chainlock_error {
248- self . sync_state . qrinfo_retry_count += 1 ;
238+ let summary = match engine. feed_qr_info ( qr_info. clone ( ) , true , true ) {
239+ Ok ( summary ) => summary ,
240+ Err ( e ) => {
241+ // Check if this is a tip ChainLock error (h - 0 means the tip block)
242+ // The QRInfo response always includes `mn_list_diff_tip` which is the
243+ // current chain tip. If the tip was just mined, the ChainLock hasn't
244+ // propagated yet.
245+ let is_tip_chainlock_error = matches ! (
246+ e ,
247+ QuorumValidationError :: RequiredRotatedChainLockSigNotPresent ( 0 , _ )
248+ ) ;
249249
250- if self . sync_state . qrinfo_retry_count <= MAX_RETRY_ATTEMPTS {
251- tracing:: info!(
252- "ChainLock not yet available for tip, scheduling retry {}/{} in {}s" ,
253- self . sync_state. qrinfo_retry_count,
254- MAX_RETRY_ATTEMPTS ,
255- CHAINLOCK_RETRY_DELAY_SECS
256- ) ;
257- // Schedule a delayed retry - the tick handler will trigger it
258- self . sync_state . chainlock_retry_after = Some (
259- Instant :: now ( ) + Duration :: from_secs ( CHAINLOCK_RETRY_DELAY_SECS ) ,
260- ) ;
261- drop ( engine) ;
262- self . set_state ( SyncState :: Syncing ) ;
263- return Ok ( vec ! [ ] ) ;
250+ if is_tip_chainlock_error {
251+ self . sync_state . qrinfo_retry_count += 1 ;
252+
253+ if self . sync_state . qrinfo_retry_count <= MAX_RETRY_ATTEMPTS {
254+ tracing:: info!(
255+ "ChainLock not yet available for tip, scheduling retry {}/{} in {}s" ,
256+ self . sync_state. qrinfo_retry_count,
257+ MAX_RETRY_ATTEMPTS ,
258+ CHAINLOCK_RETRY_DELAY_SECS
259+ ) ;
260+ // Schedule a delayed retry - the tick handler will trigger it
261+ self . sync_state . chainlock_retry_after = Some (
262+ Instant :: now ( )
263+ + Duration :: from_secs ( CHAINLOCK_RETRY_DELAY_SECS ) ,
264+ ) ;
265+ drop ( engine) ;
266+ self . set_state ( SyncState :: Syncing ) ;
267+ return Ok ( vec ! [ ] ) ;
268+ }
264269 }
265- }
266270
267- // For other errors or max retries reached, fail
268- tracing:: error!(
269- "QRInfo failed after {} retries: {}" ,
270- self . sync_state. qrinfo_retry_count,
271- e
272- ) ;
273- return Err ( SyncError :: MasternodeSyncFailed ( e. to_string ( ) ) ) ;
274- }
271+ // For other errors or max retries reached, fail
272+ tracing:: error!(
273+ "QRInfo failed after {} retries: {}" ,
274+ self . sync_state. qrinfo_retry_count,
275+ e
276+ ) ;
277+ return Err ( SyncError :: MasternodeSyncFailed ( e. to_string ( ) ) ) ;
278+ }
279+ } ;
275280
276281 // Populate known_mn_list_heights from engine after QRInfo processing
277282 self . sync_state . known_mn_list_heights =
@@ -296,6 +301,15 @@ impl<H: BlockHeaderStorage> SyncManager for MasternodesManager<H> {
296301 drop ( engine) ;
297302 drop ( storage) ;
298303
304+ if let Some ( summary) = summary {
305+ tracing:: info!(
306+ "QRInfo processed: stored_cycle_height={:?}, rotated_quorum_count={}, freshly_validated_count={}" ,
307+ summary. stored_cycle_height,
308+ summary. rotated_quorum_count,
309+ summary. freshly_validated_count,
310+ ) ;
311+ }
312+
299313 // Queue and send MnListDiff requests via pipeline
300314 self . sync_state . mnlistdiff_pipeline . queue_requests ( request_pairs) ;
301315 self . sync_state . mnlistdiff_pipeline . send_pending ( requests) ?;
0 commit comments