Skip to content
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
49 changes: 4 additions & 45 deletions ledger/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,7 @@ impl LastFECSetCheckResults {
&self,
feature_set: &FeatureSet,
) -> std::result::Result<Option<Hash>, BlockstoreProcessorError> {
if feature_set.is_active(&agave_feature_set::vote_only_full_fec_sets::id())
&& self.last_fec_set_merkle_root.is_none()
{
if self.last_fec_set_merkle_root.is_none() {
return Err(BlockstoreProcessorError::IncompleteFinalFecSet);
} else if feature_set
.is_active(&agave_feature_set::vote_only_retransmitter_signed_fec_sets::id())
Expand Down Expand Up @@ -3787,10 +3785,7 @@ impl Blockstore {
"Unable to check the last fec set for slot {slot} {bank_hash}, \
marking as dead: {results:?}",
);
if feature_set.is_active(&agave_feature_set::vote_only_full_fec_sets::id()) {
return Err(BlockstoreProcessorError::IncompleteFinalFecSet);
}
return Ok(None);
return Err(BlockstoreProcessorError::IncompleteFinalFecSet);
};
// Update metrics
if results.last_fec_set_merkle_root.is_none() {
Expand Down Expand Up @@ -5347,7 +5342,6 @@ pub mod tests {
leader_schedule::{FixedSchedule, IdentityKeyedLeaderSchedule},
shred::{max_ticks_per_n_shreds, ShredFlags, LEGACY_SHRED_DATA_CAPACITY},
},
agave_feature_set::{vote_only_full_fec_sets, vote_only_retransmitter_signed_fec_sets},
assert_matches::assert_matches,
bincode::{serialize, Options},
crossbeam_channel::unbounded,
Expand Down Expand Up @@ -11859,11 +11853,7 @@ pub mod tests {
#[test]
fn test_last_fec_set_check_results() {
let enabled_feature_set = FeatureSet::all_enabled();
let disabled_feature_set = FeatureSet::default();
let mut full_only = FeatureSet::default();
full_only.activate(&vote_only_full_fec_sets::id(), 0);
let mut retransmitter_only = FeatureSet::default();
retransmitter_only.activate(&vote_only_retransmitter_signed_fec_sets::id(), 0);
let full_only = FeatureSet::default();

let results = LastFECSetCheckResults {
last_fec_set_merkle_root: None,
Expand All @@ -11877,14 +11867,6 @@ pub mod tests {
results.get_last_fec_set_merkle_root(&full_only),
Err(BlockstoreProcessorError::IncompleteFinalFecSet)
);
assert_matches!(
results.get_last_fec_set_merkle_root(&retransmitter_only),
Err(BlockstoreProcessorError::InvalidRetransmitterSignatureFinalFecSet)
);
assert!(results
.get_last_fec_set_merkle_root(&disabled_feature_set)
.unwrap()
.is_none());

let block_id = Hash::new_unique();
let results = LastFECSetCheckResults {
Expand All @@ -11899,16 +11881,6 @@ pub mod tests {
results.get_last_fec_set_merkle_root(&full_only).unwrap(),
Some(block_id)
);
assert_matches!(
results.get_last_fec_set_merkle_root(&retransmitter_only),
Err(BlockstoreProcessorError::InvalidRetransmitterSignatureFinalFecSet)
);
assert_eq!(
results
.get_last_fec_set_merkle_root(&disabled_feature_set)
.unwrap(),
Some(block_id)
);

let results = LastFECSetCheckResults {
last_fec_set_merkle_root: None,
Expand All @@ -11922,26 +11894,13 @@ pub mod tests {
results.get_last_fec_set_merkle_root(&full_only),
Err(BlockstoreProcessorError::IncompleteFinalFecSet)
);
assert!(results
.get_last_fec_set_merkle_root(&retransmitter_only)
.unwrap()
.is_none());
assert!(results
.get_last_fec_set_merkle_root(&disabled_feature_set)
.unwrap()
.is_none());

let block_id = Hash::new_unique();
let results = LastFECSetCheckResults {
last_fec_set_merkle_root: Some(block_id),
is_retransmitter_signed: true,
};
for feature_set in [
enabled_feature_set,
disabled_feature_set,
full_only,
retransmitter_only,
] {
for feature_set in [enabled_feature_set, full_only] {
assert_eq!(
results.get_last_fec_set_merkle_root(&feature_set).unwrap(),
Some(block_id)
Expand Down
Loading