Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version gate next epoch QC check #2642

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions hotshot-task-impls/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ pub async fn validate_proposal_safety_and_liveness<
let proposal_epoch = option_epoch_from_block_number::<TYPES>(
validation_info
.upgrade_lock
.epochs_enabled(proposed_leaf.view_number())
.epochs_enabled(view_number)
.await,
proposed_leaf.height(),
validation_info.epoch_height,
Expand Down Expand Up @@ -646,7 +646,7 @@ pub async fn validate_proposal_safety_and_liveness<
let justify_qc_epoch = option_epoch_from_block_number::<TYPES>(
validation_info
.upgrade_lock
.epochs_enabled(proposed_leaf.view_number())
.epochs_enabled(view_number)
.await,
parent_leaf.height(),
validation_info.epoch_height,
Expand All @@ -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!");
}
Expand Down
Loading