Skip to content

Commit

Permalink
Merge pull request #5175 from stacks-network/chore/miner-logs
Browse files Browse the repository at this point in the history
chore: add info to signature gathering failure logs
  • Loading branch information
obycode authored Sep 13, 2024
2 parents ff57dc6 + c77c024 commit 1fa594a
Showing 1 changed file with 25 additions and 15 deletions.
40 changes: 25 additions & 15 deletions testnet/stacks-node/src/nakamoto_node/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,22 +358,32 @@ impl BlockMinerThread {
&mut attempts,
) {
Ok(x) => x,
Err(e) => {
match e {
NakamotoNodeError::StacksTipChanged => {
info!("Stacks tip changed while waiting for signatures");
return Err(e);
}
NakamotoNodeError::BurnchainTipChanged => {
info!("Burnchain tip changed while waiting for signatures");
return Err(e);
}
_ => {
error!("Error while gathering signatures: {e:?}. Will try mining again.");
continue;
}
Err(e) => match e {
NakamotoNodeError::StacksTipChanged => {
info!("Stacks tip changed while waiting for signatures";
"signer_sighash" => %new_block.header.signer_signature_hash(),
"block_height" => new_block.header.chain_length,
"consensus_hash" => %new_block.header.consensus_hash,
);
return Err(e);
}
}
NakamotoNodeError::BurnchainTipChanged => {
info!("Burnchain tip changed while waiting for signatures";
"signer_sighash" => %new_block.header.signer_signature_hash(),
"block_height" => new_block.header.chain_length,
"consensus_hash" => %new_block.header.consensus_hash,
);
return Err(e);
}
_ => {
error!("Error while gathering signatures: {e:?}. Will try mining again.";
"signer_sighash" => %new_block.header.signer_signature_hash(),
"block_height" => new_block.header.chain_length,
"consensus_hash" => %new_block.header.consensus_hash,
);
continue;
}
},
};

new_block.header.signer_signature = signer_signature;
Expand Down

0 comments on commit 1fa594a

Please sign in to comment.