Skip to content
Merged
Show file tree
Hide file tree
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
31 changes: 20 additions & 11 deletions core/src/consensus/progress_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,26 @@ impl ForkProgress {
num_dropped_blocks_on_fork,
);

if let Some(first_alpenglow_slot) = bank
.feature_set
.activated_slot(&solana_feature_set::secp256k1_program_enabled::id())
{
if let Some(num_expected_ticks) = Self::calculate_alpenglow_ticks(
bank.slot(),
first_alpenglow_slot,
bank.parent_slot(),
bank.ticks_per_slot(),
) {
bank.set_tick_height(bank.max_tick_height() - num_expected_ticks);
// Don't need set ticks for our own leader banks, poh service will do that
if bank.collector_id() != validator_identity {
if let Some(first_alpenglow_slot) = bank
.feature_set
.activated_slot(&solana_feature_set::secp256k1_program_enabled::id())
{
if let Some(num_expected_ticks) = Self::calculate_alpenglow_ticks(
bank.slot(),
first_alpenglow_slot,
bank.parent_slot(),
bank.ticks_per_slot(),
) {
info!(
"{} setting tick height for slot {} to {}",
validator_identity,
bank.slot(),
bank.max_tick_height() - num_expected_ticks
);
bank.set_tick_height(bank.max_tick_height() - num_expected_ticks);
}
}
}

Expand Down
39 changes: 28 additions & 11 deletions core/src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2404,6 +2404,12 @@ impl ReplayStage {
leader_schedule_cache,
);
}

info!(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need info! on line 2376 if we log here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can exit before this line is hit

"new fork:{} parent:{} (leader) root:{}",
my_leader_slot, parent_slot, root_slot
);

let tpu_bank = Self::new_bank_from_parent_with_notify(
parent_bank.clone(),
my_leader_slot,
Expand Down Expand Up @@ -2476,6 +2482,17 @@ impl ReplayStage {
}
} else {
// We are in full alpenglow mode
let highest_certificate_slot = cert_pool.highest_certificate_slot();
if highest_certificate_slot < first_alpenglow_slot.unwrap() {
// We haven't got a notarization cert yet for any of the first
// alpenglow slots after the migration, wait for something to
// get notarized
info!(
"{} alpenglow maybe_start_leader no notarization certificates yet",
my_pubkey
);
return false;
}
info!(
"alpenglow maybe_start_leader certficates
higheset notarized slot: {},
Expand All @@ -2487,7 +2504,7 @@ impl ReplayStage {
);
(
cert_pool.highest_not_skip_certificate_slot(),
cert_pool.highest_certificate_slot() + 1,
highest_certificate_slot + 1,
)
}
};
Expand Down Expand Up @@ -2774,9 +2791,9 @@ impl ReplayStage {
return None;
};
info!(
"pushing into vote pool {} {}",
vote_bank.epoch_vote_account_stake(vote_account_pubkey),
vote_bank.total_epoch_stake()
"{} pushing into vote pool {:?}",
identity_keypair.pubkey(),
vote
);
let Ok(maybe_new_cert) = cert_pool.add_vote(
&vote,
Expand Down Expand Up @@ -3353,7 +3370,6 @@ impl ReplayStage {
.expect("alpenglow feature must have been enabled if migration is complete");
let highest_frozen_bank = bank_forks.read().unwrap().highest_frozen_bank();
assert!(highest_frozen_bank.is_frozen());
assert!(highest_frozen_bank.slot() >= first_alpenglow_slot);

let poh_start_slot = poh_recorder.read().unwrap().start_slot();
if poh_start_slot < highest_frozen_bank.slot() {
Expand All @@ -3366,7 +3382,8 @@ impl ReplayStage {
// was a skip certificate for your slot, so it's ok to abandon your leader slot
//
// TODO: move PohRecorder::would_be_leader() to skip loop timer
// TODO: test this scenario
// TODO: test this scenario if we reset immediately after starting up a
// leader block
Self::reset_poh_recorder(
my_pubkey,
blockstore,
Expand All @@ -3375,8 +3392,10 @@ impl ReplayStage {
leader_schedule_cache,
);
}

// Try to notarize the highest frozen bank
if vote_history.latest_notarize_vote.slot() != highest_frozen_bank.slot()
if highest_frozen_bank.slot() >= first_alpenglow_slot
&& vote_history.latest_notarize_vote.slot() != highest_frozen_bank.slot()
&& !vote_history.is_slot_skipped(highest_frozen_bank.slot())
{
// TODO: Consider if voting on duplicate requires a retry, or not necessary if the other one has already been notarized?
Expand Down Expand Up @@ -3414,10 +3433,8 @@ impl ReplayStage {

// Try to finalize the highest notarized block
let highest_notarized_slot = cert_pool.highest_notarized_slot();
// Validators shouldn't be notarizing non alpenglow slots
assert!(highest_notarized_slot >= first_alpenglow_slot);

if vote_history.latest_finalize_vote.slot() != highest_notarized_slot
if highest_notarized_slot >= first_alpenglow_slot
&& vote_history.latest_finalize_vote.slot() != highest_notarized_slot
&& !vote_history.is_slot_skipped(highest_notarized_slot)
{
let maybe_vote_bank = bank_forks.read().unwrap().get(highest_notarized_slot);
Expand Down