From bdfc3604b10134559624ef5b8e28f0f2e624c9d3 Mon Sep 17 00:00:00 2001 From: Aaron Blankstein Date: Fri, 8 Mar 2024 10:50:32 -0600 Subject: [PATCH] more logging --- .../stacks-node/src/nakamoto_node/miner.rs | 22 ++++++++++++++++--- .../stacks-node/src/nakamoto_node/relayer.rs | 3 ++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/testnet/stacks-node/src/nakamoto_node/miner.rs b/testnet/stacks-node/src/nakamoto_node/miner.rs index 3546e48b9..b4f52292a 100644 --- a/testnet/stacks-node/src/nakamoto_node/miner.rs +++ b/testnet/stacks-node/src/nakamoto_node/miner.rs @@ -144,6 +144,12 @@ impl BlockMinerThread { pub fn run_miner(mut self, prior_miner: Option>) { // when starting a new tenure, block the mining thread if its currently running. // the new mining thread will join it (so that the new mining thread stalls, not the relayer) + debug!( + "New miner thread starting"; + "had_prior_miner" => prior_miner.is_some(), + "parent_tenure_id" => %self.parent_tenure_id, + "thread_id" => ?thread::current().id(), + ); if let Some(prior_miner) = prior_miner { Self::stop_miner(&self.globals, prior_miner); } @@ -960,9 +966,19 @@ impl ParentStacksBlockInfo { None }; - debug!("Mining tenure's last consensus hash: {} (height {} hash {}), stacks tip consensus hash: {} (height {} hash {})", - &check_burn_block.consensus_hash, check_burn_block.block_height, &check_burn_block.burn_header_hash, - &parent_snapshot.consensus_hash, parent_snapshot.block_height, &parent_snapshot.burn_header_hash); + debug!( + "Looked up parent information"; + "parent_tenure_id" => %parent_tenure_id, + "parent_tenure_consensus_hash" => %parent_tenure_header.consensus_hash, + "parent_tenure_burn_hash" => %parent_tenure_header.burn_header_hash, + "parent_tenure_burn_height" => parent_tenure_header.burn_header_height, + "mining_consensus_hash" => %check_burn_block.consensus_hash, + "mining_burn_hash" => %check_burn_block.burn_header_hash, + "mining_burn_height" => check_burn_block.block_height, + "stacks_tip_consensus_hash" => %parent_snapshot.consensus_hash, + "stacks_tip_burn_hash" => %parent_snapshot.burn_header_hash, + "stacks_tip_burn_height" => parent_snapshot.block_height, + ); let coinbase_nonce = { let principal = miner_address.into(); diff --git a/testnet/stacks-node/src/nakamoto_node/relayer.rs b/testnet/stacks-node/src/nakamoto_node/relayer.rs index d0072c35d..78051a52f 100644 --- a/testnet/stacks-node/src/nakamoto_node/relayer.rs +++ b/testnet/stacks-node/src/nakamoto_node/relayer.rs @@ -562,6 +562,7 @@ impl RelayerThread { "Relayer: Spawn tenure thread"; "height" => last_burn_block.block_height, "burn_header_hash" => %burn_header_hash, + "parent_tenure_id" => %parent_tenure_id, ); let miner_thread_state = @@ -588,7 +589,7 @@ impl RelayerThread { let new_miner_state = self.create_block_miner(vrf_key, burn_tip, parent_tenure_start)?; let new_miner_handle = std::thread::Builder::new() - .name(format!("miner-{}", self.local_peer.data_url)) + .name(format!("miner.{parent_tenure_start}")) .stack_size(BLOCK_PROCESSOR_STACK_SIZE) .spawn(move || new_miner_state.run_miner(prior_tenure_thread)) .map_err(|e| {