@@ -670,17 +670,15 @@ impl Signer {
670
670
/// Check the current tracked submitted block proposal to see if it has timed out.
671
671
/// Broadcasts a rejection and marks the block locally rejected if it has.
672
672
fn check_submitted_block_proposal ( & mut self ) {
673
- let Some ( ( block_proposal, block_submission) ) = self . submitted_block_proposal . clone ( ) else {
673
+ let Some ( ( block_proposal, block_submission) ) = self . submitted_block_proposal . take ( ) else {
674
674
// Nothing to check.
675
675
return ;
676
676
} ;
677
677
if block_submission. elapsed ( ) < self . block_proposal_validation_timeout {
678
- // Not expired yet.
678
+ // Not expired yet. Put it back!
679
+ self . submitted_block_proposal = Some ( ( block_proposal, block_submission) ) ;
679
680
return ;
680
681
}
681
- // Let us immediately flush, even if we later encounter an error broadcasting our responses.
682
- // We should still attempt to handle a new proposal at this point.
683
- self . submitted_block_proposal = None ;
684
682
let signature_sighash = block_proposal. block . header . signer_signature_hash ( ) ;
685
683
// For mutability reasons, we need to take the block_info out of the map and add it back after processing
686
684
let mut block_info = match self
@@ -710,6 +708,8 @@ impl Signer {
710
708
return ;
711
709
}
712
710
} ;
711
+ // We cannot determine the validity of the block, but we have not reached consensus on it yet.
712
+ // Reject it so we aren't holding up the network because of our inaction.
713
713
warn ! (
714
714
"{self}: Failed to receive block validation response within {} ms. Rejecting block." , self . block_proposal_validation_timeout. as_millis( ) ;
715
715
"signer_sighash" => %signature_sighash,
@@ -721,7 +721,6 @@ impl Signer {
721
721
& self . private_key ,
722
722
self . mainnet ,
723
723
) ;
724
- // We know proposal is invalid. Send rejection message, do not do further validation
725
724
if let Err ( e) = block_info. mark_locally_rejected ( ) {
726
725
warn ! ( "{self}: Failed to mark block as locally rejected: {e:?}" , ) ;
727
726
} ;
@@ -855,6 +854,7 @@ impl Signer {
855
854
. map ( |( proposal, _) | & proposal. block . header . signer_signature_hash ( ) == block_hash)
856
855
. unwrap_or ( false )
857
856
{
857
+ // Consensus reached! No longer bother tracking its validation submission to the node as we are too late to participate in the decision anyway.
858
858
self . submitted_block_proposal = None ;
859
859
}
860
860
}
@@ -1005,6 +1005,7 @@ impl Signer {
1005
1005
. map ( |( proposal, _) | & proposal. block . header . signer_signature_hash ( ) == block_hash)
1006
1006
. unwrap_or ( false )
1007
1007
{
1008
+ // Consensus reached! No longer bother tracking its validation submission to the node as we are too late to participate in the decision anyway.
1008
1009
self . submitted_block_proposal = None ;
1009
1010
}
1010
1011
}
0 commit comments