Skip to content

Commit 34eb466

Browse files
committed
Merge branch 'develop' of https://github.com/stacks-network/stacks-core into feat/signer-state-machine-rollout
2 parents 30816d6 + d4980dd commit 34eb466

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

stacks-signer/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
99

1010
### Added
1111

12+
- Added `info` logs to the signer to provide more visibility into the block approval/rejection status
1213
- Introduced `capitulate_miner_view_timeout_secs`: the duration (in seconds) for the signer to wait between updating the local state machine viewpoint and capitulating to other signers' miner views.
1314
- Added codepath to enable signers to evaluate block proposals and miner activity against global signer state for improved consistency and correctness. Currently feature gated behind the `SUPPORTED_SIGNER_PROTOCOL_VERSION`
1415

stacks-signer/src/v0/signer.rs

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,9 +1519,28 @@ impl Signer {
15191519
});
15201520
if total_reject_weight.saturating_add(min_weight) <= total_weight {
15211521
// Not enough rejection signatures to make a decision
1522+
info!("{self}: Received block rejection";
1523+
"signer_pubkey" => public_key.to_hex(),
1524+
"signer_signature_hash" => %block_hash,
1525+
"consensus_hash" => %block_info.block.header.consensus_hash,
1526+
"block_height" => block_info.block.header.chain_length,
1527+
"reject_reason" => ?rejection.response_data.reject_reason,
1528+
"total_weight_rejected" => total_reject_weight,
1529+
"total_weight" => total_weight,
1530+
"percent_rejected" => (total_reject_weight as f64 / total_weight as f64 * 100.0),
1531+
);
15221532
return;
15231533
}
1524-
info!("{self}: {total_reject_weight}/{total_weight} signers voted to reject the block {block_hash}");
1534+
info!("{self}: Received block rejection and have reached the rejection threshold";
1535+
"signer_pubkey" => public_key.to_hex(),
1536+
"signer_signature_hash" => %block_hash,
1537+
"consensus_hash" => %block_info.block.header.consensus_hash,
1538+
"block_height" => block_info.block.header.chain_length,
1539+
"reject_reason" => ?rejection.response_data.reject_reason,
1540+
"total_weight_rejected" => total_reject_weight,
1541+
"total_weight" => total_weight,
1542+
"percent_rejected" => (total_reject_weight as f64 / total_weight as f64 * 100.0),
1543+
);
15251544
if let Err(e) = self.signer_db.mark_block_globally_rejected(&mut block_info) {
15261545
warn!("{self}: Failed to mark block as globally rejected: {e:?}",);
15271546
}
@@ -1639,12 +1658,26 @@ impl Signer {
16391658
});
16401659

16411660
if min_weight > signature_weight {
1642-
debug!(
1643-
"{self}: Not enough signatures on block {} (have {}, need at least {}/{})",
1644-
block_hash, signature_weight, min_weight, total_weight
1661+
info!("{self}: Received block acceptance";
1662+
"signer_pubkey" => public_key.to_hex(),
1663+
"signer_signature_hash" => %block_hash,
1664+
"consensus_hash" => %block_info.block.header.consensus_hash,
1665+
"block_height" => block_info.block.header.chain_length,
1666+
"total_weight_approved" => signature_weight,
1667+
"total_weight" => total_weight,
1668+
"percent_approved" => (signature_weight as f64 / total_weight as f64 * 100.0),
16451669
);
16461670
return;
16471671
}
1672+
info!("{self}: Received block acceptance and have reached the threshold";
1673+
"signer_pubkey" => public_key.to_hex(),
1674+
"signer_signature_hash" => %block_hash,
1675+
"consensus_hash" => %block_info.block.header.consensus_hash,
1676+
"block_height" => block_info.block.header.chain_length,
1677+
"total_weight_approved" => signature_weight,
1678+
"total_weight" => total_weight,
1679+
"percent_approved" => (signature_weight as f64 / total_weight as f64 * 100.0),
1680+
);
16481681

16491682
// have enough signatures to broadcast!
16501683
// move block to LOCALLY accepted state.

0 commit comments

Comments
 (0)