From 28f7ad8b5aa7fe5140b0e409e19fa7924d5043f1 Mon Sep 17 00:00:00 2001 From: Steven Czabaniuk Date: Fri, 23 Apr 2021 12:19:22 -0500 Subject: [PATCH] Remove test that is no longer valid Blockstore clips shreds that are too large now --- core/src/serve_repair.rs | 61 ---------------------------------------- 1 file changed, 61 deletions(-) diff --git a/core/src/serve_repair.rs b/core/src/serve_repair.rs index 17e9fa098b00bf..7873b557ce946a 100644 --- a/core/src/serve_repair.rs +++ b/core/src/serve_repair.rs @@ -925,67 +925,6 @@ mod tests { Blockstore::destroy(&ledger_path).expect("Expected successful database destruction"); } - #[test] - fn run_orphan_corrupted_shred_size() { - solana_logger::setup(); - let recycler = PacketsRecycler::default(); - let ledger_path = get_tmp_ledger_path!(); - { - let blockstore = Arc::new(Blockstore::open(&ledger_path).unwrap()); - // Create slots [1, 2] with 1 shred apiece - let (mut shreds, _) = make_many_slot_entries(1, 2, 1); - - // Make shred for slot 1 too large - assert_eq!(shreds[0].slot(), 1); - assert_eq!(shreds[0].index(), 0); - shreds[0].payload.push(10); - shreds[0].data_header.size = shreds[0].payload.len() as u16; - blockstore - .insert_shreds(shreds, None, false) - .expect("Expect successful ledger write"); - let nonce = 42; - // Make sure repair response is corrupted - assert!(repair_response::repair_response_packet( - &blockstore, - 1, - 0, - &socketaddr_any!(), - nonce, - ) - .is_none()); - - // Orphan request for slot 2 should only return slot 1 since - // calling `repair_response_packet` on slot 1's shred will - // be corrupted - let rv: Vec<_> = ServeRepair::run_orphan( - &recycler, - &socketaddr_any!(), - Some(&blockstore), - 2, - 5, - nonce, - ) - .expect("run_orphan packets") - .packets - .iter() - .cloned() - .collect(); - - // Verify responses - let expected = vec![repair_response::repair_response_packet( - &blockstore, - 2, - 0, - &socketaddr_any!(), - nonce, - ) - .unwrap()]; - assert_eq!(rv, expected); - } - - Blockstore::destroy(&ledger_path).expect("Expected successful database destruction"); - } - #[test] fn test_repair_with_repair_validators() { let cluster_slots = ClusterSlots::default();