@@ -738,22 +738,6 @@ impl SignCoordinator {
738
738
739
739
let start_ts = Instant :: now ( ) ;
740
740
while start_ts. elapsed ( ) <= self . signing_round_timeout {
741
- // one of two things can happen:
742
- // * we get enough signatures from stackerdb from the signers, OR
743
- // * we see our block get processed in our chainstate (meaning, the signers broadcasted
744
- // the block and our node got it and processed it)
745
- let event = match receiver. recv_timeout ( EVENT_RECEIVER_POLL ) {
746
- Ok ( event) => event,
747
- Err ( std:: sync:: mpsc:: RecvTimeoutError :: Timeout ) => {
748
- continue ;
749
- }
750
- Err ( std:: sync:: mpsc:: RecvTimeoutError :: Disconnected ) => {
751
- return Err ( NakamotoNodeError :: SigningCoordinatorFailure (
752
- "StackerDB event receiver disconnected" . into ( ) ,
753
- ) )
754
- }
755
- } ;
756
-
757
741
// look in the nakamoto staging db -- a block can only get stored there if it has
758
742
// enough signing weight to clear the threshold
759
743
if let Ok ( Some ( ( stored_block, _sz) ) ) = chain_state
@@ -773,6 +757,22 @@ impl SignCoordinator {
773
757
return Ok ( stored_block. header . signer_signature ) ;
774
758
}
775
759
760
+ // one of two things can happen:
761
+ // * we get enough signatures from stackerdb from the signers, OR
762
+ // * we see our block get processed in our chainstate (meaning, the signers broadcasted
763
+ // the block and our node got it and processed it)
764
+ let event = match receiver. recv_timeout ( EVENT_RECEIVER_POLL ) {
765
+ Ok ( event) => event,
766
+ Err ( std:: sync:: mpsc:: RecvTimeoutError :: Timeout ) => {
767
+ continue ;
768
+ }
769
+ Err ( std:: sync:: mpsc:: RecvTimeoutError :: Disconnected ) => {
770
+ return Err ( NakamotoNodeError :: SigningCoordinatorFailure (
771
+ "StackerDB event receiver disconnected" . into ( ) ,
772
+ ) )
773
+ }
774
+ } ;
775
+
776
776
// check to see if this event we got is a signer event
777
777
let is_signer_event =
778
778
event. contract_id . name . starts_with ( SIGNERS_NAME ) && event. contract_id . is_boot ( ) ;
@@ -821,33 +821,34 @@ impl SignCoordinator {
821
821
) ) ;
822
822
} ;
823
823
if rejected_data. signer_signature_hash
824
- == block. header . signer_signature_hash ( )
824
+ != block. header . signer_signature_hash ( )
825
+ {
826
+ debug ! ( "Received rejected block response for a block besides my own. Ignoring." ) ;
827
+ continue ;
828
+ }
829
+
830
+ debug ! (
831
+ "Signer {} rejected our block {}/{}" ,
832
+ slot_id,
833
+ & block. header. consensus_hash,
834
+ & block. header. block_hash( )
835
+ ) ;
836
+ total_reject_weight = total_reject_weight
837
+ . checked_add ( signer_entry. weight )
838
+ . expect ( "FATAL: total weight rejected exceeds u32::MAX" ) ;
839
+
840
+ if total_reject_weight. saturating_add ( self . weight_threshold )
841
+ > self . total_weight
825
842
{
826
843
debug ! (
827
- "Signer {} rejected our block {}/{}" ,
828
- slot_id,
844
+ "{}/{} signers vote to reject our block {}/{}" ,
845
+ total_reject_weight,
846
+ self . total_weight,
829
847
& block. header. consensus_hash,
830
848
& block. header. block_hash( )
831
849
) ;
832
- total_reject_weight = total_reject_weight
833
- . checked_add ( signer_entry. weight )
834
- . expect ( "FATAL: total weight rejected exceeds u32::MAX" ) ;
835
-
836
- if total_reject_weight. saturating_add ( self . weight_threshold )
837
- > self . total_weight
838
- {
839
- debug ! (
840
- "{}/{} signers vote to reject our block {}/{}" ,
841
- total_reject_weight,
842
- self . total_weight,
843
- & block. header. consensus_hash,
844
- & block. header. block_hash( )
845
- ) ;
846
- counters. bump_naka_rejected_blocks ( ) ;
847
- return Err ( NakamotoNodeError :: SignersRejected ) ;
848
- }
849
- } else {
850
- debug ! ( "Received rejected block response for a block besides my own. Ignoring." ) ;
850
+ counters. bump_naka_rejected_blocks ( ) ;
851
+ return Err ( NakamotoNodeError :: SignersRejected ) ;
851
852
}
852
853
continue ;
853
854
}
@@ -909,7 +910,7 @@ impl SignCoordinator {
909
910
}
910
911
911
912
if Self :: fault_injection_ignore_signatures ( ) {
912
- debug ! ( "SignCoordinator: fault injection: ignoring well-formed signature for block" ;
913
+ warn ! ( "SignCoordinator: fault injection: ignoring well-formed signature for block" ;
913
914
"block_signer_sighash" => %block_sighash,
914
915
"signer_pubkey" => signer_pubkey. to_hex( ) ,
915
916
"signer_slot_id" => slot_id,
@@ -922,7 +923,7 @@ impl SignCoordinator {
922
923
continue ;
923
924
}
924
925
925
- debug ! ( "SignCoordinator: Signature Added to block" ;
926
+ info ! ( "SignCoordinator: Signature Added to block" ;
926
927
"block_signer_sighash" => %block_sighash,
927
928
"signer_pubkey" => signer_pubkey. to_hex( ) ,
928
929
"signer_slot_id" => slot_id,
0 commit comments