From f8a0c71780ce68b55fc371bfa969321776accad6 Mon Sep 17 00:00:00 2001 From: Ashwin Sekar Date: Fri, 16 Aug 2024 12:40:54 -0400 Subject: [PATCH] ff cleanup: merkle_conflict_duplicate_proofs (#2601) --- core/src/window_service.rs | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/core/src/window_service.rs b/core/src/window_service.rs index 14ffcf6277a890..511da236958af3 100644 --- a/core/src/window_service.rs +++ b/core/src/window_service.rs @@ -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, @@ -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 {