@@ -478,7 +478,7 @@ impl Signer {
478
478
"burn_height" => block_proposal. burn_height,
479
479
) ;
480
480
481
- self . submit_block_for_validation ( stacks_client, block_proposal. block . clone ( ) ) ;
481
+ self . submit_block_for_validation ( stacks_client, & block_proposal. block ) ;
482
482
} else {
483
483
// Still store the block but log we can't submit it for validation. We may receive enough signatures/rejections
484
484
// from other signers to push the proposed block into a global rejection/acceptance regardless of our participation.
@@ -503,11 +503,9 @@ impl Signer {
503
503
match block_response {
504
504
BlockResponse :: Accepted ( accepted) => {
505
505
self . handle_block_signature ( stacks_client, accepted) ;
506
- accepted. signer_signature_hash
507
506
}
508
507
BlockResponse :: Rejected ( block_rejection) => {
509
508
self . handle_block_rejection ( block_rejection) ;
510
- block_rejection. signer_signature_hash
511
509
}
512
510
} ;
513
511
@@ -517,6 +515,7 @@ impl Signer {
517
515
. remove_pending_block_validation ( & signer_sig_hash)
518
516
. unwrap_or_else ( |e| warn ! ( "{self}: Failed to remove pending block validation: {e:?}" ) ) ;
519
517
518
+ // Check if there is a pending block validation that we need to submit to the node
520
519
match self . signer_db . get_pending_block_validation ( ) {
521
520
Ok ( Some ( signer_sig_hash) ) => {
522
521
info ! ( "{self}: Found a pending block validation: {signer_sig_hash:?}" ) ;
@@ -525,7 +524,7 @@ impl Signer {
525
524
. block_lookup ( self . reward_cycle , & signer_sig_hash)
526
525
{
527
526
Ok ( Some ( block_info) ) => {
528
- self . submit_block_for_validation ( stacks_client, block_info. block ) ;
527
+ self . submit_block_for_validation ( stacks_client, & block_info. block ) ;
529
528
}
530
529
Ok ( None ) => {
531
530
// This should never happen
@@ -1066,15 +1065,16 @@ impl Signer {
1066
1065
}
1067
1066
1068
1067
/// Submit a block for validation, and mark it as pending if the node
1069
- fn submit_block_for_validation ( & mut self , stacks_client : & StacksClient , block : NakamotoBlock ) {
1068
+ /// is busy with a previous request.
1069
+ fn submit_block_for_validation ( & mut self , stacks_client : & StacksClient , block : & NakamotoBlock ) {
1070
1070
let signer_signature_hash = block. header . signer_signature_hash ( ) ;
1071
1071
match stacks_client. submit_block_for_validation ( block. clone ( ) ) {
1072
1072
Ok ( _) => {
1073
1073
self . submitted_block_proposal = Some ( ( signer_signature_hash, Instant :: now ( ) ) ) ;
1074
1074
}
1075
1075
Err ( ClientError :: RequestFailure ( status) ) => {
1076
1076
if status. as_u16 ( ) == TOO_MANY_REQUESTS_STATUS {
1077
- info ! ( "{self}: Received 429 from stacks node. Inserting pending block validation..." ;
1077
+ info ! ( "{self}: Received 429 from stacks node for block validation request . Inserting pending block validation..." ;
1078
1078
"signer_signature_hash" => %signer_signature_hash,
1079
1079
) ;
1080
1080
self . signer_db
0 commit comments