Skip to content

Commit a9da959

Browse files
authored
Shredder: axe legacy shred API (#7209)
* axe legacy shred tests from shredder * rm also entries_to_shreds
1 parent 15ba27d commit a9da959

File tree

6 files changed

+21
-807
lines changed

6 files changed

+21
-807
lines changed

core/benches/shredder.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use {
1010
solana_keypair::Keypair,
1111
solana_ledger::shred::{
1212
get_data_shred_bytes_per_batch_typical, max_entries_per_n_shred, max_ticks_per_n_shreds,
13-
ProcessShredsStats, ReedSolomonCache, Shred, Shredder, DATA_SHREDS_PER_FEC_BLOCK,
13+
recover, ProcessShredsStats, ReedSolomonCache, Shred, Shredder, DATA_SHREDS_PER_FEC_BLOCK,
1414
},
1515
solana_perf::test_tx,
1616
test::{black_box, Bencher},
@@ -192,7 +192,8 @@ fn bench_shredder_decoding(bencher: &mut Bencher) {
192192
.partition(Shred::is_data);
193193

194194
bencher.iter(|| {
195-
let result = Shredder::try_recovery(coding_shreds.clone(), &reed_solomon_cache).unwrap();
196-
black_box(result);
195+
for shred in recover(coding_shreds.clone(), &reed_solomon_cache).unwrap() {
196+
black_box(shred.unwrap());
197+
}
197198
})
198199
}

ledger/src/shred.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,6 @@ impl Shred {
402402
dispatch!(fn signed_data(&self) -> Result<SignedData, Error>);
403403

404404
dispatch!(pub fn chained_merkle_root(&self) -> Result<Hash, Error>);
405-
// Returns the portion of the shred's payload which is erasure coded.
406-
dispatch!(pub(crate) fn erasure_shard(&self) -> Result<&[u8], Error>);
407-
// Returns the shard index within the erasure coding set.
408-
dispatch!(pub(crate) fn erasure_shard_index(&self) -> Result<usize, Error>);
409405
dispatch!(pub(crate) fn retransmitter_signature(&self) -> Result<Signature, Error>);
410406

411407
dispatch!(pub fn into_payload(self) -> Payload);

ledger/src/shred/shred_code.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ impl ShredCode {
3131
dispatch!(fn coding_header(&self) -> &CodingShredHeader);
3232

3333
dispatch!(pub(super) fn common_header(&self) -> &ShredCommonHeader);
34-
dispatch!(pub(super) fn erasure_shard(&self) -> Result<&[u8], Error>);
35-
dispatch!(pub(super) fn erasure_shard_index(&self) -> Result<usize, Error>);
3634
dispatch!(pub(super) fn first_coding_index(&self) -> Option<u32>);
3735
dispatch!(pub(super) fn into_payload(self) -> Payload);
3836
dispatch!(pub(super) fn payload(&self) -> &Payload);

ledger/src/shred/shred_data.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ impl ShredData {
2323
dispatch!(fn data_header(&self) -> &DataShredHeader);
2424

2525
dispatch!(pub(super) fn common_header(&self) -> &ShredCommonHeader);
26-
dispatch!(pub(super) fn erasure_shard(&self) -> Result<&[u8], Error>);
27-
dispatch!(pub(super) fn erasure_shard_index(&self) -> Result<usize, Error>);
2826
dispatch!(pub(super) fn into_payload(self) -> Payload);
2927
dispatch!(pub(super) fn parent(&self) -> Result<Slot, Error>);
3028
dispatch!(pub(super) fn payload(&self) -> &Payload);

0 commit comments

Comments
 (0)