Skip to content

Commit

Permalink
replay: extend last fec set check for 32+ retransmitter signed shreds
Browse files Browse the repository at this point in the history
  • Loading branch information
AshwinSekar committed Jul 15, 2024
1 parent 9a7bf72 commit ef2185c
Show file tree
Hide file tree
Showing 5 changed files with 299 additions and 58 deletions.
75 changes: 39 additions & 36 deletions core/src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3077,48 +3077,51 @@ impl ReplayStage {
}

if bank.collector_id() != my_pubkey {
// If the block does not have at least DATA_SHREDS_PER_FEC_BLOCK shreds in the last FEC set,
// mark it dead. No reason to perform this check on our leader block.
if !blockstore
.is_last_fec_set_full(bank.slot())
.inspect_err(|e| {
// If the block does not have at least DATA_SHREDS_PER_FEC_BLOCK correctly retransmitted
// shreds in the last FEC set, mark it dead. No reason to perform this check on our leader block.
let check_result = match blockstore.check_last_fec_set(bank.slot()) {
Ok(last_fec_set_check_results) => {
// Update metrics regardless of feature flag
last_fec_set_check_results.report_metrics(bank_slot, bank.hash());
// Get a final result based on the feature flags
last_fec_set_check_results.get_result(&bank.feature_set)
}
Err(e) => {
warn!(
"Unable to determine if last fec set is full for slot {} {},
"Unable to check the last fec set for slot {} {},
marking as dead: {e:?}",
bank.slot(),
bank.hash()
)
})
.unwrap_or(false)
{
// Update metric regardless of feature flag
datapoint_warn!(
"incomplete_final_fec_set",
("slot", bank_slot, i64),
("hash", bank.hash().to_string(), String)
);
if bank
.feature_set
.is_active(&solana_sdk::feature_set::vote_only_full_fec_sets::id())
{
let root = bank_forks.read().unwrap().root();
Self::mark_dead_slot(
blockstore,
bank,
root,
&BlockstoreProcessorError::IncompleteFinalFecSet,
rpc_subscriptions,
duplicate_slots_tracker,
duplicate_confirmed_slots,
epoch_slots_frozen_slots,
progress,
heaviest_subtree_fork_choice,
duplicate_slots_to_repair,
ancestor_hashes_replay_update_sender,
purge_repair_slot_counter,
);
continue;
if bank
.feature_set
.is_active(&solana_sdk::feature_set::vote_only_full_fec_sets::id())
{
Err(BlockstoreProcessorError::IncompleteFinalFecSet)
} else {
Ok(())
}
}
};

if let Err(result_err) = check_result {
let root = bank_forks.read().unwrap().root();
Self::mark_dead_slot(
blockstore,
bank,
root,
&result_err,
rpc_subscriptions,
duplicate_slots_tracker,
duplicate_confirmed_slots,
epoch_slots_frozen_slots,
progress,
heaviest_subtree_fork_choice,
duplicate_slots_to_repair,
ancestor_hashes_replay_update_sender,
purge_repair_slot_counter,
);
continue;
}
}

Expand Down
Loading

0 comments on commit ef2185c

Please sign in to comment.