From 47f92ffac680759199e0da78261be788e8bb59d8 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Tue, 27 Aug 2024 12:13:15 +0800 Subject: [PATCH 1/2] Early return init_load_unverified thread when no unverified blocks found after tip --- chain/src/init_load_unverified.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/chain/src/init_load_unverified.rs b/chain/src/init_load_unverified.rs index e2c4ebae00..30b0247cdb 100644 --- a/chain/src/init_load_unverified.rs +++ b/chain/src/init_load_unverified.rs @@ -93,6 +93,15 @@ impl InitLoadUnverified { let unverified_hashes: Vec = self.find_unverified_block_hashes(check_unverified_number); + if check_unverified_number > tip_number && unverified_hashes.is_empty() { + info!( + "no unverified blocks found after tip, current tip: {}-{}", + tip_number, + self.shared.snapshot().tip_hash() + ); + return; + } + for unverified_hash in unverified_hashes { f(&unverified_hash); } From d28bde6c4ee915d7b9c943030f0ce8f09aeaa697 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Tue, 27 Aug 2024 12:24:57 +0800 Subject: [PATCH 2/2] Integration Test: add more log for SyncChurn --- test/src/specs/sync/sync_churn.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/src/specs/sync/sync_churn.rs b/test/src/specs/sync/sync_churn.rs index 554f580ef6..4770947053 100644 --- a/test/src/specs/sync/sync_churn.rs +++ b/test/src/specs/sync/sync_churn.rs @@ -60,6 +60,11 @@ impl Spec for SyncChurn { if too_many_blocks || restart_stopped_rx.try_recv().is_ok() { break; } + info!( + "mining_node {}, tip: {}", + mining_node.node_id(), + mining_node.get_tip_block_number() + ); waiting_for_sync(&mining_nodes); } });