diff --git a/hotshot-task-impls/src/helpers.rs b/hotshot-task-impls/src/helpers.rs index 3e4f295602..3d391e04d9 100644 --- a/hotshot-task-impls/src/helpers.rs +++ b/hotshot-task-impls/src/helpers.rs @@ -594,7 +594,7 @@ pub async fn validate_proposal_safety_and_liveness< let proposal_epoch = option_epoch_from_block_number::( validation_info .upgrade_lock - .epochs_enabled(proposed_leaf.view_number()) + .epochs_enabled(view_number) .await, proposed_leaf.height(), validation_info.epoch_height, @@ -646,7 +646,7 @@ pub async fn validate_proposal_safety_and_liveness< let justify_qc_epoch = option_epoch_from_block_number::( validation_info .upgrade_lock - .epochs_enabled(proposed_leaf.view_number()) + .epochs_enabled(view_number) .await, parent_leaf.height(), validation_info.epoch_height, @@ -664,7 +664,12 @@ pub async fn validate_proposal_safety_and_liveness< ); // Make sure that the epoch transition proposal includes the next epoch QC - if is_last_block_in_epoch(parent_leaf.height(), validation_info.epoch_height) { + if is_last_block_in_epoch(parent_leaf.height(), validation_info.epoch_height) + && validation_info + .upgrade_lock + .epochs_enabled(view_number) + .await + { ensure!(proposal.data.next_epoch_justify_qc().is_some(), "Epoch transition proposal does not include the next epoch justify QC. Do not vote!"); }