Skip to content

Commit 01f730b

Browse files
committed
chore: add signer info logs for acceptance/rejections
1 parent bc58a1e commit 01f730b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

stacks-signer/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to the versioning scheme outlined in the [README.md](README.md).
77

8+
## [Unreleased]
9+
10+
### Added
11+
12+
- Added `info` logs to the signer to provide more visibility into the block approval/rejection status
13+
814
## [3.1.0.0.13.0]
915

1016
### Changed

stacks-signer/src/v0/signer.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,9 +1425,11 @@ impl Signer {
14251425
});
14261426
if total_reject_weight.saturating_add(min_weight) <= total_weight {
14271427
// Not enough rejection signatures to make a decision
1428+
let reject_threshold = total_weight.saturating_sub(min_weight).saturating_add(1);
1429+
info!("{self}: Received rejection for block {block_hash}, but have not reached rejection threshold yet (have {total_reject_weight}, need at least {min_weight}/{reject_threshold})");
14281430
return;
14291431
}
1430-
info!("{self}: {total_reject_weight}/{total_weight} signers voted to reject the block {block_hash}");
1432+
info!("{self}: Received rejection for block {block_hash} and have reached the rejection threshold with {total_reject_weight}/{total_weight} rejections");
14311433
if let Err(e) = self.signer_db.mark_block_globally_rejected(&mut block_info) {
14321434
warn!("{self}: Failed to mark block as globally rejected: {e:?}",);
14331435
}
@@ -1544,12 +1546,10 @@ impl Signer {
15441546
});
15451547

15461548
if min_weight > signature_weight {
1547-
debug!(
1548-
"{self}: Not enough signatures on block {} (have {}, need at least {}/{})",
1549-
block_hash, signature_weight, min_weight, total_weight
1550-
);
1549+
info!("{self}: Received block acceptance for block {block_hash}, but have not reached threshold yet (have {signature_weight}, need at least {min_weight}/{total_weight})");
15511550
return;
15521551
}
1552+
info!("{self}: Received block acceptance for block {block_hash} and have reached threshold with {signature_weight}/{total_weight} signatures");
15531553

15541554
// have enough signatures to broadcast!
15551555
// move block to LOCALLY accepted state.

0 commit comments

Comments
 (0)