Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Nakamoto block heights to info logs for easier integration with log analysis tools #5257

Merged
merged 3 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions stacks-signer/src/chainstate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ impl SortitionsView {
{
info!(
"Current miner timed out, marking as invalid.";
"block_height" => block.header.chain_length,
"current_sortition_consensus_hash" => ?self.cur_sortition.consensus_hash,
);
self.cur_sortition.miner_status = SortitionMinerStatus::InvalidatedBeforeFirstBlock;
Expand All @@ -203,6 +204,7 @@ impl SortitionsView {
if last_sortition.is_timed_out(self.config.block_proposal_timeout, signer_db)? {
info!(
"Last miner timed out, marking as invalid.";
"block_height" => block.header.chain_length,
"last_sortition_consensus_hash" => ?last_sortition.consensus_hash,
);
last_sortition.miner_status = SortitionMinerStatus::InvalidatedBeforeFirstBlock;
Expand Down Expand Up @@ -365,6 +367,7 @@ impl SortitionsView {
"sortition_state.consensus_hash" => %sortition_state.consensus_hash,
"sortition_state.prior_sortition" => %sortition_state.prior_sortition,
"sortition_state.parent_tenure_id" => %sortition_state.parent_tenure_id,
"block_height" => block.header.chain_length,
);

let tenures_reorged = client.get_tenure_forking_info(
Expand Down Expand Up @@ -424,6 +427,7 @@ impl SortitionsView {
"Miner is not building off of most recent tenure. A tenure they reorg has already mined blocks, but the block was poorly timed, allowing the reorg.";
"proposed_block_consensus_hash" => %block.header.consensus_hash,
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
"proposed_block_height" => block.header.chain_length,
"parent_tenure" => %sortition_state.parent_tenure_id,
"last_sortition" => %sortition_state.prior_sortition,
"violating_tenure_id" => %tenure.consensus_hash,
Expand Down Expand Up @@ -596,6 +600,7 @@ impl SortitionsView {
"Have no accepted blocks in the tenure, assuming block confirmation is correct";
"proposed_block_consensus_hash" => %block.header.consensus_hash,
"proposed_block_signer_sighash" => %block.header.signer_signature_hash(),
"proposed_block_height" => block.header.chain_length,
);
return Ok(true);
};
Expand Down
2 changes: 2 additions & 0 deletions stacks-signer/src/v0/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ impl SignerTrait<SignerMessage> for Signer {
info!(
"{self}: Got block pushed message";
"block_id" => %b.block_id(),
"block_height" => b.header.chain_length,
"signer_sighash" => %b.header.signer_signature_hash(),
);
stacks_client.post_block_until_ok(self, &b);
Expand Down Expand Up @@ -352,6 +353,7 @@ impl Signer {
"{self}: received a block proposal for a new block. Submit block for validation. ";
"signer_sighash" => %signer_signature_hash,
"block_id" => %block_proposal.block.block_id(),
"block_height" => block_proposal.block.header.chain_length,
"burn_height" => block_proposal.burn_height,
);
crate::monitoring::increment_block_proposals_received();
Expand Down