File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -439,8 +439,24 @@ impl SortitionsView {
439
439
continue ;
440
440
}
441
441
442
+ // disallow reorg if more than one block has already been signed
443
+ let signed_blocks =
444
+ signer_db. get_signed_block_count_in_tenure ( & tenure. consensus_hash ) ?;
445
+ if signed_blocks > 1 {
446
+ warn ! (
447
+ "Miner is not building off of most recent tenure, but a tenure they attempted to reorg has already more than one signed block." ;
448
+ "proposed_block_consensus_hash" => %block. header. consensus_hash,
449
+ "proposed_block_signer_sighash" => %block. header. signer_signature_hash( ) ,
450
+ "parent_tenure" => %sortition_state. parent_tenure_id,
451
+ "last_sortition" => %sortition_state. prior_sortition,
452
+ "violating_tenure_id" => %tenure. consensus_hash,
453
+ "violating_tenure_first_block_id" => ?tenure. first_block_mined,
454
+ "signed_blocks" => signed_blocks,
455
+ ) ;
456
+ return Ok ( false ) ;
457
+ }
458
+
442
459
if tenure. first_block_mined . is_some ( ) {
443
- // TODO: roberto -> get the amount of signed blocks
444
460
let Some ( local_block_info) =
445
461
signer_db. get_first_signed_block_in_tenure ( & tenure. consensus_hash ) ?
446
462
else {
You can’t perform that action at this time.
0 commit comments