Skip to content

Commit

Permalink
Merge pull request #14 from paritytech/subshard
Browse files Browse the repository at this point in the history
Subshard
  • Loading branch information
arkpar authored Jun 21, 2024
2 parents 707d856 + a3282b1 commit 512e774
Show file tree
Hide file tree
Showing 7 changed files with 724 additions and 95 deletions.
201 changes: 130 additions & 71 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ panic = "abort"
opt-level = 1

[dev-dependencies]
criterion = { version = "0.4.0", default-features = false, features = ["cargo_bench_support"] }
criterion = { version = "0.5.1", default-features = false, features = ["cargo_bench_support"] }
quickcheck = { version = "1.0.3", default-features = false }
rand = { version = "0.8.4", features = [ "small_rng"] }

[[bench]]
name = "all"
Expand Down
9 changes: 7 additions & 2 deletions benches/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,13 @@ fn bench_all(c: &mut Criterion) {
group.throughput(Throughput::Bytes(pov.len() as u64));
group.bench_with_input(BenchmarkId::from_parameter(param), &n_chunks, |b, &n| {
b.iter(|| {
let _pov: Vec<u8> =
reconstruct_from_systematic(n, chunks.clone(), pov.len()).unwrap();
let _pov: Vec<u8> = reconstruct_from_systematic(
n,
chunks.len(),
&mut chunks.iter().map(Vec::as_slice),
pov.len(),
)
.unwrap();
});
});
}
Expand Down
3 changes: 2 additions & 1 deletion fuzz/fuzz_targets/round_trip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ fuzz_target!(|data: (Vec<u8>, u16)| {
let threshold = systematic_recovery_threshold(n_chunks).unwrap();
let reconstructed_systematic: Vec<u8> = reconstruct_from_systematic(
n_chunks,
chunks.iter().cloned().take(threshold as usize).collect(),
chunks.len(),
&mut chunks.iter().map(Vec::as_slice),
data.len(),
)
.unwrap();
Expand Down
Loading

0 comments on commit 512e774

Please sign in to comment.