File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,14 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
1111
1212## Changed
1313
14+ # [ 3.1.0.0.2.1]
15+
16+ ## Added
17+
18+ ## Changed
19+
20+ - Prevent old reward cycle signers from processing block validation response messages that do not apply to blocks from their cycle.
21+
1422## [ 3.1.0.0.2.0]
1523
1624## Added
Original file line number Diff line number Diff line change @@ -564,6 +564,14 @@ impl Signer {
564564 // For mutability reasons, we need to take the block_info out of the map and add it back after processing
565565 let mut block_info = match self . signer_db . block_lookup ( & signer_signature_hash) {
566566 Ok ( Some ( block_info) ) => {
567+ if block_info. reward_cycle != self . reward_cycle {
568+ // We are not signing for this reward cycle. Ignore the block.
569+ debug ! (
570+ "{self}: Received a block validation response for a different reward cycle. Ignore it." ;
571+ "requested_reward_cycle" => block_info. reward_cycle,
572+ ) ;
573+ return None ;
574+ }
567575 if block_info. is_locally_finalized ( ) {
568576 debug ! ( "{self}: Received block validation for a block that is already marked as {}. Ignoring..." , block_info. state) ;
569577 return None ;
@@ -635,6 +643,14 @@ impl Signer {
635643 }
636644 let mut block_info = match self . signer_db . block_lookup ( & signer_signature_hash) {
637645 Ok ( Some ( block_info) ) => {
646+ if block_info. reward_cycle != self . reward_cycle {
647+ // We are not signing for this reward cycle. Ignore the block.
648+ debug ! (
649+ "{self}: Received a block validation response for a different reward cycle. Ignore it." ;
650+ "requested_reward_cycle" => block_info. reward_cycle,
651+ ) ;
652+ return None ;
653+ }
638654 if block_info. is_locally_finalized ( ) {
639655 debug ! ( "{self}: Received block validation for a block that is already marked as {}. Ignoring..." , block_info. state) ;
640656 return None ;
You can’t perform that action at this time.
0 commit comments