Skip to content

Commit

Permalink
Merge pull request #5387 from stacks-network/fix/block-response-metric
Browse files Browse the repository at this point in the history
Increment block responses sent all the time
  • Loading branch information
hstove authored Oct 29, 2024
2 parents 38ae702 + 68ea4da commit 452fbaf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions stacks-signer/src/v0/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,17 @@ impl Signer {
};
// Submit a proposal response to the .signers contract for miners
debug!("{self}: Broadcasting a block response to stacks node: {block_response:?}");
if let Err(e) = self
let accepted = matches!(block_response, BlockResponse::Accepted(..));
match self
.stackerdb
.send_message_with_retry::<SignerMessage>(block_response.into())
{
warn!("{self}: Failed to send block rejection to stacker-db: {e:?}",);
Ok(_) => {
crate::monitoring::increment_block_responses_sent(accepted);
}
Err(e) => {
warn!("{self}: Failed to send block rejection to stacker-db: {e:?}",);
}
}
return;
}
Expand Down Expand Up @@ -612,12 +618,12 @@ impl Signer {
info!(
"{self}: Broadcasting a block response to stacks node: {response:?}";
);
let accepted = matches!(response, BlockResponse::Accepted(..));
match self
.stackerdb
.send_message_with_retry::<SignerMessage>(response.clone().into())
.send_message_with_retry::<SignerMessage>(response.into())
{
Ok(_) => {
let accepted = matches!(response, BlockResponse::Accepted(..));
crate::monitoring::increment_block_responses_sent(accepted);
}
Err(e) => {
Expand Down

0 comments on commit 452fbaf

Please sign in to comment.