Skip to content

Commit

Permalink
ff cleanup: merkle_conflict_duplicate_proofs (anza-xyz#2601)
Browse files Browse the repository at this point in the history
  • Loading branch information
AshwinSekar authored and ray-kast committed Nov 27, 2024
1 parent 813003c commit f8a0c71
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions core/src/window_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,6 @@ fn run_check_duplicate(
root_bank = bank_forks.read().unwrap().root_bank();
}
let shred_slot = shred.slot();
let merkle_conflict_duplicate_proofs = cluster_nodes::check_feature_activation(
&feature_set::merkle_conflict_duplicate_proofs::id(),
shred_slot,
&root_bank,
);
let chained_merkle_conflict_duplicate_proofs = cluster_nodes::check_feature_activation(
&feature_set::chained_merkle_conflict_duplicate_proofs::id(),
shred_slot,
Expand All @@ -173,22 +168,18 @@ fn run_check_duplicate(
PossibleDuplicateShred::LastIndexConflict(shred, conflict)
| PossibleDuplicateShred::ErasureConflict(shred, conflict) => (shred, conflict),
PossibleDuplicateShred::MerkleRootConflict(shred, conflict) => {
if merkle_conflict_duplicate_proofs {
// Although this proof can be immediately stored on detection, we wait until
// here in order to check the feature flag, as storage in blockstore can
// preclude the detection of other duplicate proofs in this slot
if blockstore.has_duplicate_shreds_in_slot(shred_slot) {
return Ok(());
}
blockstore.store_duplicate_slot(
shred_slot,
conflict.clone(),
shred.clone().into_payload(),
)?;
(shred, conflict)
} else {
// Although this proof can be immediately stored on detection, we wait until
// here in order to check the feature flag, as storage in blockstore can
// preclude the detection of other duplicate proofs in this slot
if blockstore.has_duplicate_shreds_in_slot(shred_slot) {
return Ok(());
}
blockstore.store_duplicate_slot(
shred_slot,
conflict.clone(),
shred.clone().into_payload(),
)?;
(shred, conflict)
}
PossibleDuplicateShred::ChainedMerkleRootConflict(shred, conflict) => {
if chained_merkle_conflict_duplicate_proofs {
Expand Down

0 comments on commit f8a0c71

Please sign in to comment.